-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathai_assistant.php
More file actions
2615 lines (2371 loc) · 112 KB
/
ai_assistant.php
File metadata and controls
2615 lines (2371 loc) · 112 KB
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
<?php
// ============================================================
// INTELE TOUR – AI TRAVEL ASSISTANT
// Full-featured: Chat, Session History, Trip Planner,
// Budget Calculator, Destination Quiz, Weather Widget,
// Popular Queries, Typing Simulation, Context Awareness
// ============================================================
session_start();
require_once 'database.php';
// ================================================================
// SECTION 1 — CHAT HISTORY TABLE (auto-create if not exists)
// ================================================================
$conn->query("
CREATE TABLE IF NOT EXISTS chat_history (
id INT AUTO_INCREMENT PRIMARY KEY,
session_key VARCHAR(100) NOT NULL,
user_id INT DEFAULT NULL,
sender ENUM('user','bot') NOT NULL,
message TEXT NOT NULL,
intent VARCHAR(80) DEFAULT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
INDEX idx_session (session_key),
INDEX idx_user (user_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
");
// ================================================================
// SECTION 2 — SESSION KEY MANAGEMENT
// ================================================================
if (empty($_SESSION['chat_session_key'])) {
$_SESSION['chat_session_key'] = 'chat_' . uniqid('', true);
}
$chat_key = $_SESSION['chat_session_key'];
$uid = $_SESSION['user_id'] ?? null;
// ================================================================
// SECTION 3 — KNOWLEDGE BASE (Packages, Destinations, FAQs)
// ================================================================
$packages_kb = [
'paris' => [
'name' => 'Paris, France',
'emoji' => '🗼',
'price' => 85000,
'duration' => '7 Days / 6 Nights',
'id' => 1,
'region' => 'Europe',
'best_for' => 'Romance, Culture, Art',
'best_time' => 'April – June, September – November',
'highlights'=> ['Eiffel Tower','Louvre Museum','Seine River Cruise','Versailles Palace','Montmartre'],
'tips' => 'Book Eiffel Tower tickets in advance. Best croissants at Du Pain et des Idées.',
'climate' => 'Mild summers (20°C), cold winters (5°C)',
'currency' => 'Euro (€)',
'visa' => 'Schengen Visa required for Indian passport holders',
],
'tokyo' => [
'name' => 'Tokyo, Japan',
'emoji' => '🏯',
'price' => 95000,
'duration' => '8 Days / 7 Nights',
'id' => 2,
'region' => 'Asia',
'best_for' => 'Adventure, Technology, Culture',
'best_time' => 'March – May (Cherry Blossom), October – November',
'highlights'=> ['Mount Fuji','Shibuya Crossing','Senso-ji Temple','Akihabara','Shinjuku'],
'tips' => 'Get an IC card (Suica) for easy transit. Try ramen at Ichiran.',
'climate' => 'Hot summers (30°C), cold winters (5°C)',
'currency' => 'Japanese Yen (¥)',
'visa' => 'Japan Visa required for Indian passport holders',
],
'bali' => [
'name' => 'Bali, Indonesia',
'emoji' => '🏝️',
'price' => 65000,
'duration' => '6 Days / 5 Nights',
'id' => 3,
'region' => 'Asia',
'best_for' => 'Beach, Wellness, Culture',
'best_time' => 'April – October (Dry Season)',
'highlights'=> ['Tanah Lot Temple','Ubud Rice Terraces','Seminyak Beach','Kecak Dance','Mount Batur'],
'tips' => 'Rent a scooter in Ubud. Bargain at Kuta Market.',
'climate' => 'Tropical (28°C average). Rainy Nov–Mar.',
'currency' => 'Indonesian Rupiah (IDR)',
'visa' => 'Visa on arrival for Indian passport holders (30 days)',
],
'dubai' => [
'name' => 'Dubai, UAE',
'emoji' => '🏙️',
'price' => 75000,
'duration' => '5 Days / 4 Nights',
'id' => 4,
'region' => 'Middle East',
'best_for' => 'Luxury, Shopping, Adventure',
'best_time' => 'November – March',
'highlights'=> ['Burj Khalifa','Desert Safari','Dubai Mall','Palm Jumeirah','Dubai Frame'],
'tips' => 'Dress modestly in older areas. Book desert safari in advance.',
'climate' => 'Very hot summers (45°C), pleasant winters (22°C)',
'currency' => 'UAE Dirham (AED)',
'visa' => 'Visa on arrival for Indian passport holders (30 days)',
],
'maldives' => [
'name' => 'Maldives',
'emoji' => '🌊',
'price' => 145000,
'duration' => '6 Days / 5 Nights',
'id' => 103,
'region' => 'Asia',
'best_for' => 'Luxury, Diving, Honeymoon',
'best_time' => 'November – April',
'highlights'=> ['Overwater Bungalows','Snorkeling','Coral Reefs','Dolphin Cruise','Sunset Fishing'],
'tips' => 'Book overwater villa early. Bring reef-safe sunscreen.',
'climate' => 'Tropical (29°C). Wet season May–October.',
'currency' => 'Maldivian Rufiyaa (MVR)',
'visa' => 'Free visa on arrival for all nationalities (30 days)',
],
'singapore' => [
'name' => 'Singapore',
'emoji' => '🌆',
'price' => 72000,
'duration' => '5 Days / 4 Nights',
'id' => 101,
'region' => 'Asia',
'best_for' => 'Family, Food, City Life',
'best_time' => 'February – April',
'highlights'=> ['Marina Bay Sands','Gardens by the Bay','Sentosa Island','Universal Studios','Hawker Centers'],
'tips' => 'Use MRT for getting around. Try Chicken Rice at Tian Tian.',
'climate' => 'Tropical (30°C all year). Rain anytime.',
'currency' => 'Singapore Dollar (SGD)',
'visa' => 'Visa required for Indian passport holders',
],
'london' => [
'name' => 'London, UK',
'emoji' => '🎡',
'price' => 98000,
'duration' => '7 Days / 6 Nights',
'id' => 104,
'region' => 'Europe',
'best_for' => 'History, Culture, Shopping',
'best_time' => 'June – August',
'highlights'=> ['Big Ben','Buckingham Palace','Tower of London','British Museum','Hyde Park'],
'tips' => 'Get Oyster card for tube travel. Visit free museums.',
'climate' => 'Mild (18°C summer), cold and rainy winters',
'currency' => 'British Pound (£)',
'visa' => 'UK Visa required for Indian passport holders',
],
'rome' => [
'name' => 'Rome, Italy',
'emoji' => '🏛️',
'price' => 88000,
'duration' => '7 Days / 6 Nights',
'id' => 107,
'region' => 'Europe',
'best_for' => 'History, Food, Art',
'best_time' => 'April – June, September – October',
'highlights'=> ['Colosseum','Vatican City','Trevi Fountain','Roman Forum','Borghese Gallery'],
'tips' => 'Book Vatican tour in advance. Try authentic cacio e pepe.',
'climate' => 'Hot summers (32°C), mild winters (10°C)',
'currency' => 'Euro (€)',
'visa' => 'Schengen Visa required for Indian passport holders',
],
'phuket' => [
'name' => 'Phuket, Thailand',
'emoji' => '⛵',
'price' => 55000,
'duration' => '6 Days / 5 Nights',
'id' => 106,
'region' => 'Asia',
'best_for' => 'Beach, Party, Budget Travel',
'best_time' => 'November – April',
'highlights'=> ['Phi Phi Islands','Patong Beach','Big Buddha','Elephant Sanctuary','Old Town'],
'tips' => 'Haggle at Chatuchak-style markets. Try Pad Thai on the street.',
'climate' => 'Tropical (33°C). Monsoon June–October.',
'currency' => 'Thai Baht (THB)',
'visa' => 'Visa on arrival for Indian passport holders (30 days)',
],
'newyork' => [
'name' => 'New York, USA',
'emoji' => '🗽',
'price' => 125000,
'duration' => '8 Days / 7 Nights',
'id' => 105,
'region' => 'Americas',
'best_for' => 'City Life, Entertainment, Shopping',
'best_time' => 'April – June, September – November',
'highlights'=> ['Times Square','Central Park','Statue of Liberty','Brooklyn Bridge','Broadway'],
'tips' => 'Buy NYC Pass for attractions. Walk the Brooklyn Bridge at sunset.',
'climate' => 'Hot summers (28°C), cold snowy winters (-2°C)',
'currency' => 'US Dollar ($)',
'visa' => 'B1/B2 Visa required for Indian passport holders',
],
'sydney' => [
'name' => 'Sydney, Australia',
'emoji' => '🦘',
'price' => 115000,
'duration' => '8 Days / 7 Nights',
'id' => 108,
'region' => 'Oceania',
'best_for' => 'Adventure, Nature, Beach',
'best_time' => 'September – November, March – May',
'highlights'=> ['Opera House','Harbour Bridge','Bondi Beach','Blue Mountains','Wildlife Park'],
'tips' => 'Opal card for trains. Try Tim Tams! Sunscreen essential.',
'climate' => 'Warm summers (26°C), mild winters (14°C)',
'currency' => 'Australian Dollar (AUD)',
'visa' => 'ETA Visa required for Indian passport holders',
],
'santorini' => [
'name' => 'Santorini, Greece',
'emoji' => '🏺',
'price' => 110000,
'duration' => '7 Days / 6 Nights',
'id' => 102,
'region' => 'Europe',
'best_for' => 'Romance, Photography, Wine',
'best_time' => 'May – October',
'highlights'=> ['Oia Sunset','Caldera Views','Volcanic Beach','Wine Tasting','Akrotiri Ruins'],
'tips' => 'Stay in Oia for the best sunset views. Book accommodation early.',
'climate' => 'Warm summers (28°C), mild winters (12°C)',
'currency' => 'Euro (€)',
'visa' => 'Schengen Visa required for Indian passport holders',
],
];
// ================================================================
// SECTION 4 — INTENT DETECTION ENGINE
// ================================================================
function detectIntent(string $msg): string {
$msg = strtolower($msg);
$intents = [
'greeting' => ['hi','hello','hey','good morning','good evening','good afternoon','howdy','namaste','hola','what\'s up','sup'],
'farewell' => ['bye','goodbye','see you','take care','thanks bye','ciao','au revoir'],
'thanks' => ['thank','thanks','thank you','thx','appreciate','awesome','great','perfect','wonderful','excellent','brilliant'],
'booking' => ['book','reserve','booking','how to book','want to book','buy package','purchase','confirm','reservation'],
'payment' => ['pay','payment','upi','gpay','credit card','debit card','net banking','cost','how much','price','charge','fee'],
'cancel' => ['cancel','cancellation','refund','money back','reschedule','change booking'],
'recommend' => ['recommend','suggest','best','which','where should','good place','where to go','help me choose','advice','advise','which package'],
'paris' => ['paris','france','eiffel','louvre','seine','versailles','montmartre'],
'tokyo' => ['tokyo','japan','fuji','shibuya','kyoto','osaka','anime','sushi','ramen'],
'bali' => ['bali','indonesia','ubud','seminyak','kuta','tanah lot','uluwatu','rice terrace'],
'dubai' => ['dubai','uae','burj','desert safari','palm','creek','emirates'],
'maldives' => ['maldives','overwater','atoll','coral','snorkel','dive','island resort'],
'singapore' => ['singapore','marina bay','sentosa','gardens by the bay','hawker','lion city'],
'london' => ['london','uk','england','big ben','buckingham','thames','tube','underground'],
'rome' => ['rome','italy','colosseum','vatican','trevi','pizza','pasta','roman'],
'phuket' => ['phuket','thailand','phi phi','patong','thai','bangkok','chiang mai'],
'newyork' => ['new york','nyc','manhattan','times square','broadway','central park','statue of liberty'],
'sydney' => ['sydney','australia','opera house','bondi','harbour bridge','kangaroo','koala'],
'santorini' => ['santorini','greece','oia','aegean','caldera','cyclades'],
'budget' => ['budget','cheap','affordable','low cost','economical','value','best deal','inexpensive','less money'],
'luxury' => ['luxury','premium','5 star','five star','lavish','high end','expensive','splurge'],
'visa' => ['visa','passport','travel document','entry','immigration','permit','customs'],
'weather' => ['weather','climate','temperature','when to visit','best time','season','monsoon','rain','cold','hot'],
'packing' => ['pack','packing','luggage','what to bring','clothes','carry','bag','essentials'],
'food' => ['food','eat','restaurant','cuisine','local food','dish','meal','street food','must try'],
'family' => ['family','kids','children','parents','grandparents','family trip','kid friendly'],
'honeymoon' => ['honeymoon','couple','romantic','anniversary','wedding trip','romance'],
'adventure' => ['adventure','trek','hiking','scuba','diving','extreme','outdoor','sports','bungee','rafting'],
'solo' => ['solo','alone','single traveler','by myself','solo trip','travelling alone'],
'group' => ['group','team','friends','gang','crew','large group','corporate','batch'],
'help' => ['help','support','contact','customer service','complaint','issue','problem','query'],
'packages_list'=> ['show packages','all packages','list packages','available packages','what packages','see all'],
'compare' => ['compare','difference','vs','versus','better','which is better'],
'trip_planner' => ['plan','itinerary','schedule','trip plan','day by day','day 1','plan my trip'],
'quiz' => ['quiz','suggest me','not sure','can\'t decide','help me pick','surprise me'],
'calculator' => ['calculator','calculate','total cost','how much will','estimate','total price'],
];
foreach ($intents as $intent => $keywords) {
foreach ($keywords as $kw) {
if (strpos($msg, $kw) !== false) return $intent;
}
}
return 'general';
}
// ================================================================
// SECTION 5 — AI RESPONSE ENGINE
// ================================================================
function generateBotResponse(string $msg, array $packages_kb, $conn, ?int $uid, string $chat_key): array {
$intent = detectIntent($msg);
$reply = '';
$extras = [];
switch ($intent) {
// ---- GREETINGS ----
case 'greeting':
$time = date('H');
$greet = $time < 12 ? 'Good morning' : ($time < 17 ? 'Good afternoon' : 'Good evening');
$reply = "👋 <strong>$greet!</strong> Welcome to <strong>InteleTour AI Assistant</strong>! 🌍<br><br>
I'm your personal travel guide powered by AI. I can help you:<br>
✈️ Discover dream destinations<br>
📦 Find the perfect travel package<br>
💰 Calculate your trip budget<br>
📋 Plan a day-by-day itinerary<br>
🌤️ Check best travel seasons<br>
🎯 Take a destination quiz<br><br>
<em>What kind of adventure are you dreaming of today?</em> 😊";
break;
// ---- FAREWELL ----
case 'farewell':
$reply = "👋 <strong>Safe travels!</strong> It was wonderful helping you plan your trip!<br><br>
Whenever you're ready to book or need more travel inspiration, I'm here 24/7. <br>
Have an amazing journey! ✈️🌏<br><br>
<em>Don't forget to check out our <a href='packages.php'>latest packages</a> before you go!</em>";
break;
// ---- THANKS ----
case 'thanks':
$replies = [
"😊 You're so welcome! Is there anything else I can help you explore? ✈️",
"🙏 Happy to help! Your dream trip is just a few clicks away. Need anything else?",
"🌟 Glad I could assist! Feel free to ask me anything about your travel plans!",
"✈️ Anytime! That's what I'm here for. Ready to book your adventure? 😊"
];
$reply = $replies[array_rand($replies)];
break;
// ---- BOOKING ----
case 'booking':
$reply = "📋 <strong>How to Book Your Dream Trip in 4 Steps:</strong><br><br>
<strong>Step 1 – Browse Packages</strong><br>
👉 Visit our <a href='packages.php'>Packages Page</a> and explore all destinations.<br><br>
<strong>Step 2 – Select & Click 'Book Now'</strong><br>
👉 Choose your preferred package and click the Book Now button.<br><br>
<strong>Step 3 – Fill Travel Details</strong><br>
👉 Enter your travel date and number of travelers. Total price auto-calculates.<br><br>
<strong>Step 4 – Complete Payment</strong><br>
👉 Pay securely via Credit Card, Debit Card, UPI, or Net Banking.<br><br>
✅ You'll receive an instant <strong>Transaction ID</strong> and booking confirmation!<br><br>
<em>Need help with a specific destination? Just ask! 😊</em>";
break;
// ---- PAYMENT ----
case 'payment':
$reply = "💳 <strong>Payment Methods We Accept:</strong><br><br>
💳 <strong>Credit Card</strong> – Visa, Mastercard, Amex<br>
🏧 <strong>Debit Card</strong> – All major Indian banks<br>
📱 <strong>UPI</strong> – GPay, PhonePe, Paytm, BHIM<br>
🏦 <strong>Net Banking</strong> – HDFC, SBI, ICICI, Axis, and 50+ banks<br><br>
🔒 <strong>Security Promise:</strong><br>
• SSL-encrypted transactions<br>
• PCI-DSS compliant payment gateway<br>
• Instant confirmation after payment<br>
• Unique Transaction ID for every booking<br><br>
💡 <em>Tip: UPI payments are fastest for confirmation!</em>";
break;
// ---- CANCELLATION ----
case 'cancel':
$reply = "🔄 <strong>Cancellation & Refund Policy:</strong><br><br>
📅 <strong>More than 30 days before travel:</strong><br>
→ Full refund minus 5% processing fee<br><br>
📅 <strong>15–30 days before travel:</strong><br>
→ 75% refund of total amount paid<br><br>
📅 <strong>7–14 days before travel:</strong><br>
→ 50% refund of total amount paid<br><br>
📅 <strong>Less than 7 days:</strong><br>
→ No refund (non-refundable)<br><br>
📋 <strong>How to Cancel:</strong><br>
→ Go to <a href='my_bookings.php'>My Bookings</a> → Select Booking → Cancel<br><br>
💬 <em>Need help with a cancellation? Contact us at support@inteletour.com</em>";
break;
// ---- RECOMMEND ----
case 'recommend':
$reply = "🌟 <strong>My Top Destination Recommendations:</strong><br><br>
🥇 <strong>Best Value</strong> → 🏝️ <a href='booking.php?id=3'>Bali</a> (₹65,000) – Beach, culture, temples<br>
🥈 <strong>Best for Romance</strong> → 🗼 <a href='booking.php?id=1'>Paris</a> (₹85,000) – The city of love<br>
🥉 <strong>Best for Luxury</strong> → 🌊 <a href='packages.php'>Maldives</a> (₹1,45,000) – Overwater paradise<br>
🏅 <strong>Best for Adventure</strong> → 🏯 <a href='booking.php?id=2'>Tokyo</a> (₹95,000) – Fuji & culture<br>
🎖️ <strong>Best for Families</strong> → 🌆 <a href='packages.php'>Singapore</a> (₹72,000) – Universal Studios<br>
⭐ <strong>Best for Shopping</strong> → 🏙️ <a href='booking.php?id=4'>Dubai</a> (₹75,000) – World-class malls<br><br>
🎯 <em>Want a personalised pick? Take our <strong>Destination Quiz</strong> below!</em>";
$extras['show_quiz_btn'] = true;
break;
// ---- DESTINATION SPECIFIC ----
case 'paris':
case 'tokyo':
case 'bali':
case 'dubai':
case 'maldives':
case 'singapore':
case 'london':
case 'rome':
case 'phuket':
case 'newyork':
case 'sydney':
case 'santorini':
$dest = $packages_kb[$intent];
$highlights = implode(', ', $dest['highlights']);
$tips_text = $dest['tips'];
$reply = "{$dest['emoji']} <strong>{$dest['name']}</strong><br><br>
📦 <strong>Package:</strong> {$dest['duration']} starting from <strong>₹" . number_format($dest['price']) . "</strong> per person<br>
🌍 <strong>Region:</strong> {$dest['region']}<br>
💡 <strong>Best For:</strong> {$dest['best_for']}<br>
📅 <strong>Best Time to Visit:</strong> {$dest['best_time']}<br>
🌤️ <strong>Climate:</strong> {$dest['climate']}<br>
💵 <strong>Currency:</strong> {$dest['currency']}<br>
🛂 <strong>Visa:</strong> {$dest['visa']}<br><br>
🗺️ <strong>Top Highlights:</strong><br>
" . implode('<br>', array_map(fn($h) => "• $h", $dest['highlights'])) . "<br><br>
💡 <strong>Travel Tip:</strong> {$tips_text}<br><br>
" . ($dest['id'] < 200 ? "<a href='booking.php?id={$dest['id']}' class='chat-book-btn'>📅 Book {$dest['name']} Now →</a>" : "<a href='packages.php' class='chat-book-btn'>📅 View Package →</a>");
break;
// ---- BUDGET ----
case 'budget':
$reply = "💰 <strong>Best Budget-Friendly Packages:</strong><br><br>
🏝️ <strong>Bali, Indonesia</strong> – ₹65,000 / person (6D/5N)<br>
→ Rice terraces, temples, beaches<br><br>
⛵ <strong>Phuket, Thailand</strong> – ₹55,000 / person (6D/5N)<br>
→ Phi Phi Islands, Patong Beach, nightlife<br><br>
🌆 <strong>Singapore</strong> – ₹72,000 / person (5D/4N)<br>
→ Marina Bay, Gardens, Universal Studios<br><br>
🏙️ <strong>Dubai</strong> – ₹75,000 / person (5D/4N)<br>
→ Desert Safari, Burj Khalifa, shopping<br><br>
💡 <em>All prices are per person, inclusive of hotel, transfers, and guided tours. No hidden charges!</em><br><br>
Want me to <strong>calculate the total cost</strong> for your group? Just tell me the number of travelers! 😊";
break;
// ---- LUXURY ----
case 'luxury':
$reply = "👑 <strong>Our Premium Luxury Packages:</strong><br><br>
🌊 <strong>Maldives</strong> – ₹1,45,000 / person (6D/5N)<br>
→ Overwater villa, seaplane transfer, all-inclusive<br><br>
🗽 <strong>New York</strong> – ₹1,25,000 / person (8D/7N)<br>
→ 5-star hotel, Broadway show, helicopter tour<br><br>
🦘 <strong>Sydney</strong> – ₹1,15,000 / person (8D/7N)<br>
→ Harbour view hotel, private tours<br><br>
🏺 <strong>Santorini</strong> – ₹1,10,000 / person (7D/6N)<br>
→ Clifftop villa, sunset cruise, wine tour<br><br>
🎡 <strong>London</strong> – ₹98,000 / person (7D/6N)<br>
→ West End show, Thames cruise, tea ceremony<br><br>
✨ <em>Premium packages include 5-star stays, private transfers, and personal tour guides.</em>";
break;
// ---- VISA ----
case 'visa':
$reply = "🛂 <strong>Visa Information for Indian Travelers:</strong><br><br>
✅ <strong>Visa on Arrival (Easy Entry):</strong><br>
• 🏝️ Bali, Indonesia – 30 days<br>
• 🏙️ Dubai, UAE – 30 days<br>
• ⛵ Phuket, Thailand – 30 days<br>
• 🌊 Maldives – All nationalities free<br><br>
📋 <strong>Visa Required (Apply in Advance):</strong><br>
• 🗼 Paris – Schengen Visa (15–30 days processing)<br>
• 🏛️ Rome – Schengen Visa<br>
• 🏺 Santorini – Schengen Visa<br>
• 🎡 London – UK Visa<br>
• 🗽 New York – B1/B2 US Visa<br>
• 🏯 Tokyo – Japan Visa<br>
• 🌆 Singapore – Singapore Visa<br>
• 🦘 Sydney – ETA Visa (online)<br><br>
📞 <em>Our team can assist with visa guidance. Contact support@inteletour.com</em>";
break;
// ---- WEATHER / BEST TIME ----
case 'weather':
$reply = "🌤️ <strong>Best Time to Visit – Destination Guide:</strong><br><br>
🗼 <strong>Paris</strong> – April–June & Sep–Nov (Pleasant, ~20°C)<br>
🏯 <strong>Tokyo</strong> – March–May (Cherry Blossom!) & Oct–Nov<br>
🏝️ <strong>Bali</strong> – April–October (Dry season, sunny beaches)<br>
🏙️ <strong>Dubai</strong> – November–March (Best weather, ~22°C)<br>
🌊 <strong>Maldives</strong> – November–April (Crystal clear water)<br>
🌆 <strong>Singapore</strong> – February–April (Driest months)<br>
🎡 <strong>London</strong> – June–August (Longest days, 18°C)<br>
🏛️ <strong>Rome</strong> – April–June & Sep–Oct (Best sightseeing)<br>
⛵ <strong>Phuket</strong> – November–April (No monsoon)<br>
🗽 <strong>New York</strong> – April–June & Sep–Nov (Perfect temp)<br>
🦘 <strong>Sydney</strong> – September–November (Spring, ~24°C)<br>
🏺 <strong>Santorini</strong> – May–October (Warm, scenic)<br><br>
❓ <em>Ask me about a specific destination for detailed weather info!</em>";
break;
// ---- PACKING ----
case 'packing':
$reply = "🎒 <strong>Universal Travel Packing Checklist:</strong><br><br>
📄 <strong>Documents:</strong><br>
• Passport + Visa + Flight tickets<br>
• Hotel vouchers + Travel insurance<br>
• Emergency contacts + InteleTour booking ID<br><br>
👕 <strong>Clothing (based on destination):</strong><br>
• Light cottons for Bali, Dubai, Singapore, Phuket<br>
• Layers and jackets for Paris, London, Tokyo<br>
• Modest clothing for religious sites<br>
• Swimwear for Maldives, Bali, Phuket<br><br>
💊 <strong>Health & Safety:</strong><br>
• Basic medicines + prescription drugs<br>
• Sunscreen (SPF 50+) for tropical destinations<br>
• Hand sanitizer, face masks, insect repellent<br><br>
🔌 <strong>Tech Essentials:</strong><br>
• Universal power adapter<br>
• Power bank (10,000 mAh+)<br>
• Offline maps downloaded<br>
• InteleTour app bookmarked<br><br>
💡 <em>Need a destination-specific packing list? Just ask!</em>";
break;
// ---- FOOD ----
case 'food':
$reply = "🍽️ <strong>Must-Try Foods by Destination:</strong><br><br>
🗼 <strong>Paris:</strong> Croissants, Crêpes, French Onion Soup, Escargot<br>
🏯 <strong>Tokyo:</strong> Ramen, Sushi, Tempura, Takoyaki, Matcha desserts<br>
🏝️ <strong>Bali:</strong> Nasi Goreng, Babi Guling, Mie Goreng, Satay<br>
🏙️ <strong>Dubai:</strong> Shawarma, Hummus, Machboos, Camel Burger<br>
🌆 <strong>Singapore:</strong> Chicken Rice, Laksa, Char Kway Teow, Chilli Crab<br>
⛵ <strong>Phuket:</strong> Pad Thai, Tom Yum, Mango Sticky Rice, Green Curry<br>
🏛️ <strong>Rome:</strong> Cacio e Pepe, Gelato, Tiramisu, Pizza Margherita<br>
🎡 <strong>London:</strong> Fish & Chips, Full English, Afternoon Tea, Pie<br>
🗽 <strong>New York:</strong> NY Pizza, Bagels, Hot Dogs, Cheesecake<br><br>
🌟 <em>Pro Tip: Always explore local street food — it's authentic and affordable!</em>";
break;
// ---- FAMILY ----
case 'family':
$reply = "👨👩👧👦 <strong>Top Family-Friendly Destinations:</strong><br><br>
🥇 <strong>Singapore</strong> (₹72,000/person)<br>
→ Universal Studios, SEA Aquarium, Night Safari, cable car rides<br><br>
🥈 <strong>Bali</strong> (₹65,000/person)<br>
→ Water parks, Elephant Riding, cultural shows, safe beaches<br><br>
🥉 <strong>Dubai</strong> (₹75,000/person)<br>
→ Legoland, Dubai Aquarium, IMG Worlds of Adventure, waterparks<br><br>
🏅 <strong>Phuket</strong> (₹55,000/person)<br>
→ Elephant sanctuary, cooking class, calm beaches, island boat trips<br><br>
💡 <strong>Family Travel Tips:</strong><br>
• Book non-stop flights for kids<br>
• Keep an extra day unplanned for rest<br>
• Pack medical kit & kids' snacks<br>
• Request connecting rooms when booking<br><br>
📞 <em>Contact us to customise a family package within your budget!</em>";
break;
// ---- HONEYMOON ----
case 'honeymoon':
$reply = "💑 <strong>Most Romantic Destinations for Couples:</strong><br><br>
🥇 <strong>Maldives</strong> – The Ultimate Honeymoon Destination<br>
→ Overwater bungalows, private beach dinners, snorkeling, sunset cruises<br>
💰 From ₹1,45,000/person<br><br>
🥈 <strong>Santorini, Greece</strong> – Europe's Most Romantic Island<br>
→ White-washed villas, caldera sunsets, wine tasting, volcanic beaches<br>
💰 From ₹1,10,000/person<br><br>
🥉 <strong>Paris, France</strong> – The City of Love<br>
→ Eiffel Tower by night, Seine dinner cruise, wine & cheese, art<br>
💰 From ₹85,000/person<br><br>
🏅 <strong>Bali, Indonesia</strong> – Tropical Romance<br>
→ Rice terrace walks, spa retreats, sunset at Tanah Lot, villas<br>
💰 From ₹65,000/person<br><br>
💝 <em>We offer special honeymoon add-ons: rose petals, private dinners, couples spa!</em>";
break;
// ---- ADVENTURE ----
case 'adventure':
$reply = "🧗 <strong>Top Adventure Destinations:</strong><br><br>
🏯 <strong>Tokyo/Japan</strong> – Mount Fuji hike, skiing in Hokkaido, zip-lining<br>
🏝️ <strong>Bali</strong> – Mount Batur sunrise trek, white water rafting, surfing<br>
⛵ <strong>Phuket</strong> – Scuba diving, rock climbing, ATV rides, deep sea fishing<br>
🦘 <strong>Sydney</strong> – BridgeClimb, shark diving, Blue Mountains hiking<br>
🌊 <strong>Maldives</strong> – Scuba diving, parasailing, jet-ski, submarine tour<br>
🗽 <strong>New York</strong> – Skydiving over Catskills, kayaking, urban exploration<br><br>
🎯 <strong>Adventure Add-Ons Available:</strong><br>
• Scuba diving certification courses<br>
• Guided mountain treks<br>
• Paragliding experiences<br>
• Safari day trips<br><br>
⚡ <em>Adventure packages can be customised — ask us for details!</em>";
break;
// ---- SOLO ----
case 'solo':
$reply = "🧳 <strong>Best Destinations for Solo Travelers:</strong><br><br>
🥇 <strong>Bali</strong> – Super safe, budget-friendly, vibrant hostel scene, yoga retreats<br>
🥈 <strong>Singapore</strong> – Extremely safe, English-speaking, easy to navigate alone<br>
🥉 <strong>Tokyo</strong> – Safe, efficient transport, amazing solo food spots<br>
🏅 <strong>Phuket</strong> – Fun nightlife, easy island hopping, social hostels<br>
⭐ <strong>London</strong> – English-speaking, excellent public transport, solo-friendly<br><br>
🛡️ <strong>Solo Travel Safety Tips:</strong><br>
• Share your itinerary with family<br>
• Register at local embassy portal<br>
• Keep digital copies of all documents<br>
• Buy comprehensive travel insurance<br>
• Download offline maps before going<br>
• Stay in well-reviewed hotels/hostels<br><br>
💪 <em>Solo travel is the most transformative experience. Go for it! ✈️</em>";
break;
// ---- GROUP ----
case 'group':
$reply = "👥 <strong>Planning a Group Trip?</strong><br><br>
We offer special <strong>group discounts</strong> for 10+ travelers!<br><br>
🎯 <strong>Best Group Destinations:</strong><br>
• 🏝️ Bali – Budget-friendly, fun activities for everyone<br>
• 🏙️ Dubai – Luxury group experience, desert safari, BBQ<br>
• 🌆 Singapore – Theme parks, city tours, diverse food<br>
• ⛵ Phuket – Island parties, beach activities, affordable<br><br>
💰 <strong>Group Discounts:</strong><br>
• 10–15 people → 8% off total price<br>
• 16–25 people → 12% off total price<br>
• 26+ people → 15% off + free group coordinator<br><br>
🎁 <strong>Group Add-Ons:</strong><br>
• Dedicated tour manager<br>
• Private coach transfers<br>
• Group meals & team activities<br><br>
📞 <em>Call +91 98765 43210 for custom group quotes!</em>";
break;
// ---- PACKAGES LIST ----
case 'packages_list':
$reply = "📦 <strong>All Available InteleTour Packages:</strong><br><br>";
$i = 1;
foreach ($packages_kb as $key => $p) {
$reply .= "{$p['emoji']} <strong>{$p['name']}</strong> – ₹" . number_format($p['price']) . " | {$p['duration']}<br>";
$i++;
}
$reply .= "<br>👉 <a href='packages.php'>View All Packages with Details →</a><br><br>
<em>Which destination would you like to know more about? 😊</em>";
break;
// ---- COMPARE ----
case 'compare':
$reply = "⚖️ <strong>Quick Package Comparison:</strong><br><br>
<table style='width:100%;font-size:12px;border-collapse:collapse;'>
<tr style='background:var(--primary);color:white;'>
<th style='padding:7px;text-align:left;'>Destination</th>
<th style='padding:7px;'>Price</th>
<th style='padding:7px;'>Duration</th>
<th style='padding:7px;'>Best For</th>
</tr>";
$alt = false;
foreach ($packages_kb as $p) {
$bg = $alt ? '#f8f9fa' : 'white';
$reply .= "<tr style='background:{$bg};'>
<td style='padding:7px;'>{$p['emoji']} {$p['name']}</td>
<td style='padding:7px;text-align:center;font-weight:700;color:var(--accent);'>₹" . number_format($p['price']) . "</td>
<td style='padding:7px;text-align:center;'>{$p['duration']}</td>
<td style='padding:7px;'>{$p['best_for']}</td>
</tr>";
$alt = !$alt;
}
$reply .= "</table><br>
💡 <em>Ask me about any specific destination for detailed info!</em>";
break;
// ---- TRIP PLANNER ----
case 'trip_planner':
// Check which destination from the message
$dest_found = null;
foreach ($packages_kb as $key => $p) {
if (strpos(strtolower($msg), $key) !== false) {
$dest_found = $key;
break;
}
}
if ($dest_found) {
$p = $packages_kb[$dest_found];
$reply = "{$p['emoji']} <strong>Sample Itinerary – {$p['name']}</strong><br><br>";
$days = (int)explode(' ', $p['duration'])[0];
for ($d = 1; $d <= min($days, count($p['highlights']) + 1); $d++) {
$highlight = $p['highlights'][$d - 1] ?? 'Leisure & shopping';
$reply .= "📅 <strong>Day $d:</strong> Explore {$highlight}<br>";
}
$reply .= "<br>💡 <em>This is a sample itinerary. We can customise it just for you!</em><br>
<a href='booking.php?id={$p['id']}' class='chat-book-btn'>Book {$p['name']} →</a>";
} else {
$reply = "📅 <strong>I'd love to plan your trip!</strong> Which destination are you planning for?<br><br>
Try asking: <em>'Plan a trip to Bali'</em> or <em>'Plan Tokyo itinerary'</em><br><br>
Available destinations: " . implode(', ', array_map(fn($p) => "{$p['emoji']} {$p['name']}", $packages_kb));
}
break;
// ---- BUDGET CALCULATOR ----
case 'calculator':
// Try to extract number from message
preg_match('/\d+/', $msg, $matches);
$travelers = !empty($matches) ? (int)$matches[0] : null;
if ($travelers && $travelers >= 1 && $travelers <= 50) {
$reply = "🧮 <strong>Price Estimate for $travelers Traveler(s):</strong><br><br>";
foreach ($packages_kb as $p) {
$total = $p['price'] * $travelers;
$reply .= "{$p['emoji']} <strong>{$p['name']}</strong> – ₹" . number_format($total) . " total<br>";
}
$reply .= "<br>💡 <em>Prices are per person x $travelers travelers. Includes hotel, transfer, and guided tours.</em>";
} else {
$reply = "🧮 <strong>Trip Budget Calculator</strong><br><br>
Tell me: <strong>How many travelers?</strong><br><br>
<em>Example: 'Calculate for 2 travelers' or 'Total cost for 4 people'</em><br><br>
I'll instantly show you the total cost for every destination! 💰";
}
break;
// ---- DESTINATION QUIZ ----
case 'quiz':
$reply = "🎯 <strong>Destination Quiz – Let Me Find Your Perfect Trip!</strong><br><br>
Answer these 3 quick questions and I'll match you with your ideal destination:<br><br>
<strong>Q1: What's your travel style?</strong><br>
Type: <em>a) Beach & Relax b) Adventure c) Culture & History d) Luxury e) City Life</em><br><br>
<strong>Q2: What's your budget per person?</strong><br>
Type: <em>a) Under ₹70K b) ₹70K–₹1L c) Above ₹1L</em><br><br>
<strong>Q3: Who are you traveling with?</strong><br>
Type: <em>a) Solo b) Couple c) Family d) Friends</em><br><br>
<em>🎲 Or just type 'Surprise me!' and I'll pick randomly!</em>";
$extras['show_quiz'] = true;
break;
// ---- HELP / SUPPORT ----
case 'help':
$reply = "🎧 <strong>InteleTour Customer Support</strong><br><br>
📧 <strong>Email:</strong> support@inteletour.com<br>
📱 <strong>Phone:</strong> +91 98765 43210<br>
🕐 <strong>Hours:</strong> Mon–Sat, 9 AM – 6 PM IST<br>
💬 <strong>AI Chat:</strong> Available 24/7 (that's me! 🤖)<br><br>
<strong>Quick Links:</strong><br>
📦 <a href='packages.php'>Browse Packages</a><br>
📋 <a href='my_bookings.php'>View My Bookings</a><br>
📝 <a href='register.php'>Create Account</a><br>
🔐 <a href='login.php'>Login</a><br><br>
<em>What issue can I help resolve for you today? 😊</em>";
break;
// ---- GENERAL FALLBACK ----
default:
// Check if the message contains a destination name as partial match
foreach ($packages_kb as $key => $p) {
if (stripos($msg, $key) !== false || stripos($msg, explode(',', $p['name'])[0]) !== false) {
return generateBotResponse($key, $packages_kb, $conn, $uid, $chat_key);
}
}
// Check for numbers (could be calculator query)
if (preg_match('/\b([2-9]|[1-9][0-9])\s*(people|persons?|travelers?|pax|adults?)\b/i', $msg)) {
return generateBotResponse("calculate $msg", $packages_kb, $conn, $uid, $chat_key);
}
$replies = [
"🤔 Interesting question! Let me help you better — could you be more specific?<br><br>
Here's what I can help with:<br>
🌍 Destination info & recommendations<br>
📦 Package details & pricing<br>
📋 Booking & payment guidance<br>
🌤️ Best travel seasons<br>
🧮 Trip budget calculator<br>
🎯 Destination quiz<br><br>
<em>Try asking: 'Tell me about Bali' or 'Best budget destination'</em>",
"💭 I'm not sure I understood that completely. Try rephrasing?<br><br>
Some things you can ask me:<br>
• <em>'What's the best time to visit Paris?'</em><br>
• <em>'Compare Bali and Dubai'</em><br>
• <em>'Plan a 5 day trip to Tokyo'</em><br>
• <em>'Calculate cost for 3 travelers'</em>",
"🌍 I'm your travel expert! Ask me anything about our destinations, packages, visa requirements, packing tips, or local food recommendations.<br><br>
<em>Or take our quick Destination Quiz to find your perfect match! 🎯</em>"
];
$reply = $replies[array_rand($replies)];
break;
}
return [
'reply' => $reply,
'intent' => $intent,
'extras' => $extras,
];
}
// ================================================================
// SECTION 6 — AJAX HANDLER (POST Request from JS)
// ================================================================
if (isset($_POST['ajax']) && $_POST['ajax'] === '1') {
header('Content-Type: application/json; charset=utf-8');
$user_msg = trim($_POST['message'] ?? '');
if (empty($user_msg)) {
echo json_encode(['reply' => 'Please type a message.', 'intent' => 'empty', 'extras' => []], JSON_UNESCAPED_UNICODE);
exit();
}
try {
$safe_msg = htmlspecialchars($user_msg, ENT_QUOTES, 'UTF-8');
$result = generateBotResponse($user_msg, $packages_kb, $conn, $uid, $chat_key);
$intent = (string)($result['intent'] ?? 'general');
$reply = (string)($result['reply'] ?? "I can help with destinations, pricing, bookings, and travel planning. Tell me what you want to plan.");
$extras = is_array($result['extras'] ?? null) ? $result['extras'] : [];
// Save chat history if DB insert is possible; do not fail response on write errors.
$senderUser = 'user';
if ($stmt = $conn->prepare("INSERT INTO chat_history (session_key, user_id, sender, message, intent) VALUES (?,?,?,?,?)")) {
$stmt->bind_param("sisss", $chat_key, $uid, $senderUser, $safe_msg, $intent);
$stmt->execute();
$stmt->close();
}
$senderBot = 'bot';
if ($stmt2 = $conn->prepare("INSERT INTO chat_history (session_key, user_id, sender, message, intent) VALUES (?,?,?,?,?)")) {
$stmt2->bind_param("sisss", $chat_key, $uid, $senderBot, $reply, $intent);
$stmt2->execute();
$stmt2->close();
}
echo json_encode([
'reply' => $reply,
'intent' => $intent,
'extras' => $extras,
], JSON_UNESCAPED_UNICODE);
exit();
} catch (Throwable $e) {
error_log('AI assistant AJAX error: ' . $e->getMessage());
echo json_encode([
'reply' => "I am still here. Ask me about destinations, budget, visa, itinerary, bookings, or payments and I will help right away.",
'intent' => 'general',
'extras' => [],
], JSON_UNESCAPED_UNICODE);
exit();
}
}
// ================================================================
// SECTION 7 — CLEAR CHAT HISTORY
// ================================================================
if (isset($_POST['clear_chat'])) {
if ($clearStmt = $conn->prepare("DELETE FROM chat_history WHERE session_key = ?")) {
$clearStmt->bind_param("s", $chat_key);
$clearStmt->execute();
$clearStmt->close();
}
$_SESSION['chat_session_key'] = 'chat_' . uniqid('', true);
header('Location: ai_assistant.php');
exit();
}
// ================================================================
// SECTION 8 — LOAD PREVIOUS CHAT HISTORY (last 30 messages)
// ================================================================
$history_stmt = $conn->prepare("
SELECT sender, message, created_at
FROM chat_history
WHERE session_key = ?
ORDER BY created_at ASC
LIMIT 30
");
$history_stmt->bind_param("s", $chat_key);
$history_stmt->execute();
$chat_history_result = $history_stmt->get_result();
$previous_chats = $chat_history_result->fetch_all(MYSQLI_ASSOC);
// ================================================================
// SECTION 9 — STATS (messages count, session age)
// ================================================================
$msg_count = count($previous_chats);
$session_start_time = !empty($previous_chats) ? $previous_chats[0]['created_at'] : date('Y-m-d H:i:s');
// ================================================================
// SECTION 10 — POPULAR QUICK TOPICS
// ================================================================
$quick_topics = [
['emoji' => '🌍', 'label' => 'Show all packages', 'msg' => 'Show all available packages'],
['emoji' => '🏝️', 'label' => 'Tell me about Bali', 'msg' => 'Tell me about Bali'],
['emoji' => '🗼', 'label' => 'Tell me about Paris', 'msg' => 'Tell me about Paris'],
['emoji' => '🏙️', 'label' => 'Tell me about Dubai', 'msg' => 'Tell me about Dubai'],
['emoji' => '💰', 'label' => 'Budget destinations', 'msg' => 'What are the best budget destinations?'],
['emoji' => '👑', 'label' => 'Luxury packages', 'msg' => 'Show me luxury travel packages'],
['emoji' => '💑', 'label' => 'Honeymoon ideas', 'msg' => 'Best honeymoon destinations'],
['emoji' => '👨👩👧', 'label' => 'Family trips', 'msg' => 'Best family-friendly destinations'],
['emoji' => '🧗', 'label' => 'Adventure travel', 'msg' => 'Best adventure travel destinations'],
['emoji' => '🌤️', 'label' => 'Best travel seasons', 'msg' => 'When is the best time to visit each destination?'],
['emoji' => '🛂', 'label' => 'Visa information', 'msg' => 'Tell me about visa requirements'],
['emoji' => '🎒', 'label' => 'Packing tips', 'msg' => 'What should I pack for my trip?'],
['emoji' => '🍽️', 'label' => 'Local food guide', 'msg' => 'What local food should I try?'],
['emoji' => '📋', 'label' => 'How to book', 'msg' => 'How do I book a package?'],
['emoji' => '💳', 'label' => 'Payment options', 'msg' => 'What payment methods do you accept?'],
['emoji' => '🔄', 'label' => 'Cancellation policy', 'msg' => 'What is the cancellation policy?'],
['emoji' => '🎯', 'label' => 'Destination quiz', 'msg' => 'Take me through the destination quiz'],
['emoji' => '🧮', 'label' => 'Calculate trip cost', 'msg' => 'Calculate total cost for 2 travelers'],
['emoji' => '🧳', 'label' => 'Solo travel tips', 'msg' => 'Best destinations for solo travelers'],
['emoji' => '👥', 'label' => 'Group travel deals', 'msg' => 'Tell me about group travel discounts'],
];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="InteleTour AI Travel Assistant – Your intelligent 24/7 travel planning companion. Get personalised destination recommendations, itinerary planning, and booking guidance.">
<title>AI Travel Assistant – InteleTour</title>
<link rel="stylesheet" href="style.css">
<style>
/* ============================================================
AI ASSISTANT PAGE – FULL STYLESHEET
============================================================ */
/* Page Layout */
.ai-page-wrapper {
max-width: 1400px;
margin: 0 auto;
padding: 40px 24px 80px;
display: grid;
grid-template-columns: 300px 1fr 280px;
gap: 28px;
align-items: start;
}
/* ---- LEFT SIDEBAR ---- */
.ai-sidebar-left {
position: sticky;
top: 90px;
}
.ai-sidebar-card {
background: white;
border-radius: 14px;
box-shadow: 0 4px 20px rgba(0,0,0,0.09);
overflow: hidden;
margin-bottom: 20px;
}
.ai-sidebar-card-header {
background: linear-gradient(135deg, var(--dark), var(--primary));
color: white;
padding: 14px 18px;
font-size: 14px;
font-weight: 700;
display: flex;
align-items: center;
gap: 8px;
}
.ai-sidebar-card-body {
padding: 16px;
}
/* Quick Topics */
.quick-topics-list {
display: flex;
flex-direction: column;
gap: 6px;
}
.quick-topic-btn {
background: var(--light);
border: 1.5px solid rgba(0,119,182,0.15);
border-radius: 8px;
padding: 9px 12px;
font-size: 13px;
font-weight: 500;
color: var(--dark);
cursor: pointer;
text-align: left;
transition: all 0.25s;
display: flex;
align-items: center;
gap: 8px;
width: 100%;
}
.quick-topic-btn:hover {
background: var(--primary);
color: white;
border-color: var(--primary);
transform: translateX(4px);
}
/* Session Info */
.session-info {
display: flex;
flex-direction: column;
gap: 10px;
}
.session-stat {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 12px;
background: var(--light);
border-radius: 8px;
font-size: 13px;
}
.session-stat span:first-child { color: var(--gray); }
.session-stat span:last-child { font-weight: 700; color: var(--dark); }
/* Destination Pills */
.dest-pills {
display: flex;
flex-wrap: wrap;
gap: 7px;
}
.dest-pill {
background: white;
border: 1.5px solid var(--primary);
color: var(--primary);
padding: 5px 12px;
border-radius: 20px;
font-size: 12px;
font-weight: 600;
cursor: pointer;
transition: all 0.25s;
}
.dest-pill:hover {