<?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");
$project=$_SESSION[var_project];
$screen=$_SESSION[var_screen];
?>
<?php
$screen=($_POST['screen']);
$name=quote($_POST['name']);
$stitle=quote($_POST['stitle']);
$class=quote($_POST['class']);
$parent=quote($_POST['parent']);
$f_dta = $sql->data[parent];
if ($f_dta <> 0) {
$esql->QueryItem("screen and `screen`=$f_dta");
if ($esql->data[LNR]==0) {die ('No valid data in \'Parent\''); }
}
$helpfile=quote($_POST['helpfile']);
$sql->Update("UPDATE `screen` SET
`name`=$name,
`title`=$stitle,
`class`=$class,
`parent`=$parent,
`helpfile`=$helpfile WHERE `screen`='$screen' AND `project`='$project'");
$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 "$name<BR>";
echo "$stitle<BR>";
echo "$helpfile<BR>";
echo "</P>";
if ($affected_rows=1) {
echo "<script>window.opener.location.reload(true)</script>";
echo "<script>window.close(self)</script>";
}
$_SESSION[last_60]=$screen;
?>
<INPUT TYPE=BUTTON VALUE="Close" onClick="window.opener.location.reload(true);self.close()">