You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
3.1 KiB
69 lines
3.1 KiB
<?php // form for editing page items
|
|
|
|
require("../db.php3");
|
|
|
|
// connect to the db and retrieve our page data
|
|
$connection = connect($host, $dbname);
|
|
if($connection) {
|
|
include("intro.php3");
|
|
if($ord) {
|
|
$insert = "insert into item (pid,ord) values ('$pid','$ord')";
|
|
// stuff the db insert into an html comment
|
|
print("<!--\n insert string = $insert\n-->\n");
|
|
$res1 = query($connection, $insert);
|
|
$sel1 = "select id from item where pid='$pid' and ord='$ord'";
|
|
$res2 = query($connection, $sel1);
|
|
$data = fetch_object($res2, 0);
|
|
$id = $data->id;
|
|
}
|
|
$select = "select * from item where id=$id";
|
|
$delete = "delete from item where id=$id";
|
|
$result = query($connection, $select);
|
|
$item = fetch_object($result, 0);
|
|
// stuff the db query into an html comment
|
|
print("<!--\n item query = $query\n-->\n");
|
|
print("<div class=\"center\">\n<form name=item action=item_update.php3 ");
|
|
print("method=post>\n<table border=1 cellspacing=0 cellpadding=4>\n");
|
|
print("<input type=hidden name=id value=$id>\n");
|
|
print("<input type=hidden name=pid value=$pid>\n");
|
|
print("<tr class=\"header\">\n <th>Order</th>\n <th>Type</th>\n ");
|
|
print("<th>Class</th>\n <th>Clear</th></tr>\n");
|
|
print("<tr class=\"dark\">\n ");
|
|
print("<td class=\"center\"><input type=text name=ord size=17 ");
|
|
print("maxlength=30 value=\"$item->ord\"></td>\n ");
|
|
print("<td class=\"center\"><input type=text name=type size=17 ");
|
|
print("maxlength=30 value=\"$item->type\"></td>\n ");
|
|
print("<td class=\"center\"><input type=text name=class size=17 ");
|
|
print("maxlength=30 value=\"$item->class\"></td>\n ");
|
|
print("<td class=\"center\"><input type=text name=clear size=17 ");
|
|
print("maxlength=30 value=\"$item->clear\"></td></tr>\n");
|
|
print("<tr class=\"header\">\n <th colspan=2>Description</th>\n ");
|
|
print("<th colspan=2>Link</th></tr>\n");
|
|
print("<tr class=dark>\n ");
|
|
print("<td class=\"center\" colspan=2><input type=text name=alt size=36 ");
|
|
print("maxlength=30 value=\"$item->alt\"></td>\n ");
|
|
print("<td class=\"center\" colspan=2><input type=text name=url size=36 ");
|
|
print("maxlength=30 value=\"$item->url\"></td></tr>\n");
|
|
print("<tr class=\"header\">\n <th colspan=4>Data</th></tr>\n");
|
|
print("<tr class=\"dark\">\n ");
|
|
print("<td class=\"center\" colspan=4><textarea name=dat cols=74 rows=14>");
|
|
print(htmlentities($item->dat));
|
|
print("</textarea></td></tr>\n");
|
|
// button area begins
|
|
print("<tr class=\"dark\">\n <td colspan=4 class=\"center\">\n ");
|
|
print("<a href=\"item_edit.php3?id=$id&pid=$pid\">");
|
|
print("<img src=\"btn.php3?label=Reset\" name=Reset border=0></a>\n ");
|
|
print("<input type=image src=\"btn.php3?label=Update\" name=Update ");
|
|
print("border=0>\n ");
|
|
print("<a href=\"page_edit.php3?pid=$pid\"><img src=\"btn.php3");
|
|
print("?label=Item+List\" name=\"Item List\" border=0>");
|
|
print("</a></td></tr>\n</form>\n");
|
|
print("</table>\n</div>\n");
|
|
print("<br clear=all>\n<div class=\"footer\">\n<hr>\n");
|
|
require("../footer.php3");
|
|
print("</body>\n</html>");
|
|
} else {
|
|
print("<div class=\"center\">\n<h2>Database Error</h2>\n");
|
|
print("<h2>Failed to connect to database: $dbname</h2>\n");
|
|
}
|
|
?>
|