First Commit
This commit is contained in:
1 parent
5eb9dd037d
commit
2e62c0e60b
11877 files changed
+2035312
No files matched your search
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
$ValidAccess = 2010;
|
||||
$sessionName = 'hotlunch';
|
||||
session_name($sessionName);
|
||||
session_start();
|
||||
require_once("include/globals.php");
|
||||
|
||||
|
||||
if (SessionActive() != 1 || ! UserLoggedIn()) {
|
||||
logExit("Session is not active",$moduleName);
|
||||
exit;
|
||||
}
|
||||
|
||||
// CSRF token validation
|
||||
include "include/ajax.csrfToken.php";
|
||||
|
||||
|
||||
|
||||
// Set default timezone
|
||||
date_default_timezone_set("Canada/Pacific");
|
||||
$now = date("Y-m-d H:i:s",time());
|
||||
|
||||
$return_data = array();
|
||||
|
||||
$moduleName = "ajax.ToggleReporting.php";
|
||||
// startLog($moduleName);
|
||||
|
||||
|
||||
|
||||
// Get parameters
|
||||
$school_num = intval($_GET['school_num']);
|
||||
|
||||
// Ensure parameters are valid
|
||||
|
||||
if (!is_numeric($school_num)) logExit("School num is not numeric\n");
|
||||
if ($school_num == 0) logExit("school_num is zero\n");
|
||||
|
||||
writeLog("school_num: $school_num\n");
|
||||
|
||||
|
||||
// Get current setting
|
||||
$query = "SELECT rep FROM schools WHERE record_num = $school_num";
|
||||
writeLog("query: $query\n");
|
||||
$rep = db_getVal($query);
|
||||
|
||||
switch ($rep) {
|
||||
case 'R':
|
||||
default:
|
||||
$query = "UPDATE schools SET rep = 'N' WHERE record_num = $school_num";
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
$query = "UPDATE schools SET rep = 'R' WHERE record_num = $school_num";
|
||||
break;
|
||||
}
|
||||
|
||||
writeLog("query: $query\n");
|
||||
db_query($query);
|
||||
|
||||
writeLog("completed\n");
|
||||
?>
|
||||
Reference in new issue
Block a user