File: //proc/self/root/home/awaldron/www/archive/demo/admin/pages_act.php
<?php
session_start();
include("../_functions.php");
function page_list($pid,$base) {
$sql = "SELECT * FROM tbl_pages WHERE parent_id=".$pid." AND page_active=1 AND gbtab_id=0 ORDER BY page_rank ASC";
$res = mysql_query($sql);
if (mysql_num_rows($res) > 0) {
for ($i=0; $i < mysql_num_rows($res); $i++) {
$row = mysql_fetch_array($res);
if ($row["page_id"] != 0) {
if ($row["parent_id"]==1) $top = TRUE;
else $top = FALSE;
echo "<tr bgcolor=\"".($top?"#FFCC00":"#FFFFFF")."\"><td".($top?" style=\"font-weight:bold\"":"").">";
for ($j=0; $j < ($base*5); $j++) echo " ";
echo "<img src=\"/gui/bullet.gif\"> ";
echo $row["page_title"]."\n";
echo "</td>";
if (strlen($row["page_linkto"]) > 7) $linkto = TRUE;
else $linkto = FALSE;
echo "<td align=\"center\"> ".($linkto?"<span style=\"color:#009900\">LinkTo-></span>":"Content")." </td>\n";
echo "<td align=\"center\"> <a href=\"".($linkto?$row["page_linkto"]:"/content.php?p=".$row["page_id"])."\" target=\"page\">View</a> | <a href=\"/content_edit.php?p=".$row["page_id"]."\" target=\"page\">Edit</a> | <a href=\"pages_layout.php?p=".$row["page_id"]."\">Layout</a> | <a href=\"#\" onClick=\"openWindow('quick_change.php?a=movepage&id=".$row["page_id"]."','','resizable=yes,width=500,height=235')\">Move</a> | <a href=\"pages_act.php?del=".$row["page_id"]."\">Deactivate</a> </td>\n";
echo "<td> ";
if (quickSQL("SELECT COUNT(page_id) FROM tbl_pages WHERE parent_id=".$row["page_id"]) > 0) {
$sql1 = "SELECT username FROM tbl_section_admins WHERE page_id=".$row["page_id"];
$res1 = mysql_query($sql1);
while ($sa = mysql_fetch_array($res1)) echo "<a href=\"/profile.php?u=".$sa["username"]."\" target=\"profile\">".$sa["username"]."</a> ";
echo "<a href=\"#\" onClick=\"openWindow('manage_sect_owners.php?p=".$row["page_id"]."','','resizable=yes,width=500,height=350')\" class=\"small\">[manage]</a>";
} else echo " ";
echo " </td>\n";
echo "</tr>\n";
page_list($row["page_id"],($base+1));
}
}
}
}
dbconnect();
if (!is_logged()) auto_login();
echo "<html>\n";
echo "<head>\n";
echo "<title>".COMPANY_NAME." : Active Web Pages</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 "-->\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"])) {
quickUPDATE("UPDATE tbl_pages SET page_active=0 WHERE page_id=".$_GET["del"]);
}
echo "<P><img src=\"/gui/icons/cog.gif\" align=\"left\">\n";
echo "<div class=\"headline\">Active Web Pages</div>\n";
echo "<P>From this control panel, you have the ability to add/remove company organization groups.\n";
echo "<br><br><br><center><table class=\"textdn\" border=0 cellspacing=1 cellpadding=3 bgcolor=\"#".COLOR_TBAR."\">\n";
echo "<tr class=\"header\"><td>Page Title</td><td align=\"center\">Type</td><td align=\"center\">Actions</td><td align=\"center\">Section Owners</td></tr>\n";
page_list(0,0);
echo "</table></center>\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";
?>