-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.php
More file actions
56 lines (41 loc) · 1.62 KB
/
Copy pathadmin.php
File metadata and controls
56 lines (41 loc) · 1.62 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
<?php
session_start();
$current = $_SESSION['comp'];
include 'dbcxn.php';
include 'view_database.php';
$query = "SELECT * FROM graders WHERE Comp = '" . $current . "' AND Priv = 1 LIMIT 1;";
$result = mysqli_query($conn, $query);
if (mysqli_num_rows($result) === 0) {
Header("Location: index.html");
}
?>
<html>
<head>
<title>admin tools</title>
<link rel="stylesheet" type="text/css" href="standard.css">
</head>
<body>
<div class="house box"> <?php echo $current;?>'s admin tools </div>
<a href="index.html"><div class="house box"> back home </div></a>
<!-- ADD USER -->
<form class="house box" name="new_user" method="POST" action="add_user.php">
<h4>add user</h4>
<input type="text" maxlength="30" name="new_name" placeholder="name (max 30)">
<input type="text" maxlength="6" name="new_comp" placeholder="compid (max 6)">
<input type="password" maxlength="10" name="new_pass" placeholder="password (max 10)">
<input type="checkbox" name="new_priv" value="yes">admin priv
<input type="submit">
<h6 style="margin:0;">your password is visible to admins; choose wisely</h6>
</form>
<!-- VIEW USERS -->
<div class="id box">
<?php view('graders',['Name', 'Pass']); ?>
</div>
<!-- VIEW RESULTS -->
<div class="id box">
<h4> Results and Average Scores </h4>
<?php view('applications', ['ID', 'COMP ID', 'SCORE1', 'SCORE2']); ?>
</div>
<?php
$conn->close();
?>