} else { $query = "\tSELECT a.`poll_id`\n\t\t\t\t\t\tFROM `poll_questions` AS a\n\t\t\t\t\t\tLEFT JOIN `poll_results` AS b\n\t\t\t\t\t\tON b.`poll_id` = a.`poll_id`\n\t\t\t\t\t\tWHERE b.`result_id` IS NOT NULL\n\t\t\t\t\t\tAND (`poll_from` = '0' OR `poll_from` <= '" . time() . "')\n\t\t\t\t\t\tAND (`poll_until` = '0' OR `poll_until` >= '" . time() . "')\n\t\t\t\t\t\tORDER BY RAND() LIMIT 1"; $result = $db->GetRow($query); if ($result) { $_SESSION[APPLICATION_IDENTIFIER]["tmp"][$MODULE]["poll_id"] = $result["poll_id"]; } else { $_SESSION[APPLICATION_IDENTIFIER]["tmp"][$MODULE]["poll_id"] = 0; } } } if ($_SESSION[APPLICATION_IDENTIFIER]["tmp"][$MODULE]["poll_id"]) { $HEAD[] = "<script type=\"text/javascript\" src=\"" . ENTRADA_RELATIVE . "/javascript/poll-js.php\"></script>\n"; new_sidebar_item($translate->_("Quick Polls"), poll_display($_SESSION[APPLICATION_IDENTIFIER]["tmp"][$MODULE]["poll_id"]), "quick-poll", "open"); } if (defined("ENABLE_NOTICES") && ENABLE_NOTICES) { $notices_to_display = Models_Notice::fetchUserNotices(); if ($notices_to_display && ($total_notices = count($notices_to_display))) { ?> <form action="<?php echo ENTRADA_RELATIVE; ?> /dashboard?action=read" method="post"> <div class="dashboard-notices alert"> <div class="row-fluid"> <div class="span8"> <h2><?php echo APPLICATION_NAME . " " . $translate->_("Message Center"); ?> </h2> </div> <div class="span4">
* @copyright Copyright 2013 Queen's University. All Rights Reserved. * */ if (!defined("PARENT_INCLUDED")) { exit; } if (!$ENTRADA_ACL->amIAllowed("dashboard", "read")) { add_error("Your account does not have the permissions required to use this module.<br /><br />If you believe you are receiving this message in error please contact <a href=\"mailto:" . html_encode($AGENT_CONTACTS["administrator"]["email"]) . "\">" . html_encode($AGENT_CONTACTS["administrator"]["name"]) . "</a> for assistance."); echo display_error(); application_log("error", "Group [" . $_SESSION["permissions"][$ENTRADA_USER->getAccessId()]["group"] . "] and role [" . $_SESSION["permissions"][$ENTRADA_USER->getAccessId()]["role"] . "] does not have access to this module [" . $MODULE . "]"); } else { $HEAD[] = "<script type=\"text/javascript\" src=\"" . ENTRADA_URL . "/javascript/jquery/jquery.dataTables.min.js" . "\"></script>"; if (isset($_GET["ajax"]) && $_GET["ajax"] && isset($_GET["method"]) && $_GET["method"] == "list") { ob_clear_open_buffers(); $output = array("aaData" => array()); $notices = Models_Notice::fetchUserNotices(false, true); $count = 0; if ($notices) { /* * Ordering */ if (isset($_GET["iSortCol_0"]) && in_array($_GET["iSortCol_0"], array(0, 1, 2))) { $aColumns = array("updated_date", "notice_summary", "last_read"); $sort_array = array(); foreach ($notices as $notice) { $notice_array = $notice; $sort_array[] = $notice_array[$aColumns[clean_input($_GET["iSortCol_0"], "int")]]; } array_multisort($sort_array, isset($_GET["sSortDir_0"]) && $_GET["sSortDir_0"] == "desc" ? SORT_DESC : SORT_ASC, clean_input($_GET["iSortCol_0"], "int") == 2 ? SORT_NUMERIC : SORT_STRING, $notices); } if (isset($_GET["iDisplayStart"]) && isset($_GET["iDisplayLength"]) && $_GET["iDisplayLength"] != "-1") {