/**
      * Add the student search sidebar item.
      */
     $sidebar_html = "<form action=\"" . ENTRADA_URL . "/clerkship?section=results\" method=\"post\" style=\"display: inline\">\n";
     $sidebar_html .= "<label for=\"name\" class=\"form-nrequired\">Student Search:</label><br />";
     $sidebar_html .= "<input type=\"text\" id=\"name\" name=\"name\" value=\"\" style=\"width: 95%\" /><br />\n";
     $sidebar_html .= "<input type=\"hidden\" name=\"action\" value=\"results\" />";
     $sidebar_html .= "<span style=\"float: right; padding-top: 4px;\"><input type=\"submit\" class=\"btn btn-primary\" value=\"Search\" /></span>\n";
     $sidebar_html .= "</form>\n";
     new_sidebar_item("View Schedule", $sidebar_html, "search", "open");
 }
 if ($_SESSION["permissions"][$ENTRADA_USER->getAccessId()]["group"] == "student") {
     /**
      * Process local page actions.
      */
     $elective_weeks = clerkship_get_elective_weeks($ENTRADA_USER->getID());
     $remaining_weeks = (int) $CLERKSHIP_REQUIRED_WEEKS - (int) $elective_weeks["approved"];
     $sidebar_html = "<ul class=\"menu\">\n";
     $sidebar_html .= "\t<li><a href=\"" . ENTRADA_URL . "/clerkship/electives?section=view&type=approval\"><strong>" . $elective_weeks["approval"] . "</strong> Pending Approval</a></li>\n";
     $sidebar_html .= "\t<li class=\"checkmark\"><a href=\"" . ENTRADA_URL . "/clerkship/electives?section=view&type=published\"><strong>" . $elective_weeks["approved"] . "</strong> Weeks Approved</a></li>\n";
     $sidebar_html .= "\t<li class=\"rejected\"><a href=\"" . ENTRADA_URL . "/clerkship/electives?section=view&type=rejected\"><strong>" . $elective_weeks["trash"] . "</strong> Weeks Rejected</a></li>\n";
     $sidebar_html .= "\t<br />";
     if ((int) $elective_weeks["approval"] + (int) $elective_weeks["approved"] > 0) {
         $sidebar_html .= "\t<li><a href=\"" . ENTRADA_URL . "/clerkship/electives?section=disciplines\">Discipline Breakdown</a></li>\n";
     }
     $sidebar_html .= "</ul>\n";
     $sidebar_html .= "<div style=\"margin-top: 10px\">\n";
     $sidebar_html .= "\tYou have " . $remaining_weeks . " required elective week" . ($remaining_weeks != 1 ? "s" : "") . " remaining.\n";
     if ($remaining_weeks > 0) {
         $sidebar_html .= "\tTo submit electives for approval, <a href=\"" . ENTRADA_URL . "/clerkship/electives?section=add\">click here</a>.";
     }
Example #2
0
    application_log("error", "Group [" . $_SESSION["permissions"][$ENTRADA_USER->getAccessId()]["group"] . "] and role [" . $_SESSION["permissions"][$ENTRADA_USER->getAccessId()]["role"] . "] do not have access to this module [" . $MODULE . "]");
} else {
    $BREADCRUMB[] = array("url" => ENTRADA_URL . "/clerkship/clerk?", "title" => "Clerk Management");
    $HEAD[] = "<link href=\"" . ENTRADA_URL . "/css/tabpane.css?release=" . html_encode(APPLICATION_VERSION) . "\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />\n";
    $HEAD[] = "<style type=\"text/css\">.dynamic-tab-pane-control .tab-page { height:auto; }</style>\n";
    $HEAD[] = "<script type=\"text/javascript\" src=\"" . ENTRADA_URL . "/javascript/tabpane/tabpane.js?release=" . html_encode(APPLICATION_VERSION) . "\"></script>\n";
    if (isset($_GET["ids"]) && ($PROXY_ID = clean_input($_GET["ids"], "int"))) {
        $student_name = get_account_data("firstlast", $PROXY_ID);
        /**
         * Process local page actions.
         */
        $query = "\tSELECT a.*, c.*\n\t\t\t\t\t\tFROM `" . CLERKSHIP_DATABASE . "`.`events` AS a\n\t\t\t\t\t\tLEFT JOIN `" . CLERKSHIP_DATABASE . "`.`event_contacts` AS b\n\t\t\t\t\t\tON b.`event_id` = a.`event_id`\n\t\t\t\t\t\tLEFT JOIN `" . CLERKSHIP_DATABASE . "`.`regions` AS c\n\t\t\t\t\t\tON c.`region_id` = a.`region_id`\n\t\t\t\t\t\tWHERE b.`econtact_type` = 'student'\n\t\t\t\t\t\tAND b.`etype_id` = " . $db->qstr($PROXY_ID) . "\n\t\t\t\t\t\tORDER BY a.`event_start` ASC";
        $results = $db->GetAll($query);
        if ($results) {
            if ($ENTRADA_ACL->amIAllowed('electives', 'update')) {
                $elective_weeks = clerkship_get_elective_weeks($PROXY_ID);
                $remaining_weeks = (int) $CLERKSHIP_REQUIRED_WEEKS - (int) $elective_weeks["approved"];
                $sidebar_html = "<ul class=\"menu\">\n";
                $sidebar_html .= "\t<li><strong>" . $elective_weeks["approval"] . "</strong> Pending Approval</li>\n";
                $sidebar_html .= "\t<li class=\"checkmark\"><strong>" . $elective_weeks["approved"] . "</strong> Weeks Approved</li>\n";
                $sidebar_html .= "\t<li class=\"incorrect\"><strong>" . $elective_weeks["trash"] . "</strong> Weeks Rejected</li>\n";
                $sidebar_html .= "\t<br />";
                if ((int) $elective_weeks["approval"] + (int) $elective_weeks["approved"] > 0) {
                    $sidebar_html .= "\t<li><a target=\"blank\" href=\"" . ENTRADA_URL . "/clerkship/electives?section=disciplines&id=" . $PROXY_ID . "\">Discipline Breakdown</a></li>\n";
                }
                $sidebar_html .= "</ul>\n";
                $sidebar_html .= "<div style=\"margin-top: 10px\">\n";
                $sidebar_html .= $student_name . " has " . $remaining_weeks . " required elective week" . ($remaining_weeks != 1 ? "s" : "") . " remaining.\n";
                $sidebar_html .= "</div>\n";
                new_sidebar_item("Elective Weeks", $sidebar_html, "page-clerkship", "open");
            }
Example #3
0
     $dateCheckQuery = "SELECT `event_title`, `event_start`, `event_finish`\n\t\t\t\t\t\t\t\t\t\t\tFROM `" . CLERKSHIP_DATABASE . "`.`events`, `" . CLERKSHIP_DATABASE . "`.`electives`, `" . CLERKSHIP_DATABASE . "`.`event_contacts`\n\t\t\t\t\t\t\t\t\t\t\tWHERE `" . CLERKSHIP_DATABASE . "`.`events`.`event_id` != " . $db->qstr($EVENT_ID) . "\n\t\t\t\t\t\t\t\t\t\t\tAND `" . CLERKSHIP_DATABASE . "`.`events`.`event_id` = `" . CLERKSHIP_DATABASE . "`.`electives`.`event_id`\n\t\t\t\t\t\t\t\t\t\t\tAND `" . CLERKSHIP_DATABASE . "`.`events`.`event_id` = `" . CLERKSHIP_DATABASE . "`.`event_contacts`.`event_id`\n\t\t\t\t\t\t\t\t\t\t\tAND `" . CLERKSHIP_DATABASE . "`.`event_contacts`.`etype_id` = " . $db->qstr($student_id) . "\n\t\t\t\t\t\t\t\t\t\t\tAND `" . CLERKSHIP_DATABASE . "`.`events`.`event_type` = \"elective\"\n\t\t\t\t\t\t\t\t\t\t\tAND `" . CLERKSHIP_DATABASE . "`.`events`.`event_status` != \"trash\"\n\t\t\t\t\t\t\t\t\t\t\tAND ((" . $db->qstr($start_stamp) . " >= `" . CLERKSHIP_DATABASE . "`.`events`.`event_start`\n\t\t\t\t\t\t\t\t\t\t\tAND " . $db->qstr($start_stamp) . " <= `" . CLERKSHIP_DATABASE . "`.`events`.`event_finish`)\n\t\t\t\t\t\t\t\t\t\t\tOR (" . $db->qstr($end_stamp) . " >= `" . CLERKSHIP_DATABASE . "`.`events`.`event_start`\n\t\t\t\t\t\t\t\t\t\t\tAND " . $db->qstr($end_stamp) . " <= `" . CLERKSHIP_DATABASE . "`.`events`.`event_finish`)\n\t\t\t\t\t\t\t\t\t\t\tOR (`" . CLERKSHIP_DATABASE . "`.`events`.`event_start` >= " . $db->qstr($start_stamp) . "\n\t\t\t\t\t\t\t\t\t\t\tAND `" . CLERKSHIP_DATABASE . "`.`events`.`event_finish` <= " . $db->qstr($end_stamp) . "))";
     if ($dateCheck = $db->GetAll($dateCheckQuery)) {
         $dateError = "";
         $dateErrorCtr = 0;
         foreach ($dateCheck as $dateValue) {
             $dateErrorCtr++;
             $dateError .= "<br /><tt>" . $dateValue["event_title"] . "<br />  *  Starts: " . date("Y-m-d", $dateValue["event_start"]) . "<br />  * Finishes: " . date("Y-m-d", $dateValue["event_finish"]) . "</tt><br />";
         }
         $ERROR++;
         if ($dateErrorCtr == 1) {
             $ERRORSTR[] = "This elective conflicts with the following elective:<br />" . $dateError;
         } else {
             $ERRORSTR[] = "This elective conflicts with the following electives:<br />" . $dateError;
         }
     } else {
         $weekTotals = clerkship_get_elective_weeks($ENTRADA_USER->getID(), $EVENT_ID);
         $totalWeeks = $weekTotals["approval"] + $weekTotals["approved"];
         if ($totalWeeks + clean_input($_POST["event_finish_name"], array("int")) > $CLERKSHIP_REQUIRED_WEEKS) {
             $ERROR++;
             $ERRORSTR[] = "The <strong>Weeks</strong> field contains too large a number as this combined with the other electives you have in the system\n\t\t\t\t\t\t\t\t(both approved and awaiting approval) exceeds the maximum number of weeks allowed (" . $CLERKSHIP_REQUIRED_WEEKS . "). Please use the Page Feedback link to \n\t\t\t\t\t\t\t\tcontact the Undergraduate office if you need help resolving this issue.";
         }
     }
 }
 /**
  * Required field "schools_id" / Host School.
  */
 if (isset($_POST["schools_id"]) && ($medical_school = clean_input($_POST["schools_id"], array("int")))) {
     $PROCESSED["schools_id"] = $medical_school;
     if ($medical_school == "99999") {
         if (isset($_POST["other_medical_school"]) && ($other = clean_input($_POST["other_medical_school"], array("notags", "trim")))) {
             $PROCESSED["other_medical_school"] = $other;
Example #4
0
     $query_year = trim($_GET["year"]);
 }
 $query = "SELECT `" . AUTH_DATABASE . "`.`user_data`.`id` AS `proxy_id`, CONCAT_WS(', ', `" . AUTH_DATABASE . "`.`user_data`.`lastname`, `" . AUTH_DATABASE . "`.`user_data`.`firstname`) AS `fullname` \n\t\t\t\tFROM `" . AUTH_DATABASE . "`.`user_data` \n\t\t\t\tLEFT JOIN `" . AUTH_DATABASE . "`.`user_access` ON `" . AUTH_DATABASE . "`.`user_access`.`user_id`=`" . AUTH_DATABASE . "`.`user_data`.`id` \n\t\t\t\tWHERE `" . AUTH_DATABASE . "`.`user_access`.`app_id`='" . AUTH_APP_ID . "' \n\t\t\t\tAND `role`=" . $db->qstr(trim($query_year), get_magic_quotes_gpc()) . " \n\t\t\t\tAND `group`='student' \n\t\t\t\tORDER BY `" . AUTH_DATABASE . "`.`user_data`.`lastname`, `" . AUTH_DATABASE . "`.`user_data`.`firstname` ASC";
 $results = $db->GetAll($query);
 if ($results) {
     $counter = 0;
     $total = count($results);
     $split = round($total / 2) + 1;
     echo "There are a total of <b>" . $total . "</b> student" . ($total != "1" ? "s" : "") . " in the class of <b>" . checkslashes(trim($query_year)) . "</b>. Please choose a student you wish to work with by clicking on their name, or if you wish to add an event to multiple students simply check the checkbox beside their name and click the &quot;Add Mass Event&quot; button.";
     echo "<form action=\"" . ENTRADA_URL . "/clerkship?section=add_elective\" method=\"post\">\n";
     echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n";
     echo "<tr>\n";
     echo "\t<td style=\"vertical-align: top\">\n";
     echo "\t\t<ol start=\"1\">\n";
     foreach ($results as $result) {
         $elective_weeks = clerkship_get_elective_weeks($result["proxy_id"]);
         $remaining_weeks = (int) $CLERKSHIP_REQUIRED_WEEKS - (int) $elective_weeks["approved"];
         switch (htmlentities($_POST["qualifier"])) {
             case "*":
             default:
                 $show = true;
                 $noResults = "No Results";
                 break;
         }
         if ($show) {
             $counter++;
             if ($counter == $split) {
                 echo "\t\t</ol>\n";
                 echo "\t</td>\n";
                 echo "\t<td style=\"vertical-align: top\">\n";
                 echo "\t\t<ol start=\"" . $split . "\">\n";
Example #5
0
     if (isset($_POST["event_status"]) && $_POST["event_status"] == "published" || isset($PROCESSED["event_status"]) && $PROCESSED["event_status"] == "published") {
         $ONLOAD[] = "showRejection('false')";
         $ONLOAD[] = "showNotification('approved')";
     } else {
         $ONLOAD[] = "showRejection('false')";
         $ONLOAD[] = "showNotification('false')";
     }
 }
 $LASTUPDATED = $event_info["updated_date"];
 if ($ERROR) {
     echo display_error();
 }
 /**
  * Process local page actions.
  */
 $elective_weeks = clerkship_get_elective_weeks($event_info["etype_id"]);
 $remaining_weeks = (int) $CLERKSHIP_REQUIRED_WEEKS - (int) $elective_weeks["approved"];
 $sidebar_html = "<ul class=\"menu\">\n";
 $sidebar_html .= "\t<li><strong>" . $elective_weeks["approval"] . "</strong> Pending Approval</li>\n";
 $sidebar_html .= "\t<li class=\"checkmark\"><strong>" . $elective_weeks["approved"] . "</strong> Weeks Approved</li>\n";
 $sidebar_html .= "\t<li class=\"incorrect\"><strong>" . $elective_weeks["trash"] . "</strong> Weeks Rejected</li>\n";
 $sidebar_html .= "\t<br />";
 if ((int) $elective_weeks["approval"] + (int) $elective_weeks["approved"] > 0) {
     $sidebar_html .= "\t<li><a target=\"blank\" href=\"" . ENTRADA_URL . "/admin/clerkship/electives?section=disciplines&id=" . $event_info["etype_id"] . "\">Discipline Breakdown</a></li>\n";
 }
 $sidebar_html .= "</ul>\n";
 $sidebar_html .= "<div style=\"margin-top: 10px\">\n";
 $sidebar_html .= $student_name . " has " . $remaining_weeks . " required elective week" . ($remaining_weeks != 1 ? "s" : "") . " remaining.\n";
 $sidebar_html .= "</div>\n";
 new_sidebar_item("Elective Weeks", $sidebar_html, "page-clerkship", "open");
 ?>