-
Notifications
You must be signed in to change notification settings - Fork 0
/
res_review.php
447 lines (279 loc) · 11.5 KB
/
res_review.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
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
<?php
include("connection.php");
include("page_content/header.php");
$res_id=$_REQUEST['id'];
$sql="Select * from res where id=$res_id";
$res=mysqli_query($conn,$sql);
$row=mysqli_fetch_array($res);
$res_name=$row["res_name"];
if(isset($_POST['review_submit']))
{
$rating=floor($_POST['rating']);
$review=$_POST['review'];
$fnm= $_FILES["pimage"]["name"];
$dst="image/".$fnm;
$dst1="image/".$fnm;
move_uploaded_file($_FILES["pimage"]["tmp_name"],$dst);
$sql_gallery2="Insert into res_gallery(res_name,image) VALUES('$res_name','$dst')";
$res_gallery2=mysqli_query($conn,$sql_gallery2);
if($rating>5)
{
$rating=5;
}
$sql2="INSERT INTO res_review(res_id,user_id,review,rating,image) VALUES ($res_id,$user_id,'$review',$rating,'$dst') ";
$res2=mysqli_query($conn,$sql2);
if($res2)
{
header("location:res_review.php?id=$res_id");
}
}
$sql3="SELECT * FROM res_review where res_id=$res_id";
$res3=mysqli_query($conn,$sql3);
$sql4="SELECT * FROM user where id=$user_id";
$res4=mysqli_query($conn,$sql4);
$row4=mysqli_fetch_array($res4);
$sql_gallery="Select * from res_gallery where res_name='$res_name'";
$res_gallery=mysqli_query($conn,$sql_gallery);
?>
<!-- ======================= End Navigation ===================== -->
<!-- ======================= Start Banner ===================== -->
<section class="page-title-banner" style="background-image:url(<?php echo $row['res_image'] ?>);">
<div class="container">
<div class="row">
<div class="tr-list-detail">
<div class="tr-list-detail">
</div>
<div class="tr-list-info">
<h4><?php echo $row['res_name'] ?></h4>
</div>
</div>
</div>
</div>
</section>
<!-- ======================= End Banner ===================== -->
<!-- ======================= Start Detail Header ===================== -->
<section class="profile-header-nav padd-0 bb-1">
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="tab" role="tabpanel">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" ><a href="res_detail.php?id=<?php echo $res_id?>" ><i class="ti-user"></i>Overview</a></li>
<li role="presentation" class="active" ><a href="res_review.php?id=<?php echo $res_id?>" >Review</a></li>
<li role="presentation"><a href="#Photos" aria-controls="messages" role="tab" data-toggle="tab">Photos</a></li>
</ul>
<!-- Tab panes -->
</div>
</div>
</div>
</div>
</section>
<!-- ======================= End Detail Header ===================== -->
<!-- ======================= Start Detail ===================== -->
<section class="tr-single-detail gray-bg">
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="tab-content tabs">
<div role="tabpanel" class="tab-pane fade in active" id="Overview">
<div class="row">
<div class="col-md-8 col-sm-12">
<div class="tr-single-box">
<div class="tr-single-header">
<h4><i class="ti-write"></i>All Review</h4>
</div>
<div class="tr-single-body">
<?php
while($row3=mysqli_fetch_array($res3))
{
$id=$row3['user_id'];
$sql4="SELECT * FROM user where id=$id";
$res4=mysqli_query($conn,$sql4);
$row4=mysqli_fetch_array($res4);
?>
<!-- Single Review -->
<div class="review-box">
<div class = "row">
<div class = "col-md-6">
<div class="review-box-content">
<div class="review-user-info">
<h4><?php echo $row4['user_name'] ?></h4>
<p><?php echo $row3['review'] ?></p>
<?php
for($i=0;$i<$row3['rating'];$i++)
{
?>
<i class="fa fa-star"></i>
<?php
}?>
</div>
</div>
</div>
<div class= "col-md-4" style=" float: right;">
<figure>
<a data-fancybox="gallery" href="<?php echo $row3['image'] ?>">
<img src="<?php echo $row3['image'] ?>" class="img-responsive listing-box-img" alt="" width="50%" height="50%" />
<div class="list-overlay"></div>
</a>
</figure>
</div>
</div>
</div>
<!-- Single Review -->
<?php
}
?>
</div>
</div>
</div>
<div class="col-md-4 col-sm-12">
<div class="tr-single-box">
<div class="tr-single-header">
<h4><i class="ti-write"></i>Write Review</h4>
</div>
<div class="tr-single-body">
<div class="row">
<div class="col-sm-12 col-md-12">
<form method="post" action="" name="sForm" enctype="multipart/form-data">
<div id="result1"> </div>
<div class="form-group">
<label>Rating(Out of 5)</label>
<input type="number" name="rating" class="form-control form-control-sm" required>
</div>
<div class="form-group">
<label for="exampleFormControlTextarea2">Write Your Review </label>
<textarea class="form-control rounded-0" name="review" id="exampleFormControlTextarea2" rows="3" required ></textarea>
</div>
<div class="form-group">
<div class="custom-file">
<input type="file" name="pimage"">
<label class="custom-file-label" for="customFile">Upload Photo(Optional)</label>
</div>
</div>
<br>
<div class="form-group text-center">
<?php if($user_id!=NULL)
{
?>
<button type="submit" name="review_submit" class="btn theme-btn full-width btn-m">Done </button>
<?php
}
else{
?>
<button type="button" name="review_submit" class="btn theme-btn full-width btn-m" disabled>You need to login first </button>
<?php
}
?>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- overview & booking Form -->
<!-- /col-md-4 -->
</div>
</div>
</div>
<!-- ============ Review =================== -->
<div role="tabpanel" class="tab-pane fade in" id="Photos">
<section class="gray-bg">
<div class="container">
<div class="row">
<!-- Single Destination -->
<?php
while($row_gallery=mysqli_fetch_array($res_gallery))
{
?>
<div class="col-md-4 col-sm-6">
<article class="destination-box style-1">
<div class="destination-box-image">
<figure>
<a data-fancybox="gallery" href="<?php echo $row_gallery['image'] ?>">
<img src="<?php echo $row_gallery['image'] ?>" class="img-responsive listing-box-img" alt="" />
<div class="list-overlay"></div>
</a>
</figure>
</div>
</article>
</div>
<?php
}
?>
<!-- Single Destination -->
</div>
</div>
</section>
</div>
<!-- ============ Photos =================== -->
</div>
</div>
<!-- Sidebar Start -->
</div>
</section>
<!-- ======================= End Detail ===================== -->
<!-- ============== Before Footer ====================== -->
<div class="modal fade" id="signin" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
<?php include("page_content/login_window.php"); ?>
</div>
<!-- =================== Before Footer ====================== -->
<!-- ================= footer start ========================= -->
<?php
include("page_content/footer.php");
?>
<!-- Sign Up Window Code -->
<!-- End Sign Up Window -->
<!-- Switcher -->
<!-- /Switcher -->
<!-- =================== START JAVASCRIPT ================== -->
<script src="assets/plugins/js/jquery.min.js"></script>
<script src="assets/plugins/js/bootstrap.min.js"></script>
<script src="assets/plugins/js/viewportchecker.js"></script>
<script src="assets/plugins/js/bootsnav.js"></script>
<script src="assets/plugins/js/slick.min.js"></script>
<script src="assets/plugins/js/jquery.nice-select.min.js"></script>
<script src="assets/plugins/js/jquery.fancybox.min.js"></script>
<script src="assets/plugins/js/jquery.downCount.js"></script>
<script src="assets/plugins/js/freshslider.1.0.0.js"></script>
<script src="assets/plugins/js/moment.min.js"></script>
<script src="assets/plugins/js/daterangepicker.js"></script>
<script src="assets/plugins/js/wysihtml5-0.3.0.js"></script>
<script src="assets/plugins/js/bootstrap-wysihtml5.js"></script>
<script src="http://maps.google.com/maps/api/js?key=AIzaSyCJjm88GF1sxHWQuSScWVpDmdNP0c-QPSc"></script>
<script src="assets/plugins/js/markerclusterer.js"></script>
<script src="assets/js/map.js"></script>
<!-- Dashboard Js -->
<script src="assets/plugins/js/jquery.slimscroll.min.js"></script>
<script src="assets/plugins/js/jquery.metisMenu.js"></script>
<script src="assets/plugins/js/jquery.easing.min.js"></script>
<!-- Custom Js -->
<script src="assets/js/custom.js"></script>
<script>
$('#checkin').daterangepicker({
"singleDatePicker": true,
"timePicker": true,
"startDate": "12/12/2018",
"endDate": "12/14/2018"
}, function(start, end, label) {
console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')');
});
</script>
<script>
$('#checkout').daterangepicker({
"singleDatePicker": true,
"timePicker": true,
"startDate": "12/18/2018",
"endDate": "12/18/2018"
}, function(start, end, label) {
console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')');
});
</script>
<script src="assets/js/jQuery.style.switcher.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#styleOptions').styleSwitcher();
});
</script>
</body>
</html>]