Exemplo n.º 1
0
} else {
    if ($EVENT_ID) {
        $query = "\tSELECT a.*, b.`organisation_id`\n\t\t\t\t\tFROM `events` AS a\n\t\t\t\t\tLEFT JOIN `courses` AS b\n\t\t\t\t\tON b.`course_id` = a.`course_id`\n\t\t\t\t\tWHERE a.`event_id` = " . $db->qstr($EVENT_ID);
        $event_info = $db->GetRow($query);
        if ($event_info) {
            if (!$ENTRADA_ACL->amIAllowed(new EventContentResource($event_info["event_id"], $event_info["course_id"], $event_info["organisation_id"]), "update")) {
                application_log("error", "Someone attempted to view statistics for an event [" . $EVENT_ID . "] that they were not the coordinator for.");
                header("Location: " . ENTRADA_URL . "/admin/" . $MODULE);
                exit;
            } else {
                $BREADCRUMB[] = array("url" => ENTRADA_URL . "/admin/events?" . replace_query(array("section" => "Statistics", "id" => $EVENT_ID)), "title" => "Event Statistics");
                $PROCESSED["proxy_id"] = $ENTRADA_USER->getID();
                //This will create a record set that has the proxyid, firstname, lastname, last timestamp, view per user.
                $statistics = Models_Statistic::getEventViews($EVENT_ID);
                $total_views = 0;
                events_subnavigation($event_info, 'statistics');
                ?>
                <div class="content-small"><?php 
                echo fetch_course_path($event_info["course_id"]);
                ?>
</div>
                <h1 id="page-top" class="event-title"><?php 
                echo html_encode($event_info["event_title"]);
                ?>
</h1>
                <h2 title="Event Statistics Section">Event Statistics</h2>
                <?php 
                $HEAD[] = "<script type=\"text/javascript\" src=\"" . ENTRADA_RELATIVE . "/javascript/jquery/jquery.dataTables.min.js?release=" . html_encode(APPLICATION_VERSION) . "\"></script>";
                ?>
                <script type="text/javascript">
                    jQuery(function($) {
Exemplo n.º 2
0
         } else {
             textarea.innerHTML = default_text;
         }
         textarea.className = "expandable objective";
         $('objective_'+id+"_append").insert({after: textarea});
         setTimeout('new ExpandableTextarea($("objective_text_'+id+'"));', 100);
     } else {
         if ($('objective_text_'+id)) {
             text[id] = $('objective_text_'+id).value;
             $('objective_text_'+id).remove();
         }
     }
 }
 </script>
 <?php 
 events_subnavigation($event_info, 'content');
 echo "<div class=\"content-small\">" . fetch_course_path($event_info["course_id"]) . "</div>\n";
 echo "<h1 id=\"page-top\" class=\"event-title\">" . html_encode($event_info["event_title"]) . "</h1>\n";
 if ($SUCCESS) {
     fade_element("out", "display-success-box");
     echo display_success();
 }
 if ($NOTICE) {
     echo display_notice();
 }
 if ($ERROR) {
     echo display_error();
 }
 ?>
 <form id="content_form" action="<?php 
 echo ENTRADA_URL;
Exemplo n.º 3
0
     $recurring_events = false;
 }
 if (!$ENTRADA_ACL->amIAllowed(new EventResource($event_info["event_id"], $event_info["course_id"], $event_info["organisation_id"]), 'update')) {
     application_log("error", "A program coordinator attempted to edit an event [" . $EVENT_ID . "] that they were not the coordinator for.");
     header("Location: " . ENTRADA_URL . "/admin/" . $MODULE);
     exit;
 } else {
     $BREADCRUMB[] = array("url" => ENTRADA_URL . "/admin/events?" . replace_query(array("section" => "edit", "id" => $EVENT_ID)), "title" => "Editing Event");
     $PROCESSED["associated_faculty"] = array();
     $PROCESSED["event_audience_type"] = "course";
     $PROCESSED["associated_cohort_ids"] = array();
     $PROCESSED["associated_cgroup_ids"] = array();
     $PROCESSED["associated_proxy_ids"] = array();
     $PROCESSED["event_types"] = array();
     if (!$is_draft) {
         events_subnavigation($event_info, 'edit');
     } else {
         $EVENT_ID = $event_info["event_id"];
     }
     echo "<h1>Editing Event</h1>\n";
     // Error Checking
     switch ($STEP) {
         case 2:
             $stats = array();
             /**
              * Required field "course_id" / Course
              */
             if (isset($_POST["course_id"]) && ($course_id = clean_input($_POST["course_id"], array("int")))) {
                 $query = "\tSELECT * FROM `courses`\n\t\t\t\t\t\t\t\t\t\tWHERE `course_id` = " . $db->qstr($course_id) . "\n\t\t\t\t\t\t\t\t\t\tAND (`course_active` = '1' OR `course_id` = " . $db->qstr($event_info["course_id"]) . ")";
                 $result = $db->GetRow($query);
                 if ($result) {
Exemplo n.º 4
0
                exit;
            } else {
                $BREADCRUMB[] = array("url" => ENTRADA_URL . "/admin/events?" . replace_query(array("section" => "history", "id" => $EVENT_ID)), "title" => "Event History");
                $LASTUPDATED = $event_info["updated_date"];
                /**
                 * Fetch event content history
                 * If no history just display the creation information
                 */
                $query = "\tSELECT a.`history_message` AS message, a.`history_timestamp` AS timestamp, CONCAT_WS(' ', b.`firstname`, b.`lastname`) AS `fullname`\n\t\t\t\t\t\tFROM `event_history` AS a\n\t\t\t\t\t\tLEFT JOIN `" . AUTH_DATABASE . "`.`user_data` AS b\n\t\t\t\t\t\tON a.`proxy_id` = b.`id`\n\t\t\t\t\t\tWHERE a.`event_id`  = " . $db->qstr($EVENT_ID) . "\n\t\t\t\t\t\tORDER BY `history_timestamp` DESC, `history_message` ASC";
                $history = $db->GetAll($query);
                if (!$history) {
                    $query = "\tSELECT CONCAT_WS(' ', `firstname`, `lastname`) AS `fullname`,\n\t\t\t\t\t\t\t{$LASTUPDATED} AS timestamp, 'created this learning event.' AS message\n\t\t\t\t\t\t\tFROM `" . AUTH_DATABASE . "`.`user_data`\n\t\t\t\t\t\t\tWHERE `id`  = " . $db->qstr($event_info["updated_by"]);
                    $history = $db->GetAll($query);
                }
                if ($history) {
                    events_subnavigation($event_info, 'history');
                    ?>
					<h2 title="Event History Section">Event History</h2>
					<p>
					<?php 
                    $previous_day = 0;
                    foreach ($history as $key => $result) {
                        $current_day = mktime(0, 0, 0, date("m", $result["timestamp"]), date("d", $result["timestamp"]), date("Y", $result["timestamp"]));
                        if ($current_day != $previous_day) {
                            $previous_day = $current_day;
                            if ($key > 0) {
                                echo "</ul></p>";
                            }
                            echo "<strong>" . date("F j, Y", $current_day) . "</strong><ul class=\"history\">\n";
                        }
                        echo "<li>" . date("g:ia ", $result["timestamp"]) . $result["fullname"] . " " . $result["message"] . "</li>";
Exemplo n.º 5
0
} elseif (!$ENTRADA_ACL->amIAllowed('eventcontent', 'update', false)) {
    $ONLOAD[] = "setTimeout('window.location=\\'" . ENTRADA_URL . "/admin/" . $MODULE . "\\'', 15000)";
    $ERROR++;
    $ERRORSTR[] = "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 {
    if ($EVENT_ID) {
        $query = "\tSELECT a.*, b.`organisation_id`\n\t\t\t\t\t\tFROM `events` AS a\n\t\t\t\t\t\tLEFT JOIN `courses` AS b\n\t\t\t\t\t\tON b.`course_id` = a.`course_id`\n\t\t\t\t\t\tWHERE a.`event_id` = " . $db->qstr($EVENT_ID);
        $event_info = $db->GetRow($query);
        if ($event_info && isset($event_info["recurring_id"])) {
            $query = "SELECT * FROM `events`\n                        WHERE `recurring_id` = " . $db->qstr($event_info["recurring_id"]);
            $recurring_events = $db->GetAll($query);
            if ($recurring_events) {
                $BREADCRUMB[] = array("url" => ENTRADA_URL . "/admin/events?" . replace_query(array("section" => "content", "id" => $EVENT_ID)), "title" => "Event Content");
                events_subnavigation($event_info, "recurring");
                echo "<div class=\"content-small\">" . fetch_course_path($event_info["course_id"]) . "</div>\n";
                echo "<h1 class=\"event-title\">" . html_encode($event_info["event_title"]) . "</h1>\n";
                if ($SUCCESS) {
                    fade_element("out", "display-success-box");
                    echo display_success();
                }
                if ($NOTICE) {
                    echo display_notice();
                }
                if ($ERROR) {
                    echo display_error();
                }
                ?>
                <a name="event-attendance-section"></a>
                <h2 title="Event Resources Section">Related Recurring Events</h2>
Exemplo n.º 6
0
                        foreach ($audience as $learner) {
                            $output .= $learner["number"] . ',' . $learner["lastname"] . ',' . $learner["firstname"] . ',' . ($learner["has_attendance"] ? 'Present' : 'Absent') . "\n";
                        }
                        $file_title = "attendance-for-event-" . $event_info["event_id"] . "-" . time() . ".csv";
                        header("Pragma: public");
                        header("Expires: 0");
                        header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
                        header("Content-Type: text/csv");
                        header("Content-Disposition: inline; filename=\"" . $file_title . "\"");
                        header("Content-Length: " . @strlen($output));
                        header("Content-Transfer-Encoding: binary\n");
                        echo $output;
                        exit;
                    }
                }
                events_subnavigation($event_info, 'attendance');
                echo "<div class=\"content-small\">" . fetch_course_path($event_info["course_id"]) . "</div>\n";
                echo "<h1 class=\"event-title\">" . html_encode($event_info["event_title"]) . "</h1>\n";
                if ($SUCCESS) {
                    fade_element("out", "display-success-box");
                    echo display_success();
                }
                if ($NOTICE) {
                    echo display_notice();
                }
                if ($ERROR) {
                    echo display_error();
                }
                ?>

					<div class="pull-right">