Menu

[r29]: / html / postaddfield.php  Maximize  Restore  History

Download this file

112 lines (111 with data), 3.1 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
<?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");
$table=$_SESSION[var_table];
$project=$_SESSION[var_project];
$field=$_SESSION[var_field];
?>
<?php
$intern=quote($_POST['intern']);
$title=quote($_POST['title']);
$Name=quote($_POST['Name']);
$SessionVar=quote($_POST['SessionVar']);
$Type=quote($_POST['Type']);
$width=quote($_POST['width']);
$height=quote($_POST['height']);
$List=quote($_POST['List']);
$Record=quote($_POST['Record']);
$add=quote($_POST['add']);
$edit=quote($_POST['edit']);
$link_table=quote($_POST['link_table']);
$link_field=quote($_POST['link_field']);
$link_display=quote($_POST['link_display']);
$Default=quote($_POST['Default']);
$Order=quote($_POST['Order']);
if ($order<>'' && $order<>'\'\'') {
$sql->Query("UPDATE `field` SET `order`=`order`+1 WHERE `order`>=$order AND `field`.`table`='$table'");
} else {
$sql->QueryItem("SELECT `order`+1 as next FROM `field` WHERE `field`.`table`='$table' ORDER BY `order` DESC LIMIT 1");
if (!$sql->data[next]) {
$order=1;
} else {
$order=$sql->data[next];
}
}
$sql->Insert("INSERT INTO `field`
(
`sql`,
`table`,
`title`,
`name`,
`sessionvar`,
`type`,
`width`,
`height`,
`List`,
`Record`,
`Add`,
`Edit`,
`link_table`,
`link_field`,
`link_display`,
`default`,
`order`
)
VALUES (
$intern,
'$table',
$title,
$Name,
$SessionVar,
$Type,
$width,
$height,
$List,
$Record,
$add,
$edit,
$link_table,
$link_field,
$link_display,
$Default,
$Order
)");
$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 toegevoegd<BR>";
echo "$field<BR>";
echo "$intern<BR>";
echo "$title<BR>";
echo "$Name<BR>";
echo "$SessionVar<BR>";
echo "$Type<BR>";
echo "$width<BR>";
echo "$height<BR>";
echo "$List<BR>";
echo "$Record<BR>";
echo "$add<BR>";
echo "$edit<BR>";
echo "$link_table<BR>";
echo "$link_field<BR>";
echo "$link_display<BR>";
echo "$Default<BR>";
echo "</P>";
if ($affected_rows>0) {
echo "<script>window.opener.location.reload(true)</script>";
echo "<script>window.close(self)</script>";
}
$_SESSION[last_63]=$field;
;
?>
<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.