Menu

[r52]: / html / addpart.php  Maximize  Restore  History

Download this file

138 lines (137 with data), 4.4 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
session_start();
$user_ID=$_SESSION[user_ID];
if (!$user_ID || $user_ID=='0')
{
header('location: index.php');
die('Login failed');
}
require("util.php");
$sql = new MySQL_class;
$sql->Create("generator");
$esql = new MySQL_class;
$esql->Create("generator");
if ($_GET[screen]) { $_SESSION[var_screen] = $_GET[screen]; }
if ($_GET[part]) { $_SESSION[var_part] = $_GET[part]; }
$screen=$_SESSION[var_screen];
$project=$_SESSION[var_project];
$part=$_SESSION[var_part];
?>
<?php
if ($_POST['type']!='') {
$type = $_POST['type'];
$table = $_POST['table'];
$link = $_POST['link'];
$title = ($_POST['title']);
$code = ($_POST['code']);
$order = $_POST['order'];
}
?>
<html>
<head>
<link href="list.css" type="text/css" rel=stylesheet>
<meta content="text/css" http-equiv="Content-Style-Type">
<title>Part add</title>
</head>
<body class="top" onload="Insert.<?php
if ($_POST[FOCUS]==452) {echo 'table';}
else if ($_POST[FOCUS]==453) {echo 'link';}
else if ($_POST[FOCUS]==454) {echo 'title';}
else {echo 'type';}
?>.focus();">
<form name="Insert" action="postaddpart.php" method="post">
<input type=hidden name="FOCUS" value="">
<input type=hidden name="order" value="<?php echo $_GET[order]; ?>">
<table class=enter>
<tr id=title><th colspan=2>Part add</th></tr>
<tr><th>Type</th>
<td>
<?php
$current=($_POST['type']!='');
echo ("<select name=\"type\" style=\"width: 70px\" OnChange=\"document.Insert.action=''; Insert.FOCUS.value='452'; Insert.submit();\">");
if ('icon' == $_POST['type']) {$sel='selected ';} else {$sel='';};
echo "<option value=\"icon\"$sel>icon</option>\n";
if ('link' == $_POST['type']) {$sel='selected ';} else {$sel='';};
echo "<option value=\"link\"$sel>link</option>\n";
if ('script' == $_POST['type']) {$sel='selected ';} else {$sel='';};
echo "<option value=\"script\"$sel>script</option>\n";
if ('record' == $_POST['type']) {$sel='selected ';} else {$sel='';};
echo "<option value=\"record\"$sel>record</option>\n";
if ('edit' == $_POST['type']) {$sel='selected ';} else {$sel='';};
echo "<option value=\"edit\"$sel>edit</option>\n";
if ('list' == $_POST['type']) {$sel='selected ';} else {$sel='';};
echo "<option value=\"list\"$sel>list</option>\n";
if ('html' == $_POST['type']) {$sel='selected ';} else {$sel='';};
echo "<option value=\"html\"$sel>html</option>\n";
if ('multiedit' == $_POST['type']) {$sel='selected ';} else {$sel='';};
echo "<option value=\"multiedit\"$sel>multiedit</option>\n";
echo ("</select>");
?>
</td></tr>
<tr><th>Table</th>
<td>
<?php
$current=($_POST['table']!='');
echo ("<select name=\"table\" style=\"width: 175px\" OnChange=\"Insert.action=''; Insert.FOCUS.value='453'; Insert.submit();\">");
echo ("<option value=\"\"></option>\n");
$sql->Query("SELECT `table`.`name` as F0_1, `table`.table FROM `table` WHERE `table`.project=$project ORDER BY `table`.`name`");
for ($i = 0; $i < $sql->rows; $i++) { $sql->Fetch($i);
$searchID = $sql->data[table];
$name_0=htmlspecialchars($sql->data[F0_1]);
$searchshow = "$name_0";
echo "<option ";
if ($current && $searchID == $_POST['table']) {echo "selected ";};
echo "value=\"$searchID\">$searchshow";
echo "</option>\n";
}
echo ("</select>");
?>
</td></tr>
<tr><th>Link</th>
<td>
<?php
$current=($_POST['link']!='');
echo ("<select name=\"link\" style=\"width: 175px\" OnChange=\"Insert.action=''; Insert.FOCUS.value='454'; Insert.submit();\">");
$sql->Query("SELECT `screen`.`name` as F0_1, `screen`.screen FROM `screen` WHERE screen.project=$project ORDER BY `screen`.`name`");
for ($i = 0; $i < $sql->rows; $i++) { $sql->Fetch($i);
$searchID = $sql->data[screen];
$name_0=htmlspecialchars($sql->data[F0_1]);
$searchshow = "$name_0";
echo "<option ";
if ($current && $searchID == $_POST['link']) {echo "selected ";};
echo "value=\"$searchID\">$searchshow";
echo "</option>\n";
}
echo ("</select>");
?>
</td></tr>
<tr><th>Title</th>
<td>
<?php
$current=($_POST['title']!='');
$strdefault = $_POST['title'];
echo "<input type=text name=\"title\" size=25 value=\"$strdefault\">";
?>
</td></tr>
<tr><th>Code</th>
<td>
<?php
$current=($_POST['code']!='');
$strdefault = $_POST['code'];
echo "<textarea name=\"code\" rows=5 cols=35>$strdefault</textarea>";
?>
</td></tr>
<tr><th>Order</th>
<td>
<?php
$current=($_POST['order']!='');
?>
</td></tr>
</table>
<p id=buttons>
<input type=submit value=Add>
<input type=button value=Cancel onClick="window.close()">
</p>
</form>
</body>
</html>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.