Menu

[r11]: / html / postedittables.php  Maximize  Restore  History

Download this file

75 lines (74 with data), 2.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
<?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[TableID]) { $_SESSION[var_TableID] = $_GET[TableID]; }
$DatabaseID=$_SESSION[var_DatabaseID];
$TableID=$_SESSION[var_TableID];
?>
<?php
$sql = new MySQL_class;
$sql->Create("generator");
$TableID=($_POST['TableID']);
$TableName=quote($_POST['TableName']);
$field = $sql->data[TableName];
if ($field <> 0) {
$esql->QueryItem("show tables from $database and `0`=$field");
if ($esql->data[LNR]==0) {die ('No valid data in \'SQL name\''); }
}
$Title=quote($_POST['Title']);
$Subject=quote($_POST['Subject']);
$IDfield=quote($_POST['IDfield']);
$field = $sql->data[IDfield];
if ($field <> 0) {
$esql->QueryItem("show fields from $database.$TableName and `Field`=$field");
if ($esql->data[LNR]==0) {die ('No valid data in \'IDfield\''); }
}
$ListOrderByField=quote($_POST['ListOrderByField']);
$field = $sql->data[ListOrderByField];
if ($field <> 0) {
$esql->QueryItem("show fields from $database.$TableName and `Field`=$field");
if ($esql->data[LNR]==0) {die ('No valid data in \'OrderBy\''); }
}
$ListOrderByAscDec=quote($_POST['ListOrderByAscDec']);
$ScreenWidth=quote($_POST['ScreenWidth']);
$ScreenHeight=quote($_POST['ScreenHeight']);
$Checks=quote($_POST['Checks']);
$sql->Update("UPDATE `tables` SET
`TableName`=$TableName,
`Title`=$Title,
`Subject`=$Subject,
`IDfield`=$IDfield,
`ListOrderByField`=$ListOrderByField,
`ListOrderByAscDec`=$ListOrderByAscDec,
`ScreenWidth`=$ScreenWidth,
`ScreenHeight`=$ScreenHeight,
`Checks`=$Checks WHERE `TableID`='$TableID' AND `DatabaseID`='$DatabaseID'");
$affected_rows = $sql->a_rows;
echo "<P><FONT FACE=\"Verdana, sans-serif\"><FONT SIZE=1 STYLE=\"font-size: 8pt\">";
echo "Er is/zijn $affected_rows records gewijzigd<BR>";
echo "$TableName<BR>";
echo "$Title<BR>";
echo "$Subject<BR>";
echo "$IDfield<BR>";
echo "$ListOrderByField<BR>";
echo "$ListOrderByAscDec<BR>";
echo "$ScreenWidth<BR>";
echo "$ScreenHeight<BR>";
echo "</P>";
if ($affected_rows=1) {
echo "<script>window.opener.location.reload(true)</script>";
echo "<script>window.close(self)</script>";
}
$_SESSION[last_61]=$TableName;
?>
<INPUT TYPE=BUTTON VALUE="Close" onClick="window.opener.location.reload(true);self.close()">
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.