File: //home/awaldron/public_html/archive/demo/admin/boards_manage.php
<?php
session_start();
include("../_functions.php");
dbconnect();
if (!is_logged()) auto_login();
echo "<html>\n";
echo "<head>\n";
echo "<title>".COMPANY_NAME." : Manage Noticeboards</title>\n";
echo "<script language=\"JavaScript\" type=\"text/javascript\">\n";
echo "<!--\n";
echo "function openWindow(theURL,winName,features) { //v2.0\n";
echo " window.open(theURL,winName,features);\n";
echo "}\n";
echo "function confirm_delete(id) {\n";
echo " input_box=confirm(\"Are you sure you want to delete this Noticeboard? (This cannot be undone)\");\n";
echo " if (input_box==true) {\n";
echo " self.location=\"boards_manage.php?del=\"+id;\n";
echo " }\n";
echo "}\n";
echo "-->\n";
echo "</script>\n";
echo "</head>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../default.css\">\n";
echo "<body style=\"margin:15px;\">\n";
if (!admin_panel($_SESSION["auth_user"])) {
echo "<br><br><br><br>".error("You must be logged in to access the administration panel!");
} else {
if (isset($_GET["del"])) {
$board_admins = quickSQL("SELECT board_admins FROM tbl_notice_types WHERE notice_type_id=".$_GET["del"]);
delete_pgroup($board_admins);
quickUPDATE("DELETE FROM tbl_notice_types WHERE notice_type_id=".$_GET["del"]);
quickUPDATE("DELETE FROM tbl_notices WHERE notice_type_id=".$_GET["del"]);
}
echo "<P><img src=\"/gui/icons/cog.gif\" align=\"left\">\n";
echo "<div class=\"headline\">Manage Noticeboards</div>\n";
echo "<P>From this control panel, you have the ability to add/remove noticeboards and discussion boards.\n";
echo "<br><br><br>\n";
echo "<table class=\"textdn\" border=0 cellspacing=1 cellpadding=3 bgcolor=\"#".COLOR_TBAR."\">\n";
echo "<tr class=\"header\"><td><b>Board Name</b></td><td align=\"center\"><b> Type </b></td><td align=\"center\"><b> Posts </b><td align=\"center\"><b> Replies? </b></td><td align=\"center\"><b> Linked? </b></td><td align=\"center\"><b>Actions</b></td><td><b>Parent Page</b></td></tr>\n";
$sql = "SELECT tbl_pages.page_title, tbl_notice_types.* FROM tbl_pages, tbl_notice_types WHERE tbl_notice_types.parent_id=tbl_pages.page_id ORDER BY tbl_notice_types.notice_type_name ASC";
$res = mysql_query($sql);
for ($i=0; $i < mysql_num_rows($res); $i++) {
$row = mysql_fetch_array($res);
echo "<tr".($i%2==0?" bgcolor=#FFFFFF":" bgcolor=#EEEEEE").">\n";
echo "<td><a href=\"/noticeboard.php?ntid=".$row["notice_type_id"]."\" target=\"new\">".$row["notice_type_name"]."</a> </td>\n";
echo "<td align=\"center\">".($row["forum_view"]==1?"Forum":"Notice")."</td>\n";
echo "<td align=\"center\">".quickSQL("SELECT COUNT(notice_id) FROM tbl_notices WHERE notice_active=1 AND notice_type_id=".$row["notice_type_id"])."</td>\n";
echo "<td align=\"center\">".($row["notice_type_discuss"]==1?"Yes":"No")."</td>\n";
echo "<td align=\"center\">".($row["notice_type_active"]==1?"Yes":"No")."</td>\n";
echo "<td align=\"center\"> <a href=\"boards_add.php?a=edit&id=".$row["notice_type_id"]."\">Edit</a> | <a href=\"boards_permissions.php?id=".$row["notice_type_id"]."\">Perms</a> | <a href=\"JavaScript:confirm_delete(".$row["notice_type_id"].")\">Delete</a> </td>\n";
echo "<td><a href=\"/content.php?p=".$row["parent_id"]."\" target=\"new\">".$row["page_title"]."</a> </td>\n";
echo "</tr>\n"; $j=$i;
}
echo "</table>\n";
echo "<br><br><br><br>\n";
echo "<center>Powered by <a href=\"http://www.intrabreeze.com\">IntraBreeze</a> © 2005 IntraBreeze, LLC</center>\n";
}
echo "</body>\n</html>\n";
?>