-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathadmin.inc.php
61 lines (46 loc) · 1.16 KB
/
admin.inc.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
58
59
60
61
<?php
session_start();
require_once 'class/admin.class.php';
if (!Admin::loggedIn()) die('not logged in!');
$action = DB::escape($_POST['action']);
$log = array();
switch ($action) {
case 'show':
$id = DB::escape($_POST['id']);
$log['result'] = Admin::showEvent($id);
break;
case 'insert':
$log['result'] = Admin::getInsertEventForm();
break;
case 'save':
$log['result'] = Admin::saveEvent($_POST);
break;
case 'edit':
$id = DB::escape($_POST['id']);
$log['result'] = Admin::editEvent($id);
break;
case 'update':
$id = DB::escape($_POST['id']);
$log['result'] = Admin::updateEvent($id, $_POST);
break;
case 'deleteconfirmation':
$id = DB::escape($_POST['id']);
$log['result'] = Admin::deleteEventConfirmation($id);
break;
case 'refresh':
$log['result'] = Admin::getEvents();
break;
case 'databaseRefresh':
$insertdata = trim($_POST['insert']);
$log['result'] = Admin::checkAndUpdateTable($insertdata?true:false);
break;
case 'dropAndInsertTestData':
$log['result'] = Admin::dropTables() && Admin::checkAndUpdateTable(true);
break;
default:
$log['result'] = false;
break;
}
$log['debug'] = Log::getDebugMsg();
echo json_encode($log);
?>