Olive Branch MS Chamber of Commerce (circa Oct 1999)
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

69 lines
3.1 KiB

  1. <?php // form for editing page items
  2. require("../db.php3");
  3. // connect to the db and retrieve our page data
  4. $connection = connect($host, $dbname);
  5. if($connection) {
  6. include("intro.php3");
  7. if($ord) {
  8. $insert = "insert into item (pid,ord) values ('$pid','$ord')";
  9. // stuff the db insert into an html comment
  10. print("<!--\n insert string = $insert\n-->\n");
  11. $res1 = query($connection, $insert);
  12. $sel1 = "select id from item where pid='$pid' and ord='$ord'";
  13. $res2 = query($connection, $sel1);
  14. $data = fetch_object($res2, 0);
  15. $id = $data->id;
  16. }
  17. $select = "select * from item where id=$id";
  18. $delete = "delete from item where id=$id";
  19. $result = query($connection, $select);
  20. $item = fetch_object($result, 0);
  21. // stuff the db query into an html comment
  22. print("<!--\n item query = $query\n-->\n");
  23. print("<div class=\"center\">\n<form name=item action=item_update.php3 ");
  24. print("method=post>\n<table border=1 cellspacing=0 cellpadding=4>\n");
  25. print("<input type=hidden name=id value=$id>\n");
  26. print("<input type=hidden name=pid value=$pid>\n");
  27. print("<tr class=\"header\">\n <th>Order</th>\n <th>Type</th>\n ");
  28. print("<th>Class</th>\n <th>Clear</th></tr>\n");
  29. print("<tr class=\"dark\">\n ");
  30. print("<td class=\"center\"><input type=text name=ord size=17 ");
  31. print("maxlength=30 value=\"$item->ord\"></td>\n ");
  32. print("<td class=\"center\"><input type=text name=type size=17 ");
  33. print("maxlength=30 value=\"$item->type\"></td>\n ");
  34. print("<td class=\"center\"><input type=text name=class size=17 ");
  35. print("maxlength=30 value=\"$item->class\"></td>\n ");
  36. print("<td class=\"center\"><input type=text name=clear size=17 ");
  37. print("maxlength=30 value=\"$item->clear\"></td></tr>\n");
  38. print("<tr class=\"header\">\n <th colspan=2>Description</th>\n ");
  39. print("<th colspan=2>Link</th></tr>\n");
  40. print("<tr class=dark>\n ");
  41. print("<td class=\"center\" colspan=2><input type=text name=alt size=36 ");
  42. print("maxlength=30 value=\"$item->alt\"></td>\n ");
  43. print("<td class=\"center\" colspan=2><input type=text name=url size=36 ");
  44. print("maxlength=30 value=\"$item->url\"></td></tr>\n");
  45. print("<tr class=\"header\">\n <th colspan=4>Data</th></tr>\n");
  46. print("<tr class=\"dark\">\n ");
  47. print("<td class=\"center\" colspan=4><textarea name=dat cols=74 rows=14>");
  48. print(htmlentities($item->dat));
  49. print("</textarea></td></tr>\n");
  50. // button area begins
  51. print("<tr class=\"dark\">\n <td colspan=4 class=\"center\">\n ");
  52. print("<a href=\"item_edit.php3?id=$id&pid=$pid\">");
  53. print("<img src=\"btn.php3?label=Reset\" name=Reset border=0></a>\n ");
  54. print("<input type=image src=\"btn.php3?label=Update\" name=Update ");
  55. print("border=0>\n ");
  56. print("<a href=\"page_edit.php3?pid=$pid\"><img src=\"btn.php3");
  57. print("?label=Item+List\" name=\"Item List\" border=0>");
  58. print("</a></td></tr>\n</form>\n");
  59. print("</table>\n</div>\n");
  60. print("<br clear=all>\n<div class=\"footer\">\n<hr>\n");
  61. require("../footer.php3");
  62. print("</body>\n</html>");
  63. } else {
  64. print("<div class=\"center\">\n<h2>Database Error</h2>\n");
  65. print("<h2>Failed to connect to database: $dbname</h2>\n");
  66. }
  67. ?>