} 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">
Beispiel #2
0
 * @author Unit: School of Medicine
 * @author Developer: Josh Dillon <*****@*****.**>
 * @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 {
    if (isset($_GET["notice_id"]) && ($tmp_input = clean_input($_GET["notice_id"], array("int")))) {
        $PROCESSED["notice_id"] = $tmp_input;
        $notice = Models_Notice::fetchNotice($PROCESSED["notice_id"]);
    }
    $BREADCRUMB[] = array("url" => ENTRADA_RELATIVE . "/dashboard/notices?section=view", "title" => $notice ? date(DEFAULT_DATE_FORMAT, $notice["updated_date"]) : "");
    ?>
	<?php 
    if ($notice) {
        echo "<div id=\"notice_box_" . (int) $notice["notice_id"] . "\" class=\"space-below\">";
        echo "<strong>" . date(DEFAULT_DATE_FORMAT, $notice["updated_date"]) . "</strong>";
        echo "<div class=\"space-left\">" . trim(clean_input($notice["notice_summary"], "html")) . "</div>";
        echo "</div>";
        add_statistic("notices", "read", "notice_id", $notice["notice_id"]);
    } else {
        ?>
		<div class="alert alert-info">
			<strong>No message found.</strong>
		</div>
 * @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") {
				<label class="control-label" for="password">Password</label>
				<div class="controls">
					<input type="password" id="password" name="password" value=""/>
				</div>
			</div>
			<div class="form-actions">
				<input type="submit" class="btn btn-primary" value="Login">
                <strong style="margin-left: 5px">or</strong> <a href="<?php 
echo ENTRADA_RELATIVE;
?>
/password_reset">Forgot your password?</a>
			</div>
		</form>
	</div>
	<?php 
$public_notices = Models_Notice::fetchPublicNotices();
if ($public_notices) {
    ?>
		<div class="span6">
			<h2>Public Notices</h2>
			<ul class="public-notices">
				<?php 
    foreach ($public_notices as $notice) {
        echo "<li>";
        echo "\t<span class=\"label label-info\">" . date(DEFAULT_DATE_FORMAT, $notice["updated_date"]) . "</span>\n";
        echo "\t<p>" . trim(strip_selected_tags(clean_input($notice["notice_summary"], "html"), "p")) . "</p>";
        echo "</li>";
    }
    ?>
			</ul>
		</div>
 * @author Developer: James Ellis <*****@*****.**>
 * @copyright Copyright 2010 Queen's University. All Rights Reserved.
 *
*/
if (!defined("PARENT_INCLUDED") || !defined("IN_NOTICES")) {
    exit;
} elseif (!isset($_SESSION["isAuthorized"]) || !$_SESSION["isAuthorized"]) {
    header("Location: " . ENTRADA_URL);
    exit;
} elseif (!$ENTRADA_ACL->amIAllowed("notice", "update", false)) {
    add_error("Your account does not have the permissions required to use this feature of 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>";
    $notices = Models_Notice::fetchOrganisationNotices();
    if (isset($_GET["ajax"]) && $_GET["ajax"] && isset($_GET["method"]) && $_GET["method"] == "list") {
        ob_clear_open_buffers();
        $output = array("aaData" => array());
        $count = 0;
        if ($notices) {
            /*
             * Ordering
             */
            if (isset($_GET["iSortCol_0"]) && in_array($_GET["iSortCol_0"], array(1, 2, 3))) {
                $aColumns = array("notice_id", "display_until", "notice_author", "notice_summary");
                $sort_array = array();
                foreach ($notices as $notice) {
                    $notice_array = $notice;
                    $sort_array[] = $notice_array[$aColumns[clean_input($_GET["iSortCol_0"], "int")]];
                }