-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathsystem_settings.php
executable file
·177 lines (169 loc) · 6.86 KB
/
system_settings.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<?php
require_once 'core/init.php';
if(!loggedIn()){
Redirect::to('logout.php');
}
else if(loggedIn() && (privilege()==='teacher' || privilege()==='dppc' || privilege()==='dupc' || privilege()==NULL)){
Session::destroy();
Redirect::to('includes/errors/unauthorized.php');
}
?>
<section class="content-header">
<h1>
System Settings
<small>All settings</small>
</h1>
<ol class="breadcrumb">
<li><a href="home.php"><i class="fa fa-dashboard"></i> Home</a></li>
<li><a href="#">System Settings</a></li>
<li class="active">All settings</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div id="update"></div>
<div class="row">
<div class="col-md-5">
<div class="box box-danger">
<div class="box-header">
<h3 class="box-title">Current Semester Details</h3>
<div class="btn btn-success btn-lg pull-right" id="new_sem">
<i class="fa fa-refresh"></i> Start New Semester
</div>
</div> <!-- ./box-header -->
<div class="box-body table-responsive" id="semester_details">
<table class="table">
<tr>
<th>Session (year)</th>
<td><?php echo Session::get('semester_session');?></td>
</tr>
<tr>
<th>Type</th>
<td><?php echo strtoupper(Session::get('semester_type'));?></td>
</tr>
<tr>
<th>Starting Date</th>
<td>
<?php
$date = Session::get('semester_timestamp');
$date = strtotime($date);
$date = date('d/M/Y', $date);
echo $date;
?>
</td>
</tr>
</table>
</div> <!-- ./box-body -->
<div class="box-footer">
It is an irreversible process. <br/>
Starting new semester will reset course allotment and students registration details.<br/>
Also, students will not be able to see their results.<br/>
It is advisable to start new semester after 1-week of publishing result.
</div>
</div>
</div>
<div class="col-md-4">
<div class="box box-danger">
<div class="box-header">
<h3 class="box-title">Publish the Result</h3>
<div class="btn btn-success btn-lg pull-right" id="publish_result">
<i class="fa fa-random"></i> Click Here
</div>
</div> <!-- ./box-header -->
<div class="box-body">
Click on the green button to publish the result.<br/>
SPI (Student Performance Index) and CPI (Cummulative Performance Index) will be calculated henceforth. Please do not refresh or close the browser before getting any response.<br/>
All students will be able to see his/her result in SIS.<br/>
<b>Condition : All course's result must be approved prior to publishing otherwise result will not be published.</b>
</div> <!-- ./box-body -->
</div>
</div>
<div class="col-md-3">
<div id="reg_update"></div>
<?php
$s = new Semester();
if(!$s->isRegistration()){
?>
<div class="box box-success">
<div class="box-header">
<h3 class="box-title">Online Registration</h3>
<div class="btn btn-success btn-lg pull-right" id="start_registration">
<i class="fa fa-play"></i> Start
</div>
</div> <!-- ./box-header -->
<div class="box-body">
Click on Start button to start online student's registration.<br/>
<?php
$s = new Student();
$r = $s->getAllStudents();
if(!empty($r)){
echo "<b>".$r->num_rows."</b> Earlier Registered Students.";
}else{
echo "No Earlier Registered Students.";
}
?>
</div> <!-- ./box-body -->
</div>
<?php
}
else if($s->isRegistration()){
unset($s);
?>
<div class="box box-danger">
<div class="box-header">
<h3 class="box-title">Online Registration</h3>
<div class="btn btn-danger btn-lg pull-right" id="stop_registration">
<i class="fa fa-stop"></i> Stop
</div>
</div> <!-- ./box-header -->
<div class="box-body">
Click on Stop button to stop online student's registration. <br/>
<?php
$s = new Student();
$r = $s->getAllStudents();
if(!empty($r)){
echo "<b>".$r->num_rows."</b> Students Registered.";
}else{
echo "No Students Registered yet.";
}
?>
</div> <!-- ./box-body -->
</div>
<?php
}
?>
</div>
</div>
</section>
<!-- jQuery 2.0.2 -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<!-- AJAX FORM -->
<script type="text/javascript" src="js/jquery.form.js"></script>
<script type="text/javascript" src="js/add_new_course.js"></script>
<!-- Bootstrap -->
<script src="js/bootstrap.min.js" type="text/javascript"></script>
<!-- AdminLTE App -->
<script src="js/AdminLTE/app.js" type="text/javascript"></script>
<!--Page Script -->
<script type="text/javascript">
$(document).ready(function() {
$('#new_sem').click(function() {
if(confirm('Are you sure, you want to start new semester? It is an irreversible process. Starting new semester will reset course allotment and students registration details.')){
var check = prompt("Please type the following text: \nI am changing semester");
if(check=="I am changing semester"){
$("#semester_details").load("ajax/new_session.php");
}
}
});
$('#start_registration').click(function(){
if(confirm('Are you sure, you want to start registration process?')){
$("#reg_update").load("ajax/registration_action.php?a=1");
}
});
$('#stop_registration').click(function(){
if(confirm('Are you sure, you want to stop registration process?')){
$("#reg_update").load("ajax/registration_action.php?a=2");
}
});
});
</script>