-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostback.php
executable file
·41 lines (35 loc) · 1.03 KB
/
postback.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
<?php
//Shutter would like to note:
//We wish you a Merry Christmas and a happy New Year!
$path = "./";
require_once($path."Main.php");
require_once($path."smarty/Smarty.class.php");
$mode = $_REQUEST["mode"];
if(isset($_REQUEST["data"])) {
parse_str(urldecode($_REQUEST["data"]), $data);
$_REQUEST = array_merge($_REQUEST, $data);
unset($_REQUEST["data"]);
}
$smarty = new Smarty();
$data = new Smarty_Data();
Main::init();
if(Main::isStudent()) {
$main = new Student();
} else {
$main = new Professor();
}
if($mode == "updateClasses") {
$data->assign("student", $main);
if($main instanceof Student) {
$smarty->display("classList.tpl", $data);
} else {
$smarty->display("profClassList.tpl", $data);
}
}
if($mode == "getDepartmentData") {
print $main->getDepartmentJSON();
}
if($mode == "getCourseData") {
print $main->getCourseJSON($_REQUEST["dept"]);
}
?>