-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadminprofile.php
More file actions
299 lines (205 loc) · 7.98 KB
/
adminprofile.php
File metadata and controls
299 lines (205 loc) · 7.98 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
<!DOCTYPE HTML>
<html>
<!----userprofile>
<!--->
<!---->
<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 -->
<title>Qbnb - Come to a journey of a life time</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS: You can use this stylesheet to override any Bootstrap styles and/or apply your own styles -->
<link href="css/custom.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- Custom Fonts from Google -->
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
</head>
<br>
<br>
<br>
<body>
<?php
//Create a user session or resume an existing one
session_start();
?>
<?php
if(isset($_SESSION['id'])){
// include database connection
include_once 'config/connection.php';
// SELECT query
$query = "SELECT fName FROM service_member WHERE id=?";
// prepare query for execution
$stmt = $con->prepare($query);
// bind the parameters. This is the best way to prevent SQL injection hacks.
$stmt->bind_Param("s", $_SESSION['id']);
// Execute the query
$stmt->execute();
// results
$result = $stmt->get_result();
// Row data
$myrow = $result->fetch_assoc();
//echo $_SESSION['AdminSESSION'];
//-----------------
// SELECT query
/* $query = "SELECT numMembers, numAccomodations, numBookingsMade, numCities FROM qbnb WHERE dataIndex=?";
// prepare query for execution
$stmt = $con->prepare($query);
// bind the parameters. This is the best way to prevent SQL injection hacks.
$stmt->bind_Param("i", $dataIndexTemp);
$dataIndexTemp = "1";
// Execute the query
$stmt->execute();
// results
$result2 = $stmt->get_result();
// Row data
$myrow2 = $result2->fetch_assoc(); */
//------------------
// SELECT query
$query = "SELECT COUNT(poiID)
FROM points_of_interest
WHERE isPending = ?";
// prepare query for execution
$stmt = $con->prepare($query);
// bind the parameters. This is the best way to prevent SQL injection hacks.
$stmt->bind_Param("i", $isPendingTemp);
$isPendingTemp = "1";
// Execute the query
$stmt->execute();
// results
$result3 = $stmt->get_result();
// Row data
$myrow3 = $result3->fetch_assoc();
// SELECT query
$query = "SELECT COUNT(service_member.id)
FROM service_member";
// prepare query for execution
$stmt = $con->prepare($query);
// bind the parameters. This is the best way to prevent SQL injection hacks.
// Execute the query
$stmt->execute();
// results
$result4 = $stmt->get_result();
// Row data
$myrow4 = $result4->fetch_assoc();
// SELECT query
$query = "SELECT COUNT(rental_properties.propertyID)
FROM rental_properties";
// prepare query for execution
$stmt = $con->prepare($query);
// bind the parameters. This is the best way to prevent SQL injection hacks.
// Execute the query
$stmt->execute();
// results
$result5 = $stmt->get_result();
// Row data
$myrow5 = $result5->fetch_assoc();
// SELECT query
$query = "SELECT COUNT(city_districts.city)
FROM city_districts";
// prepare query for execution
$stmt = $con->prepare($query);
// bind the parameters. This is the best way to prevent SQL injection hacks.
// Execute the query
$stmt->execute();
// results
$result6 = $stmt->get_result();
// Row data
$myrow6 = $result6->fetch_assoc();
// SELECT query
$query = "SELECT COUNT(bookings.bookingID)
FROM bookings";
// prepare query for execution
$stmt = $con->prepare($query);
// bind the parameters. This is the best way to prevent SQL injection hacks.
// Execute the query
$stmt->execute();
// results
$result7 = $stmt->get_result();
// Row data
$myrow7 = $result7->fetch_assoc();
} else {
//User is not logged in. Redirect the browser to the login index.php page and kill this page.
header("Location: login.php");
die();
}
/*
SELECT points_of_interest.name, points_of_interest.address, city_districts.districtName, points_of_interest.details
FROM points_of_interest
INNER JOIN city_districts ON city_districts.districtID = points_of_interest.districtID
WHERE isPending = '1'
*/
?>
<!-- dynamic content will be here -->
<body class="body_general">
<!-- Navigation -->
<nav id="siteNav" class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<!-- Logo and responsive toggle -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#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.html">
<span class="glyphicon glyphicon-tower"></span>
Qbnb - They hate us coz they ain't us
</a>
</div>
</div><!-- /.container -->
</nav>
<div class="container">
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title"><h1 align="Middle"> Admin Profile</h1> <a href="login.php?logout=1" class="btn btn-primary btn-sm" align="Right">Log Out</a></h3>
</div>
<div class="panel-body">
<div class="container-fluid">
<div class="container-fluid">
<div class="container-fluid">
<p ><h3 align="Middle">Welcome <?php echo $myrow['fName']; ?> !</h3></p>
<div class="row">
<div class="profile-header-container">
<div class="profile-header-img">
<img class="img-circle" src="images/logo.png" />
<!-- badge -->
<div class="rank-label-container">
<span class="label label-default rank-label"> <?php echo $myrow3['COUNT(poiID)']; ?> </span>
</div>
</div>
</div>
</div>
</div>
<div id="wrap_user">
<div class="box_admin">
<!--------------------------Fetch the Info from database--------------->
<div><p>Current Number Of Members: <?php echo $myrow4['COUNT(service_member.id)']; ?> </p></div>
<div><p>Current Number Of Accommodations: <?php echo $myrow5['COUNT(rental_properties.propertyID)']; ?></p></div>
<div><p>Number Of Cities Qbnb Supports: <?php echo $myrow6['COUNT(city_districts.city)']; ?></p></div>
<div><p>Number Of Bookings Made: <?php echo $myrow7['COUNT(bookings.bookingID)']; ?></p></div>
</div>
</div><!--end wrap-->
<div class="admin_button">
<div >
<a href="ViewAllMembers_Admin.php" class="btn btn-primary btn-sm">View All Members</a>
<a href="viewallaccommodation.php" class="btn btn-primary btn-sm">View All Accommodations</a>
<a href="viewpendingPOI.html" class="btn btn-primary btn-sm">View Pending POI</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>