First Commit
This commit is contained in:
1 parent
5eb9dd037d
commit
2e62c0e60b
11877 files changed
+2035312
No files matched your search
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
$ValidAccess = 2010;
|
||||
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.EventsCopy.php";
|
||||
// startLog($moduleName);
|
||||
|
||||
|
||||
// Get parameters
|
||||
$source_school = intval($_GET['source_school']);
|
||||
$start_date = db_escape_string($_GET['start_date']);
|
||||
|
||||
writeLog("source_school: $source_school\n");
|
||||
writeLog("start_date: $start_date\n");
|
||||
|
||||
$query = "SELECT * FROM event_calendar WHERE school_num = $source_school AND start_date >= '$start_date'";
|
||||
writeLog("query: $query\n");
|
||||
$events = db_query($query);
|
||||
|
||||
$eventTable = new Table("event_calendar");
|
||||
|
||||
while ($row = db_fetch_assoc($events)) {
|
||||
$row['school_num'] = $school_num;
|
||||
$query = $eventTable->BuildInsert($row);
|
||||
db_query($query);
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in new issue
Block a user