-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
356 lines (300 loc) · 11.8 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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
<?php
session_start();
require_once("class.user.php");
$auth_user = new USER();
//if user's logged in redirect to dashboard
if ($auth_user->is_loggedin() !="") {
$auth_user->redirect_dashboard();
}
if (empty($_REQUEST['page'])) {
$page = "";
}
else{
$page = $_REQUEST['page'];
}
?>
<!doctype html>
<html lang="en">
<?php
include ('x-head.php');
?>
<body>
<?php
include('x-header.php');
?>
<main role="main">
<div style="height:100px;">
</div>
<!-- Marketing messaging and featurettes
================================================== -->
<!-- Wrap the rest of the page in another container to center all the content. -->
<?php if (empty($page)) { ?>
<style>
.custom-bd img {
display: block;
}
.custom-bd:after {
position: absolute;
content:"";
height:100%;
width:100%;
top:0;
left:0;
background: linear-gradient(to bottom, rgba( 18, 20, 22,0) 0%,rgba( 18, 20, 22,0.65) 100%);
}
</style>
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<div class="custom-bd">
<img src="assets/img/background/BG1.jpg" class="bd-placeholder-img" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" preserveaspectratio="xMidYMid slice" focusable="false">
</div>
<div class="container">
<div class="carousel-caption">
<h4>WELCOME TO</h4>
<h2>IMUS NATIONAL HIGH SCHOOL - GREENGATE ANNEX</h2>
<h4>IMUS CITY</h4>
<!-- <a href="index?page=history" class="btn btn-info" >ABOUT US</a> -->
<a href="index?page=list_of_subject_by_faculty" class="btn btn-default" style="background-color:#4ea02a; color:white;">PROGRAMS</a>
</div>
</div>
</div>
<div class="carousel-item">
<div class="custom-bd">
<img src="assets/img/background/BG.jpg" class="bd-placeholder-img" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" preserveaspectratio="xMidYMid slice" focusable="false">
</div>
<div class="container">
<div class="carousel-caption">
<h4>WELCOME TO</h4>
<h2>IMUS NATIONAL HIGH SCHOOL - GREENGATE ANNEX</h2>
<h4>IMUS CITY</h4>
<!-- <a href="index?page=history" class="btn btn-info" >ABOUT US</a> -->
<a href="index?page=list_of_subject_by_faculty" class="btn btn-default" style="background-color:#4ea02a; color:white;">PROGRAMS</a>
</div>
</div>
</div>
<div class="carousel-item">
<div class="custom-bd">
<img src="assets/img/background/IMG_1274.jpg" class="bd-placeholder-img" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" preserveaspectratio="xMidYMid slice" focusable="false">
</div>
<div class="carousel-caption">
<h4>WELCOME TO</h4>
<h2>IMUS NATIONAL HIGH SCHOOL - GREENGATE ANNEX</h2>
<h4>IMUS CITY</h4>
<!-- <a href="index?page=history" class="btn btn-info" >ABOUT US</a> -->
<a href="index?page=list_of_subject_by_faculty" class="btn btn-default" style="background-color:#4ea02a; color:white;">PROGRAMS</a>
</div>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#myCarousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#myCarousel" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<?php } ?>
<div class="container marketing" style="min-height: 45em; /* Will be AT LEAST 20em tall */">
<br>
<?php if (!empty($page)): ?>
<!--NOTHING HERE -->
<?php endif ?>
<?php
if (file_exists("index-content-".$page.".php")) {
include ("index-content-".$page.".php");
}
else{
if (empty($page)) {
include ("index-content.php");
}
else{
include ("index-content-error.php");
}
}
?>
</div><!-- /.container -->
<!-- LOGIN MODAL -->
<div class="modal fade" id="login" tabindex="-1" role="dialog" aria-labelledby="LoginModalLabel" aria-hidden="true">
<div class="modal-dialog " role="document">
<div class="modal-content">
<div class="modal-header" style="border-bottom: 0px ;">
<h5 class="modal-title" id="exampleModalLabel">Sign In</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" style="background-color: #f5f5f5; border-radius: 0px 0px 5px 5px; ">
<div class="text-center msg">
<img src="assets/img/logo/logo.png" alt="GTMNHS Logo" style="width: 100px;">
<h5>Information System</h5>
<small>Enter your username and password</small>
</div>
<form class="form-signin" id="login_form" method="POST">
<div class="form-label-group">
<input type="text" id="inputUsername" class="form-control" placeholder="Username" name="login_user" required autofocus>
<label for="inputUsername">Username</label>
</div>
<div class="form-label-group">
<input type="password" id="inputPassword" class="form-control" placeholder="Password" name="login_password" required>
<label for="inputPassword">Password</label>
</div>
<div class="checkbox mb-3">
<label>
<input type="checkbox" value="remember-me"> Remember me
</label>
</div>
<label data-toggle="modal" data-target="#forgotpassword">
Forgot Password
</label>
<input type="hidden" name="operation" value="submit_login">
<button class="btn btn-primary btn-block" type="submit" style="background-color: #1d8f1d" name="submit_login">Sign in</button>
</form>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="forgotpassword" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header bg-warning">
<h5 class="modal-title" id="exampleModalLabel">Forgot Password</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form class="form-horizontal" id="forgot_form" method="POST">
<div class="form-group">
<label for="forgot_user">Username</label>
<input type="text" class="form-control" name="forgot_user" id="forgot_user" aria-describedby="emailHelp" placeholder="Username">
</div>
<div class="form-group">
<label for="forgot_email">Email address</label>
<input type="email" class="form-control" name="forgot_email" id="forgot_email" aria-describedby="emailHelp" placeholder="Enter email">
</div>
</div>
<div class="modal-footer ">
<input type="hidden" name="operation" value="submit_forgot">
<div class="btn-group">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- FOOTER -->
<button onclick="topFunction()" id="myBtn" title="Go to top">
<div >
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" ><path fill="white" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"/></svg>
</div>
</button>
<footer class="container-fluid w-100 bg-dark text-center" style="padding-top: 2rem;
padding-bottom: 2rem;">
<!-- <p class="float-right"><a href="#">Back to top</a></p> -->
<center class="text-white">
Imus National High School - Greengate Annex - Information System<br>
All Rights Reserved<br>Copyright © 2019 <?php
if (date('Y') !== "2019")
{
echo " - " . date('Y');
}
else
{
}
?>
</center>
</footer>
</main>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<?php
include('x-script.php');
?>
<script type="text/javascript">
$('#f_register').hide();
$(document).on('submit', '#login_form', function(event){
event.preventDefault();
$.ajax({
url:"data-login.php",
method:'POST',
data:new FormData(this),
contentType:false,
processData:false,
type: 'html',
success:function(data)
{
var newdata = JSON.parse(data);
if (newdata.success) {
alertify.alert(newdata.success).setHeader('Login Success');
window.location.assign("dashboard/");
}
else{
alertify.alert(newdata.error).setHeader('Error Login');
}
}
});
});
$(document).on('submit', '#forgot_form', function(event){
event.preventDefault();
$.ajax({
url:"data-forgot.php",
method:'POST',
data:new FormData(this),
contentType:false,
processData:false,
type: 'html',
success:function(data)
{
alertify.alert(data).setHeader('Forgot Password');
}
});
});
$(document).on('submit', '#reset_form', function(event){
event.preventDefault();
$.ajax({
url:"data-reset.php",
method:'POST',
data:new FormData(this),
contentType:false,
processData:false,
type: 'html',
success:function(data)
{
var newdata = JSON.parse(data);
if (newdata.success) {
alertify.alert(newdata.success).setHeader('Forgot Password');
window.location.assign("dashboard/");
}
else{
alertify.alert(newdata.error).setHeader('Forgot Password');
}
}
});
});
$(document).on('click', '#a_sign', function(){
$('#f_text').text('Register');
$('#f_stext').text('Fill-up to register');
$('#f_login').hide();
$('#f_register').show();
});
$(document).on('click', '#a_login', function(){
$('#f_text').text('Login');
$('#f_stext').text('Login here using your username and password');
$('#f_login').show();
$('#f_register').hide();
});
</script>
</body>
</html>