-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
1066 lines (963 loc) · 40.8 KB
/
index.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
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- jQuery UI CSS -->
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" href="http://jqueryui.com/resources/demos/style.css">
<link href="https://fonts.googleapis.com/css?family=Courgette|Dancing+Script|Kaushan+Script" rel="stylesheet">
<link rel="stylesheet" href="./css/ticket.css">
<title>Ticket Booking</title>
</head>
<body>
<header>
<nav class="navbar navbar-expand-lg navbar-light bg-white">
<a class="navbar-brand" href="#">
<img src="./images/ctrip.png" width="130" alt="">
</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 mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Flights <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Hotels</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Trains</a>
</li>
<li id="new-position" class="nav-item">
<div class="badge">
<div class="square">New</div>
<div class="triangle"></div>
</div>
<a class="nav-link" href="#">Mobile</a>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Help
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
CAD
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
<li class="nav-item dropdown">
<a id="icon-EN" class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="icon-EN"></i> EN
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
<li id="icon-Account" class="nav-item">
<a class="nav-link" href="#">
<i class="icon-Account mx-1"></i> <span class="Account mx-1">Account</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<i class="icon-App"></i> <span id="icon-App">App</span>
</a>
</li>
</ul>
</div>
</nav>
</header>
<main role="main">
<div class="background-image">
<div class="main-search p-3">
<div class="btn-group btn-group-toggle" data-toggle="buttons">
<label id="icon-Flights" class="btn btn-primary active btn-outline-primary">
<i class="icon-Flights"></i>
<input type="radio" name="options" id="option1" autocomplete="off" checked> Flights
</label>
<label class="btn btn-secondary btn-outline-primary">
<i class="icon-Hotels"></i>
<input type="radio" name="options" id="option2" autocomplete="off"> Hotels
</label>
<label class="btn btn-secondary btn-outline-primary">
<i class="icon-Trains"></i>
<input type="radio" name="options" id="option3" autocomplete="off"> Trains
</label>
</div>
<br><br>
<div class="btn-group btn-group-sm btn-group-toggle" data-toggle="buttons">
<label class="btn btn-secondary btn-outline-light">
<input type="radio" name="options" id="option1" autocomplete="off" checked> One way
</label>
<label class="btn btn-primary btn-outline-light active">
<input type="radio" name="options" id="option2" autocomplete="off"> Round trip
</label>
<label class="btn btn-secondary btn-outline-light">
<input type="radio" name="options" id="option3" autocomplete="off"> Multi-City
</label>
</div>
<form id="J_Search" target="_blank">
<div class="row">
<div class="col ui-widget">
<label for="tags">From</label>
<input type="text" class="form-control" id="tags" placeholder="City of airport">
</div>
<a href="#">
<i class="icon-switch"></i>
</a>
<div class="col ui-widget">
<label for="to">To</label>
<input type="text" class="form-control" id="to" placeholder="City or airport">
</div>
</div>
<br>
<div class="row">
<div class="col-4">
<label class="" for="J_DepDate">Depart</label>
<input id="J_DepDate" type="text" class="form-control" value="" />
</div>
<div class="col-4">
<label class="" for="J_EndDate">Return</label>
<input id="J_EndDate" type="text" class="form-control" value="" />
</div>
</div>
<div class="row">
<div class="col">
<label class="" for="adult">Adult(12+ yrs)</label>
<input id="adult" type="number" name="" min="0" max="10">
</div>
<div class="col">
<label class="" for="child">Child(2-12 yrs)</label>
<input id="child" type="number" name="" min="0" max="10">
</div>
<div class="col">
<label class="" for="select_class">Class</label>
<select id="select_class" class="custom-select">
<option value="Economy" selected>Economy</option>
<option value="Business">Business</option>
<option value="First Class">First Class</option>
</select>
</div>
<div class="col">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="customCheck">
<label class="custom-control-label" for="customCheck">Nonstop only</label>
</div>
</div>
</div>
<input style="cursor:pointer" id="J_search_btn" type="submit" class="search_btn" value="Search flights" />
</form>
</div>
<div class="table-ticket">
<?php
require_once('./PHP/database.php');
$db = new Database();
$all_tickets = $db->getAllTickets();
?>
<table class="table table-striped table-hover">
<thead>
<tr>
<th scope="col">Flight</th>
<th scope="col">From</th>
<th scope="col">To</th>
<th scope="col">Depart</th>
<th scope="col">Return</th>
<th scope="col">Adult</th>
<th scope="col">Child</th>
<th scope="col">Class</th>
<th scope="col">Delete</th>
</tr>
</thead>
<tbody>
<?php
foreach($all_tickets as $key => $ticket) {
echo '<tr id="' . $ticket['id'] .'">';
echo '<th scope="row">AC' . $ticket['id'] .'</th>';
echo '<td>' . $ticket['Origin'] . '</td>';
echo '<td>' . $ticket['Destination'] . '</td>';
echo '<td>' . $ticket['DepartDate'] . '</td>';
echo '<td>' . $ticket['ReturnDate'] . '</td>';
echo '<td>' . $ticket['Adult'] . '</td>';
echo '<td>' . $ticket['Child'] . '</td>';
echo '<td>' . $ticket['Class'] . '</td>';
echo '<td>' . '<button class="btn btn-success" onclick="deleteTicket(\'' . $ticket['id'] . '\')">Delete</button>' . '</td>';
echo '</tr>';
}
?>
</tbody>
</table>
</div>
<div class="info"></div>
</div>
<div class="banner my-2">
<img class="img-fluid" src="./images/banner.png" alt="banner">
</div>
<div class="container">
<h3 class="top-deal my-4">
Today's Top Deals
</h3>
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="3"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<div class="row">
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<img class="card-img-top images" src="./images/pink.png" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Cherry Blossom in Japan</h5>
<p class="card-text">
Each spring, the whole country seems to relax in the presence of ephemeral beauty.
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<img class="card-img-top images" src="./images/sakura.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Save in this sakura season!</h5>
<p class="card-text">
Enjoy the cherry blossoms at the right time this year for less.
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<img class="card-img-top images" src="./images/hotel.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Exclusive Japan Hotel Deals</h5>
<p class="card-text">
Ever wondered what lies beyond the crowded city of Tokyo?
</p>
</div>
</div>
</div>
</div>
</div>
<div class="carousel-item">
<div class="row">
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<img class="card-img-top images" src="./images/taiwan.png" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">The Island of Taiwan</h5>
<p class="card-text">
Escape the concrete jungle, and spend a few days in the China of your dreams.
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<img class="card-img-top images" src="./images/suzhou.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Escape to Suzhou</h5>
<p class="card-text">
Beautiful gardens, ancient pagodas and quaint - the Western view of China.
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<img class="card-img-top images" src="./images/jiangsu.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Plan your trip to Jiangsu</h5>
<p class="card-text">
Suzhou is famous for beautiful scenery and is known as “Venice of the East”.
</p>
</div>
</div>
</div>
</div>
</div>
<div class="carousel-item">
<div class="row">
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<img class="card-img-top images" src="./images/greatwall.png" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Great Wall of China</h5>
<p class="card-text">
Protect the Chinese empires against the invasions of the Eurasian Steppe.
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<img class="card-img-top images" src="./images/shanghai.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Global Financial Centre</h5>
<p class="card-text">
Grew in importance in the 19th century due to trade and economic potential.
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<img class="card-img-top images" src="./images/delhi.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">National Territory of Delhi</h5>
<p class="card-text">
Through history, Delhi has served as a capital of various kingdoms and empires.
</p>
</div>
</div>
</div>
</div>
</div>
<div class="carousel-item">
<div class="row">
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<img class="card-img-top images" src="./images/casablanca.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Morocco's chief port</h5>
<p class="card-text">
Casablanca is considered the economic and business center of Morocco.
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<img class="card-img-top images" src="./images/melbourne.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Melbourne Victoria</h5>
<p class="card-text">
Melbourne is the most populous city of the Australian state of Victoria.
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<img class="card-img-top images" src="./images/montego.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Montego Bay</h5>
<p class="card-text">
With numerous beach resorts and golf courses outside its commercial core.
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon carousel-icon" aria-hidden="true"></span>
<span class="sr-only previous">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon carousel-icon" aria-hidden="true"></span>
<span class="sr-only next">Next</span>
</a>
</div>
</div>
<div class="container-fluid">
<div class="subscribe ml-4">
<div class="row email-box">
<div class="col-3">
Get great deals delivered to your inbox!
</div>
<div class="col-4">
<div class="input-group mb-3">
<input type="text" class="form-control" placeholder="Email Address" aria-label="Recipient's username" aria-describedby="basic-addon2">
<div class="input-group-append">
<button class="btn btn-primary" type="button">Subscribe</button>
</div>
</div>
</div>
<div class="col-2">
Save up to <b>50%</b> with mobile-exclusive deals!
</div>
<div class="col">
<img src="./images/appStore.png" alt="AppStore">
<img src="./images/googlePlay.png" alt="GooglePlay">
</div>
</div>
</div>
</div>
<div class="container">
<h3 class="top-deal my-4">
Recommended Hotels
</h3>
<div class="hotel my-4">
<div class="btn-group btn-group-toggle" data-toggle="buttons">
<label class="btn btn-secondary btn-outline-success">
<input type="radio" name="options" id="option1" autocomplete="off" checked> Paris
</label>
<label class="btn btn-success btn-outline-success active">
<input type="radio" name="options" id="option2" autocomplete="off"> New York
</label>
<label class="btn btn-secondary btn-outline-success">
<input type="radio" name="options" id="option3" autocomplete="off"> Los Angeles
</label>
<label class="btn btn-secondary btn-outline-success">
<input type="radio" name="options" id="option4" autocomplete="off"> London
</label>
<label class="btn btn-secondary btn-outline-success">
<input type="radio" name="options" id="option5" autocomplete="off"> Shanghai
</label>
<label class="btn btn-secondary btn-outline-success">
<input type="radio" name="options" id="option6" autocomplete="off"> Hong Kong
</label>
<label class="btn btn-secondary btn-outline-success">
<input type="radio" name="options" id="option7" autocomplete="off"> Bangkok
</label>
<label class="btn btn-secondary btn-outline-success">
<input type="radio" name="options" id="option8" autocomplete="off"> Seoul
</label>
</div>
</div>
<!-- <div class="hotel">
<div class="btn-group" role="group" aria-label="Basic example">
<button type="button" class="btn btn-primary ">Paris</button>
<button type="button" class="btn btn-light ">New York</button>
<button type="button" class="btn btn-light ">Los Angeles</button>
<button type="button" class="btn btn-light">London</button>
<button type="button" class="btn btn-light">Shanghai</button>
<button type="button" class="btn btn-light">Hong Kong</button>
<button type="button" class="btn btn-light">Bangkok</button>
<button type="button" class="btn btn-light">Seoul</button>
</div>
</div> -->
<!-- <div class="row">
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<img class="card-img-top images" src="./images/1.png" alt="Card image cap">
<div class="card-body">
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<img class="card-img-top images" src="./images/2.png" alt="Card image cap">
<div class="card-body">
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<img class="card-img-top images" src="./images/3.png" alt="Card image cap">
<div class="card-body">
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<img class="card-img-top images" src="./images/4.png" alt="Card image cap">
<div class="card-body">
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<img class="card-img-top images" src="./images/5.png" alt="Card image cap">
<div class="card-body">
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<img class="card-img-top images" src="./images/6.png" alt="Card image cap">
<div class="card-body">
</div>
</div>
</div>
</div> -->
<div class="row hotels">
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<div class="overlay-label">
<span>
Latest booking 46 hrs ago
</span>
<span class="hotel-rank">
<i class="crown"></i>
<img src="./images/crown.png" alt="">
<span class="rank-num">1</span>
</span>
</div>
<img class="card-img-top images" src="./images/1.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Huatian Chinagora Paris</h5>
<div>
<i class="icon-star"></i>
</div>
<p class="card-text">
<div class="hotel-review">
<span class="hotel-score">4.5</span>
<span class="full-score">/5</span>
<span class="review-num">(12 reviews)</span>
</div>
<div class="hotel-price">
<span class="price-currency">CAD</span>
<span class="price-num">1,713</span>
</div>
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<div class="overlay-label">
<span>
Latest booking 34 hrs ago
</span>
<span class="hotel-rank">
<i class="crown"></i>
<img src="./images/crown.png" alt="">
<span class="rank-num">2</span>
</span>
</div>
<img class="card-img-top images" src="./images/2.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Champs Elysees Friedland</h5>
<div>
<i class="icon-star"></i>
</div>
<p class="card-text">
<div class="hotel-review">
<span class="hotel-score">4.2</span>
<span class="full-score">/5</span>
<span class="review-num">(56 reviews)</span>
</div>
<div class="hotel-price">
<span class="price-currency">CAD</span>
<span class="price-num">1,252</span>
</div>
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<div class="overlay-label">
<span>
Latest booking 26 hrs ago
</span>
<span class="hotel-rank">
<i class="crown"></i>
<img src="./images/crown.png" alt="">
<span class="rank-num">3</span>
</span>
</div>
<img class="card-img-top images" src="./images/3.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">The Bailey's Hotel London</h5>
<div>
<i class="icon-star"></i>
</div>
<p class="card-text">
<div class="hotel-review">
<span class="hotel-score">4.4</span>
<span class="full-score">/5</span>
<span class="review-num">(337 reviews)</span>
</div>
<div class="hotel-price">
<span class="price-currency">CAD</span>
<span class="price-num">851</span>
</div>
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<div class="overlay-label">
<span>
Latest booking 70 hrs ago
</span>
<span class="hotel-rank">
<i class="crown"></i>
<img src="./images/crown.png" alt="">
<span class="rank-num">4</span>
</span>
</div>
<img class="card-img-top images" src="./images/4.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Lit BANGKOK Hotel</h5>
<div>
<i class="icon-star"></i>
</div>
<p class="card-text">
<div class="hotel-review">
<span class="hotel-score">4.3</span>
<span class="full-score">/5</span>
<span class="review-num">(18 reviews)</span>
</div>
<div class="hotel-price">
<span class="price-currency">CAD</span>
<span class="price-num">1,493</span>
</div>
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<div class="overlay-label">
<span>
Latest booking 18 hrs ago
</span>
<span class="hotel-rank">
<i class="crown"></i>
<img src="./images/crown.png" alt="">
<span class="rank-num">5</span>
</span>
</div>
<img class="card-img-top images" src="./images/5.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Hotel Belleclaire</h5>
<div>
<i class="icon-star"></i>
</div>
<p class="card-text">
<div class="hotel-review">
<span class="hotel-score">4.6</span>
<span class="full-score">/5</span>
<span class="review-num">(20 reviews)</span>
</div>
<div class="hotel-price">
<span class="price-currency">CAD</span>
<span class="price-num">1,577</span>
</div>
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<div class="overlay-label">
<span>
Latest booking 6 hrs ago
</span>
<span class="hotel-rank">
<i class="crown"></i>
<img src="./images/crown.png" alt="">
<span class="rank-num">6</span>
</span>
</div>
<img class="card-img-top images" src="./images/6.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Hôtel California Elysées</h5>
<div>
<i class="icon-star"></i>
</div>
<p class="card-text">
<div class="hotel-review">
<span class="hotel-score">4.1</span>
<span class="full-score">/5</span>
<span class="review-num">(17 reviews)</span>
</div>
<div class="hotel-price">
<span class="price-currency">CAD</span>
<span class="price-num">1,472</span>
</div>
</p>
</div>
</div>
</div>
</div>
</div>
<div class="app-download my-5">
<div class="app-inner">
<div class="app-phone"></div>
<div class="app-content">
<div class="txt">
<p class="desc">
Save up to 50% With the Free Trip.com App!
</p>
</div>
<div class="qr-image">
<span class="qr-code"></span>
</div>
<div class="download-btns">
<a href="#" class="btn-appstore"></a>
<a href="#" class="btn-googleplay"></a>
<a href="#" class="btn-android"></a>
</div>
</div>
</div>
</div>
<div class="ft-channel">
<div class="ft-app">
<a href="#" class="ft-appstore">
<i></i>
</a>
<a href="#" class="ft-googleplay">
<i></i>
</a>
</div>
<div class="ft-media">
<a href="#" class="icon-facebook"></a>
<a href="#" class="icon-twitter"></a>
<a href="#" class="icon-youtube"></a>
<a href="#" class="icon-google"></a>
</div>
</div>
<!-- <div class="row footer-logo my-5">
<div class="col-2">
<a href="#" class="logo-pic">
<i class="iPhone"></i>
</a>
</div>
<div class="col-2">
<a href="#" class="logo-pic">
<i class="android"></i>
</a>
</div>
<div class="col-2">
<a href="#" class="facebook"></a>
</div>
<div class="col-2">
<a href="#" class="twitter"></a>
</div>
<div class="col-2">
<a href="#" class="youtube"></a>
</div>
<div class="col-2">
<a href="#" class="google"></a>
</div>
</div> -->
<br><br><br><br><br><br>
</main>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<!-- jQuery UI JS -->
<script src="//code.jquery.com/jquery-1.9.1.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script src="./js/yui-min.js"></script>
<script>
YUI({
modules: {
'trip-calendar': {
fullpath: './js/trip-calendar.js',
type : 'js',
requires: ['trip-calendar-css']
},
'trip-calendar-css': {
fullpath: './css/trip-calendar.css',
type : 'css'
}
}
}).use('trip-calendar', function(Y) {
var oCal = new Y.TripCalendar({
minDate : new Date, //最小时间限制
triggerNode : '#J_DepDate', //第一个触节点
finalTriggerNode: '#J_EndDate' //最后一个触发节点
});
//校验
Y.one('#J_Search').on('submit', function(e) {
e.halt();
var rDate = /^((19|2[01])\d{2})-(0?[1-9]|1[012])-(0?[1-9]|[12]\d|3[01])$/;
oDepDate = Y.one('#J_DepDate'),
oEndDate = Y.one('#J_EndDate'),
sDepDate = oDepDate.get('value'),
sEndDate = oEndDate.get('value'),
aMessage = ['请选择出发日期', '请选择返程日期', '返程时间不能早于出发时间,请重新选择', '日期格式错误'],
iError = -1;
switch(!0) {
case !sDepDate:
oDepDate.focus();
iError = 0;
break;
case !rDate.test(sDepDate):
oDepDate.focus();
iError = 3;
break;
case !sEndDate:
oEndDate.focus();
iError = 1;
break;
case !rDate.test(sEndDate):
oEndDate.focus();
iError = 3;
break;
case sDepDate.replace(/-/g, '') > sEndDate.replace(/-/g, ''):
oEndDate.focus();
iError = 2;
break;
};
if(iError > -1) {
this.set('message', aMessage[iError]).showMessage();
}
else {
// alert('开始时间:' + sDepDate + '\n返程时间:' + sEndDate);
}
}, oCal);
});
</script>
<script>
$(document).ready(function(){
$('#J_search_btn').click(function(){
var from = $('#tags').val();
var to = $('#to').val();
var departDate = $('#J_DepDate').val();
var returnDate = $('#J_EndDate').val();
var adult = $('#adult').val();
var child = $('#child').val();
var flightClass = $('#select_class').val();
$.post(
"http://192.168.33.10/Ticket Booking/PHP/insert.php",
{
"insert_from": from,
"insert_to": to,
"insert_departDate": departDate,
"insert_returnDate": returnDate,
"insert_adult": adult,
"insert_child": child,
"insert_flightClass": flightClass
},
function(data) {
if(data.message == 'A new ticket has been added successfully!') {
var id = $('tbody').children("tr:last-child").attr('id');
id++;
var insert = '<tr id="' + id + '">'+
'<th scope="row">AC' + id + '</th>' +
'<td>' + from + '</td>' +
'<td>' + to + '</td>' +
'<td>' + departDate + '</td>' +
'<td>' + returnDate + '</td>' +
'<td>' + adult + '</td>' +
'<td>' + child + '</td>' +
'<td>' + flightClass + '</td>' +
'<td>' + '<button class="btn btn-success" onclick="deleteTicket(\'' + id + '\')">Delete</button>' + '</td>' +
'</tr>';
$('tbody').append(insert);
$('.info').html(data.message);
} else {
$('.info').html(data.message);
}
},
"json"
);
});
$('.hotels .card').on({
mouseenter: function(){
$(this).addClass("border-primary");
},
mouseleave: function(){
$(this).removeClass("border-primary");
}
});
});
function deleteTicket(id) {
//ajax to connect backend
$.post(
"http://192.168.33.10/Ticket Booking/PHP/delete.php",
{
"delete_id": id
},
function(data) {
// console.log(data.message);
$('.info').html(data.message);
$('#' + id).hide();
},
"json"
);
}
</script>
<script>
$(function() {
var availableTags = [