forked from anjaliunnikrishnan/PlacesSearchWebsite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
376 lines (364 loc) · 19.9 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en" ng-app="myapp" >
<head>
<title>Welcome</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/rateYo/2.3.2/jquery.rateyo.min.css">
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places" async defer>
initMap();
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script language="JavaScript" type="text/javascript" src="index.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/rateYo/2.3.2/jquery.rateyo.min.js"></script>
<script type="text/javascript" async src="https://platform.twitter.com/widgets.js"></script>
<style>
.custom-well {
margin: 0 auto;
}
.row {
margin-bottom: 5px;
}
.btn-outline-secondary:hover {
color: black;
background-color: white;
border-color: #6c757d;
}
.btn-outline-secondary{
border-color: #6c757d;
background-color: white;
color: black;
}
.btn-light {
border-color: #212529;
background-color: transparent;
}
.btn-light:hover {
color: #212529;
background-color: transparent;
border-color: #212529;
}
@media (max-width: 34em) {
.card-columns {
-webkit-column-count: 1;
-moz-column-count: 1;
column-count: 1;
}
}
@media (min-width: 34em) {
.card-columns {
-webkit-column-count: 4;
-moz-column-count: 4;
column-count: 4;
}
}
@media (min-width: 48em) {
.card-columns {
-webkit-column-count: 4;
-moz-column-count: 4;
column-count: 4;
}
}
@media (min-width: 62em) {
.card-columns {
-webkit-column-count: 4;
-moz-column-count: 4;
column-count: 4;
}
}
@media (min-width: 75em) {
.card-columns {
-webkit-column-count: 4;
-moz-column-count: 4;
column-count: 4;
}
}
.error{
display: none;
margin-left: 10px;
}
.error_show{
color: red;
margin-left: 10px;
}
input.invalid{
border: 2px solid red;
box-shadow: 0 0 0 2px red !important;
}
.card-columns .card{
display:block;
}
#street-view, #street-view .img-thumbnail {
padding: 0;
}
.form-control:focus {
border-color:transparent;
box-shadow: 0 0 0 0.1px #ced4da;
}
.checked {
color:#ffcc00;
}
.checkedStar {
color:#ffcc00;
}
.highlight{
background-color: #ffcc00;
}
</style>
</head>
<body>
<div class="container">
<div class="col-sm-10 custom-well" style="margin-top: 10px">
<div class="card card-body bg-light">
<h5 class="text-center">Travel and Entertainment Search</h5>
<form method="get" onsubmit="event.preventDefault(); submitData();" novalidate>
<div class="form-group row">
<label for="key" class="col-sm-2 col-form-label col-form-label-sm offset-sm-2">Keyword<span class="text-danger">*</span></label>
<div class="col-sm-6">
<input type="text" class="form-control form-control-sm offset-sm-0" id="key" required>
<div class="error" id="error_message">
Please enter a keyword.
</div>
</div>
</div>
<div class="form-group row">
<label for="category" class="col-form-label col-sm-2 col-form-label-sm offset-sm-2">Category</label>
<div class="col-sm-4">
<select class="form-control form-control-sm" id="category">
<option value="default">Default</option>
<option value="airport">Airport</option>
<option value="amusement_park">Amusement Park</option>
<option value="aquarium">Aquarium</option>
<option value="art_gallery">Art Gallery</option>
<option value="bakery">Bakery</option>
<option value="bar">Bar</option>
<option value="beauty_salon">Beauty Salon</option>
<option value="bowling_alley">Bowling Alley</option>
<option value="bus_station">Bus Station</option>
<option value="cafe">Cafe</option>
<option value="campground">Campground</option>
<option value="car_rental">Car Rental</option>
<option value="casino">Casino</option>
<option value="lodging">Lodging</option>
<option value="movie_theater">Movie Theater</option>
<option value="museum">Museum</option>
<option value="night_club">Night Club</option>
<option value="park">Park</option>
<option value="parking">Parking</option>
<option value="restaurant">Restaurant</option>
<option value="shopping_mall">Shopping Mall</option>
<option value="stadium">Stadium</option>
<option value="subway_station">Subway Station</option>
<option value="taxi_stand">Taxi Stand</option>
<option value="train_station">Train Station</option>
<option value="transit_station">Transit Station</option>
<option value="travel_agency">Travel Agency</option>
<option value="zoo">Zoo</option>
</select>
</div>
</div>
<div class="form-group row">
<label for="dist" class="col-sm-2 col-form-label col-form-label-sm offset-sm-2">Distance(miles)</label>
<div class="col-sm-4">
<input type="text" class="form-control form-control-sm" id="dist" placeholder="10">
</div>
</div>
<fieldset class="form-group">
<div class="row">
<legend class="col-form-label col-sm-2 pt-0 col-form-label-sm offset-sm-2">From<span class="text-danger">*</span></legend>
<div class="col-sm-8">
<div class="form-check">
<input class="form-check-input" type="radio" name="gridRadios" id="current-location" checked onclick="myFunctionHere();toggle();" value="here">
<label class="form-check-label col-form-label-sm" for="current-location">
Current Location
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="gridRadios" id="other-location" value="other" onclick="myFunctionLoc();toggle();">
<label class="form-check-label col-form-label-sm" for="other-location">
Other. Please Specify:
</label>
</div>
<div class="col-sm-8">
<input class="form-control form-control-sm" id="location-text" type="text" placeholder="Enter a location" disabled>
<div class="error" id="error_message">
Please enter a keyword.
</div>
</div>
</div>
</div>
</fieldset>
<div class="form-group row offset-sm-2">
<div class="col-sm-12">
<button type="submit" class="btn btn-primary btn-sm" id="search" disabled>
<i class="fa fa-search"></i> Search
</button>
<button type="button" class="btn btn-light btn-sm" id="clear" onclick="clearEverything();">Clear</button>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="container">
<br>
<div class="d-flex justify-content-center">
<button type="button" class="btn btn-primary btn-sm " id="results" onclick="onClickResults();">Results</button>
<button type="button" class="btn btn-link btn-sm" id='fav' onclick="createFavouriteTable();">Favourites</button>
</div>
</div>
<div class="container" id="details" style="display:none">
<br>
<div class="d-flex flex-row-reverse">
<button type="button" class="btn btn-light btn-sm " disabled id="details-token" onclick="onClickDetail();">Details <i class="fa fa-angle-right" style="font-size:20px"></i></button>
</div>
</div>
<div class="container" id="show-progress-bar" style="margin-top:150px; display:none">
<!-- <div class="col-sm-12 custom-well">-->
<div class="progress">
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" style="width: 50%" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<!-- </div>-->
</div>
<div class="container justify-content-center" id="table-data" style="display:none">
</div>
<div class="container justify-content-center" id="favourite-data" style="display:none">
</div>
<!-- <div class="container" id="next" style="display:none">-->
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-center">
<li class="page-item disabled">
<div id="prev" style="display:none">
<button type="button" class="btn btn-outline-secondary btn-lg " disabled id="prev-token" onclick="prevDetails();">Previous</button>
</div>
</li>
<li class="page-item">
<div id="next" style="display:none">
<button type="button" class="btn btn-outline-secondary btn-lg " disabled id="next-token" onclick="nextDetails();">Next</button>
</div>
</li>
</ul>
</nav>
<!-- </div>-->
<br>
<div class="container" id="list" style="display:none">
<!-- Nav tabs -->
<h5 id="detail-name"></h5>
<div class="btn-toolbar justify-content-between" role="toolbar" aria-label="Toolbar with button groups">
<div class="btn-group mr-2" role="group" aria-label="First group">
<button type="button" id="list-token" class="btn btn-outline-secondary" onclick="onClickList();"><i class="fa fa-angle-left" style="font-size:25px"></i> List</button>
</div>
<div class="btn-toolbar">
<div class="btn-group mr-2" role="group" aria-label="Second group">
<button type="button" class="btn btn-outline-secondary btn-sm" onclick="testing(this);"><i class="fa fa-star-o" style="font-size:20px" id="star"></i></button>
</div>
<div class="btn-group" role="group" aria-label="Third group">
<button style="background-color:deepskyblue" type="button" class="btn btn-outline-secondary btn-sm" id='twitter' onclick="clickTwitter();"><i class="fa fa-twitter" style="font-size:24px;color:white"></i></button>
</div>
</div>
</div>
<ul class="nav nav-tabs justify-content-end" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#home" onclick="checkWarning('info');">Info</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#menu1" onclick="checkWarning('photo');">Photos</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#menu2" onclick="checkWarning('maps');">Maps</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#menu3" onclick="checkWarning('review');">Reviews</a>
</li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div id="home" class="container tab-pane active"><br>
</div>
<div id="menu1" class="container tab-pane fade"><br><br>
</div>
<div id="menu2" class="container tab-pane fade"><br>
<div class="form-row">
<div class="form-group col-md-4">
<label for="from-address">From</label>
<input type="text" class="form-control form-control-sm" id="from-address" placeholder="Your Location">
</div>
<div class="form-group col-md-4">
<label for="to-address">To</label>
<input type="text" class="form-control form-control-sm" id="to-address" disabled>
</div>
<div class="form-group col-md-2">
<label for="travel-mode">Travel Mode</label>
<select class="form-control form-control-sm" id="travel-mode">
<option value="DRIVING">Driving</option>
<option value="BICYCLING">Bicycling</option>
<option value="TRANSIT">Transit</option>
<option value="WALKING">Walking</option>
</select>
</div>
<div class="form-group">
<input type="button" class="btn btn-primary btn-sm" id="directions" style="margin-top:30px;margin-left:30px" value="Get Directions" disabled onclick="maps_info();">
</div>
</div>
<div class="row">
<div class="col">
<button class='btn btn-default' onclick="streetView();" id="street-view">
<img src="http://cs-server.usc.edu:45678/hw/hw8/images/Pegman.png" width="35px" height="30px" class='img-thumbnail rounded' id='maps-view'>
</button>
</div>
</div>
<div id="add-map" style="display:block;">
<div id="map" style="height:350px;" class='col-lg-12'></div>
</div>
<div id="add-pano" style="display:none;">
<div id="pano" style="height:350px;" class='col-lg-12'></div>
</div>
<div id="suggested-route" style="display:block;">
</div>
</div>
<div id="menu3" class="container tab-pane fade"><br>
<div class="form-inline">
<select class="form-control form-control-sm col-md-2 btn-secondary" id="reviews" onchange="switchReviews(this);">
<option default="google_reviews">Google Reviews</option>
<option default="yelp_reviews">Yelp Reviews</option>
</select>
<select class="form-control form-control-sm col-md-2 btn-secondary ml-2" id="sorting-order" onchange="sample(this);">
<option default="default_order">Default Order</option>
<option default="highest_rating">Highest Rating</option>
<option default="lowest_rating">Lowest Rating</option>
<option default="most_recent">Most Recent</option>
<option default="highest_rating">Least Recent</option>
</select>
</div><br>
<div id="reviews-parent-google" style="display:block"></div>
<div id="reviews-parent-yelp" style="display:none"></div>
</div>
</div>
</div>
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Open Hours</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body" id="timings"></div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="alert alert-danger container col-sm-9" role="alert" id="danger" style="display:none">
Failed to get search results
</div>
<div class="alert alert-warning container mt-3" style="display:none" id="warning" role="alert">
No records.
</div>
</body>
</html>