-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
236 lines (196 loc) · 9.88 KB
/
index.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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE html>
<?php
include_once './admin/objts/school.php';
include_once './admin/objts/config.php';
$cf = new config();
$cf->connect();
$sch = new school();
session_start();
session_destroy();
$dead = mysqli_fetch_object(mysqli_query($cf->con,"select * from deadline"));
?>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>Report Master |Log In</title>
<link rel="icon" href="admin/img/rmicon.png"/>
<link href="admin/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="admin/css/mdb.min.css" rel="stylesheet" type="text/css"/>
<link href="admin/css/mystyle.css" rel="stylesheet" type="text/css"/>
<link href="admin/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
<link href="admin/css/wecss.css" rel="stylesheet" type="text/css"/>
<link href="admin/css/mystyle.css" rel="stylesheet" type="text/css"/>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-10 col-12 mx-auto pt-5">
<div class="row">
<p class="text-danger">Before you login, please prove that you are not a robot</p> <br>
<div class="g-recaptcha" data-sitekey="6Lcx5-geAAAAAIdRxz5120jW-o_fFpWYIfV4tmxT"></div>
</div>
<div class="card animated fadeInUp mt-5 container-fluid">
<div class="row">
<div class="col-md-12 col-12 bg-warning text-center p-3 m-0">
<i class="fa fa-lock"></i> USER AUTHENTICATION
</div>
</div>
<div class="row">
<div class="col-12 col-md-4 my-auto ">
<form action="" class="m-1">
<div class="md-form">
<i class="fa fa-user prefix grey-text"></i>
<input type="text" id="uname" class="form-control">
<label for="uname">User Name</label>
</div>
<div class="md-form">
<i class="fa fa-asterisk prefix grey-text"></i>
<input type="password" id="upass" class="form-control">
<label for="upass">Password</label>
</div>
<br>
<button type="button" id="btnlogin" style="border-radius: 0;" class=" btn bg-info btn-block btn-lg">LogIn <i
class="fa fa-sign-in"></i></button>
</form>
</div>
<div class="col-md-8 col-12 bg-info">
<div class="list-group list-group-flush">
<div class="list-group-item bg-transparent">
<div class="row">
<div class="col-md-3 col-3">
<i class="fa fa-info-circle fa-4x text-white"></i>
</div>
<div class="col-md-9 col-9 text-white">
Please note that anything you do is recorded against your user account for security auditing purposes
</div>
</div>
</div>
<div class="list-group-item bg-transparent">
<div class="row">
<div class="col-md-3 col-3">
<i class="fa fa-clock-o fa-4x text-white"></i>
</div>
<div class="col-md-9 col-9 text-white">
<?php
if($dead->status == 'ON'){
?>
Deadline set for <?=$dead->ddate?> you will not be able to log in after this day
<?php
}else{
?>
No deadline set for staff
<?php
}
?>
</div>
</div>
</div>
<div class="list-group-item bg-transparent">
<div class="row">
<div class="col-md-3 col-3">
<i class="fa fa-calendar-check-o fa-4x text-white"></i>
</div>
<div class="col-md-9 col-9 text-white">
<?php
if($sch->sub_date == null){
?>
Your school is not on a subscription
<?php
}else{
if($sch->sub_expired()) {
?>
<h3 class="text-danger">Expired!</h3>
<?php
}else{
?>
<h5 class="text-white">Next Subscription date: <strong><?=date('d-M-Y',strtotime($sch->sub_date))?></strong></h5>
<h5 class="text-danger"><?=$sch->get_subdays()?> Days to Expiration</h5>
<?php
}}
?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
if($sch->sub_expired()){
?>
<div class="card-footer bg-danger m-0 text-white">
Your portal subscription is Over. per our agreed terms and conditions, some system features will not work. Please contact us to renew your subscription <br>
info@skoolrec.com or 0549403129
</div>
<?php
}
?>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 cil-xs-12 col-lg-off-4 col-md-offset-4">
<br/>
<span id="msg" style="color: red; display: none; text-align: center;">
</span>
</div>
</div>
</div>
</div>
</div>
<script src="admin/js/jquery-3.2.1.min.js" type="text/javascript"></script>
<script src="admin/js/bootstrap.min.js" type="text/javascript"></script>
<script src="admin/js/mdb.min.js" type="text/javascript"></script>
<script>
$(document).ready(function () {
$("#btnlogin").click(function () {
var cac = grecaptcha.getResponse();
if(cac.length > 0){
$("#msg").html("Please wait....").show();
if (!$("#uname").val() && !$("#upass").val()) {
$("#msg").html("<span class='glyphicon glyphicon-warning-sign'></span> You have not entered your user account information");
$("#msg").fadeIn();
} else if (!$("#uname").val()) {
$("#msg").html("<span class='glyphicon glyphicon-warning-sign'></span> You have not entered your user name");
$("#msg").fadeIn();
} else if (!$("#upass").val()) {
$("#msg").html("<span class='glyphicon glyphicon-warning-sign'></span> You have not entered your password");
$("#msg").fadeIn();
} else {
$.getJSON("login.php?uname=" + $("#uname").val() + "&upass=" + $("#upass").val(), function (data) {
if (data.uname == "none" || data.msg != "ok") {
$("#msg").html("<span class='glyphicon glyphicon-warning-sign'></span> " + data.msg);
$("#msg").fadeIn();
} else if (data.status == "Disabled") {
$("#msg").html("<span class='glyphicon glyphicon-warning-sign'></span> Your user account is currently disabled please contact your system admin");
$("#msg").fadeIn();
} else if (data.user_type == "admin") {
window.location = "admin/";
} else if (data.user_type == "staff") {
$.getJSON("testdead.php", function (data) {
if (data.status == 0) {
window.location = "staff/";
} else {
$("#msg").html("<span class='glyphicon glyphicon-warning-sign'></span> Sorry, the deadline set by your admin has been met");
$("#msg").fadeIn();
}
});
}
}).error(function () {
$("#msg").fadeOut();
show_error();
});
}
}else{
$("#msg").html("You have NOT checked the captcha, please prove you are not a robot");
$("#msg").fadeIn();
}
});
$("#uname,#upass").keypress(function (e) {
if (e.which === 13) {
$("#btnlogin").click();
}
});
});
</script>
</body>
</html>