-
Notifications
You must be signed in to change notification settings - Fork 4
/
force_sync.php
executable file
·57 lines (36 loc) · 1.22 KB
/
force_sync.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/*
* This file is intended to pull every room resource and place them in jpg files.
* The end result is /images/<room_name_location>.png
*/
require("settings.php");
if ($_GET["p"] == $passcode) {
function __autoload($class_name)
{
// Start from the base path and determine the location from the class name,
$base_path = 'php-ews';
$include_file = $base_path . '/' . str_replace('_', '/', $class_name) . '.php';
return (file_exists($include_file) ? require_once $include_file : false);
}
$force = TRUE;
$con=mysqli_connect($sql_server,$sql_username,$sql_password,"rpiwayfinding") or die("Connect failed: %s\n". mysqli_connect_error());
//empty the table - empties everything and restarts PID to 0
$stmt = mysqli_prepare($con, "TRUNCATE TABLE events");
mysqli_stmt_execute($stmt);
foreach($rooms as $r) {
//create daily events
if ($r['type'] == 1) {
include('exchange.php');
} else if ($r['type'] == 2) {
include('planning-center.php');
} else if ($r['type'] == 3) {
include('google-calendar.php');
} else {
//you need to make your own code.
}
}
mysqli_close($con);
//todo: add optional mail to recipient when completed.
} else {
echo "Invalid passcode. Quitting...";
}