📁 File Manager
Editing:
/home/wvl7mof7402e/www/wingstourandtravels.com/book.php
<?php require_once __DIR__ . '/db_config.php'; require_once __DIR__ . '/header.php'; $msg = ""; $msg_type = ""; $booking_columns = [ 'pickup' => 'VARCHAR(255) NULL', 'departure' => 'VARCHAR(255) NULL', 'weight_info' => 'TEXT NULL', 'food' => 'VARCHAR(255) NULL', 'special_request' => 'TEXT NULL', ]; $existing_columns_result = $conn->query("SHOW COLUMNS FROM `enquiries`"); if (!$existing_columns_result) { die("Database Error: Unable to inspect enquiries table: " . $conn->error); } $existing_columns = []; while ($column = $existing_columns_result->fetch_assoc()) { $existing_columns[$column['Field']] = true; } foreach ($booking_columns as $column_name => $column_definition) { if (!isset($existing_columns[$column_name])) { $alter_query = "ALTER TABLE `enquiries` ADD COLUMN `$column_name` $column_definition"; if (!$conn->query($alter_query)) { die("Database Error: Unable to add enquiries column `$column_name`: " . $conn->error); } } } // Form Submission Processing Block if ($_SERVER["REQUEST_METHOD"] == "POST") { // Form Inputs Receive Aur Clean Karein $travel_date = !empty($_POST['travel_date']) ? mysqli_real_escape_string($conn, $_POST['travel_date']) : NULL; $passengers = !empty($_POST['passengers']) ? intval($_POST['passengers']) : 1; $pickup = isset($_POST['pickup']) ? mysqli_real_escape_string($conn, trim($_POST['pickup'])) : ''; $departure = isset($_POST['departure']) ? mysqli_real_escape_string($conn, trim($_POST['departure'])) : ''; $name = isset($_POST['name']) ? mysqli_real_escape_string($conn, trim($_POST['name'])) : ''; $phone = isset($_POST['phone']) ? mysqli_real_escape_string($conn, trim($_POST['phone'])) : ''; $email = isset($_POST['email']) ? mysqli_real_escape_string($conn, trim($_POST['email'])) : ''; $city = isset($_POST['city']) ? mysqli_real_escape_string($conn, trim($_POST['city'])) : ''; $weight_info = isset($_POST['weight_info']) ? mysqli_real_escape_string($conn, trim($_POST['weight_info'])) : ''; $food = isset($_POST['food']) ? mysqli_real_escape_string($conn, trim($_POST['food'])) : ''; $special_request = isset($_POST['special_request']) ? mysqli_real_escape_string($conn, trim($_POST['special_request'])) : ''; if (!empty($name) && !empty($phone) && !empty($email) && !empty($travel_date)) { // SQL Prepare Statement $sql = "INSERT INTO enquiries (name, phone, email, city, travel_date, passengers, pickup, departure, weight_info, food, special_request) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; $stmt = $conn->prepare($sql); // SQL Prepare check - agar query/table me gadbad ho toh fatal error aane se bachega if ($stmt === false) { die("Database Error (Prepare Failed): " . $conn->error . " <br><br><b>Tip:</b> Apne MySQL Table me ye sabhi columns check karein: <i>name, phone, email, city, travel_date, passengers, pickup, departure, weight_info, food, special_request</i>"); } // Bind Parameters (11 parameters: s = string, i = integer) $stmt->bind_param("sssssisssss", $name, $phone, $email, $city, $travel_date, $passengers, $pickup, $departure, $weight_info, $food, $special_request); if ($stmt->execute()) { $msg = "Aapki booking request safaltapoorvak submit ho gayi hai! Hum aapse jaldi hi sampark karenge."; $msg_type = "success"; } else { $msg = "Query Execution Failed: " . $stmt->error; $msg_type = "danger"; } $stmt->close(); } else { $msg = "Kripya sabhi zaroori fields (* wale) sahi se bharein."; $msg_type = "danger"; } } ?> <style> /* ========================================================= BOOKING PAGE ========================================================= */ :root { --book-primary: #0d47a1; --book-secondary: #1565c0; --book-accent: #f59e0b; --book-dark: #102a43; --book-text: #334e68; --book-muted: #627d98; --book-light: #f5f8fc; --book-border: #d9e2ec; --book-white: #ffffff; --book-success: #16825d; } *{box-sizing:border-box} /* ---------- PAGE ---------- */ .book-page { background: #f7f9fc; color: var(--book-text); overflow-x: hidden; } /* ---------- ALERT MESSAGES ---------- */ .form-alert { padding: 15px; border-radius: 10px; margin-bottom: 25px; font-size: 14px; font-weight: 600; } .form-alert.success { background-color: #d1e7dd; color: #0f5132; border: 1px solid #badbcc; } .form-alert.danger { background-color: #f8d7da; color: #842029; border: 1px solid #f5c2c7; } /* ---------- HERO ---------- */ .book-hero { position: relative; min-height: 430px; display: flex; align-items: center; background: linear-gradient( 90deg, rgba(5, 25, 55, 0.92) 0%, rgba(5, 25, 55, 0.78) 45%, rgba(5, 25, 55, 0.35) 100% ), url('image/chardham-banner.jpg') center/cover no-repeat; } .book-hero-inner { width: min(1180px, calc(100% - 40px)); margin: auto; padding: 80px 0; } .book-breadcrumb { display: flex; align-items: center; gap: 9px; margin-bottom: 20px; color: rgba(255,255,255,0.78); font-size: 14px; } .book-breadcrumb a { color: #fff; text-decoration: none; } .book-breadcrumb i { font-size: 10px; } .book-hero h1 { max-width: 780px; margin: 0 0 18px; color: #fff; font-size: clamp(32px, 5vw, 64px); line-height: 1.08; font-weight: 800; letter-spacing: -1.5px; } .book-hero p { max-width: 700px; margin: 0; color: rgba(255,255,255,0.9); font-size: clamp(14px, 2vw, 18px); line-height: 1.75; } /* ---------- MAIN ---------- */ .book-main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 75px 0 90px; } .book-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.9fr); gap: 30px; align-items: start; } /* ---------- FORM CARD ---------- */ .booking-card { background: var(--book-white); border: 1px solid #e5ebf2; border-radius: 24px; padding: 36px; box-shadow: 0 18px 50px rgba(16, 42, 67, 0.08); } .section-heading { margin-bottom: 30px; } .section-heading .small-label { display: inline-flex; align-items: center; gap: 8px; color: var(--book-primary); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 10px; } .section-heading h2 { margin: 0 0 8px; color: var(--book-dark); font-size: clamp(22px, 3.5vw, 30px); line-height: 1.2; } .section-heading p { margin: 0; color: var(--book-muted); line-height: 1.7; font-size: 15px; } /* ---------- FORM SECTIONS ---------- */ .form-section { margin-bottom: 34px; padding-bottom: 32px; border-bottom: 1px solid #e8edf3; } .form-section:last-of-type { border-bottom: 0; margin-bottom: 10px; padding-bottom: 0; } .form-section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; } .form-section-icon { width: 42px; height: 42px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: #edf5ff; color: var(--book-primary); } .form-section-title h3 { margin: 0; color: var(--book-dark); font-size: 19px; } .form-section-title span { display: block; margin-top: 3px; color: var(--book-muted); font-size: 13px; } /* ---------- GRID ---------- */ .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px; } .form-group { display: flex; flex-direction: column; } .form-group.full { grid-column: 1 / -1; } .form-group label { margin-bottom: 8px; color: #243b53; font-size: 14px; font-weight: 700; } .required { color: #dc2626; } .form-group input, .form-group select, .form-group textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--book-border); border-radius: 12px; background: #fff; color: #243b53; padding: 13px 14px; font-family: inherit; font-size: 15px; outline: none; transition: all 0.2s ease; } .form-group input, .form-group select { min-height: 49px; } .form-group textarea { min-height: 120px; resize: vertical; } .form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--book-secondary); box-shadow: 0 0 0 4px rgba(21, 101, 192, 0.09); } .form-help { margin-top: 6px; color: #829ab1; font-size: 12px; line-height: 1.5; } /* ---------- PACKAGE INFO ---------- */ .package-summary { position: sticky; top: 25px; } .package-card { overflow: hidden; background: #fff; border: 1px solid #e4eaf1; border-radius: 22px; box-shadow: 0 18px 45px rgba(16, 42, 67, 0.08); } .package-top { padding: 28px; background: linear-gradient( 135deg, #0d47a1, #1565c0 ); color: #fff; } .package-top .tag { display: inline-flex; padding: 6px 10px; margin-bottom: 13px; border-radius: 30px; background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.18); font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; } .package-top h3 { margin: 0 0 9px; font-size: 25px; } .package-top p { margin: 0; color: rgba(255,255,255,0.84); font-size: 14px; line-height: 1.65; } .package-body { padding: 25px; } .package-route { display: flex; align-items: center; gap: 10px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid #e8edf3; } .route-point { color: var(--book-dark); font-size: 13px; font-weight: 800; } .route-line { flex: 1; height: 1px; background: #d8e1eb; position: relative; } .route-line::after { content: ""; position: absolute; top: 50%; right: 0; width: 6px; height: 6px; transform: translateY(-50%); border-radius: 50%; background: var(--book-accent); } .package-features { display: grid; gap: 14px; } .package-feature { display: flex; align-items: flex-start; gap: 12px; } .package-feature i { width: 32px; height: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 9px; background: #edf8f4; color: var(--book-success); font-size: 13px; } .package-feature strong { display: block; margin-bottom: 2px; color: #243b53; font-size: 14px; } .package-feature span { display: block; color: var(--book-muted); font-size: 12px; line-height: 1.45; } /* ---------- IMPORTANT NOTE ---------- */ .booking-note { display: flex; gap: 12px; margin-top: 20px; padding: 15px; border: 1px solid #f4dfac; border-radius: 13px; background: #fffaf0; color: #76520a; font-size: 12px; line-height: 1.6; } .booking-note i { margin-top: 3px; color: #d18b00; } /* ---------- CONSENT ---------- */ .consent-box { display: flex; align-items: flex-start; gap: 10px; margin: 25px 0; padding: 15px; border-radius: 12px; background: #f7f9fc; } .consent-box input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--book-primary); cursor: pointer; } .consent-box label { color: #52677d; font-size: 13px; line-height: 1.55; cursor: pointer; } .consent-box a { color: var(--book-primary); font-weight: 700; text-decoration: none; } /* ---------- BUTTON ---------- */ .book-submit { width: 100%; min-height: 55px; border: 0; border-radius: 13px; background: linear-gradient(135deg, #0d47a1, #1565c0); color: #fff; font-family: inherit; font-size: 16px; font-weight: 800; cursor: pointer; box-shadow: 0 12px 25px rgba(13, 71, 161, 0.22); transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease; } .book-submit:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(13, 71, 161, 0.28); } .book-submit i { margin-right: 8px; } /* ---------- CONTACT HELP ---------- */ .help-card { margin-top: 20px; padding: 22px; border-radius: 20px; background: #102a43; color: #fff; } .help-card h4 { margin: 0 0 7px; font-size: 18px; } .help-card p { margin: 0 0 16px; color: rgba(255,255,255,0.72); font-size: 13px; line-height: 1.6; } .help-link { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; } /* ---------- RESPONSIVE MEDIA QUERIES ---------- */ @media (max-width: 950px) { .book-layout { grid-template-columns: 1fr; } .package-summary { position: static; } .package-card { max-width: 100%; } } @media (max-width: 700px) { .book-hero { min-height: auto; } .book-hero-inner { width: min(100% - 30px, 1180px); padding: 50px 0; } .book-main { width: min(100% - 30px, 1180px); padding: 40px 0 60px; } .booking-card { padding: 24px 18px; border-radius: 18px; } .form-grid { grid-template-columns: 1fr; gap: 17px; } .form-group.full { grid-column: auto; } .package-top, .package-body { padding: 20px 18px; } } @media (max-width: 480px) { .book-hero-inner { padding: 40px 0; } .book-breadcrumb { font-size: 12px; } .book-main { width: calc(100% - 24px); padding-top: 30px; } .booking-card { padding: 20px 15px; } .form-section { margin-bottom: 25px; padding-bottom: 25px; } .form-section-title h3 { font-size: 17px; } .form-section-icon { width: 36px; height: 36px; font-size: 14px; } .package-top h3 { font-size: 21px; } .consent-box { padding: 12px; } .consent-box label { font-size: 12px; } .booking-note { flex-direction: column; gap: 6px; } } </style> <div class="book-page"> <!-- HERO --> <section class="book-hero"> <div class="book-hero-inner"> <div class="book-breadcrumb"> <a href="index.php">Home</a> <i class="fas fa-chevron-right"></i> <span>Book Your Yatra</span> </div> <h1>Book Your Chardham Yatra</h1> <p> Share your travel details with us and our team will assist you with the next steps for your Chardham helicopter journey. </p> </div> </section> <!-- MAIN BOOKING AREA --> <main class="book-main"> <div class="book-layout"> <!-- BOOKING FORM --> <div class="booking-card"> <div class="section-heading"> <div class="small-label"> <i class="fas fa-paper-plane"></i> Booking Request </div> <h2>Plan Your Yatra</h2> <p> Please provide the required details below. Our team can use this information to assist you with your booking request. </p> </div> <!-- Alert Messages Display --> <?php if (!empty($msg)): ?> <div class="form-alert <?php echo $msg_type; ?>"> <?php echo $msg; ?> </div> <?php endif; ?> <form method="post" action=""> <!-- TRAVEL DETAILS --> <div class="form-section"> <div class="form-section-title"> <div class="form-section-icon"> <i class="fas fa-route"></i> </div> <div> <h3>Travel Details</h3> <span>Your preferred journey information</span> </div> </div> <div class="form-grid"> <div class="form-group"> <label for="travel_date"> Preferred Travel Date <span class="required">*</span> </label> <input type="date" id="travel_date" name="travel_date" required > </div> <div class="form-group"> <label for="passengers"> Number of Passengers <span class="required">*</span> </label> <select id="passengers" name="passengers" required > <option value="">Select passengers</option> <option value="1">1 Passenger</option> <option value="2">2 Passengers</option> <option value="3">3 Passengers</option> <option value="4">4 Passengers</option> <option value="5">5 Passengers</option> <option value="6">6 Passengers</option> <option value="7">7 Passengers</option> <option value="8">8 Passengers</option> <option value="9">9 Passengers</option> <option value="10">10 Passengers</option> </select> </div> <div class="form-group"> <label for="pickup"> Arrival / Pickup Point </label> <select id="pickup" name="pickup"> <option value="">Select option</option> <option value="Dehradun Airport">Dehradun Airport</option> <option value="Dehradun Railway Station">Dehradun Railway Station</option> <option value="Dehradun Bus Stand">Dehradun Bus Stand</option> <option value="Own Arrangement">Own Arrangement</option> </select> <span class="form-help"> Arrival/pickup arrangements are subject to the applicable itinerary and timings. </span> </div> <div class="form-group"> <label for="departure"> Departure / Drop Preference </label> <select id="departure" name="departure"> <option value="">Select option</option> <option value="Dehradun Airport">Dehradun Airport</option> <option value="Dehradun Railway Station">Dehradun Railway Station</option> <option value="Dehradun Bus Stand">Dehradun Bus Stand</option> <option value="Own Arrangement">Own Arrangement</option> </select> </div> </div> </div> <!-- CONTACT DETAILS --> <div class="form-section"> <div class="form-section-title"> <div class="form-section-icon"> <i class="fas fa-user"></i> </div> <div> <h3>Lead Passenger Details</h3> <span>Primary contact information</span> </div> </div> <div class="form-grid"> <div class="form-group"> <label for="name"> Full Name <span class="required">*</span> </label> <input type="text" id="name" name="name" placeholder="Enter full name" autocomplete="name" required > </div> <div class="form-group"> <label for="phone"> Mobile Number <span class="required">*</span> </label> <input type="tel" id="phone" name="phone" placeholder="Enter mobile number" autocomplete="tel" required > </div> <div class="form-group"> <label for="email"> Email Address <span class="required">*</span> </label> <input type="email" id="email" name="email" placeholder="Enter email address" autocomplete="email" required > </div> <div class="form-group"> <label for="city"> City </label> <input type="text" id="city" name="city" placeholder="Enter your city" autocomplete="address-level2" > </div> </div> </div> <!-- PASSENGER INFORMATION --> <div class="form-section"> <div class="form-section-title"> <div class="form-section-icon"> <i class="fas fa-users"></i> </div> <div> <h3>Passenger Information</h3> <span>Additional information for your group</span> </div> </div> <div class="form-grid"> <div class="form-group"> <label for="weight_info"> Passenger Weight Information </label> <input type="text" id="weight_info" name="weight_info" placeholder="e.g. Approx. weight details" > <span class="form-help"> Passenger body weight is taken as part of the operational process. </span> </div> <div class="form-group"> <label for="food"> Food Preference </label> <select id="food" name="food"> <option value="">Select preference</option> <option value="Regular">Regular</option> <option value="Jain">Jain</option> </select> <span class="form-help"> Jain food availability is subject to the applicable arrangements. </span> </div> <div class="form-group full"> <label for="special_request"> Special Request / Additional Information </label> <textarea id="special_request" name="special_request" placeholder="Mention any important requirement or additional information..." ></textarea> </div> </div> </div> <!-- TERMS --> <div class="consent-box"> <input type="checkbox" id="terms" name="terms" required > <label for="terms"> I confirm that the information provided above is correct and I understand that the final booking, itinerary, timings and operational arrangements are subject to availability, weather, permissions and applicable conditions. </label> </div> <button type="submit" class="book-submit" > <i class="fas fa-paper-plane"></i> Submit Booking Request </button> </form> </div> <!-- PACKAGE SUMMARY --> <aside class="package-summary"> <div class="package-card"> <div class="package-top"> <span class="tag">Chardham Yatra</span> <h3>5 Nights / 6 Days</h3> <p> Helicopter journey covering the four sacred Dhams of Uttarakhand. </p> </div> <div class="package-body"> <div class="package-route"> <span class="route-point">Dehradun</span> <div class="route-line"></div> <span class="route-point">Badrinath</span> </div> <div class="package-features"> <div class="package-feature"> <i class="fas fa-helicopter"></i> <div> <strong>Helicopter Journey</strong> <span>Helicopter flying as per the applicable itinerary.</span> </div> </div> <div class="package-feature"> <i class="fas fa-hotel"></i> <div> <strong>Accommodation</strong> <span>Stay arrangements across the planned journey.</span> </div> </div> <div class="package-feature"> <i class="fas fa-utensils"></i> <div> <strong>Meals</strong> <span>Meals are included as per the package arrangements.</span> </div> </div> <div class="package-feature"> <i class="fas fa-mountain"></i> <div> <strong>Local Sightseeing</strong> <span>Local sightseeing as mentioned in the itinerary.</span> </div> </div> <div class="package-feature"> <i class="fas fa-shuttle-van"></i> <div> <strong>Transfers & Shuttle</strong> <span>Applicable transfers and Kedarnath shuttle arrangements.</span> </div> </div> <div class="package-feature"> <i class="fas fa-receipt"></i> <div> <strong>Applicable Taxes</strong> <span>Taxes included according to package terms.</span> </div> </div> </div> <div class="booking-note"> <i class="fas fa-circle-info"></i> <div> <strong>Important:</strong> Flight timings and operations may change due to weather, visibility, permissions, VVIP movements, NOTAMs, technical or other operational conditions. </div> </div> </div> </div> <!-- HELP CARD --> <div class="help-card"> <h4>Need Assistance?</h4> <p> If you have questions before submitting your booking request, visit our contact page and connect with the travel team. </p> <a href="contact.php" class="help-link"> Contact Us <i class="fas fa-arrow-right"></i> </a> </div> </aside> </div> </main> </div> <?php require_once __DIR__ . '/footer.php'; ?>
Save
Cancel