-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_page.php
264 lines (176 loc) · 5.83 KB
/
main_page.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
<?php
include("connection.php");
include("page_content/header.php");
$district=$_POST['district'];
$view=$_POST['view'];
if($district=='Any' and $view!="Any")
{
$sql="Select * from place where place_category='$view'";
}
else if($view=="Any" and $district!="Any")
{
$sql="Select * from place where district='$district'";
}
else if($district=="Any" and $view=="Any")
{
$sql="Select * from place";
}
else{
$sql="Select * from place where place_category='$view' and district='$district' ";
}
$res=mysqli_query($conn,$sql);
// file_put_contents("sss.txt", $district.$view);
?>
<!-- ======================= End Navigation ===================== -->
<!-- ======================= Start Banner ===================== -->
<!-- ======================= End Banner ===================== -->
<div class="clearfix"></div>
<!-- ====================== Popular Tour ================= -->
<section class="gray-bg">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="heading">
<h1>Your Searching Place</h1>
</div>
</div>
</div>
<div class="row">
<!-- Single Destination -->
<?php
while($row=mysqli_fetch_array($res))
{
$place_id=$row['id'];
$sql3="Select * from place_review where place_id=$place_id";
$res3=mysqli_query($conn,$sql3);
$rating=0;
$num_of_review=mysqli_num_rows($res3);
while($row3=mysqli_fetch_array($res3))
{
$rating=$rating+$row3['rating'];
}
if($num_of_review==0)
{
$num_of_review=1;
}
if($rating==0)
{
$rating=0;
}
$rating=floor($rating/$num_of_review);
?>
<div class="col-md-4 col-sm-6">
<article class="destination-box style-1">
<div class="destination-box-image">
<figure>
<a href="place.php?id=<?php echo $row['id'] ?>">
<img src="<?php echo $row['place_image'] ?>" class="img-responsive listing-box-img" alt="" />
<div class="list-overlay"></div>
</a>
<h4 class="destination-place">
<a href="place.php?id=<?php echo $row['id'] ?>"><?php echo $row['district'] ?></a>
</h4>
</figure>
</div>
<div class="entry-meta">
<div class="meta-item meta-rating">
<?php
if ($rating < 1) {
?>
<p style="margin:0px;font-size:10px;" >No Ratings</p>
<?php
}else {
for($i=0;$i<$rating;$i++)
{
?>
<i class="fa fa-star"></i>
<?php
}
}
?>
</div>
</div>
<div class="inner-box">
<div class="box-inner-ellipsis">
<h4 class="entry-location">
<a href="place.php?id=<?php echo $row['id'] ?>"><?php echo $row['place_category'].','.$row['place_name'] ?> </a>
</h4>
<div class="price-box">
<div class="destination-price fl-right">
<a href="place.php?id=<?php echo $row['id'] ?>"><i class="theme-cl ti-arrow-right"></i></a>
</div>
</div>
</div>
</div>
</article>
</div>
<?php
}
?>
<!-- Single Destination -->
</div>
</section>
<div class="clearfix"></div>
<!-- ================= footer start ========================= -->
<?php
include("page_content/footer.php");
?>
<!-- Sign Up Window Code -->
<div class="modal fade" id="signin" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
<?php include("page_content/login_window.php"); ?>
</div>
<!-- End Sign Up Window -->
<!-- =================== 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="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.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 type="text/javascript" src="assets/js/sweetalert.min.js"></script>
<script>
$(function() {
$('input[name="book-date"]').daterangepicker({
autoUpdateInput: false,
locale: {
cancelLabel: 'Clear'
}
});
$('input[name="book-date"]').on('apply.daterangepicker', function(ev, picker) {
$(this).val(picker.startDate.format('MM/DD/YYYY') + ' - ' + picker.endDate.format('MM/DD/YYYY'));
});
$('input[name="book-date"]').on('cancel.daterangepicker', function(ev, picker) {
$(this).val('');
});
});
</script>
<script src="assets/js/jQuery.style.switcher.js"></script>
<script>
function openRightMenu() {
document.getElementById("rightMenu").style.display = "block";
}
function closeRightMenu() {
document.getElementById("rightMenu").style.display = "none";
}
</script>
<script type="text/javascript">
$(document).ready(function() {
$('#styleOptions').styleSwitcher();
});
</script>
</body>
</html>