Menu

[r47]: / html / addtable.php  Maximize  Restore  History

Download this file

143 lines (142 with data), 3.9 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
138
139
140
141
142
<?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[project]) { $_SESSION[var_project] = $_GET[project]; }
if ($_GET[table]) { $_SESSION[var_table] = $_GET[table]; }
$project=$_SESSION[var_project];
$table=$_SESSION[var_table];
?>
<?php
$sql->QueryItem("SELECT `T582`.`sql` as F582_1 FROM `project` as T582 WHERE `project` = $project");
$sql_582=htmlspecialchars($sql->data[F582_1]);
$project_lup = "$sql_582";
if ($_POST['intern']!='') {
$intern = ($_POST['intern']);
$name = ($_POST['name']);
$title = ($_POST['title']);
$id_field = ($_POST['id_field']);
$width = $_POST['width'];
$height = $_POST['height'];
$where = ($_POST['where']);
$edit_where = ($_POST['edit_where']);
}
?>
<html>
<head>
<link href="list.css" type="text/css" rel=stylesheet>
<meta content="text/css" http-equiv="Content-Style-Type">
<title>Table add</title>
</head>
<body class="top" onload="Insert.<?php
if ($_POST[FOCUS]==441) {echo 'name';}
else if ($_POST[FOCUS]==487) {echo 'width';}
else {echo 'sql';}
?>.focus();">
<form name="Insert" action="postaddtable.php" method="post">
<input type=hidden name="FOCUS" value="">
<table class=enter>
<tr id=title><th colspan=2>Table add</th></tr>
<tr><th>SQL name</th>
<td>
<?php
$current=($_POST['intern']!='');
echo ("<select name=\"intern\" style=\"width: 210px\" OnChange=\"Insert.action=''; Insert.FOCUS.value='441'; Insert.submit();\">");
$sql->QueryTry("show tables from $project_lup");
for ($i = 0; $i < $sql->rows; $i++) { $sql->Fetch($i);
$searchID = $sql->data[0];
$searchshow = $searchID;
echo "<option ";
if ($current && $searchID == $_POST['intern']) {echo "selected ";};
echo "value=\"$searchID\">$searchshow";
echo "</option>\n";
}
echo ("</select>");
?>
</td></tr>
<tr><th>Name</th>
<td>
<?php
$current=($_POST['name']!='');
$strdefault = $intern;
if ($current) {$strdefault = $_POST['name'];}
echo "<input type=text name=\"name\" size=30 value=\"$strdefault\">";
?>
</td></tr>
<tr><th>Title</th>
<td>
<?php
$current=($_POST['title']!='');
$strdefault = $intern;
if ($current) {$strdefault = $_POST['title'];}
echo "<input type=text name=\"title\" size=30 value=\"$strdefault\">";
?>
</td></tr>
<tr><th>ID field</th>
<td>
<?php
$current=($_POST['id_field']!='');
echo ("<select name=\"id_field\" OnChange=\"Insert.action=''; Insert.FOCUS.value='487'; Insert.submit();\">");
$sql->QueryTry("show fields from $project_lup.$intern");
for ($i = 0; $i < $sql->rows; $i++) { $sql->Fetch($i);
$searchID = $sql->data[Field];
$searchshow = $searchID;
echo "<option ";
if ($current && $searchID == $_POST['id_field']) {echo "selected ";};
echo "value=\"$searchID\">$searchshow";
echo "</option>\n";
}
echo ("</select>");
?>
</td></tr>
<tr><th>Width</th>
<td>
<?php
$current=($_POST['width']!='');
$strdefault = 500;
if ($current) {$strdefault = $_POST['width'];}
echo "<input type=text name=\"width\" size=5 value=\"$strdefault\">";
?>
</td></tr>
<tr><th>Height</th>
<td>
<?php
$current=($_POST['height']!='');
$strdefault = 500;
if ($current) {$strdefault = $_POST['height'];}
echo "<input type=text name=\"height\" size=5 value=\"$strdefault\">";
?>
</td></tr>
<tr><th>Where</th>
<td>
<?php
$current=($_POST['where']!='');
$strdefault = $_POST['where'];
echo "<textarea name=\"where\" rows=3 cols=40>$strdefault</textarea>";
?>
</td></tr>
<tr><th>edit_where</th>
<td>
<?php
$current=($_POST['edit_where']!='');
$strdefault = $_POST['edit_where'];
echo "<textarea name=\"edit_where\" rows=3 cols=40>$strdefault</textarea>";
?>
</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.