本文整理汇总了PHP中validate_calendars函数的典型用法代码示例。如果您正苦于以下问题:PHP validate_calendars函数的具体用法?PHP validate_calendars怎么用?PHP validate_calendars使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了validate_calendars函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validate_calendars
}
if (isset($_POST["assignment_uploads"]) && ($tmp_uploads = clean_input($_POST["assignment_uploads"], array("trim", "notags")))) {
$PROCESSED["assignment_uploads"] = $tmp_uploads == "allow" ? 0 : 1;
} else {
$PROCESSED["assignment_uploads"] = 1;
}
if (isset($_POST["allow_multiple_files"]) && $_POST["allow_multiple_files"] && isset($_POST["num_files_allowed"]) && ($max_file_uploads = (int) $_POST["num_files_allowed"]) > 0) {
$PROCESSED["max_file_uploads"] = $max_file_uploads;
} else {
$PROCESSED["max_file_uploads"] = 1;
}
/**
* Required field "event_start" / Event Date & Time Start (validated through validate_calendars function).
*/
$release_date = validate_calendars("viewable", false, false, true);
$due_date = validate_calendars("due", false, false, true);
if (isset($release_date["start"]) && (int) $release_date["start"]) {
$PROCESSED["release_date"] = (int) $release_date["start"];
} else {
$PROCESSED["release_date"] = 0;
}
if (isset($release_date["finish"]) && (int) $release_date["finish"]) {
$PROCESSED["release_until"] = (int) $release_date["finish"];
} else {
$PROCESSED["release_until"] = 0;
}
if (isset($due_date["finish"]) && (int) $due_date["finish"]) {
$PROCESSED["due_date"] = (int) $due_date["finish"];
} else {
$PROCESSED["due_date"] = 0;
}
示例2: elseif
} elseif (!isset($_SESSION["isAuthorized"]) || !$_SESSION["isAuthorized"]) {
header("Location: " . ENTRADA_URL);
exit;
} elseif (!$ENTRADA_ACL->amIAllowed("reportindex", "read", false)) {
$ERROR++;
$ERRORSTR[] = "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"] . "] do not have access to this module [" . $MODULE . "]");
} else {
define("IN_REPORTS", true);
$BREADCRUMB[] = array("url" => ENTRADA_URL . "/admin/" . $MODULE, "title" => $MODULES[strtolower($MODULE)]["title"]);
if ($router && $router->initRoute()) {
$PREFERENCES = preferences_load($MODULE);
$ORGANISATION_LIST = array();
if (isset($_POST["reporting_start"]) && (int) trim($_POST["reporting_start"]) && isset($_POST["reporting_finish"]) && (int) trim($_POST["reporting_finish"])) {
$report_date = validate_calendars("reporting", true, true, true);
if (isset($report_date["start"]) && (int) $report_date["start"]) {
$_SESSION[APPLICATION_IDENTIFIER][$MODULE]["reporting_start"] = (int) $report_date["start"];
}
if (isset($report_date["finish"]) && (int) $report_date["finish"]) {
$_SESSION[APPLICATION_IDENTIFIER][$MODULE]["reporting_finish"] = (int) $report_date["finish"];
}
} else {
if (!isset($_SESSION[APPLICATION_IDENTIFIER][$MODULE]["reporting_start"])) {
$_SESSION[APPLICATION_IDENTIFIER][$MODULE]["reporting_start"] = strtotime("July 1st, " . (date("Y", time()) - (date("m", time()) < 7 ? 1 : 2)) . " 0:00:00");
}
if (!isset($_SESSION[APPLICATION_IDENTIFIER][$MODULE]["reporting_finish"])) {
$_SESSION[APPLICATION_IDENTIFIER][$MODULE]["reporting_finish"] = strtotime("+1 year", $_SESSION[APPLICATION_IDENTIFIER][$MODULE]["reporting_start"] - 1);
}
}
/**
示例3: validate_calendars
} else {
$PROCESSED["incident_severity"] = 1;
}
/*
* Required field "incident_status" / Incident Status.
*/
if (isset($_POST["incident_status"]) && $_POST["incident_status"]) {
$PROCESSED["incident_status"] = 1;
} else {
$PROCESSED["incident_status"] = 0;
}
/**
* Required field "incident_date" / Incident Start (validated through validate_calendars function).
* Non-required field "follow_up_date" / Incident Finish (validated through validate_calendars function).
*/
$incident_date = validate_calendars("incident", true, false);
if (isset($incident_date["start"]) && (int) $incident_date["start"]) {
$PROCESSED["incident_date"] = (int) $incident_date["start"];
}
if (isset($incident_date["finish"]) && (int) $incident_date["finish"]) {
$PROCESSED["follow_up_date"] = (int) $incident_date["finish"];
} else {
$PROCESSED["follow_up_date"] = 0;
}
/**
* Non-required field "incident_description" / Comments.
*/
if (isset($_POST["incident_description"]) && ($incident_description = clean_input($_POST["incident_description"], array("trim", "notags")))) {
$PROCESSED["incident_description"] = $incident_description;
} else {
$PROCESSED["incident_description"] = "";
示例4: validate_calendars
$PROCESSED["event_desc"] = "";
}
if (isset($_POST["rotation_id"]) && ($rotation_id = (int) $_POST["rotation_id"])) {
$query = "SELECT `rotation_id` FROM `" . CLERKSHIP_DATABASE . "`.`global_lu_rotations` WHERE `rotation_id` = " . $db->qstr($rotation_id);
$result = $db->GetRow($query);
if ($result) {
$PROCESSED["rotation_id"] = (int) $result["rotation_id"];
} else {
$ERROR++;
$ERRORSTR[] = "We were unable to locate the rotation title you've selected.";
}
} else {
$ERROR++;
$ERRORSTR[] = "The <strong>Rotation ID</strong> field is required if this event is to be a part of a Core Rotation.";
}
$event_dates = validate_calendars("event", true, true);
if (isset($event_dates["start"]) && (int) $event_dates["start"]) {
$PROCESSED["event_start"] = (int) $event_dates["start"];
} else {
$ERROR++;
$ERRORSTR[] = "The <strong>Event Start</strong> field is required if this is to appear on the calendar.";
}
if (isset($event_dates["finish"]) && (int) $event_dates["finish"]) {
$PROCESSED["event_finish"] = (int) $event_dates["finish"];
} else {
$ERROR++;
$ERRORSTR[] = "The <strong>Event Finish</strong> field is required if this is to appear on the calendar.";
}
if (strlen(trim($_POST["event_status"])) < 1) {
$ERROR++;
$ERRORSTR[] = "Please select the status of this category after you have saved it.";
示例5: elseif
*/
if (isset($_POST["max_submittable"]) && (($max_submittable = clean_input($_POST["max_submittable"], "int")) || $max_submittable === 0) && $max_submittable <= 999) {
$PROCESSED["max_submittable"] = $max_submittable;
} elseif ($evaluation_target_type == "peer") {
$PROCESSED["max_submittable"] = 0;
} else {
add_error("The evaluation <strong>Max Submittable</strong> field is required and must be less than 999.");
}
if ($PROCESSED["min_submittable"] > $PROCESSED["max_submittable"] && $PROCESSED["max_submittable"] !== 0) {
add_error("Your <strong>Min Submittable</strong> value may not be greater than your <strong>Max Submittable</strong> value.");
}
/**
* Non-required field "release_date" / Viewable Start (validated through validate_calendars function).
* Non-required field "release_until" / Viewable Finish (validated through validate_calendars function).
*/
$viewable_date = validate_calendars("viewable", false, false);
if (isset($viewable_date["start"]) && (int) $viewable_date["start"]) {
$PROCESSED["release_date"] = (int) $viewable_date["start"];
} else {
$PROCESSED["release_date"] = 0;
}
if (isset($viewable_date["finish"]) && (int) $viewable_date["finish"]) {
$PROCESSED["release_until"] = (int) $viewable_date["finish"];
} else {
$PROCESSED["release_until"] = 0;
}
/**
* Processing for evaluation_evaluators table.
*/
if (isset($_POST["target_group_type"]) && in_array($_POST["target_group_type"], array("cohort", "percentage", "proxy_id", "faculty", "cgroup_id"))) {
switch ($_POST["target_group_type"]) {
示例6: array
* Serves as a detection method for conflicting events.
*
* @author Organisation: Queen's University
* @author Unit: School of Medicine
* @author Developer: Brandon Thorn <brandon.thorn@queensu.ca>
* @copyright Copyright 2010 Queen's University. All Rights Reserved.
*
*/
@set_include_path(implode(PATH_SEPARATOR, array(dirname(__FILE__) . "/../core", dirname(__FILE__) . "/../core/includes", dirname(__FILE__) . "/../core/library", get_include_path())));
/**
* Include the Entrada init code.
*/
require_once "init.inc.php";
if (isset($_SESSION["isAuthorized"]) && (bool) $_SESSION["isAuthorized"]) {
if (isset($_POST) && isset($_POST["duration_segment"]) && is_array($_POST["duration_segment"]) && !empty($_POST["duration_segment"])) {
$date = validate_calendars("event", true, false);
$length = 0;
foreach ($_POST["duration_segment"] as $segment) {
$segment = clean_input($segment, array("trim", "int"));
if ($segment) {
$length += $segment;
}
}
$start_time = $date["start"];
$finish_time = $start_time + $length * 60;
$audience_type = clean_input($_POST["event_audience_type"], array("notags", "trim"));
$event_id = (int) $_POST["event_id"];
$query = "\tSELECT * FROM `events` AS a JOIN `event_audience` AS b ON a.`event_id` = b.`event_id`\n\t\t\t\t\tWHERE (" . $start_time . " BETWEEN `event_start` AND `event_finish` \n\t\t\t\t\tOR " . $finish_time . " BETWEEN `event_start` AND `event_finish`)";
switch ($audience_type) {
case "cohort":
$cohort = isset($_POST["associated_cohort"]) ? clean_input($_POST["associated_cohort"], array("int")) : 0;
示例7: display_error
echo display_error();
application_log("error", "LTI Provider wizard was accessed without any LTI Provider id.");
}
break;
case "add":
default:
switch ($STEP) {
case 2:
$PROCESSED["event_id"] = $EVENT_ID;
/**
* Step 2 Error Checking
* Because this unsets the $ERRORSTR array, only do this if there is not already an error.
* PITA, I know.
*/
if (isset($_POST["timedrelease"]) && $_POST["timedrelease"] == "yes") {
$timed_release = validate_calendars("valid", false, false);
if ($ERROR) {
$modal_onload[] = "alert('" . addslashes($ERRORSTR[0]) . "')";
$ERROR = 0;
$ERRORSTR = array();
$ERROR++;
$ERRORSTR[] = "q3";
$JS_INITSTEP = 2;
}
if (isset($timed_release["start"]) && (int) $timed_release["start"]) {
$PROCESSED["valid_from"] = (int) $timed_release["start"];
}
if (isset($timed_release["finish"]) && (int) $timed_release["finish"]) {
$PROCESSED["valid_until"] = (int) $timed_release["finish"];
}
}
示例8: switch
$PROCESSED["organisation_id"] = $ENTRADA_USER->getActiveOrganisation();
echo "<h1>Editing Notice</h1>\n";
// Error Checking
switch ($STEP) {
case 2:
if (isset($_POST["target"]) && ($target_audience = clean_input($_POST["target"], array("trim", "dir")))) {
$PROCESSED["target"] = $target_audience;
} else {
$PROCESSED["target"] = 'updated';
}
if (isset($_POST["notice_summary"]) && ($notice_summary = strip_tags(clean_input($_POST["notice_summary"], "trim"), "<a><br><p>"))) {
$PROCESSED["notice_summary"] = $notice_summary;
} else {
add_error("You must provide a notice summary.");
}
$display_date = validate_calendars("display", true, true);
if (isset($display_date["start"]) && (int) $display_date["start"]) {
$PROCESSED["display_from"] = (int) $display_date["start"];
} else {
add_error("You must select a valid display start date.");
}
if (isset($display_date["finish"]) && (int) $display_date["finish"]) {
$PROCESSED["display_until"] = (int) $display_date["finish"];
} else {
add_error("You must select a valid display finish date.");
}
if (isset($_POST["target_audience"]) && ($target_audience = clean_input($_POST["target_audience"], "trim"))) {
if (strpos($target_audience, "all:") !== false || $target_audience == "public") {
$PROCESSED["associated_audience"][] = array("audience_type" => $target_audience, "audience_value" => 0);
}
}
示例9: validate_calendars
} else {
$PROCESSED["clinical"] = 1;
}
/*
* Required field "account_active" / Account Status.
*/
if (isset($_POST["account_active"]) && $_POST["account_active"] == "true") {
$PROCESSED_ACCESS["account_active"] = "true";
} else {
$PROCESSED_ACCESS["account_active"] = "false";
}
/**
* Required field "access_starts" / Access Start (validated through validate_calendars function).
* Non-required field "access_finish" / Access Finish (validated through validate_calendars function).
*/
$access_date = validate_calendars("access", true, false);
if (isset($access_date["start"]) && (int) $access_date["start"]) {
$PROCESSED_ACCESS["access_starts"] = (int) $access_date["start"];
}
if (isset($access_date["finish"]) && (int) $access_date["finish"]) {
$PROCESSED_ACCESS["access_expires"] = (int) $access_date["finish"];
} else {
$PROCESSED_ACCESS["access_expires"] = 0;
}
/**
* Non-required field "prefix" / Prefix.
*/
if (isset($_POST["prefix"]) && @in_array($prefix = clean_input($_POST["prefix"], "trim"), $PROFILE_NAME_PREFIX)) {
$PROCESSED["prefix"] = $prefix;
} else {
$PROCESSED["prefix"] = "";
示例10: switch
}
} else {
$ERROR++;
$ERRORSTR[] = "The <strong>Marking Scheme</strong> field is a required field.";
}
//Show in learner gradebook check
if (isset($_POST["show_learner_option"])) {
switch ($show_learner_option = clean_input($_POST["show_learner_option"], array("trim", "int"))) {
case 0:
$PROCESSED["show_learner"] = $show_learner_option;
$PROCESSED["release_date"] = 0;
$PROCESSED["release_until"] = 0;
break;
case 1:
$PROCESSED["show_learner"] = $show_learner_option;
$release_dates = validate_calendars("show", false, false);
if (isset($release_dates["start"]) && (int) $release_dates["start"]) {
$PROCESSED["release_date"] = (int) $release_dates["start"];
} else {
$PROCESSED["release_date"] = 0;
}
if (isset($release_dates["finish"]) && (int) $release_dates["finish"]) {
$PROCESSED["release_until"] = (int) $release_dates["finish"];
} else {
$PROCESSED["release_until"] = 0;
}
break;
default:
$PROCESSED["show_learner"] = 0;
break;
}
示例11: validate_calendars
$ERRORSTR[] = "You must provide an occupant name or title in the <strong>Occupant Name / Title</strong> field.";
}
if (isset($_POST["cost_recovery"]) && $_POST["cost_recovery"] == "1") {
$PROCESSED["cost_recovery"] = 1;
}
$PROCESSED["confirmed"] = 1;
break;
default:
$ERROR++;
$ERRORSTR[] = "You must provide a valid occupant type in order to continue.";
break;
}
if (isset($_POST["notes"]) && ($tmp_input = clean_input($_POST["notes"], array("trim", "allowedtags")))) {
$PROCESSED["notes"] = $tmp_input;
}
$inhabiting_date = validate_calendars("inhabiting", true, true, false);
if (isset($inhabiting_date["start"]) && (int) $inhabiting_date["start"]) {
$PROCESSED["inhabiting_start"] = (int) $inhabiting_date["start"];
} else {
$ERROR++;
$ERRORSTR[] = "You must select a date that the occupant will move into " . html_encode($APARTMENT_INFO["apartment_title"]);
}
if (isset($inhabiting_date["finish"]) && (int) $inhabiting_date["finish"]) {
$PROCESSED["inhabiting_finish"] = (int) $inhabiting_date["finish"];
} else {
$ERROR++;
$ERRORSTR[] = "You must select a date that the occupant will vacate from " . html_encode($APARTMENT_INFO["apartment_title"]);
}
if (!$ERROR) {
$PROCESSED["updated_last"] = time();
$PROCESSED["updated_by"] = $ENTRADA_USER->getID();
示例12: validate_calendars
*/
$draft_date = validate_calendars("copy", true, true, false);
if (isset($draft_date["start"]) && (int) $draft_date["start"]) {
$PROCESSED["draft_start_date"] = (int) $draft_date["start"];
} else {
$PROCESSED["draft_start_date"] = 0;
}
if (isset($draft_date["finish"]) && (int) $draft_date["finish"]) {
$PROCESSED["draft_finish_date"] = (int) $draft_date["finish"];
} else {
$PROCESSED["draft_finish_date"] = 0;
}
/**
* Required field "new_start" / Event Date & Time Start (validated through validate_calendars function).
*/
$start_date = validate_calendars("new", true, false, false);
if (isset($start_date["start"]) && (int) $start_date["start"]) {
$PROCESSED["new_start_day"] = (int) $start_date["start"];
}
if (has_error()) {
$STEP = 1;
} else {
if ($db->AutoExecute("drafts", $PROCESSED, "INSERT") && ($draft_id = $db->Insert_ID())) {
$creators = array("draft_id" => $draft_id, "proxy_id" => $ENTRADA_USER->getActiveId());
if (!$db->AutoExecute("draft_creators", $creators, "INSERT")) {
application_log("error", "Error when creating draft [" . $draft_id . "]. Unable to insert to the draft_creators table. Database said: " . $db->ErrorMsg());
}
if ($PROCESSED["options"]) {
// This is just to be safe I am assuming.
$query = "DELETE FROM `draft_options` WHERE `draft_id` = " . $db->qstr($draft_id);
$db->Execute($query);
示例13: application_log
$url = ENTRADA_URL;
$SUCCESS++;
$SUCCESSSTR[] = "You have successfully updated this <strong>Deficiency Plan</strong> in the system.<br /><br />Please <a href=\"" . $url . "\">click here</a> to proceed to the Dashboard or you will be automatically forwarded in 5 seconds.";
$ONLOAD[] = "setTimeout('window.location=\\'" . $url . "\\'', 5000)";
application_log("success", "Updated deficiency plan [" . $PLAN_ID . "] in the system.");
} else {
$ERROR++;
$ERRORSTR[] = "There was a problem editing this deficiency plan in the system. The MEdTech Unit was informed of this error; please try again later.";
application_log("error", "There was an error editing a deficiency plan for Proxy ID [" . $PROXY_ID . "]. Database said: " . $db->ErrorMsg());
}
}
} else {
if (isset($_POST["plan_body"]) && ($plan_body = clean_input($_POST["plan_body"], array("notags", "trim")))) {
$PROCESSED["plan_body"] = $plan_body;
}
$timeline_dates = validate_calendars("timeline", true, true);
if (isset($timeline_dates["start"]) && (int) $timeline_dates["start"]) {
$PROCESSED["timeline_start"] = (int) $timeline_dates["start"];
} else {
$ERROR++;
$ERRORSTR[] = "The <strong>Timeline Start</strong> field is required to detail when your plan to attain deficiencies will begin.";
}
if (isset($timeline_dates["finish"]) && (int) $timeline_dates["finish"]) {
$PROCESSED["timeline_finish"] = (int) $timeline_dates["finish"];
} else {
$ERROR++;
$ERRORSTR[] = "The <strong>Timeline Finish</strong> field is required to detail when your plan to attain deficiencies will end.";
}
if (!isset($PROCESSED["clerk_accepted"]) || !$PROCESSED["clerk_accepted"]) {
if (isset($_POST["clerk_accepted"]) && ($clerk_accepted = $_POST["clerk_accepted"] ? true : false)) {
$PROCESSED["clerk_accepted"] = $clerk_accepted;
示例14: validate_calendars
$PROCESSED["report_supporting_link"] = "";
}
/**
* Required field "report_date" / Event Date & Time Start.
*/
$report_date = validate_calendars("report", true, false, false);
if (isset($report_date["start"]) && (int) $report_date["start"]) {
$PROCESSED["report_date"] = (int) $report_date["start"];
} else {
$PROCESSED["report_date"] = 0;
add_error("You must provide a reporting date for this report.");
}
/**
* Required field "event_start" / Event Date & Time Start.
*/
$period_date = validate_calendars("period", true, true, false);
if (isset($period_date["start"]) && (int) $period_date["start"]) {
$PROCESSED["report_start"] = (int) $period_date["start"];
} else {
$PROCESSED["report_start"] = 0;
add_error("You must provide a reporting start date.");
}
if (isset($period_date["finish"]) && (int) $period_date["finish"]) {
$PROCESSED["report_finish"] = (int) $period_date["finish"];
} else {
$PROCESSED["report_finish"] = 0;
add_error("You must provide a reporting finish date.");
}
/**
* Non-required field "event_location" / Event Location
*/
示例15: validate_calendars
} else {
$ERROR++;
$ERRORSTR[] = "You must provide the telephone number of the key contact.";
}
if (isset($_POST["keys_email"]) && ($tmp_input = clean_input($_POST["keys_email"], array("trim", "notags"))) && valid_address($tmp_input)) {
$PROCESSED["keys_email"] = $tmp_input;
} else {
$ERROR++;
$ERRORSTR[] = "You must provide a valid e-mail address for the key contact.";
}
}
/**
* Required field "release_date" / Available Start (validated through validate_calendars function).
* Non-required field "release_until" / Available Finish (validated through validate_calendars function).
*/
$available_date = validate_calendars("available", true, false, false);
if (isset($available_date["start"]) && (int) $available_date["start"]) {
$PROCESSED["available_start"] = (int) $available_date["start"];
} else {
$PROCESSED["available_start"] = 0;
}
if (isset($available_date["finish"]) && (int) $available_date["finish"]) {
$PROCESSED["available_finish"] = (int) $available_date["finish"];
} else {
$PROCESSED["available_finish"] = 0;
}
$query = "\tSELECT `dep_id`\n\t\t\t\t\t\tFROM `" . AUTH_DATABASE . "`.`user_departments`\n\t\t\t\t\t\tWHERE `user_id` = " . $db->qstr($ENTRADA_USER->getId());
$department_id = $db->getOne($query);
if ($department_id) {
$PROCESSED["department_id"] = $department_id;
} else {