-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathhome.php
More file actions
515 lines (457 loc) · 18.1 KB
/
home.php
File metadata and controls
515 lines (457 loc) · 18.1 KB
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
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
<?php
session_start();
error_reporting(E_ALL & ~E_NOTICE);
if(!isset($_SESSION['loggedin']))
header("Location:login.php");
global $ip,$name,$date,$time,$stat,$s_id,$addr,$fat,$mot,$info;
include_once('classes/userconnection.php');
include_once('classes/userclass.php');
include_once('functions.php');
$info= new UserClass();
//$GLOBALS['info']=$info;
$user=$_SESSION['uname'];
$user_id=$_SESSION['user_id'];
$stat= $_SESSION['status'];
$result=$info->GetUserInfo($user);
$_SESSION['password_changed']=false;
if($stat=='student'){
foreach($result as $uinfo)
{
//print_r($uinfo);
$name=$uinfo['username'];
// $ip= $uinfo[''];
$date= $uinfo['date'];
$time=$uinfo['time'];
//$stat= $uinfo['user_status'];
$s_id= $uinfo['user_id'];
//$addr=$uinfo['address'];
// $fat=$uinfo['father'];
//$mot=$uinfo['mother'];
}
$_SESSION['stat']=$stat;
$student=new db();
if(!($info=$student->get_single_std($conn,"student_table",$user_id))){
echo "Error getting student";
}
foreach($info as $val){
$studentName = $val['student_name'];
$dob = $val['dob'];
$gender = $val['gender'];
$email = $val['email'];
$phone= $val['phone'];
$add= $val['address'];
$status = $val['Status'];
$year= $val['Year'];
$class= $val['class'];
$s_id= $val['student_id'];
$father=$val['father'];
$mother=$val['mother'];
$fee=$val['fee'];
$scholarship=$val['scholarship'];
}
if(isset($_POST['logout'])){
unset($_SESSION['loggedin']);
session_destroy();
header("Location:login.php");
}
//echo "Welcome ".$name."<br />";
//echo "Your user_id is ".$user_id." and you enrolled in ".$date." at ".$time." as a ".$stat."."."<br />";
//echo " You live in ".$addr." and your father is ".$fat." and mother is ".$mot.".";
?>
<div style="background-color:blue;color:white;" >
<form action="<?php $_PHP_SELF ?>" method="POST">
<input type="submit" name="logout" value="Log Out" />
<br/>
</form>
<form action="routine/index.php" method="POST">
<input type="submit" name="routine" value="View Exam Schedule" />
<br/>
</form>
<form action="<?php $_PHP_SELF ?>" method="POST">
Change Your Password:
<br/>
Enter new Password: <input type="password" name="cpass" /><br/>
Re-Enter the password:<input type="password" name="acpass" /><br />
<input type="submit" name="changepass" value="change Password" />
</form>
<form action="pdf.php" method="POST">
<input type="submit" name="pdf" value="PDF" />
</form>
<form action="tt/php/index.php" method="POST">
<input type="submit" value="View Time Table" name="tt"/>
</form>
</div>
<!DOCTYPE html>
<html>
<title>HOME PAGE</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="wcss/css1.css">
<link rel='stylesheet' href='wcss/css2.css'>
<link rel="stylesheet" href="wcss/css3.css">
<style>
html,body,h1,h2,h3,h4,h5,h6 {font-family: "Roboto", sans-serif}
</style>
<body class="w3-light-grey">
<!-- Page Container -->
<div class="w3-content w3-margin-top" style="max-width:1400px;">
<!-- The Grid -->
<div class="w3-row-padding">
<!-- Left Column -->
<div class="w3-third">
<div class="w3-white w3-text-grey w3-card-4">
<div class="w3-display-container">
<img src="<?php echo "img/".$user.".jpg"; ?>" style="width:100%" alt=" <?php echo $studentName; ?>">
<div class="w3-display-bottomleft w3-container w3-text-black">
<h2><?php echo $studentName; ?></h2>
</div>
</div>
<div class="w3-container">
<p><i class="fa fa-briefcase fa-fw w3-margin-right w3-large w3-text-teal"></i><?php include_once('upd.php'); ?></p>
<p><i class="fa fa-briefcase fa-fw w3-margin-right w3-large w3-text-teal"><?php echo $stat; ?></i></p>
<p><i class="fa fa-home fa-fw w3-margin-right w3-large w3-text-teal"><?php echo $add; ?></i></p>
<p><i class="fa fa-envelope fa-fw w3-margin-right w3-large w3-text-teal"><?php echo $email; ?></i></p>
<p><i class="fa fa-phone fa-fw w3-margin-right w3-large w3-text-teal"><?php echo $phone; ?></i></p>
<hr>
<p class="w3-large"><b><i class="fa fa-asterisk fa-fw w3-margin-right w3-text-teal"></i>Skills</b></p>
<p>Adobe Photoshop</p>
<div class="w3-light-grey w3-round-xlarge w3-small">
<div class="w3-container w3-center w3-round-xlarge w3-teal" style="width:90%">90%</div>
</div>
<p>Photography</p>
<div class="w3-light-grey w3-round-xlarge w3-small">
<div class="w3-container w3-center w3-round-xlarge w3-teal" style="width:80%">
<div class="w3-center w3-text-white">80%</div>
</div>
</div>
<p>Illustrator</p>
<div class="w3-light-grey w3-round-xlarge w3-small">
<div class="w3-container w3-center w3-round-xlarge w3-teal" style="width:75%">75%</div>
</div>
<p>Media</p>
<div class="w3-light-grey w3-round-xlarge w3-small">
<div class="w3-container w3-center w3-round-xlarge w3-teal" style="width:50%">50%</div>
</div>
<br>
<p class="w3-large w3-text-theme"><b><i class="fa fa-globe fa-fw w3-margin-right w3-text-teal"></i>Languages</b></p>
<p>English</p>
<div class="w3-light-grey w3-round-xlarge">
<div class="w3-round-xlarge w3-teal" style="height:24px;width:100%"></div>
</div>
<p>Spanish</p>
<div class="w3-light-grey w3-round-xlarge">
<div class="w3-round-xlarge w3-teal" style="height:24px;width:55%"></div>
</div>
<p>German</p>
<div class="w3-light-grey w3-round-xlarge">
<div class="w3-round-xlarge w3-teal" style="height:24px;width:25%"></div>
</div>
<br>
</div>
</div><br>
<!-- End Left Column -->
</div>
<!-- Right Column -->
<div class="w3-twothird">
<div class="w3-container w3-card-2 w3-white w3-margin-bottom">
<h2 class="w3-text-grey w3-padding-16"><i class="fa fa-suitcase fa-fw w3-margin-right w3-xxlarge w3-text-teal"></i>About</h2>
<div class="w3-container">
<h5 class="w3-opacity"><b><?php echo $studentName; ?> /<?php echo $stat; ?> </b></h5>
<h6 class="w3-text-teal"><i class="fa fa-calendar fa-fw w3-margin-right"></i><?php echo $date; ?> <span class="w3-tag w3-teal w3-round"><?php echo $status; ?></span></h6>
<p>Amit Kumar Patel was enrolled and he is a student.</p>
<hr>
</div>
<div class="w3-container">
<h5 class="w3-opacity"><b>Father</b></h5>
<h6 class="w3-text-teal"><i class="fa fa-calendar fa-fw w3-margin-right"></i><?php echo $father; ?></h6>
<p>Consectetur adipisicing elit. Praesentium magnam consectetur vel in deserunt aspernatur est reprehenderit sunt hic. Nulla tempora soluta ea et odio, unde doloremque repellendus iure, iste.</p>
<hr>
</div>
<div class="w3-container">
<h5 class="w3-opacity"><b>Mother</b></h5>
<h6 class="w3-text-teal"><i class="fa fa-calendar fa-fw w3-margin-right"></i><?php echo $mother; ?></h6>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. </p><br>
</div>
</div>
<div class="w3-container w3-card-2 w3-white">
<h2 class="w3-text-grey w3-padding-16"><i class="fa fa-certificate fa-fw w3-margin-right w3-xxlarge w3-text-teal"></i>Education</h2>
<div class="w3-container">
<h5 class="w3-opacity"><b>W3Schools.com</b></h5>
<h6 class="w3-text-teal"><i class="fa fa-calendar fa-fw w3-margin-right"></i>Forever</h6>
<p>Web Development! All I need to know in one place</p>
<hr>
</div>
<div class="w3-container">
<h5 class="w3-opacity"><b>London Business School</b></h5>
<h6 class="w3-text-teal"><i class="fa fa-calendar fa-fw w3-margin-right"></i>2013 - 2015</h6>
<p>Master Degree</p>
<hr>
</div>
<div class="w3-container">
<h5 class="w3-opacity"><b>School of Coding</b></h5>
<h6 class="w3-text-teal"><i class="fa fa-calendar fa-fw w3-margin-right"></i>2010 - 2013</h6>
<p>Bachelor Degree</p><br>
</div>
</div>
<!-- End Right Column -->
</div>
<!-- End Grid -->
</div>
<!-- End Page Container -->
</div>
<footer class="w3-container w3-teal w3-center w3-margin-top">
<p>Find me on social media.</p>
<i class="fa fa-facebook-official w3-hover-text-indigo w3-large"></i>
<i class="fa fa-instagram w3-hover-text-purple w3-large"></i>
<i class="fa fa-snapchat w3-hover-text-yellow w3-large"></i>
<i class="fa fa-pinterest-p w3-hover-text-red w3-large"></i>
<i class="fa fa-twitter w3-hover-text-light-blue w3-large"></i>
<i class="fa fa-linkedin w3-hover-text-indigo w3-large"></i>
<p>Powered by <a href="https://www.w3schools.com/w3css/default.asp" target="_blank">w3.css</a></p>
</footer>
</body>
</html>
<?php
if(isset($_POST['changepass'])){
if($_POST['cpass']){
$info= new UserClass();
$newpass=$_POST['cpass'];
$rnewpass=$_POST['acpass'];
if($newpass==$rnewpass){
$conf=$info->ChangePassword($name,$newpass);
if($conf==1)
{
echo "Password Changed";
$_SESSION['password_changed']=true;
$_POST=array();
}
else{
echo "Duplicate operation orCouldnot change password! ";
}
}
else{
echo "Re-password didnot match!";
}
}
else{
echo "Password field is empty!";
}
}
}
// teacher section
if($stat=='teacher'){
foreach($result as $uinfo)
{
//print_r($uinfo);
$name=$uinfo['username'];
// $ip= $uinfo[''];
$date= $uinfo['date'];
$time=$uinfo['time'];
//$stat= $uinfo['user_status'];
$s_id= $uinfo['s_id'];
$addr=$uinfo['address'];
$fat=$uinfo['father'];
$mot=$uinfo['mother'];
}
$_SESSION['stat']=$stat;
if(isset($_POST['logout'])){
unset($_SESSION['loggedin']);
session_destroy();
header("Location:login.php");
}
echo "Welcome ".$name."<br />";
echo "Your user_id is ".$user_id." and you enrolled in ".$date." at ".$time." as a ".$stat."."."<br />";
//echo " You live in ".$addr." and your father is ".$fat." and mother is ".$mot.".";
$teacher=new db();
if(!($info=$teacher->get_single_teacher($conn,"teacher_table",$user_id))){
echo "Error getting student";
}
foreach($info as $val){
$firstName = $val['first_name'];
$lastName = $val['last_name'];
$dob = $val['dob'];
$gender = $val['gender'];
$email = $val['email'];
$phone= $val['phone'];
$degree= $val['degree'];
$salary= $val['salary'];
$address= $val['address'];
$father=$val['father'];
$mother=$val['mother'];
$id= $val['teacher_id'];
}
?>
<form action="<?php $_PHP_SELF ?>" method="POST">
<input type="submit" name="logout" value="Log Out" />
<br/>
</form>
<form action="<?php $_PHP_SELF ?>" method="POST">
Change Your Password:
<br/>
Enter new Password: <input type="password" name="cpass" /><br/>
Re-Enter the password:<input type="password" name="acpass" /><br />
<input type="submit" name="changepass" value="change Password" />
</form>
<form action="pdf.php" method="POST">
<input type="submit" name="pdf" value="PDF" />
</form>
<form action="tt/php/index.php" method="POST">
<input type="submit" value="View Time Table" name="tt"/>
</form>
<form action="attendance/index.php" method="POST">
<input type="submit" value="Attendance" name="attendance"/>
</form>
<!DOCTYPE html>
<html>
<title>HOME PAGE</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="wcss/css1.css">
<link rel='stylesheet' href='wcss/css2.css'>
<link rel="stylesheet" href="wcss/css3.css">
<style>
html,body,h1,h2,h3,h4,h5,h6 {font-family: "Roboto", sans-serif}
</style>
<body class="w3-light-grey">
<!-- Page Container -->
<div class="w3-content w3-margin-top" style="max-width:1400px;">
<!-- The Grid -->
<div class="w3-row-padding">
<!-- Left Column -->
<div class="w3-third">
<div class="w3-white w3-text-grey w3-card-4">
<div class="w3-display-container">
<img src="amit.jpg" style="width:100%" alt=" <?php echo $studentName; ?>">
<div class="w3-display-bottomleft w3-container w3-text-black">
<h2><?php echo $studentName; ?></h2>
</div>
</div>
<div class="w3-container">
<p><i class="fa fa-briefcase fa-fw w3-margin-right w3-large w3-text-teal"><?php echo $stat; ?></i></p>
<p><i class="fa fa-home fa-fw w3-margin-right w3-large w3-text-teal"><?php echo $add; ?></i></p>
<p><i class="fa fa-envelope fa-fw w3-margin-right w3-large w3-text-teal"><?php echo $email; ?></i></p>
<p><i class="fa fa-phone fa-fw w3-margin-right w3-large w3-text-teal"><?php echo $phone; ?></i></p>
<hr>
<p class="w3-large"><b><i class="fa fa-asterisk fa-fw w3-margin-right w3-text-teal"></i>Skills</b></p>
<p>Adobe Photoshop</p>
<div class="w3-light-grey w3-round-xlarge w3-small">
<div class="w3-container w3-center w3-round-xlarge w3-teal" style="width:90%">90%</div>
</div>
<p>Photography</p>
<div class="w3-light-grey w3-round-xlarge w3-small">
<div class="w3-container w3-center w3-round-xlarge w3-teal" style="width:80%">
<div class="w3-center w3-text-white">80%</div>
</div>
</div>
<p>Illustrator</p>
<div class="w3-light-grey w3-round-xlarge w3-small">
<div class="w3-container w3-center w3-round-xlarge w3-teal" style="width:75%">75%</div>
</div>
<p>Media</p>
<div class="w3-light-grey w3-round-xlarge w3-small">
<div class="w3-container w3-center w3-round-xlarge w3-teal" style="width:50%">50%</div>
</div>
<br>
<p class="w3-large w3-text-theme"><b><i class="fa fa-globe fa-fw w3-margin-right w3-text-teal"></i>Languages</b></p>
<p>English</p>
<div class="w3-light-grey w3-round-xlarge">
<div class="w3-round-xlarge w3-teal" style="height:24px;width:100%"></div>
</div>
<p>Spanish</p>
<div class="w3-light-grey w3-round-xlarge">
<div class="w3-round-xlarge w3-teal" style="height:24px;width:55%"></div>
</div>
<p>German</p>
<div class="w3-light-grey w3-round-xlarge">
<div class="w3-round-xlarge w3-teal" style="height:24px;width:25%"></div>
</div>
<br>
</div>
</div><br>
<!-- End Left Column -->
</div>
<!-- Right Column -->
<div class="w3-twothird">
<div class="w3-container w3-card-2 w3-white w3-margin-bottom">
<h2 class="w3-text-grey w3-padding-16"><i class="fa fa-suitcase fa-fw w3-margin-right w3-xxlarge w3-text-teal"></i>Work Experience</h2>
<div class="w3-container">
<h5 class="w3-opacity"><b>Front End Developer / w3schools.com</b></h5>
<h6 class="w3-text-teal"><i class="fa fa-calendar fa-fw w3-margin-right"></i>Jan 2015 - <span class="w3-tag w3-teal w3-round">Current</span></h6>
<p>Lorem ipsum dolor sit amet. Praesentium magnam consectetur vel in deserunt aspernatur est reprehenderit sunt hic. Nulla tempora soluta ea et odio, unde doloremque repellendus iure, iste.</p>
<hr>
</div>
<div class="w3-container">
<h5 class="w3-opacity"><b>Web Developer / something.com</b></h5>
<h6 class="w3-text-teal"><i class="fa fa-calendar fa-fw w3-margin-right"></i>Mar 2012 - Dec 2014</h6>
<p>Consectetur adipisicing elit. Praesentium magnam consectetur vel in deserunt aspernatur est reprehenderit sunt hic. Nulla tempora soluta ea et odio, unde doloremque repellendus iure, iste.</p>
<hr>
</div>
<div class="w3-container">
<h5 class="w3-opacity"><b>Graphic Designer / designsomething.com</b></h5>
<h6 class="w3-text-teal"><i class="fa fa-calendar fa-fw w3-margin-right"></i>Jun 2010 - Mar 2012</h6>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. </p><br>
</div>
</div>
<div class="w3-container w3-card-2 w3-white">
<h2 class="w3-text-grey w3-padding-16"><i class="fa fa-certificate fa-fw w3-margin-right w3-xxlarge w3-text-teal"></i>Education</h2>
<div class="w3-container">
<h5 class="w3-opacity"><b>W3Schools.com</b></h5>
<h6 class="w3-text-teal"><i class="fa fa-calendar fa-fw w3-margin-right"></i>Forever</h6>
<p>Web Development! All I need to know in one place</p>
<hr>
</div>
<div class="w3-container">
<h5 class="w3-opacity"><b>London Business School</b></h5>
<h6 class="w3-text-teal"><i class="fa fa-calendar fa-fw w3-margin-right"></i>2013 - 2015</h6>
<p>Master Degree</p>
<hr>
</div>
<div class="w3-container">
<h5 class="w3-opacity"><b>School of Coding</b></h5>
<h6 class="w3-text-teal"><i class="fa fa-calendar fa-fw w3-margin-right"></i>2010 - 2013</h6>
<p>Bachelor Degree</p><br>
</div>
</div>
<!-- End Right Column -->
</div>
<!-- End Grid -->
</div>
<!-- End Page Container -->
</div>
<footer class="w3-container w3-teal w3-center w3-margin-top">
<p>Find me on social media.</p>
<i class="fa fa-facebook-official w3-hover-text-indigo w3-large"></i>
<i class="fa fa-instagram w3-hover-text-purple w3-large"></i>
<i class="fa fa-snapchat w3-hover-text-yellow w3-large"></i>
<i class="fa fa-pinterest-p w3-hover-text-red w3-large"></i>
<i class="fa fa-twitter w3-hover-text-light-blue w3-large"></i>
<i class="fa fa-linkedin w3-hover-text-indigo w3-large"></i>
<p>Powered by <a href="https://www.w3schools.com/w3css/default.asp" target="_blank">w3.css</a></p>
</footer>
</body>
</html>
<?php
if(isset($_POST['changepass'])){
if($_POST['cpass']){
$newpass=$_POST['cpass'];
$rnewpass=$_POST['acpass'];
if($newpass==$rnewpass){
$conf=$info->ChangePassword($name,$newpass);
if($conf==1)
{
echo "Password Changed";
}
else{
echo "Coldnot change password!";
}
}
else{
echo "Re-password didnot match!";
}
}
else{
echo "Password field is empty!";
}
}
}
?>