1 |
dpavlin |
1 |
<?php |
2 |
|
|
// Load globals |
3 |
|
|
require_once ("global_vars.php"); |
4 |
|
|
|
5 |
|
|
// Includes |
6 |
|
|
require_once ($GLOBAL_ADMIN_INC."sessionClass.php"); |
7 |
|
|
require_once ($GLOBAL_ADMIN_INC."accessClass.php"); |
8 |
|
|
require_once ($GLOBAL_ADMIN_INC."db_connect.php"); |
9 |
|
|
require_once ($GLOBAL_ADMIN_INC."app_controls.php"); |
10 |
|
|
require_once ($GLOBAL_ADMIN_INC."assign.php"); |
11 |
|
|
require_once ($GLOBAL_ADMIN_INC."forms.php"); |
12 |
|
|
|
13 |
|
|
|
14 |
|
|
|
15 |
|
|
// HTML header |
16 |
|
|
printf("<HTML>\n"); |
17 |
|
|
printf("<HEAD>\n"); |
18 |
|
|
printf("<title>Administrative Functions</title>\n"); |
19 |
|
|
printf("<link rel=\"stylesheet\" href=\"%s\" type=\"text/css\">\n", $GLOBAL_ADMIN_CSS); |
20 |
|
|
printf("</HEAD>\n"); |
21 |
|
|
|
22 |
|
|
|
23 |
|
|
// Page header |
24 |
|
|
require_once ($GLOBAL_ADMIN_HEADER); |
25 |
|
|
|
26 |
|
|
|
27 |
|
|
// Collect access information |
28 |
|
|
if (isset($libsession)) { |
29 |
|
|
|
30 |
|
|
// Fetch session information |
31 |
|
|
$sessionClass = new sessionClass("", $libsession, "", ""); |
32 |
|
|
$accessClass = new accessClass($sessionClass); |
33 |
|
|
|
34 |
|
|
// Load user session variables |
35 |
|
|
$sess_time_human = $sessionClass->time_human; |
36 |
|
|
$sess_staff_account = $sessionClass->staff_account; |
37 |
|
|
$sess_access_level = $accessClass->access_level; |
38 |
|
|
$sess_access = $accessClass->access; |
39 |
|
|
$sess_last_name = $accessClass->last_name; |
40 |
|
|
$sess_first_name = $accessClass->first_name; |
41 |
|
|
|
42 |
|
|
} |
43 |
|
|
|
44 |
|
|
|
45 |
|
|
// If the cookie is set and access level is appropriate |
46 |
|
|
if(isset($libsession) && $sess_access_level >= 20) { |
47 |
|
|
|
48 |
|
|
// Determine which transaction function to call |
49 |
|
|
switch ($transaction){ |
50 |
|
|
|
51 |
|
|
// Bridging Assignments |
52 |
|
|
case "assignLibunitStaff": |
53 |
|
|
assignLibunitStaff($con, $staff_id_array, $libunit_id); |
54 |
|
|
break; |
55 |
|
|
case "assignResFeature": |
56 |
|
|
assignResFeature($con, $feature_id_array, $resource_id); |
57 |
|
|
break; |
58 |
|
|
case "assignResLoc": |
59 |
|
|
assignResLoc($con, $location_id_array, $resource_id); |
60 |
|
|
break; |
61 |
|
|
case "assignResMastersubject": |
62 |
|
|
assignResMastersubject($con, $mastersubject_id_array, $resource_id); |
63 |
|
|
break; |
64 |
|
|
case "assignServLoc": |
65 |
|
|
assignServLoc($con, $location_id_array, $service_id); |
66 |
|
|
break; |
67 |
|
|
case "assignServServtype": |
68 |
|
|
assignServServtype($con, $servicetype_id_array, $service_id); |
69 |
|
|
break; |
70 |
|
|
case "assignStaffLibunit": |
71 |
|
|
assignStaffLibunit($con, $libunit_id_array, $staff_id); |
72 |
|
|
break; |
73 |
|
|
case "assignStaffSub": |
74 |
|
|
assignStaffSub($con, $staff_id, $subject_id_array); |
75 |
|
|
break; |
76 |
|
|
case "assignSubCoursesub": |
77 |
|
|
assignSubCoursesub($con, $coursesub_id_array, $subject_id); |
78 |
|
|
break; |
79 |
|
|
case "assignSubLoc": |
80 |
|
|
assignSubLoc($con, $location_id_array, $subject_id); |
81 |
|
|
break; |
82 |
|
|
case "assignSubMaster": |
83 |
|
|
assignSubMaster($con, $mastersubject_id_array, $subject_id); |
84 |
|
|
break; |
85 |
|
|
case "assignSubStaff": |
86 |
|
|
assignSubStaff($con, $staff_id_array, $subject_id); |
87 |
|
|
break; |
88 |
|
|
} |
89 |
|
|
|
90 |
|
|
// Link to return to admin console |
91 |
|
|
adminReturn($sess_access_level); |
92 |
|
|
|
93 |
|
|
} // logged in |
94 |
|
|
|
95 |
|
|
// No access |
96 |
|
|
else require_once ($GLOBAL_NO_ACCESS); |
97 |
|
|
|
98 |
|
|
// Page footer |
99 |
|
|
require_once ($GLOBAL_ADMIN_FOOTER); |
100 |
|
|
?> |
101 |
|
|
|
102 |
|
|
</body> |
103 |
|
|
</html> |