-
Notifications
You must be signed in to change notification settings - Fork 0
/
accept.php
420 lines (324 loc) · 14.5 KB
/
accept.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
<!DOCTYPE html>
<html lang="zxx">
<?php
include 'connection.php';
session_start();
if (isset($_SESSION['login'])){
$id = $_SESSION['login'];
// $sql = "SELECT * FROM request WHERE render = '$id' ";
// $query = mysqli_query($con,$sql);
//$rw = mysqli_fetch_assoc($query);
//$xd = $rw['sender'];
}
else{
header('location:login.php');
}
?>
<?php
if (isset($_POST['accept'])){
$oj = "1";
$cade = mysqli_escape_string($con,$_POST['cash']);
$flo = "UPDATE request set status = '$oj' where render = '$id' ";
$things = mysqli_query($con,$flo);
if ($things){
//echo "true";
$com = "UPDATE users set status = '1' where studentid = '$id' ";
$tom = mysqli_query($con,$com);
if ($tom){
// echo "true";
$tue = "UPDATE users set status = '1' where studentid = '$cade' ";
$tem = mysqli_query($con,$tue);
if ($tem){
echo "true";
}
else{
echo "true";
}
}
else{
echo "false";
}
}
else{
// echo "false";
}
}
?>
<?php
if (isset($_POST['decline'])){
$oj = "1";
$cade = mysqli_escape_string($con,$_POST['cash']);
$flo = "DELETE from request where sender = '$cade' and render = '$id' ";
$things = mysqli_query($con,$flo);
if ($things){
//echo "true";
}
else{
echo "false";
}
}
?>
<head>
<title>Find a Room mate</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<!-- External CSS libraries -->
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/animate.min.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap-submenu.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap-select.min.css">
<link rel="stylesheet" href="css/leaflet.css" type="text/css">
<link rel="stylesheet" href="css/map.css" type="text/css">
<link rel="stylesheet" type="text/css" href="fonts/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="fonts/flaticon/font/flaticon.css">
<link rel="stylesheet" type="text/css" href="fonts/linearicons/style.css">
<link rel="stylesheet" type="text/css" href="css/jquery.mCustomScrollbar.css">
<link rel="stylesheet" type="text/css" href="css/dropzone.css">
<link rel="stylesheet" type="text/css" href="css/slick.css">
<!-- Custom stylesheet -->
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" id="style_sheet" href="css/skins/default.css">
<!-- Favicon icon -->
<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" >
<!-- Google fonts -->
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800%7CPlayfair+Display:400,700%7CRoboto:100,300,400,400i,500,700">
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link rel="stylesheet" type="text/css" href="css/ie10-viewport-bug-workaround.css">
<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
<!--[if lt IE 9]><script src="js/ie8-responsive-file-warning.js"></script><![endif]-->
<script src="js/ie-emulation-modes-warning.js"></script>
<!-- php5 shim and Respond.js for IE8 support of php5 elements and media queries -->
<!--[if lt IE 9]>
<script src="js/php5shiv.min.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="page_loader"></div>
<!-- Top header start -->
<!-- Top header start -->
<header class="top-header top-header-bg d-none d-xl-block d-lg-block d-md-block" id="top-header-2">
<div class="container">
<div class="row">
<div class="col-lg-6 col-md-8 col-sm-7">
<div class="list-inline">
</div>
</div>
<div class="col-lg-6 col-md-4 col-sm-5">
<ul class="top-social-media pull-right">
<li>
<a href="#" class=""><i class=""></i></a>
</li>
</ul>
</div>
</div>
</div>
</header>
<!-- Top header end -->
<!-- Main header start -->
<header class="main-header">
<div class="container">
<nav class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand logo" href="my-profile.php">
<img src="img/logos/logo.png" alt="logo">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item ">
<a class="nav-link " href="my-profile.php" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-home"> My Profile</i>
</a>
</li>
<li class="nav-item ">
<a class="nav-link " href="properties-details.php" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-search"> Search for Accomodation </i>
</a>
</li>
<li class="nav-item ">
<a class="nav-link " href="room.php" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-search"> Search for Roommate</i>
</a>
</li>
<li class="nav-item ">
<a class="nav-link " href="properties-list.php" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-eye"> View Accomodation</i>
</a>
</li>
</ul>
</div>
</nav>
</div>
</header>
<!-- Main header end -->
<!-- Sub banner start -->
<div class="sub-banner">
<div class="container">
<div class="page-name">
<h1>View Pending Roommate Request</h1>
</div>
</div>
<div class="page-info">
<div class="container">
</div>
</div>
</div>
<!-- Sub Banner end -->
<!-- Properties section body start -->
<div class="properties-section content-area">
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-12">
<!-- Option bar start -->
<div class="option-bar d-none d-xl-block d-lg-block d-md-block d-sm-block">
<div class="row">
<div class="col-lg-6 col-md-5 col-sm-5 col-xs-2">
<div class="sorting-options">
<span>Pending Request :</span>
</div>
</div>
</div>
</div>
<!-- Option bar end -->
<!-- Property box 2 start -->
<?php
include 'connection.php';
$sql = "SELECT * FROM request WHERE render = '$id' and status = 'pending' ";
$query = mysqli_query($con,$sql);
$count = mysqli_num_rows($query);
if ($count > 0 ){
while ($rw = mysqli_fetch_assoc($query)){
echo ' <div class="property-box-2 wow fadeInUp delay-03s" >
<div class="row">
<div class="col-lg-5 col-md-5 col-pad">
<a href="#" class="property-img">
<img src="'.$rw['passport'].'" width = "750px" height = "600px" alt="properties" class="img-fluid">
</a>
</div>
<div class="col-lg-7 col-md-7">
<form method="POST" action = "accept.php">
<div class="detail ">
<h3 class="title">
<a href="#">
<i class="flaticon-people"></i> Fullname : '.$rw['fullname'].'
</a>
</h3>
<h5 class="location">
<a href="#">
<i class="flaticon-people-2"></i> student id : '.$rw['sender'].'
</a>
</h5>
<h4 class="location">
<a href="#">
<i class="flaticon-people-2"></i> Department : '.$rw['department'].'
</a>
</h4>
<h4 class="location">
<a href="#">
<i class="flaticon-people-2"></i> Phone number : '.$rw['phonenumber'].'
</a>
</h4>
<ul class="facilities-list clearfix">
<li>
<div> <button name = "accept" "> Accept request </button></div>
</li>
<li>
<div> <button name = "decline" "> Decline request </button></div>
</li>
<input type = "text" name = "cash" value = '.$rw['sender'].' hidden> </input>
</ul>
</form>
</div>
</div>
</div>
</div>';
}
}
?>
<div class="col-lg-8 col-md-8">
<!-- My address start -->
<!-- My address end -->
</div>
<!-- properties end -->
<!-- Page navigation start -->
<div class="pagination-box hidden-mb-45 text-center">
<nav aria-label="Page navigation example">
<ul class="pagination">
<li class="page-item">
<a class="page-link" href="#"><i class="fa fa-angle-left"></i></a>
</li>
<li class="page-item"><a class="page-link active" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item">
<a class="page-link" href="#"><i class="fa fa-angle-right"></i></a>
</li>
</ul>
</nav>
</div>
<!-- Page navigation end-->
</div>
<div class="col-lg-4 col-md-12">
<div class="sidebar-right">
<!-- Search contents sidebar start -->
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container footer-inner">
<div class="row">
<div class="col-xl-12">
<p class="copy">© Ejigson</p>
</div>
</div>
</div>
</footer>
<!-- Footer end -->
<!-- Full Page Search -->
<div id="full-page-search">
<button type="button" class="close">×</button>
<form action="http://storage.googleapis.com/themevessel-items/real-house/index.php#">
<input type="search" value="" placeholder="type keyword(s) here" />
<button type="submit" class="btn btn-sm button-theme">Search</button>
</form>
</div>
<script src="js/jquery-2.2.0.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/bootstrap-submenu.js"></script>
<script src="js/rangeslider.js"></script>
<script src="js/jquery.mb.YTPlayer.js"></script>
<script src="js/wow.min.js"></script>
<script src="js/bootstrap-select.min.js"></script>
<script src="js/jquery.easing.1.3.js"></script>
<script src="js/jquery.scrollUp.js"></script>
<script src="js/jquery.mCustomScrollbar.concat.min.js"></script>
<script src="js/leaflet.js"></script>
<script src="js/leaflet-providers.js"></script>
<script src="js/leaflet.markercluster.js"></script>
<script src="js/dropzone.js"></script>
<script src="js/slick.min.js"></script>
<script src="js/jquery.filterizr.js"></script>
<script src="js/jquery.magnific-popup.min.js"></script>
<script src="js/jquery.countdown.js"></script>
<script src="js/maps.js"></script>
<script src="js/app.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="js/ie10-viewport-bug-workaround.js"></script>
<!-- Custom javascript -->
<script src="js/ie10-viewport-bug-workaround.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','../../../www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-89110077-3', 'auto');
ga('send', 'pageview');
</script>
</body>
<!-- Mirrored from storage.googleapis.com/themevessel-items/real-house/properties-list-rightside.php by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 20 Jul 2018 11:20:57 GMT -->
</php>