-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.php
More file actions
204 lines (180 loc) · 6.68 KB
/
admin.php
File metadata and controls
204 lines (180 loc) · 6.68 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
<?php include "header.php";
if(!isset($_SESSION['UserID'])){
header("location: /");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>VTRAK</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link href="css/styles.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<style>
.defaultHidden{display:none;visibility:hidden;}
@font-face{font-family: sanssaFont;src:url(CSS/Sansation_Regular.ttf)};
@font-face{font-family: sanssaBold;src:url(CSS/Sansation_Bold.ttf);font-weight:bold};
body{font-family:sanssaFont;}
#homePageContent h1{font-family:sanssaFont;}
.acceptOrg, .acceptAdmin{
margin-bottom: 5px;
margin-left: 5px;
background-color: #006600;
color: white;
font-family: sanssaFont;
}
.declineOrg, .declineAdmin{
margin-bottom: 5px;
margin-left: 5px;
background-color: #cc0000;
color: white;
font-family: sanssaFont;
}
.label-default{background-color:#4d4d4d;}
</style>
</head>
<body class="myDashboard">
<!-- Top Banner Start -->
<nav class="navbar navbar-default">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<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="#" data-target="home" id="vtrakButton">vTrak</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li><a href="logout.php" id="loginRibbon">Log Out</a></li>
</ul>
</div>
</div>
</nav>
<!-- Top Banner End -->
<div class="col-sm-3">
</div>
<!--Begin ORG scrollable-->
<div class="col-sm-3">
<h2><span class="label label-default">Pending Organizations</span></h2>
<div class="panel panel-default">
<div class="panel-body pre-scrollable" style="max-height: 75vh">
<table id="orgreqs" class="table" border="1">
<tbody>
<?php
$thisUserID = $_SESSION['UserID'];
$sql = "SELECT orgID, orgName, orgWebsite, conName, conEmail FROM organizations WHERE approved = 0";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0)
{
while($row = mysqli_fetch_assoc($result)){
echo '<tr class="myRequests" id="o'. sanitizeXSS($row['orgID']) .'">
<td><p class="myOrgs">' . sanitizeXSS($row['orgName']). '<br>'. sanitizeXSS($row['orgWebsite']) .'<br>'. sanitizeXSS($row['conName']).'<br>'.sanitizeXSS($row['conEmail']).'<br></p>
<button value="'.sanitizeXSS($row['orgID']).'" type="button" class="btn btn-primary btn-md acceptOrg">Accept</button>
<button value="'.sanitizeXSS($row['orgID']).'" type="button" class="btn btn-primary btn-md declineOrg">Decline</button>
</td></tr>';
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
<!--End ORG scrollable-->
<!--Begin ADMIN scrollable-->
<div class="col-sm-3">
<h2><span class="label label-default">Admin Requests</span></h2>
<div class="panel panel-default">
<div class="panel-body pre-scrollable" style="max-height: 75vh">
<table id="adminreqs" class="table" border="1">
<tbody>
<tr class="myRequests">
<td>
<p class="myAdmins">
Niel Gaiman<br>
Username: nielg<br>
</p>
<button type="button" class="btn btn-primary btn-md acceptAdmin">Accept</button>
<button type="button" class="btn btn-primary btn-md declineAdmin">Decline</button>
<hr>
</td>
</tr>
<!-- End of one entry in the table-->
<!-- Beginning of one entry in the table-->
<tr class="myRequests">
<td>
<p class="myAdmins">
Terry Pratchett<br>
Username: tpratchett<br>
</p>
<button type="button" class="btn btn-primary btn-md acceptAdmin">Accept</button>
<button type="button" class="btn btn-primary btn-md declineAdmin">Decline</button>
<hr>
</td>
</tr>
<!-- End of one entry in the table-->
<!-- Beginning of one entry in the table-->
<tr class="myRequests">
<td>
<p class="myAdmins">
Michael Ende<br>
Username: michaele<br>
</p>
<button type="button" class="btn btn-primary btn-md acceptAdmin">Accept</button>
<button type="button" class="btn btn-primary btn-md declineAdmin">Decline</button>
<hr>
</td>
</tr>
<!-- End of one entry in the table-->
<!-- Beginning of one entry in the table-->
<tr class="myRequests">
<td>
<p class="myAdmins">
Friedrich Nietzsche<br>
Username: nietzsche<br>
</p>
<button type="button" class="btn btn-primary btn-md acceptAdmin">Accept</button>
<button type="button" class="btn btn-primary btn-md declineAdmin">Decline</button>
<hr>
</td>
</tr>
<!-- End of one entry in the table-->
<!-- Beginning of one entry in the table-->
<tr class="myRequests">
<td>
<p class="myAdmins">
Herman Hesse<br>
Username: hhesse<br>
</p>
<button type="button" class="btn btn-primary btn-md acceptAdmin">Accept</button>
<button type="button" class="btn btn-primary btn-md declineAdmin">Decline</button>
<hr>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!--End ADMIN scrollable-->
<div class="col-sm-3">
</div>
<script src="API/webAJAX.js"></script>
<script>
$(".acceptOrg").on("click",function(){approveOrg($(this).val())});
$(".declineOrg").on("click",function(){declineOrg($(this).val())});
</script>
</body>
</html>