-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathadmin.php
582 lines (431 loc) · 17.5 KB
/
admin.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
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
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
<?php
include('session.php');
?>
<?php
include('pass.php');
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT `type` FROM `user_information` where username='$user_check'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
if($row["type"]!='admin')
{
header("location: home.php");
}
}
}
$conn->close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
<link rel="icon" href="images/favicon.ico">
<script src="js/pnglib.js"></script>
<script src="js/identicon.js"></script>
<title>Welcome RAPL IND. || The ASP - Premium Version</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="starter-template.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php"><span class="glyphicon glyphicon-book" aria-hidden="true"></span> The ASP - The Assignment Portal</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="index.php"><span class="glyphicon glyphicon-home" aria-hidden="true"></span> Home</a></li>
<li><a href="aboutasp.php"><span class="glyphicon glyphicon-star" aria-hidden="true"></span> About</a></li>
<li><a href="contact.php"><span class="glyphicon glyphicon-envelope" aria-hidden="true"></span> Contact</a></li>
<!------------LOGIN SYSTEM-------------------->
<!------------LOGIN SYSTEM-------------------->
<li><a href="" data-toggle="dropdown"><span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span> More</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dlabel">
<a href="contact.php?newsletter=subscribe"> <li style="background:#fff;padding:6px 6px 6px 6px;border-bottom:0px solid black;"><span class="glyphicon glyphicon-hand-right" aria-hidden="true"></span> News Letter</li></a>
<a href="faq.php"> <li style="background:#fff;padding:6px 6px 6px 6px;border-bottom:0px solid black;"><span class="glyphicon glyphicon-hand-right" aria-hidden="true"></span> FAQ</li></a>
<a href="termsofuse.php"> <li style="background:#fff;padding:6px 6px 6px 6px;border-bottom:0px solid black;"><span class="glyphicon glyphicon-hand-right" aria-hidden="true"></span> T&C</li></a>
</ul>
</li>
<li class="pull-right"><a href="" data-toggle="dropdown">
<script type="text/javascript">
var vip='<?php
echo md5($user_check);
?>';
data = new Identicon(vip, 420).toString();
document.write(
'<img alt="TheASP Avtaar" width=21 height=21 src="data:image/png;base64,' + data + '">'
);
</script>
<?php echo $user_check; ?> <span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dlabel">
<a href="profile.php"><li style="background:#fff;padding:6px 6px 6px 6px;border-bottom:0px solid black;"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> My Profile</li></a>
<a href="settings.php"><li style="background:#fff;padding:6px 6px 6px 6px;border-bottom:0px solid black;"><span class="glyphicon glyphicon-wrench" aria-hidden="true"></span> Change Password</li></a>
<a href="logout.php"><li style="background:#fff;padding:6px 6px 6px 6px;border-bottom:0px solid black;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Logout</li></a>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<!--
<blockquote>
<p>Hey hi hello</p>
<footer>-ADMIN</footer>
</blockquote>-->
</div>
<div class="container">
<!----------LOGIN FORM DATA------------->
<div class="modal fade" id="myModalsecurity" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myModalLabel">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
Set Security Question</h4>
</div>
<div class="modal-body">
<div class="alert alert-warning alert-dismissible fade in" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">?</span></button>It is strongly recommended To Set<strong> Security Question</strong> As Soon As Possible</div>
<form method="post" action="securityquestion.php">
<div class="form-group">
<label for="username">Security Question</label>
<div class="input-group">
<div class="input-group-addon"><span class="glyphicon glyphicon-user" aria-hidden="true"></span></div>
<select name="question" class="form-control" required>
<option value="1">What is the name of your favourite actor? </option>
<option value="2">What is the name of your favourite book? </option>
<option value="3">What is the name of your best buddy? </option>
<option value="4">Which brand do you prefer to wear? </option>
<option value="5">What admires you the most? </option>
</select>
</div>
</div>
<div class="form-group">
<label for="password">Security Answer</label>
<div class="input-group">
<div class="input-group-addon"><span class="glyphicon glyphicon-lock" aria-hidden="true"></span></div>
<input type="password" class="form-control" id="answer" name="answer" placeholder="Enter Your Answer Here..." required>
</div></div>
</div>
<div class="modal-footer">
<input class="btn btn-primary" type="submit" id="" value="Submit">
</div>
</form>
</div>
</div>
</div>
<center><span style="color:red;background:#fff;"><noscript>
<span class="glyphicon glyphicon-alert" aria-hidden="true"></span><br>
JavaScript is disabled in your browser, Kindly Enable it to have a better experience using TheASP
Or Update your browser
</noscript></span></center>
<div class="container">
<div class="row"> <br/><br/>
<div class="col-md-3">
<div class="regpage">
<center>
<!--------------IDENTICONAPI----------->
<script type="text/javascript">
var vip='<?php
echo md5($user_check);
?>';
data = new Identicon(vip, 420).toString();
document.write(
'<br><img alt="TheASP Avtaar" class="img-thumbnail" width=400 height=400 src="data:image/png;base64,' + data + '">'
);
</script>
</center>
<?php
include('pass.php');
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT name,college,rollno FROM `user_information` where username='$user_check'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
$_SESSION["college"]=$row["college"];
echo "<br/><p class='lead'><strong>".$row["name"]."</strong><br/>(<mark> ".$user_check."</mark> )<small><br/> ".$row["college"]."<br/>".$row["rollno"]."<br/></small></p>";
}
} else {
echo "0 results";
}
$conn->close();
?>
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
On Current Page <span style="float:right;" class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span>
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body">
<ul>
<li>All Users</li>
<li>All Assignments</li>
</ul>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingTwo">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
Edit Configurations<span style="float:right;" class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span>
</a>
</h4>
</div>
<div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
<div class="panel-body">
<ul>
<a href="mycollegeassignments.php"><li>Track Assignments</li>
</a>
</ul> </div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingThree">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
My Profile<span style="float:right;" class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span>
</a>
</h4>
</div>
<div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">
<div class="panel-body">
<ul>
<a href="profile.php"><li>My Profile</li></a>
<a href="settings.php"><li>Change Password</li></a>
<a href="logout.php"><li>Logout</li></a>
</ul>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingFour">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseFour" aria-expanded="false" aria-controls="collapseFour">
Help <span style="float:right;"class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span>
</a>
</h4>
</div>
<div id="collapseFour" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingFour">
<div class="panel-body">
<ul>
<a href="contact.php"><li>Contact Us</li>
</a>
<li>[email protected]</li>
<li>[email protected]</li>
<li>[email protected]</li>
<li>+91 9643763712</li>
</ul> </div>
</div>
</div>
</div>
<hr>
<center>
|| TheASP Premium Version || <br>|| ? RAPL IND. - 2015 || <br>|| <a href="aboutasp.php">ABOUT US ||</a>
<br><a href="https://www.facebook.com/theasp.rapl" target="_new"><img src="images/facebook.png" width="10%" height="10%"></a>
</center>
</div>
</div>
<div class="col-md-9">
<div class="regpage">
<div>
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">All Users</a></li>
<li role="presentation"><a href="#class" aria-controls="class" role="tab" data-toggle="tab">Contact requests</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active" id="home">
<table class="table table-bordered">
<?php
include('pass.php');
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `user_information`";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo"<tr class='info'><td><strong>#</strong></td><td><strong>id</strong></td><td><strong>A/C</strong></td><td><strong>Username</strong></td><td><strong>Full Name</strong></td><td><strong>E-Mail</strong></td><td><strong>Details</strong></td></tr>";
$num=1;
while($row = $result->fetch_assoc()) {
echo"<tr><td>$num</td><td>".$row["id"]."</td><td>";
if($row["type"]=="admin")
echo"<span class='glyphicon glyphicon-fire' aria-hidden='true'></span>";
else if($row["type"]=="stud")
echo"<span class='glyphicon glyphicon-user' aria-hidden='true'></span>";
else if($row["type"]=="college")
echo"<span class='glyphicon glyphicon-education' aria-hidden='true'></span>";
else if($row["type"]=="teacher")
echo"<span class='glyphicon glyphicon-blackboard' aria-hidden='true'></span>";
echo"</td><td>".$row["username"]."</td><td>".$row["name"]."</td><td>".$row["email"]."</td>
<td><form action='admin.php' method='get'><input type='text' name='id' value=".$row["id"]." hidden>
<input type='submit' value='Get Details' class='btn btn-primary'></form></td></tr>";
$num+=1;
}
} else
{
echo"No Accounts yet";
}
$conn->close();
?>
</table>
</div>
<div role="tabpanel" class="tab-pane fade" id="class">
<!----------------------->
<table class="table table-bordered">
<?php
include('pass.php');
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `logs` WHERE `type`='contact'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo"<tr class='info'><td><strong>#</strong></td><td><strong>id</strong></td><td><strong>username(ip)</strong></td><td><strong>Time</strong></td><td><strong>Type</strong></td><td><strong>Name,E-Mail,Mobile</strong></td><td><strong>Message</strong></td>
<td><strong>Status</strong></td></tr>";
$num=1;
while($row = $result->fetch_assoc()) {
echo"<tr><td>$num</td><td>".$row["id"]."</td>";
echo"<td>".$row["username"]."<br/>".$row["ip"]."</td><td>".$row["time_stamp"]."</td><td>".$row["feedback_type"]."</td>
<td>".$row["fullname"]."<br/>".$row["email"]."<br/>".$row["mobile"]."</td>
<td>".$row["message"]."</td>
<td>";
if($row["status"]=="pending")
{
echo"<form action='rqstdone.php' method='post'>
<input type='text' value='".$row["id"]."' name='idz' hidden>
<input type='Submit' value='Set As Solved' class='btn btn-success'>
</form>";
}
else
{
echo"Solved";
}
echo"</td>
</tr>";
$num+=1;
}
} else
{
echo"No Accounts yet";
}
$conn->close();
?>
</table>
<!----------------------->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
if(isset($_GET["id"]))
{
echo" <script type='text/javascript'>
$(window).load(function(){
$('#myModal4').modal('show');
});
</script>";
}
?>
<div class="modal fade" id="myModal4" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
Details</h4>
</div>
<div class="modal-body">
<div class='alert alert-info alert-dismissible fade in' role='alert'>
<?php
if(isset($_GET["id"]))
{
include('pass.php');
$getid=$_GET["id"];
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `user_information` WHERE `id`=$getid";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo"<p>Phone Number : ".$row["phoneno"]."</p>";
echo"<p>College Name : ".$row["college"]."</p>";
echo"<p>Class : ".$row["course"].",".$row["batch"].",".$row["rollno"]."</p>";
echo"<p>Security: ".$row["squestion"]."(".$row["sanswer"].")</p>";
echo"<p>Activation Status : ".$row["activate"]."</p>";
echo"<p>Registration Time : ".$row["reg_time"]."</p>";
}} else
{
echo"No Info Available";
}
$conn->close();
}
?>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>