if ($remaining_weeks > 0) {
     $sidebar_html .= "\tTo submit electives for approval, <a href=\"" . ENTRADA_URL . "/clerkship/electives?section=add\">click here</a>.";
 }
 $sidebar_html .= "</div>\n";
 new_sidebar_item("Elective Weeks", $sidebar_html, "page-clerkship", "open");
 /* Logbook Review setup */
 $query = "SELECT *\n                    FROM `" . CLERKSHIP_DATABASE . "`.`events` AS a\n                    LEFT JOIN `" . CLERKSHIP_DATABASE . "`.`event_contacts` AS b\n                    ON b.`event_id` = a.`event_id`\n                    LEFT JOIN `" . CLERKSHIP_DATABASE . "`.`regions` AS c\n                    ON c.`region_id` = a.`region_id`\n                    WHERE a.`event_finish` >= " . $db->qstr(strtotime("00:00:00", time())) . "\n                    AND (a.`event_status` = 'published' OR a.`event_status` = 'approval')\n                    AND b.`econtact_type` = 'student'\n                    AND b.`etype_id` = " . $db->qstr($ENTRADA_USER->getActiveId()) . "\n                    ORDER BY a.`event_start` ASC";
 $clerkship_schedule = $db->GetAll($query);
 $query = "SELECT *\n                    FROM `" . CLERKSHIP_DATABASE . "`.`events` AS a\n                    LEFT JOIN `" . CLERKSHIP_DATABASE . "`.`event_contacts` AS b\n                    ON b.`event_id` = a.`event_id`\n                    LEFT JOIN `" . CLERKSHIP_DATABASE . "`.`regions` AS c\n                    ON c.`region_id` = a.`region_id`\n                    WHERE a.`event_finish` <= " . $db->qstr(strtotime("00:00:00", time())) . "\n                    AND (a.`event_status` = 'published' OR a.`event_status` = 'approval')\n                    AND b.`econtact_type` = 'student'\n                    AND b.`etype_id` = " . $db->qstr($ENTRADA_USER->getActiveId()) . "\n                    ORDER BY a.`event_start` ASC";
 $clerkship_past_schedule = $db->GetAll($query);
 if (isset($clerkship_schedule[0]) && $clerkship_schedule[0]["event_start"] <= time() || isset($clerkship_past_schedule) && $clerkship_past_schedule) {
     $ROTATION_ID = isset($clerkship_schedule[0]) && $clerkship_schedule[0]["rotation_id"] ? $clerkship_schedule[0]["rotation_id"] : $clerkship_past_schedule[count($clerkship_past_schedule) - 1]["rotation_id"];
     $SHOW_LOGBOOK = (int) $_SESSION["details"]["role"] <= date("Y", strtotime("+1 year")) ? true : false;
     $clinical_rotation = clerkship_get_rotation($rotation ? $rotation : ($ROTATION_ID ? $ROTATION_ID : 0));
     $rotation = $clinical_rotation["id"];
     $clinical_encounters = clerkship_get_rotation_overview($rotation);
     $objectives_required = 0;
     $objectives_recorded = 0;
     $grad_year = get_account_data("grad_year", $ENTRADA_USER->getID());
     if ($rotation < 10) {
         $query = "\tSELECT `objective_id`, MAX(`number_required`) AS `required`\n\t\t\t\t\t\t\tFROM `" . CLERKSHIP_DATABASE . "`.`logbook_mandatory_objectives`\n\t\t\t\t\t\t\tWHERE `rotation_id` = " . $db->qstr($rotation ? $rotation : ($ROTATION_ID ? $ROTATION_ID : 0)) . "\n\t\t\t\t\t\t\tAND `grad_year_min` <= " . $db->qstr($grad_year) . "\n\t\t\t\t\t\t\tAND (`grad_year_max` = 0 OR `grad_year_max` >= " . $db->qstr($grad_year) . ")\n\t\t\t\t\t\t\tGROUP BY `objective_id`";
         $required_objectives = $db->GetAll($query);
         if ($required_objectives) {
             foreach ($required_objectives as $required_objective) {
                 $objectives_required += $required_objective["required"];
                 $number_required[$required_objective["objective_id"]] = $required_objective["required"];
                 $query = "SELECT COUNT(a.`objective_id`) AS `recorded`\n\t\t\t\t\t\t\t\t\t\tFROM `" . CLERKSHIP_DATABASE . "`.`logbook_entry_objectives` AS a\n\t\t\t\t\t\t\t\t\t\tJOIN `" . CLERKSHIP_DATABASE . "`.`logbook_entries` AS b\n\t\t\t\t\t\t\t\t\t\tON a.`lentry_id` = b.`lentry_id`\n\t\t\t\t\t\t\t\t\t\tAND b.`entry_active` = '1'\n\t\t\t\t\t\t\t\t\t\tAND b.`proxy_id` = " . $db->qstr($ENTRADA_USER->getID()) . "\n\t\t\t\t\t\t\t\t\t\tWHERE a.`objective_id` = " . $db->qstr($required_objective["objective_id"]) . "\n\t\t\t\t\t\t\t\t\t\tGROUP BY a.`objective_id`";
                 $recorded = $db->GetOne($query);
                 if ($recorded) {
                     if ($required_objective["required"] > $recorded) {
                         if ($objective_ids) {
示例#2
0
		<thead>
		    <tr>
			<td class="region">Rotation</td>
			<td class="completed">Entries</td>
			<td class="completed">CPs</td>
			<td class="completed">Mandatory CPs</td>
			<td class="completed">Procedures</td>
		    </tr>
		</thead>
		<tbody>
		<tr><td colspan="5"></td></tr>
		<?php 
        $other = false;
        foreach ($results as $result) {
            $click_url = ENTRADA_URL . "/clerkship?core=" . $result["rotation_id"];
            $clinical_encounters = clerkship_get_rotation_overview($result["rotation_id"]);
            if ($clinical_encounters["entries"]) {
                $click_url = ENTRADA_URL . "/clerkship/logbook?section=view&type=entries&core=" . $result["rotation_id"];
            } else {
                $click_url = ENTRADA_URL . "/clerkship?core=" . $result["rotation_id"];
            }
            echo "<tr><td class=\"region\"><a href=\"" . $click_url . "\" style=\"font-size: 11px\">" . limit_chars(html_decode($result["rotation_title"]), 55, true, false) . "</a></td>\n";
            echo "<td class=\"completed\">" . blank_zero($clinical_encounters["entries"]) . "</td>\n";
            echo "<td class=\"completed\">" . blank_zero($clinical_encounters["objectives"]) . "</td>\n";
            echo "<td class=\"completed\">" . blank_zero($clinical_encounters["mandatories"]) . " " . ($clinical_encounters["other_mandatories"] ? "&nbsp;(" . $clinical_encounters["other_mandatories"] . ")" : '') . "</td>\n";
            echo "<td class=\"completed\">" . blank_zero($clinical_encounters["procedures"]) . "</td></tr>\n";
        }
        ?>
		</tbody>
		</table>
	    <br />