function sendNotification($result)
{
    global $AGENT_CONTACTS, $db;
    if ($result["preceptor_proxy_id"] != 0) {
        $query = "SELECT `prefix`, `firstname`, `lastname`, `email` FROM `" . AUTH_DATABASE . "`.`user_data` WHERE `id` = " . $db->qstr($result["preceptor_proxy_id"]);
        $preceptor = $db->GetRow($query);
        $preceptor_email = $preceptor["email"];
        $preceptor_name = (!empty($preceptor["prefix"]) ? $preceptor["prefix"] . " " : "") . $preceptor["firstname"] . " " . $preceptor["lastname"];
    } else {
        $preceptor_email = $result["preceptor_email"];
        $preceptor_name = $result["preceptor_firstname"] . " " . $result["preceptor_lastname"];
    }
    if ($preceptor_email) {
        $ENTRADA_USER = User::get($result["student_id"]);
        $message = $preceptor_name . ",\n\n";
        $message .= "You have been indicated as the preceptor on an Observership:\n" . "======================================================\n" . "Submitted at: " . date("Y-m-d H:i", time()) . "\n" . "Submitted by: " . $ENTRADA_USER->getFullname(false) . "\n" . "E-Mail Address: " . $ENTRADA_USER->getEmail() . "\n" . "Observership details:\n" . "---------------------\n" . "Title: " . $result["title"] . "\n" . "Activity Type: " . $result["activity_type"] . "\n" . ($result["activity_type"] == "ipobservership" ? "IP Observership Details: " . $result["activity_type"] . "\n" : "") . "Clinical Discipline: " . $result["clinical_discipline"] . "\n" . "Organisation: " . $result["organisation"] . "\n" . "Address: " . $result["address_l1"] . "\n" . "Preceptor: " . $preceptor_name . "\n" . "Start date: " . date("Y-m-d", $result["start"]) . "\n" . "End date: " . date("Y-m-d", $result["end"]) . "\n\n" . "The observership request can be approved or rejected at the following address:\n" . ENTRADA_URL . "/confirm_observership?unique_id=" . $result["unique_id"];
        $mail = new Zend_Mail();
        $mail->addHeader("X-Section", "Observership Confirmation", true);
        $mail->setFrom($AGENT_CONTACTS["general-contact"]["email"], $AGENT_CONTACTS["general-contact"]["name"]);
        $mail->setSubject("Observership Confirmation");
        $mail->setBodyText($message);
        $mail->addTo($preceptor_email, $preceptor_name);
        if ($mail->send()) {
            $query = "UPDATE `student_observerships` SET `notice_sent` = " . $db->qstr(time()) . " WHERE `id` = " . $db->qstr($result["id"]);
            if ($db->Execute($query)) {
                return true;
                application_log("success", "Sent observership notification to [" . $preceptor_email . "] for observership_id [" . $result["id"] . "].");
            }
        } else {
            application_log("error", "Unable to send observership [observership_id: " . $result["id"] . "] confirmation request.");
            return false;
        }
    }
}
 public function delete()
 {
     global $db;
     $query = "DELETE FROM `student_formal_remediations` where `id`=" . $db->qstr($this->id);
     if (!$db->Execute($query)) {
         add_error("Failed to remove formal remediation from database.");
         application_log("error", "Unable to delete a student_formal_remediations record. Database said: " . $db->ErrorMsg());
     } else {
         add_success("Successfully removed Formal Remediation.");
     }
 }
 public function delete()
 {
     global $db;
     $query = "DELETE FROM `student_leaves_of_absence` where `id`=" . $db->qstr($this->id);
     if (!$db->Execute($query)) {
         add_error("Failed to remove leave of absence from database.");
         application_log("error", "Unable to delete a student_leaves_of_absence record. Database said: " . $db->ErrorMsg());
     } else {
         add_success("Successfully removed Leave of Absence.");
     }
 }
 public function update(array $input_arr)
 {
     extract($input_arr);
     global $db;
     $query = "Update `student_clineval_comments` set `comment`=?, `source`=? where `id`=?";
     if (!$db->Execute($query, array($text, $source, $this->id))) {
         add_error("Failed to update a clinical performance evaluation comment.");
         application_log("error", "Unable to update a student_clineval_comment record. Database said: " . $db->ErrorMsg());
     } else {
         add_success("Successfully updated clinical performance evaluation.");
     }
 }
 /**
  * User is included to prevent tampering with another user's sequence.
  * @param User $user
  * @param array $ids
  */
 public function setSequence($user_id, array $ids)
 {
     global $db;
     $stmt = $db->Prepare('update `student_research` set `priority`=? where `user_id`=? and `id`=?');
     foreach ($ids as $priority => $id) {
         if (!$db->Execute($stmt, array($priority, $user_id, $id))) {
             add_error("Failed to re-sequence Research Citations.");
             application_log("error", "Unable to modify a student_research record. Database said: " . $db->ErrorMsg());
             break;
         }
     }
 }
function grade_below_threshold_notice($assessment_list)
{
    global $db, $AGENT_CONTACTS;
    $assessment_list = (array) $assessment_list;
    foreach ($assessment_list as $assessment_id => $assessment) {
        $mail = new Zend_Mail();
        $mail->addHeader("X-Originating-IP", $_SERVER["REMOTE_ADDR"]);
        $mail->addHeader("X-Section", "Gradebook Notification System", true);
        $mail->clearFrom();
        $mail->clearSubject();
        $mail->setFrom($AGENT_CONTACTS["agent-notifications"]["email"], APPLICATION_NAME . ' Gradebook System');
        $mail->setSubject("Grade Below Threshold Notification");
        $message = "<pre>This notification is being sent to inform you that students scored below the assessment threshold.\n\n";
        $message .= "Course:\t\t\t" . $assessment["course_name"] . " - " . $assessment["course_code"] . "\n";
        $message .= "Assessment:\t\t<a href=\"" . ENTRADA_URL . "/admin/gradebook/assessments?section=grade&id=" . $assessment["course_id"] . "&assessment_id=" . $assessment_id . "\">" . $assessment["assessment_name"] . "</a>\n";
        $message .= "Assessment ID:\t\t" . $assessment_id . "\n";
        $message .= "Grade Threshold:\t" . $assessment["threshold"] . "%\n\n";
        $message .= "The following students scored below the assessment threshold:\n";
        $message .= "-------------------------------------------------------------\n\n";
        foreach ($assessment["students"] as $proxy_number => $student) {
            $query = "\tUPDATE `assessment_grades`\n\t\t\t\t\t\tSET `threshold_notified` = '1'\n\t\t\t\t\t\tWHERE `grade_id` = " . $db->qstr($student["grade_id"]);
            $result = $db->Execute($query);
            $message .= "Student:\t\t" . $student["student_name"] . " - [" . $student["student_email"] . "] \n";
            $message .= "Student Number:\t\t" . $student["student_number"] . "\n";
            $message .= "Grade Recieved:\t\t" . $student["assessment_grade"] . "%\n\n";
        }
        $message .= "</pre>";
        $mail->setBodyHtml($message);
        $query = "\tSELECT a.`contact_type`, a.`contact_order`, b.`prefix`, b.`firstname`, b.`lastname`, b.`email`, a.`proxy_id`\n\t\t\tFROM " . DATABASE_NAME . ".`course_contacts` AS a \n\t\t\tJOIN " . AUTH_DATABASE . ".`user_data` AS b \n\t\t\tON a.`proxy_id` = b.`id`  \n\t\t\tWHERE a.`course_id` = " . $db->qstr($assessment["course_id"]) . "\n\t\t\tORDER BY a.`contact_type` DESC, a.`contact_order` ASC";
        $contacts = $db->GetAll($query);
        foreach ($contacts as $contact) {
            $mail->addTo($contact["email"], (!empty($contact["prefix"]) ? $contact["prefix"] . " " : "") . $contact["firstname"] . " " . $contact["lastname"]);
            $contact_proxies[] = $contact["proxy_id"];
        }
        $sent = true;
        try {
            $mail->send();
        } catch (Exception $e) {
            $sent = false;
        }
        if ($sent) {
            application_log("success", "Sent grade below threshold notification to Program Coordinators / Directors [" . implode(",", $contact_proxies) . "].");
            $return_value = true;
        } else {
            application_log("error", "Unable to send grade below threshold notification to Program Coordinators / Directors [" . implode(",", $contact_proxies) . "].");
        }
    }
}
Exemplo n.º 7
0
 * @author Unit: School of Medicine
 * @author Developer: Harry Brundage <*****@*****.**>
 * @copyright Copyright 2010 Queen's University. All Rights Reserved.
 *
 */
if (!defined("PARENT_INCLUDED") || !defined("IN_GRADEBOOK")) {
    exit;
} elseif (!isset($_SESSION["isAuthorized"]) || !$_SESSION["isAuthorized"]) {
    header("Location: " . ENTRADA_URL);
    exit;
} elseif (!$ENTRADA_ACL->amIAllowed("gradebook", "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 (isset($_POST["assessment_id"]) && (int) $_POST["assessment_id"]) {
        $assessment_id = (int) $_POST["assessment_id"];
    }
    if (isset($_POST["course_id"]) && (int) $_POST["course_id"]) {
        $course_id = (int) $_POST["course_id"];
    }
    if (isset($_POST["import_type"]) && clean_input($_POST["import_type"], "alpha")) {
        $import_type = clean_input($_POST["import_type"], "alpha");
    } else {
        $import_type = "all";
    }
    $url = ENTRADA_URL . "/admin/gradebook/assessments?section=grade&id=" . $course_id . "&assessment_id=" . $assessment_id;
    $BREADCRUMB[] = array("url" => ENTRADA_URL . "/admin/gradebook/assessments?" . replace_query(array("section" => "grade", "id" => $COURSE_ID, "step" => false)), "title" => "Grading Assessment");
    $BREADCRUMB[] = array("url" => ENTRADA_URL . "/admin/gradebook/assessments?" . replace_query(array("section" => "import-quiz", "id" => $COURSE_ID, "step" => false)), "title" => "Importing Quiz Results");
                            } else {
                                application_log("cron", "Action: Community " . $history_timestamp["community_id"] . " inactive for 12 months 7 days. Set to inactive.");
                            }
                        }
                    }
                } elseif ($timestamp < strtotime("-12 months -7 days 00:00:00")) {
                    $query = "  SELECT * FROM `communities`\n\t\t\t\t\t\t\t\tWHERE `community_id` = " . $db->qstr($history_timestamp["community_id"]);
                    $inactive_community_results = $db->GetAll($query);
                    if ($inactive_community_results) {
                        foreach ($inactive_community_results as $inactive_community) {
                            echo "\n";
                            echo $history_timestamp["history_timestamp"] . "\n";
                            echo $history_timestamp["timestamp"] . "\n";
                            $query = "  UPDATE `communities` SET `community_active` = '0'\n\t\t\t\t\t\t\t\t\t\tWHERE `community_id` =" . $db->qstr($inactive_community["community_id"]);
                            if ($SET_INACTIVE_COMMUNITIES) {
                                $db->Execute($query);
                                if ($query) {
                                    application_log("cron", "Community " . $history_timestamp["community_id"] . " inactive for more than 12 months 7 days. Set to inactive.");
                                } else {
                                    application_log("error", "Unable to deactivate community " . $history_timestamp["community_id"]);
                                }
                            } else {
                                application_log("cron", "Action: Community " . $history_timestamp["community_id"] . " " . $history_timestamp["history_timestamp"] . " " . "inactive for more than 12 months 7 days. Set to inactive.");
                            }
                        }
                    }
                }
            }
        }
    }
}
Exemplo n.º 9
0
                /**
                 * Reset the requires_apartment flag so this person is put back on the Regional Education dashboard.
                 */
                if (!$db->AutoExecute(CLERKSHIP_DATABASE . ".events", array("requires_apartment" => 1), "UPDATE", "event_id=" . $db->qstr($ASCHEDULE_INFO["event_id"]))) {
                    $NOTICE++;
                    $NOTICESSTR[] = "We were unable to add this learners event back onto the " . $APARTMENT_INFO["department_title"] . " dashboard as a todo task.";
                    application_log("error", "Unable to set requires_apartment to 1 for event_id [" . $ASCHEDULE_INFO["event_id"] . "] after proxy_id [" . $ASCHEDULE_INFO["proxy_id"] . "] had been removed from aschedule_id [" . $ASCHEDULE_ID . "]. Database said: " . $db->ErrorMsg());
                }
            }
            if (isset($_POST["notify"]) && (int) $_POST["notify"] == 1) {
                $apartment_address = ($APARTMENT_INFO["apartment_number"] != "" ? $APARTMENT_INFO["apartment_number"] . "-" : "") . $APARTMENT_INFO["apartment_address"] . "\n";
                $apartment_address .= $APARTMENT_INFO["region_name"] . ($APARTMENT_INFO["province"] ? ", " . $APARTMENT_INFO["province"] : "") . "\n";
                $apartment_address .= $APARTMENT_INFO["apartment_postcode"] . ", " . $APARTMENT_INFO["country"];
                $message_variables = array("to_firstname" => $ASCHEDULE_INFO["firstname"], "to_lastname" => $ASCHEDULE_INFO["lastname"], "from_firstname" => $_SESSION["details"]["firstname"], "from_lastname" => $_SESSION["details"]["lastname"], "region" => $APARTMENT_INFO["region_name"], "apartment_address" => $apartment_address, "inhabiting_start" => date(DEFAULT_DATE_FORMAT, $ASCHEDULE_INFO["inhabiting_start"]), "inhabiting_finish" => date(DEFAULT_DATE_FORMAT, $ASCHEDULE_INFO["inhabiting_finish"]), "application_name" => APPLICATION_NAME, "department_title" => $APARTMENT_INFO["department_title"], "department_id" => $APARTMENT_INFO["department_id"]);
                $recipient = array("email" => $ASCHEDULE_INFO["email"], "firstname" => $ASCHEDULE_INFO["firstname"], "lastname" => $ASCHEDULE_INFO["lastname"]);
                regionaled_apartment_notification("delete", $recipient, $message_variables);
            }
        } else {
            $ERROR++;
            $ERRORSTR[] = "Unable to remove <strong>" . html_encode($ASCHEDULE_INFO["firstname"] . " " . $ASCHEDULE_INFO["lastname"]) . "</strong> from <strong>" . html_encode($APARTMENT_INFO["apartment_title"]) . "</strong> at this time. The system administrator has been notified of this issue, please try again later.<br /><br />You will now be redirected to the apartment schedule; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . ENTRADA_URL . $url . "\" style=\"font-weight: bold\">click here</a> to continue.";
            application_log("error", "Unable to remove proxy_id [" . $ASCHEDULE_INFO["proxy_id"] . "] from apartment_id [" . $APARTMENT_ID . "] / aschedule_id [" . $ASCHEDULE_ID . "]. Database said: " . $db->ErrorMsg());
        }
    } else {
        $url = "/admin/regionaled/apartments/manage/schedule?id=" . $APARTMENT_ID . "&sid=" . $ASCHEDULE_ID;
        $ERROR++;
        $ERRORSTR[] = "You must confirm that you wish to remove <strong>" . html_encode($ASCHEDULE_INFO["firstname"] . " " . $ASCHEDULE_INFO["lastname"]) . "</strong> from <strong>" . html_encode($APARTMENT_INFO["apartment_title"]) . "</strong>.<br /><br />You will now be redirected to the apartment schedule; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . ENTRADA_URL . $url . "\" style=\"font-weight: bold\">click here</a> to continue.";
        application_log("error", "The remove request for proxy_id [" . $ASCHEDULE_INFO["proxy_id"] . "] from apartment_id [" . $APARTMENT_ID . "] / aschedule_id [" . $ASCHEDULE_ID . "] was not confirmed. This step shouldn't have been accessible otherwise.");
    }
    $ONLOAD[] = "setTimeout('window.location=\\'" . ENTRADA_URL . $url . "\\'', 5000)";
    display_status_messages();
}
Exemplo n.º 10
0
                            $evaluator_ids_string .= ($evaluator_ids_string ? ", " : "") . $db->qstr($evaluator["proxy_id"]);
                        }
                    }
                }
                $query .= " AND a.`id` IN (" . $evaluator_ids_string . ")";
                break;
        }
        $query .= "\tAND b.`app_id` = " . $db->qstr(AUTH_APP_ID) . "\n\t\t\t\t\tAND b.`account_active` = 'true'\n\t\t\t\t\tAND (b.`access_starts`='0' OR b.`access_starts` <= " . $db->qstr(time()) . ")\n\t\t\t\t\tAND (b.`access_expires`='0' OR b.`access_expires` >= " . $db->qstr(time()) . ")\n\t\t\t\t\tGROUP BY a.`id`\n\t\t\t\t\tORDER BY `fullname` ASC";
        echo "<ul>\n";
        $results = $db->GetAll($query);
        if ($results) {
            foreach ($results as $result) {
                echo "\t<li id=\"" . (int) $result["proxy_id"] . "\">" . html_encode($result["fullname"]) . "<span class=\"informal content-small\"><br />" . html_encode($result["organisation_title"]) . " - " . html_encode(ucfirst($result["group"])) . "<br />" . html_encode($result["email"]) . "</span></li>\n";
            }
        } else {
            echo "\t<li id=\"0\"><span class=\"informal\">&quot;<strong>" . html_encode($fullname) . "&quot;</strong> was not found</span></li>";
        }
        echo "</ul>";
    }
    if ($email) {
        $query = "\tSELECT a.`id` AS `proxy_id`, a.`lastname`, a.`firstname`, a.`email`\n\t\t\t\t\tFROM `" . AUTH_DATABASE . "`.`user_data` AS a\n\t\t\t\t\tLEFT JOIN `" . AUTH_DATABASE . "`.`user_access` AS b\n\t\t\t\t\tON b.`user_id` = a.`id`\n\t\t\t\t\tAND (b.`group` <> 'guest')\n\t\t\t\t\tWHERE (a.`email` = " . $db->qstr($email) . " OR a.`email_alt` = " . $db->qstr($email) . ")";
        $result = $db->GetRow($query);
        if ($result) {
            echo json_encode(array("status" => "success", "data" => $result));
        } else {
            echo json_encode(array("status" => "error", "data" => array("msg" => "That email address is not registered in the system.")));
        }
    }
} else {
    application_log("error", "Personnel API accessed without valid session_id.");
}
                     $msg = "You will now be redirected to add another new record; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . $url . "\" style=\"font-weight: bold\">click here</a> to continue.";
                     break;
                 case "index":
                 default:
                     $url = ENTRADA_URL . "/annualreport/research";
                     $msg = "You will now be redirected to the research page; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . $url . "\" style=\"font-weight: bold\">click here</a> to continue.";
                     break;
             }
             $SUCCESS++;
             $SUCCESSSTR[] = "You have successfully added <strong>" . html_encode($PROCESSED["title"]) . "</strong> to the system.<br /><br />" . $msg;
             $ONLOAD[] = "setTimeout('window.location=\\'" . $url . "\\'', 5000);";
             application_log("success", "Book / Chapter / Mono [" . $EVENT_ID . "] added to the system.");
         } else {
             $ERROR++;
             $ERRORSTR[] = "There was a problem inserting this Book / Chapter / Mono into the system. The MEdIT Unit was informed of this error; please try again later.";
             application_log("error", "There was an error inserting a Book / Chapter / Mono. Database said: " . $db->ErrorMsg());
         }
     } else {
         $STEP = 1;
     }
     break;
 case 1:
     if (isset($_POST['pubmed_id'])) {
         $argv[1] = $_POST['pubmed_id'];
         $PROCESSED['pubmed_id'] = clean_input($_POST["pubmed_id"], array("notags", "trim"));
         if ($xml = simplexml_load_file('http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&retmax=0&usehistory=y&term=' . urlencode($argv[1]))) {
             if ($xml = simplexml_load_file("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&retmode=xml&query_key={$xml->QueryKey}&WebEnv={$xml->WebEnv}&retstart=0&retmax=10")) {
                 $docs = $xml->DocSum;
             }
         }
         if (!isset($xml->DocSum->Item[3]) || $xml->DocSum->Item[3] == "") {
Exemplo n.º 12
0
                         break;
                     case "index":
                     default:
                         $url = ENTRADA_URL . "/admin/courses/groups?id=" . $COURSE_ID;
                         $msg = "You will now be redirected to the group index; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . $url . "\" style=\"font-weight: bold\">click here</a> to continue.";
                         break;
                 }
                 $SUCCESS++;
                 $SUCCESSSTR[] = "You have successfully added <strong>" . $number_of_groups . " course groups</strong> to the system.<br /><br />" . $msg;
                 $ONLOAD[] = "setTimeout('window.location=\\'" . $url . "\\'', 5000)";
                 application_log("success", "New course groups added for course [" . $COURSE_ID . "] added to the system.");
             }
         } else {
             $ERROR++;
             $ERRORSTR[] = "There was a problem inserting group into the system. The system administrator was informed of this error; please try again later.";
             application_log("error", "There was an error inserting a group. Database said: " . $db->ErrorMsg());
         }
         if ($ERROR) {
             $STEP = 1;
         }
         break;
     case 1:
     default:
         continue;
         break;
 }
 // Display Content
 switch ($STEP) {
     case 2:
         display_status_messages();
         break;
                                        </form>
                                    </div>
                                </div>
                                <?php 
                                break;
                        }
                        break;
                }
                ?>
                <div id="scripts-on-open" style="display: none;">
                <?php 
                foreach ($modal_onload as $string) {
                    echo $string . ";\n";
                }
                ?>
                </div>
                <?php 
            }
        } else {
            $ERROR++;
            $ERRORSTR[] = "The provided event identifier does not exist in this system.";
            echo display_error();
            application_log("error", "LTI Provider wizard was accessed without a valid event id.");
        }
    } else {
        $ERROR++;
        $ERRORSTR[] = "You must provide an event identifier when using the LTI Provider wizard.";
        echo display_error();
        application_log("error", "LTI Provider wizard was accessed without any event id.");
    }
}
Exemplo n.º 14
0
             if (defined("EDIT_RESTRICTED_DAY") && EDIT_RESTRICTED_DAY) {
                 if ($day->fromArray($PROCESSED)->update()) {
                     add_success("The restricted day has successfully been updated. You will be redirected to the restricted days index in 5 seconds, or you can <a href=\"" . ENTRADA_URL . "/admin/settings/manage/restricteddays?org=" . $ORGANISATION_ID . "\">click here</a> if you do not wish to wait.");
                     add_statistic("restricted_day", "update", "orday_id", $PROCESSED["orday_id"], $ENTRADA_USER->getID());
                 } else {
                     add_error("An error occurred when attempting to update a restricted day [" . $PROCESSED["orday_id"] . "], an administrator has been informed, please try again later.");
                     application_log("error", "Error occurred when updating restricted day, DB said: " . $db->ErrorMsg());
                 }
             } else {
                 $PROCESSED["organisation_id"] = $ORGANISATION_ID;
                 if ($day->fromArray($PROCESSED)->insert()) {
                     add_success("The restricted day has successfully been updated. You will be redirected to the restricted days index in 5 seconds, or you can <a href=\"" . ENTRADA_URL . "/admin/settings/manage/restricteddays?org=" . $ORGANISATION_ID . "\">click here</a> if you do not wish to wait.");
                     add_statistic("restricted_day", "insert", "orday_id", $db->Insert_ID(), $ENTRADA_USER->getID());
                 } else {
                     add_error("An error occurred when attempting to create a new restricted day, an administrator has been informed, please try again later.");
                     application_log("error", "Error occurred when updating a restricted day, DB said: " . $db->ErrorMsg());
                 }
             }
         } else {
             $day = new Models_RestrictedDays();
             $day->fromArray($PROCESSED);
             $STEP = 1;
         }
         break;
     default:
         break;
 }
 switch ($STEP) {
     case 2:
         if ($ERROR) {
             echo display_error();
Exemplo n.º 15
0
									<option value="index"<?php 
                        echo $_SESSION[APPLICATION_IDENTIFIER]["tmp"]["post_action"] == "index" ? " selected=\"selected\"" : "";
                        ?>
>Return to Research list</option>
									</select>
									<input type="submit" class="btn btn-primary" value="Save" />
								</td>
							</tr>
							</table>
						</td>
					</tr>
					</table>					
					</form>
					<br /><br />
					<?php 
                        break;
                }
            } else {
                $ERROR++;
                $ERRORSTR[] = "In order to edit a research grant you must provide a valid research grant identifier. The provided ID does not exist in this system.";
                echo display_error();
                application_log("notice", "Failed to provide a valid research grant identifer when attempting to edit a research grant.");
            }
        } else {
            $ERROR++;
            $ERRORSTR[] = "In order to edit a research grant you must provide the research grant identifier.";
            echo display_error();
            application_log("notice", "Failed to provide research grant identifer when attempting to edit a research grant.");
        }
    }
}
Exemplo n.º 16
0
							</div>
						</div>
						<?php 
                        break;
                }
            } else {
                if ($ERROR) {
                    echo display_error();
                }
                if ($NOTICE) {
                    echo display_notice();
                }
            }
        } else {
            $NOTICE++;
            $NOTICESTR[] = "The photo that you are trying to edit was deactivated <strong>" . date(DEFAULT_DATE_FORMAT, $photo_record["updated_date"]) . "</strong> by <strong>" . html_encode(get_account_data("firstlast", $photo_record["updated_by"])) . "</strong>.<br /><br />If there has been a mistake or you have questions relating to this issue please contact the MEdTech Unit directly.";
            echo display_notice();
            application_log("error", "The photo record id [" . $RECORD_ID . "] is deactivated; however, " . $_SESSION["details"]["firstname"] . " " . $_SESSION["details"]["lastname"] . " [" . $ENTRADA_USER->getID() . "] has tried to edit it.");
        }
    } else {
        $ERROR++;
        $ERRORSTR[] = "The photo id that you have provided does not exist in the system. Please provide a valid record id to proceed.";
        echo display_error();
        application_log("error", "The provided photo id was invalid [" . $RECORD_ID . "] (Edit Photo).");
    }
} else {
    $ERROR++;
    $ERRORSTR[] = "Please provide a valid photo id to proceed.";
    echo display_error();
    application_log("error", "No photo id was provided to edit. (Edit Photo)");
}
Exemplo n.º 17
0
 *
 * @author Organisation: Queen's University
 * @author Unit: MEdTech
 * @author Developer: Don Zuiker <*****@*****.**>
 * @copyright Copyright 2013 Queen's University. All Rights Reserved.
 *
*/
if (!defined("IN_COURSE_REPORTS")) {
    exit;
} elseif (!isset($_SESSION["isAuthorized"]) || !$_SESSION["isAuthorized"]) {
    header("Location: " . ENTRADA_URL);
    exit;
} elseif (!$ENTRADA_ACL->amIAllowed(new CourseContentResource($COURSE_ID, $ENTRADA_USER->getActiveOrganisation(), true), "update")) {
    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 [" . $GROUP . "] and role [" . $ROLE . "] does not have access to this module [" . $MODULE . "]");
} else {
    $query = "\tSELECT * FROM `courses`\n\t\t\t\tWHERE `course_id` = " . $db->qstr($COURSE_ID) . "\n\t\t\t\tAND `course_active` = '1'";
    $course_details = $db->GetRow($query);
    courses_subnavigation($course_details, "reports");
    $query = "\tSELECT *\n\t\t\t\tFROM `course_lu_reports` a\n\t\t\t\tJOIN `course_reports` b\n\t\t\t\tON a.`course_report_id` = b.`course_report_id`\n\t\t\t\tWHERE b.`course_id` = " . $db->qstr($COURSE_ID) . "\n\t\t\t\tORDER BY a.`course_report_title` ASC";
    $reports = $db->getAll($query);
    ?>

	<h1>Available Reports</h1>
	<?php 
    if ($reports) {
        ?>
	<ul>
	<?php 
        foreach ($reports as $report) {
Exemplo n.º 18
0
                         $SUCCESS++;
                         $SUCCESSSTR[] = "You have successfully added this evaluation question to the system.<br /><br />" . $msg;
                         $ONLOAD[] = "setTimeout('window.location=\\'" . $url . "\\'', 5000)";
                         /**
                          * Unset the arrays used to construct this error checking.
                          */
                         unset($PROCESSED);
                         application_log("success", "New evaluation question [" . $equestion_id . "] added.");
                     } else {
                         add_error("There was a problem inserting this evaluation question. The system administrator was informed of this error; please try again later.");
                         application_log("error", "There was an error inserting an evaluation question. Database said: " . $db->ErrorMsg());
                     }
                 }
             } else {
                 add_error("You do not have permission to create this evaluation question. The system administrator was informed of this error; please try again later.");
                 application_log("error", "There was an error inserting an evaluation question because the user [" . $ENTRADA_USER->getID() . "] didn't have permission to create an evaluation question.");
             }
         }
         if ($ERROR) {
             $STEP = 1;
         }
         break;
     case 1:
     default:
         continue;
         break;
 }
 // Display Content
 switch ($STEP) {
     case 2:
         if ($SUCCESS) {
Exemplo n.º 19
0
                         $msg = "You will now be redirected to add another new record; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . $url . "\" style=\"font-weight: bold\">click here</a> to continue.";
                         break;
                     case "index":
                     default:
                         $url = ENTRADA_URL . "/annualreport/clinical";
                         $msg = "You will now be redirected to the clinical page; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . $url . "\" style=\"font-weight: bold\">click here</a> to continue.";
                         break;
                 }
                 $SUCCESS++;
                 $SUCCESSSTR[] = "You have successfully added information pertaining to <strong>" . html_encode($PROCESSED["service"]) . "</strong> to the system.<br /><br />" . $msg;
                 $ONLOAD[] = "setTimeout('window.location=\\'" . $url . "\\'', 5000);";
                 application_log("success", "Ward Supervision [" . $EVENT_ID . "] added to the system.");
             } else {
                 $ERROR++;
                 $ERRORSTR[] = "There was a problem inserting this record into the system. The MEdIT Unit was informed of this error; please try again later.";
                 application_log("error", "There was an error inserting an Ward Supervision record. Database said: " . $db->ErrorMsg());
             }
         } else {
             $STEP = 1;
         }
         break;
     case 1:
     default:
         continue;
         break;
 }
 // Display Content
 switch ($STEP) {
     case 2:
         if ($SUCCESS) {
             echo display_success();
                         $msg = "You will now be redirected to add another new record; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . $url . "\" style=\"font-weight: bold\">click here</a> to continue.";
                         break;
                     case "index":
                     default:
                         $url = ENTRADA_URL . "/annualreport/academic";
                         $msg = "You will now be redirected to the academic page; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . $url . "\" style=\"font-weight: bold\">click here</a> to continue.";
                         break;
                 }
                 $SUCCESS++;
                 $SUCCESSSTR[] = "You have successfully added information pertaining to internal contribution <strong>" . html_encode($PROCESSED["activity_type"]) . "</strong> to the system.<br /><br />" . $msg;
                 $ONLOAD[] = "setTimeout('window.location=\\'" . $url . "\\'', 5000);";
                 application_log("success", "Service Contributions on Behalf of Queen's University [" . $EVENT_ID . "] added to the system.");
             } else {
                 $ERROR++;
                 $ERRORSTR[] = "There was a problem inserting this record into the system. The MEdIT Unit was informed of this error; please try again later.";
                 application_log("error", "There was an error inserting an internal contribution record. Database said: " . $db->ErrorMsg());
             }
         } else {
             $STEP = 1;
         }
         break;
     case 1:
     default:
         continue;
         break;
 }
 // Display Content
 switch ($STEP) {
     case 2:
         if ($SUCCESS) {
             echo display_success();
Exemplo n.º 21
0
	                </tfoot>
	                </table>
	                <?php 
            } else {
                echo display_notice(array("There are no evaluators who have not started this evaluation."));
            }
        }
        ?>
		</div>
		<br /><br />
		<?php 
        /**
         * Sidebar item that will provide a method for choosing which results to display.
         */
        $sidebar_html = "Display progress as a:\n";
        $sidebar_html .= "<ul class=\"menu\">\n";
        $sidebar_html .= "\t<li class=\"" . ($_SESSION[APPLICATION_IDENTIFIER][$MODULE]["display"] == false ? "on" : "off") . "\"><a href=\"" . ENTRADA_URL . "/admin/" . $MODULE . "?" . replace_query(array("display" => "summary")) . "\" title=\"Summary\">summary</a></li>\n";
        $sidebar_html .= "\t<li class=\"" . ($_SESSION[APPLICATION_IDENTIFIER][$MODULE]["display"] == true ? "on" : "off") . "\"><a href=\"" . ENTRADA_URL . "/admin/" . $MODULE . "?" . replace_query(array("display" => "complete_list")) . "\" title=\"Complete list\">complete list of attempts</a></li>\n";
        $sidebar_html .= "</ul>\n";
        new_sidebar_item("Progress Display", $sidebar_html, "sort-results", "open");
    } else {
        application_log("error", "User tried to manage progress of a evaluation id [" . $EVALUATION_ID . "] that does not exist or is not active in the system.");
        $ERROR++;
        $ERRORSTR[] = "The evaluation you are trying to manage either does not exist in the system or has been deactived by an administrator.<br /><br />If you feel you are receiving this message in error, please contact the MEdTech Unit (page feedback on left) and we will investigate. The MEdTech Unit has automatically been informed that this error has taken place.";
        echo display_error();
    }
} else {
    application_log("error", "User tried to manage members a evaluation without providing a evaluation_id.");
    header("Location: " . ENTRADA_URL . "/admin/evaluations");
    exit;
}
Exemplo n.º 22
0
          */
         if (isset($_POST["mark_done"]) && @is_array($_POST["mark_done"])) {
             foreach ($_POST["mark_done"] as $notification_id) {
                 if ($notification_id = (int) $notification_id) {
                     $query = "\tSELECT a.`item_maxinstances` AS `remaining_entries`, b.`item_maxinstances` AS `total_entries`\n\t\t\t\t\t\t\t\t\t\tFROM `" . CLERKSHIP_DATABASE . "`.`notifications` AS a\n\t\t\t\t\t\t\t\t\t\tLEFT JOIN `" . CLERKSHIP_DATABASE . "`.`evaluations` AS b\n\t\t\t\t\t\t\t\t\t\tON b.`item_id` = a.`item_id`\n\t\t\t\t\t\t\t\t\t\tWHERE a.`user_id` = " . $db->qstr($ENTRADA_USER->getActiveId()) . "\n\t\t\t\t\t\t\t\t\t\tAND (\n\t\t\t\t\t\t\t\t\t\t\ta.`notification_status` <> 'complete'\n\t\t\t\t\t\t\t\t\t\t\tOR a.`notification_status` <> 'cancelled'\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\tAND a.`notification_id` = " . $db->qstr($notification_id) . "\n\t\t\t\t\t\t\t\t\t\tAND b.`item_status` = 'published'";
                     $result = $db->GetRow($query);
                     if ($result) {
                         $PROCESSED = array();
                         $PROCESSED["item_maxinstances"] = 0;
                         if ($result["remaining_entries"] == $result["total_entries"]) {
                             $PROCESSED["notification_status"] = "cancelled";
                         } else {
                             $PROCESSED["notification_status"] = "complete";
                         }
                         if (!$db->AutoExecute(CLERKSHIP_DATABASE . ".notifications", $PROCESSED, "UPDATE", "`notification_id` = " . $db->qstr($notification_id) . " AND `user_id` = " . $db->qstr($ENTRADA_USER->getActiveId()))) {
                             application_log("error", "Unable to cancel notification_id [" . $notification_id . "]. Database said: " . $db->ErrorMsg());
                         }
                     }
                 }
             }
         }
         $_SERVER["QUERY_STRING"] = replace_query(array("action" => false));
         break;
     default:
         continue;
         break;
 }
 /**
  * Display available Clerkship evaluations to the student.
  */
 clerkship_display_available_evaluations();
Exemplo n.º 23
0
                     if ($db->AutoExecute("evaluation_requests", $PROCESSED_REQUEST, "INSERT") && ($request_id = $db->Insert_Id())) {
                         require_once "Models/notifications/Notification.class.php";
                         require_once "Models/notifications/NotificationUser.class.php";
                         $notification_user = NotificationUser::get($associated_evaluator, "evaluation_request", $RECORD_ID, $ENTRADA_USER->getId());
                         if (!$notification_user) {
                             $notification_user = NotificationUser::add($associated_evaluator, "evaluation_request", $RECORD_ID, $ENTRADA_USER->getId());
                         }
                         if (Notification::add($notification_user->getID(), $ENTRADA_USER->getId(), $RECORD_ID)) {
                             $notifications_sent++;
                         } else {
                             add_error("An issue was encountered while attempting to send a notification to a user [" . get_account_data("wholename", $associated_evaluator) . "] requesting that they complete an evaluation [" . $evaluation_title . "] for you. The system administrator has been notified of this error, please try again later.");
                             application_log("Unable to send notification requesting an evaluation be completed to evaluator [" . $associated_evaluator . "] for evaluation_id [" . $RECORD_ID . "].");
                         }
                     } else {
                         add_error("Unable to create a request entry for this evaluation. The system administrator was notified of this error; please try again later.");
                         application_log("Unable to create a request entry for this evaluator [" . $associated_evaluator . "] for evaluation_id [" . $RECORD_ID . "]. Database said: " . $db->ErrorMsg());
                     }
                 } else {
                     add_error("The selected evaluator [" . get_account_data("wholename", $associated_evaluator) . "] has already completed this evaluation [" . $evaluation_title . "] for you, and is unable to attempt it again.");
                 }
             } else {
                 add_error("The selected evaluator [" . get_account_data("wholename", $associated_evaluator) . "] has already completed this evaluation [" . $evaluation_title . "] the maximum number of times, and is therefore unable to attempt it again.");
             }
         } else {
             add_error("An evaluator must be selected to request an evaluation be completed for you.");
         }
     } else {
         add_error("A valid evaluation must be selected from the drop-down list to request an evaluation be completed for you.");
     }
 } else {
     add_error("A valid evaluation must be selected from the drop-down list to request an evaluation be completed for you.");
Exemplo n.º 24
0
                    $db->Execute($query);
                    $SUCCESS++;
                    $SUCCESSSTR[] = "You have successfully removed " . $total_removed . " notice" . ($total_removed != 1 ? "s" : "") . " from the system.<br /><br />You will be automatically redirected to the event index in 5 seconds, or you can <a href=\"" . ENTRADA_URL . "/admin/notices\">click here</a> if you do not wish to wait.";
                    echo display_success();
                    application_log("success", "Successfully removed notice ids: " . implode(", ", $NOTICE_IDS));
                } else {
                    $ERROR++;
                    $ERRORSTR[] = "We were unable to remove the requested notices from the system. The MEdTech Unit has been informed of this issue and will address it shortly; please try again later.";
                    echo display_error();
                    application_log("error", "Failed to remove any notice ids: " . implode(", ", $NOTICE_IDS) . ". Database said: " . $db->ErrorMsg());
                }
            } else {
                $ERROR++;
                $ERRORSTR[] = "We were unable to remove the requested notices from the system. The MEdTech Unit has been informed of this issue and will address it shortly; please try again later.";
                echo display_error();
                application_log("error", "Failed to execute remove query for notice ids: " . implode(", ", $NOTICE_IDS) . ". Database said: " . $db->ErrorMsg());
            }
            break;
        case 1:
        default:
            if ($ERROR) {
                echo display_error();
            }
            $query = "  SELECT a.*, CONCAT(b.`firstname`, ' ', b.`lastname`) AS notice_author \n\t\t\t\t\t\t FROM `notices` AS a\n\t\t\t\t\t\t JOIN `" . AUTH_DATABASE . "`.`user_data` AS b\n\t\t\t\t\t\t ON a.`created_by` = b.`id`\n\t\t\t\t\t\t WHERE `notice_id` IN (" . implode(", ", $NOTICE_IDS) . ") ORDER BY `display_until` ASC";
            $results = $db->GetAll($query);
            if ($results) {
                echo display_notice(array("Please review the following notices to ensure that you wish to permanently delete them. This action cannot be undone."));
                ?>
				<script type="text/javascript">
					jQuery(document).ready(function () {
						jQuery("#delete-notices").on("click", function (event) {
    } elseif (isset($_GET["countries_id"]) && ($tmp_input = clean_input($_GET["countries_id"], array("trim", "int")))) {
        $countries_id = $tmp_input;
    } else {
        $countries_id = 0;
    }
    if (isset($_POST["city"]) && ($tmp_input = clean_input($_POST["city"], array("trim", "notags")))) {
        $region_name = $tmp_input;
    } elseif (isset($_GET["city"]) && ($tmp_input = clean_input($_GET["city"], array("trim", "notags")))) {
        $region_name = $tmp_input;
    } else {
        $region_name = "";
    }
    if ($countries_id && $region_name) {
        echo "<ul>\n";
        $query = "\tSELECT a.*, b.`province`, c.`country`\n\t\t\t\t\tFROM `" . CLERKSHIP_DATABASE . "`.`regions` AS a\n\t\t\t\t\tLEFT JOIN `global_lu_provinces` AS b\n\t\t\t\t\tON b.`province_id` = a.`province_id`\n\t\t\t\t\tLEFT JOIN `global_lu_countries` AS c\n\t\t\t\t\tON c.`countries_id` = a.`countries_id`\n\t\t\t\t\tWHERE a.`countries_id` = " . $db->qstr($countries_id) . "\n\t\t\t\t\tAND a.`region_name` LIKE " . $db->qstr("%" . $region_name . "%") . "\n\t\t\t\t\tAND a.`region_active` = '1'\n\t\t\t\t\tGROUP BY a.`region_name`, a.`prov_state`\n\t\t\t\t\tORDER BY c.`country`, b.`province`, a.`prov_state`, a.`region_name` ASC, a.`manage_apartments` DESC";
        $results = $db->GetAll($query);
        if ($results) {
            foreach ($results as $result) {
                $comment = array();
                if (trim($result["province"])) {
                    $comment[] = $result["province"];
                }
                $comment[] = $result["country"];
                echo "\t<li id=\"" . (int) $result["region_id"] . "\">" . str_ireplace($region_name, "<strong>" . $region_name . "</strong>", html_encode($result["region_name"])) . "<div class=\"content-small informal\">" . implode(", ", $comment) . "</div></li>\n";
            }
        }
        echo "</ul>";
    }
} else {
    application_log("error", "City names API accessed without valid session_id.");
}
Exemplo n.º 26
0
                    $ERRORSTR[] = "There are no questions currently available for under this quiz. This problem has been reported to a system administrator; please try again later.";
                    echo display_error();
                }
            } elseif ($quiz_record["quiztype_code"] == "hide") {
                $NOTICE++;
                $NOTICESTR[] = "You will not be able to review your quiz results for this quiz, however the results should be released to you by a teacher, likely through a <a href=\"" . ENTRADA_URL . "/profile/gradebook\">Course Gradebook</a>.<br /><br />Please contact a teacher if you require further assistance.";
                echo display_notice();
                application_log("error", "Someone attempted to review results of qprogress_id [" . $RECORD_ID . "] (quiz_id [" . $quiz_record["quiz_id"] . "] / event_id [" . $quiz_record["event_id"] . "]) after the release date.");
            } else {
                $NOTICE++;
                $NOTICESTR[] = "You will not be able to review your quiz results until after <strong>" . date(DEFAULT_DATE_FORMAT, $quiz_record["release_until"]) . "</strong>.<br /><br />Please contact a teacher if you require further assistance.";
                echo display_notice();
                application_log("error", "Someone attempted to review results of qprogress_id [" . $RECORD_ID . "] (quiz_id [" . $quiz_record["quiz_id"] . "] / event_id [" . $quiz_record["event_id"] . "]) after the release date.");
            }
        } else {
            application_log("error", "Someone attempted to review results of eprogress_id [" . $RECORD_ID . "] that they were not entitled to view.");
            header("Location: " . ENTRADA_URL . "/events?id=" . $quiz_record["event_id"]);
            exit;
        }
    } else {
        $ERROR++;
        $ERRORSTR[] = "In order to review a quiz, you must provide a valid attempt identifier.";
        echo display_error();
        application_log("error", "Failed to provide a valid qprogress_id [" . $RECORD_ID . "] when attempting to view quiz results.");
    }
} else {
    $ERROR++;
    $ERRORSTR[] = "In order to review a quiz, you must provide a valid attempt identifier.";
    echo display_error();
    application_log("error", "Failed to provide an qprogress_id [" . $RECORD_ID . "] when attempting to view quiz results.");
}
Exemplo n.º 27
0
     * Check if pv variable is set and see if it's a valid page, other wise page 1 it is.
     */
    if (isset($_GET["pv"])) {
        $PAGE_CURRENT = (int) trim($_GET["pv"]);
    } else {
        $PAGE_CURRENT = 0;
    }
    $query = "\tSELECT * FROM `community_events`\n\t\t\t\t\t\t\t\tWHERE `community_id` = " . $db->qstr($COMMUNITY_ID) . " \n\t\t\t\t\t\t\t\tAND `cpage_id` = " . $db->qstr($PAGE_ID) . "\n\t\t\t\t\t\t\t\tAND `pending_moderation` = '1'\n\t\t\t\t\t\t\t\tAND `event_active` = '1'\n\t\t\t\t\t\t\t\tAND `cevent_id` = " . $db->qstr($RECORD_ID);
    $event_record = $db->GetRow($query);
    if ($event_record) {
        $query = "\tUPDATE `community_events`\n\t\t\t\t\t\t\t\tSET `pending_moderation` = 0\n\t\t\t\t\t\t\t\tWHERE `community_id` = " . $db->qstr($COMMUNITY_ID) . "\n\t\t\t\t\t\t\t\tAND `cpage_id` = " . $db->qstr($PAGE_ID) . "\n\t\t\t\t\t\t\t\tAND `cevent_id` = " . $db->qstr($RECORD_ID) . " LIMIT 1";
        if (!$db->Execute($query)) {
            application_log("error", "Failed to release [" . $RECORD_ID . "] event in community. Database said: " . $db->ErrorMsg());
        }
    } else {
        application_log("error", "The provided event record [" . $RECORD_ID . "] was invalid.");
    }
    header("Location: " . COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . ($PAGE_CURRENT ? "?section=moderate&pv=" . $PAGE_CURRENT : "?section=moderate"));
    exit;
} else {
    echo "<h1>Moderating events</h1>";
    /**
     * Update requested sort column.
     * Valid: date, title
     */
    if (isset($_GET["sb"])) {
        if (@in_array(trim($_GET["sb"]), array("date", "title"))) {
            $_SESSION[APPLICATION_IDENTIFIER]["cid_" . $COMMUNITY_ID][$PAGE_URL]["sb"] = trim($_GET["sb"]);
        }
        $_SERVER["QUERY_STRING"] = replace_query(array("sb" => false));
    } else {
Exemplo n.º 28
0
                            echo "<tr>\n";
                            echo "\t<td class=\"modified\"><input type=\"checkbox\" name=\"delete[]\" value=\"" . (int) $result["region_id"] . "\" checked=\"checked\" /></td>\n";
                            echo "\t<td class=\"general\"><a href=\"" . $click_url . "\">" . html_encode($result["country"]) . "</a></td>\n";
                            echo "\t<td class=\"title\"><a href=\"" . $click_url . "\">" . html_encode($result["province"] ? $result["province"] : $result["prov_state"]) . "</a></td>\n";
                            echo "\t<td class=\"title\"><a href=\"" . $click_url . "\">" . html_encode($result["region_name"]) . "</a></td>\n";
                            echo "\t<td class=\"general\">" . ($result["manage_apartments"] == "1" ? "Yes (Managed)" : "") . "</td>\n";
                            echo "</tr>\n";
                        }
                        ?>
								</tbody>
							</table>
						</form>
						<?php 
                    } else {
                        application_log("notice", "The region removeal page was accessed without providing any valid event_ids to remove.");
                        header("Location: " . ENTRADA_URL . "/admin/regionaled/regions");
                        exit;
                    }
                    break;
            }
        } else {
            application_log("notice", "TThe region removeal page was accessed without providing any valid event_ids to remove.");
            header("Location: " . ENTRADA_URL . "/admin/regionaled/regions");
            exit;
        }
    } else {
        application_log("notice", "The region removeal page was accessed without providing any event_ids to remove.");
        header("Location: " . ENTRADA_URL . "/admin/regionaled/regions");
        exit;
    }
}
Exemplo n.º 29
0
} else {
    if ($router && $router->initRoute()) {
        if (isset($_GET["id"]) && ($tmp_input = clean_input($_GET["id"], "int"))) {
            $REPORT_ID = $tmp_input;
        }
        if ($REPORT_ID) {
            $query = "SELECT * FROM `reports_aamc_ci` WHERE `raci_id` = " . $db->qstr($REPORT_ID) . " AND `organisation_id` = " . $db->qstr($ENTRADA_USER->getActiveOrganisation());
            $REPORT = $db->GetRow($query);
            if ($REPORT) {
                $SHORT_REPORT_TITLE = date("Y", $REPORT["report_start"]) . "-" . date("Y", $REPORT["report_finish"]) . " Curriculum";
                $BREADCRUMB[] = array("url" => ENTRADA_URL . "/admin/reports/aamc/manage?id=" . $REPORT_ID, "title" => $SHORT_REPORT_TITLE);
                $sidebar_html = "<ul class=\"menu\">";
                $sidebar_html .= "\t<li class=\"link\"><a href=\"" . ENTRADA_URL . "/admin/reports/aamc/manage/edit?id=" . $REPORT_ID . "\">Edit Report</a></li>\n";
                $sidebar_html .= "</ul>";
                new_sidebar_item($SHORT_REPORT_TITLE, $sidebar_html, "aamc-report", "open");
                $module_file = $router->getRoute();
                if ($module_file) {
                    require_once $module_file;
                }
            } else {
                add_notice("You don't appear to have access to change this organisation. If you feel you are seeing this in error, please contact your system administrator.");
                echo display_notice();
            }
        }
    } else {
        $url = ENTRADA_URL . "/admin/" . $MODULE;
        application_log("error", "The Entrada_Router failed to load a request. The user was redirected to [" . $url . "].");
        header("Location: " . $url);
        exit;
    }
}
Exemplo n.º 30
0
					</table>
					</form>
					<?php 
                        break;
                }
            } else {
                if ($ERROR) {
                    echo display_error();
                }
                if ($NOTICE) {
                    echo display_notice();
                }
            }
        } else {
            $NOTICE++;
            $NOTICESTR[] = "The comment that you are trying to edit was deactivated <strong>" . date(DEFAULT_DATE_FORMAT, $comment_record["updated_date"]) . "</strong> by <strong>" . html_encode(get_account_data("firstlast", $comment_record["updated_by"])) . "</strong>.<br /><br />If there has been a mistake or you have questions relating to this issue please contact the MEdTech Unit directly.";
            echo display_notice();
            application_log("error", "The comment record id [" . $RECORD_ID . "] is deactivated; however, " . $_SESSION["details"]["firstname"] . " " . $_SESSION["details"]["lastname"] . " [" . $ENTRADA_USER->getID() . "] has tried to edit it.");
        }
    } else {
        $ERROR++;
        $ERRORSTR[] = "The comment id that you have provided does not exist in the system. Please provide a valid record id to proceed.";
        echo display_error();
        application_log("error", "The provided comment id was invalid [" . $RECORD_ID . "] (Edit Comment).");
    }
} else {
    $ERROR++;
    $ERRORSTR[] = "Please provide a valid comment id to proceed.";
    echo display_error();
    application_log("error", "No comment id was provided to edit. (Edit Comment)");
}