62 lines
1.2 KiB
PHP
62 lines
1.2 KiB
PHP
<?php
|
|
$ValidAccess = 2010;
|
|
require_once("include/globals.php");
|
|
|
|
if (session_status() != PHP_SESSION_ACTIVE) {
|
|
session_name($sessionName);
|
|
session_start();
|
|
}
|
|
|
|
|
|
|
|
$moduleName = "ajax.ResetStaffMealLocations.php";
|
|
// startLog($moduleName);
|
|
|
|
|
|
// CSRF token validation
|
|
include "include/ajax.csrfToken.php";
|
|
|
|
|
|
logActivity("Staff.ResetMealLocations");
|
|
|
|
|
|
$return_data = array();
|
|
$sequence_flag = 'N';
|
|
|
|
if (SessionActive() != 1 || ! UserLoggedIn()) {
|
|
header("Location: /?error_message=" . urlencode(getLanguageText('ERRORMSG-SESSION-EXPIRED')));
|
|
exit;
|
|
}
|
|
|
|
|
|
// Ensure that only valid user types have access to this module
|
|
$AllowedUserTypes = array('SuperUser','System Administrator','Application Administrator','Communications Administrator');
|
|
if (checkPermission($AllowedUserTypes) != 1) {
|
|
exit();
|
|
}
|
|
|
|
|
|
// Get parameters
|
|
extract($_REQUEST);
|
|
|
|
|
|
// Validate parameters
|
|
writeLog("table_name: ".$table_name);
|
|
if (strlen($table_name) == 0) logExit("Invalid Access\n");
|
|
|
|
|
|
|
|
// Error logging
|
|
writeLog("table_name: $table_name\n");
|
|
|
|
|
|
$query = "UPDATE people SET meal_location = 0 WHERE school_num = $base_school_num AND people_type IN ('Staff')";
|
|
writeLog($query);
|
|
db_query($query);
|
|
|
|
$return_data["ajax_return_code"] = 0;
|
|
echo(json_encode($return_data));
|
|
writeLog("completed\n");
|
|
|
|
?>
|