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.

41 lines
1.5 KiB

  1. <?php // minipage administration
  2. require("../db.php3");
  3. // connect to the db and generate a list of minipages
  4. $connection = connect($host, $dbname);
  5. if($connection) {
  6. $query = "select id,content,title,changed from page order by id";
  7. $result = query($connection, $query);
  8. $count = numrows($result);
  9. // stuff the db query into an html comment
  10. print("<!--\n query = $query\n-->\n");
  11. // display our intro and motd files
  12. include("intro.php3");
  13. if(is_readable("motd.php3")) include("motd.php3");
  14. // begin a table of links
  15. print("<div class=center>\n<table border=1 cellspacing=0 cellpadding=5>\n");
  16. print("<tr class=header>\n <th>Content</th>\n <th>Page Title</th>");
  17. print("<th>Last Changed</th></tr>\n");
  18. if($count) { // if we returned a list of pages...
  19. for($row=0; $row < $count; $row++) {
  20. $shade = (($row & 1) ? "dark" : "light");
  21. $page = fetch_object($result, $row);
  22. print("<tr class=$shade>\n ");
  23. print("<td class=right><a href=\"page_edit.php3?pid=$page->id\">");
  24. print("$page->content</a></td>\n ");
  25. $title = (($page->title) ? $page->title : " &nbsp ");
  26. print("<td class=left>$title</td>\n");
  27. print("<td class=center>$page->changed</td></tr>\n");
  28. }
  29. } else {
  30. print("<td colspan=2>No pages are available</td>\n");
  31. }
  32. print("</table>\n<br clear=all>\n<div class=\"footer\">\n<hr>\n");
  33. require("../footer.php3");
  34. print("</body>\n</html>");
  35. } else {
  36. print("<div class=center>\n<h2>Database Error</h2>\n");
  37. print("<h2>Failed to connect to database: $dbname</h2>\n");
  38. }
  39. ?>