-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadmin.php
158 lines (154 loc) · 5.26 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
<?php ob_start();
include 'global.php'; ?>
<style>
#footer {
position: fixed;
bottom: 0;
width: 100%;
}
#footer {
background: #fff;
line-height: 2;
text-align: right;
color: #042E64;
font-size: 30px;
font-family: sans-serif;
font-weight: bold;
}
.red {
background-color: #990000;
}
.blue {
background-color: #0068b3;
}
</style>
</head>
<body>
<?php include 'nav.php';
include 'php/debug.php';
include 'php/userCheck.php';
include 'TBAdata.php';
checkUserAdmin(true); ?>
<br>
<div class="container">
<div class="media">
<div class="media-left">
<img src="<?php echo $_SESSION['userArray']['image_32']; ?>" class="media-object">
</div>
<div class="media-body">
<h2 class="media-heading"><?php echo $_SESSION['userArray']['name']; ?></h2>
</div>
</div>
</div>
<br>
<div class="container">
<form action="post">
<div class="row">
<div class="col-sm-6">
<label>Match Type:</label>
<select name="matchType">
<option value="qm">Qualification</option>
<option value="sf">Semifinals</option>
<option value="qf">Quarterfinals</option>
<option value="f">Finals</option>
</select>
</div>
<div class="col-sm-6">
<button type="submit" class="btn btn-danger btn-lg" style="display: block; width: 100%;" value="match">Update Match Type</button>
</div>
</div>
</form>
<div class="row">
<div class="col-sm-6">
TBA cache last updated:
<?php echo getUpdateTime(); ?>
</div>
<div class="col-sm-6">
<a href="refreshTBACache.php"><button type="button" class="btn btn-danger btn-lg" style="display: block; width: 100%;" value="refresh">Refresh TBA Cache</button></a>
</div>
</div>
<form action="searchValidity.php">
<div class="row">
<div class="col-sm-3">
<label>Match #:</label>
<input type="text" name="matchnum">
</div>
<div class="col-sm-3">
<label>Set #:</label>
<select name="set">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
<div class="col-sm-6">
<button type="submit" class="btn btn-danger btn-lg" style="display: block; width: 100%;" value="matchNum","set">Validate Match Data</button>
</div>
</div>
</form>
</div>
<form action="adminSubmit" method="get">
<div id="content">
<br>
<?php
include 'php/dbDataConn.php';
include 'php/getScoutInfo.php';
$result = mysqli_query($dbDataConn, "SELECT * FROM " . $GLOBALS['DB']['TABLE']['USER'] . " ORDER BY id DESC");
echo "
<div class='container' style='width:90%'><table align='center' class='table table-striped'>
<thead>
<tr>
<th> </th>
<th>ID</th>
<th>Admin</th>
<th>Team</th>
<th>Name</th>
<th>Scout Team</th>
<th>Scouting Alliance</th>
<th>Scouting Number</th>
</tr>
</thead>
<tbody>";
while($row = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td><input type='radio' name='id' value='" . $row['id'] . "'></td>";
echo "<td>" . $row['id'] . "</td>";
if ($row['isAdmin']) {
echo "<td><i style='color:green' class='fa fa-check' aria-hidden='true'></i></td>";
} else {
echo "<td><i style='color:red' class='fa fa-times' aria-hidden='true'></i></td>";
}
echo "<td>" . $row['team'] . "</td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['scoutTeam'] . "</td>";
if ($row['scoutingAlliance'] == 1) {
echo "<td class='red'></td>";
} else if ($row['scoutingAlliance'] == 2) {
echo "<td class='blue'></td>";
} else {
echo "<td></td>";
}
echo "<td>" . $row['scoutingNumber'] . "</td>";
echo "</tr>";
}
echo "</tbody></table></div>";
$dbDataConn->close();
?>
</div>
<div id="footer">
<div class="row">
<div class="col-sm-6">
<button type='submit' class='btn btn-danger btn-lg btn-block' style='margin-bottom:5px; margin-right:5px;' name='action' value=0>Remove</button>
</div>
<div class="col-sm-6">
<button type='submit' class='btn btn-danger btn-lg btn-block' style='margin-bottom:5px; margin-right:5px;' name='action' value=1>Toggle Admin</button>
</div>
</div>
</div>
</form>
</div>
</div>
<br><br>
</body>
<?php ob_flush(); ?>
</html>