function drawNavigationHelpdesk() { global $helpdeskOptions; $pages = array("/helpdesk/" => "All"); foreach ($helpdeskOptions as $option) { $pages["/helpdesk/?dept=" . $option["id"]] = $option["name"]; } return drawNavigationRow($pages, "helpdesk", true); }
function drawNavigation() { global $user, $isAdmin, $page, $printing, $location; if (!$page["moduleID"] || $printing) { return false; } $pages = array(); $admin = $isAdmin ? "" : "AND isAdmin = 0"; $result = db_query("SELECT name, url FROM pages WHERE moduleID = {$page["moduleID"]} {$admin} AND isInstancePage = 0 ORDER BY precedence"); while ($r = db_fetch($result)) { if ($r["url"] != "/helpdesk/") { $pages[$r["url"]] = $r["name"]; } } $location = $location == "bb" || $location == "cal" || $location == "docs" || $location == "staff" || $location == "helpdesk" || $location == "contacts" ? $location : "areas"; return drawNavigationRow($pages, $location); }
<?php include 'include.php'; if (!url_id()) { url_query_add(array('id' => 1)); } drawTop(); $locations = db_query("SELECT \n\t\to.id, \n\t\to.name\n\tFROM intranet_offices o \n\tORDER BY (SELECT COUNT(*) FROM intranet_users u WHERE u.officeID = o.id) DESC"); if (db_found($locations)) { $pages = array(); while ($l = db_fetch($locations)) { $pages["/staff/locations.php?id=" . $l["id"]] = $l["name"]; } echo drawNavigationRow($pages, $location, true); } if ($_GET["id"] == "other") { echo drawStaffList("u.isactive = 1 AND u.officeID <> 1 AND u.officeID <> 6 AND u.officeID <> 11 AND u.officeID <> 9"); } else { $l = db_grab('SELECT name, address FROM intranet_offices WHERE id = ' . $_GET['id']); if (!empty($l['address'])) { echo drawServerMessage('<center><strong>' . $l['name'] . ' Office</strong><br>' . nl2br($l['address']) . '</center>'); } echo drawStaffList("u.isactive = 1 and u.officeID = " . $_GET["id"]); } drawBottom();
} elseif (url_id()) { $d = db_grab("SELECT d.name, t.extension, d.content FROM policy_docs d JOIN docs_types t ON d.type_id = t.id WHERE d.id = " . $_GET["id"]); //db_query("INSERT INTO docs_views ( documentID, user_id, viewedOn ) VALUES ( {$_GET["id"]}, {$_SESSION["user_id"]}, GETDATE() )"); file_download($d["content"], $d["name"], $d["extension"]); } //get nav options $options = array(); $categories = db_query("SELECT id, description FROM policy_categories ORDER BY description"); while ($c = db_fetch($categories)) { if (!isset($_GET["category"])) { url_query_add(array("category" => $c["id"])); } $options[str_replace(url_base(), "", url_query_add(array("category" => $c["id"]), false))] = $c["description"]; } echo drawTop(); echo drawNavigationRow($options, "areas", true); ?> <table class="left"> <?php if ($page['is_admin']) { echo drawheaderRow("", 4, "add", "edit/"); } else { echo drawheaderRow("", 3); } $docs = db_query("SELECT d.id, d.name, t.icon, ISNULL(d.updated_date, d.created_date) updated_date FROM policy_docs d JOIN docs_types t ON d.type_id = t.id WHERE d.is_active = 1 AND d.categoryID = " . $_GET["category"] . " ORDER BY d.name"); if (db_found($docs)) { ?> <tr> <th width="16"></th> <th>Name</th> <th class="r">Updated</th>