Advertisement
eightmoons

mainbookingpage.php

May 12th, 2021
732
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 9.13 KB | None | 0 0
  1. <?php
  2. require_once('db.php');
  3. ?>
  4.  
  5. <!doctype html>
  6. <html class="no-js" lang="zxx">
  7.  
  8. <head>
  9.  
  10.     <meta charset="utf-8">
  11.     <meta http-equiv="x-ua-compatible" content="ie=edge">
  12.     <title>Booking | Odyssey</title>
  13.     <meta name="description" content="">
  14.     <meta name="viewport" content="width=device-width, initial-scale=1">
  15.  
  16.     <!-- <link rel="manifest" href="site.webmanifest"> -->
  17.     <!-- Place favicon.ico in the root directory -->
  18.  
  19.     <!-- CSS here -->
  20.     <link rel="stylesheet" href="css/bootstrap.min.css">
  21.     <link rel="stylesheet" href="css/owl.carousel.min.css">
  22.     <link rel="stylesheet" href="css/magnific-popup.css">
  23.     <link rel="stylesheet" href="css/font-awesome.min.css">
  24.     <link rel="stylesheet" href="css/themify-icons.css">
  25.     <link rel="stylesheet" href="css/nice-select.css">
  26.     <link rel="stylesheet" href="css/flaticon.css">
  27.     <link rel="stylesheet" href="css/gijgo.css">
  28.     <link rel="stylesheet" href="css/animate.css">
  29.     <link rel="stylesheet" href="css/slick.css">
  30.     <link rel="stylesheet" href="css/slicknav.css">
  31.     <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css">
  32.     <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css">
  33.     <link rel="stylesheet" href="css/style.css">
  34.  
  35.     <!-- <link rel="stylesheet" href="css/responsive.css"> -->
  36. </head>
  37.  
  38. <body>
  39.     <header>
  40.       <div class="header-area ">
  41.           <div id="sticky-header" class="main-header-area">
  42.               <div class="container-fluid">
  43.                   <div class="header_bottom_border">
  44.                       <div class="row align-items-center">
  45.                           <div class="col-xl-6 col-lg-6">
  46.                               <div class="main-menu d-none d-lg-block">
  47.                                   <nav>
  48.                                       <ul id="navigation">
  49.                                           <li><img src="img/logotransparent.png" width="150" height="50"></li>
  50.                                           <li><a class="active" href="index.html">home</a></li>
  51.                                           <li><a class="" href="travel_destination.html">Destinations</a></l/li>
  52.                                           <li><a href="mainbookingpage.php">Bookings</a></li>
  53.                                           <li><a href="about.html">About Us</a></li>
  54.                                       </ul>
  55.                                   </nav>
  56.                               </div>
  57.                           </div>
  58.             <div class="col-xl-6 col-lg-6">
  59.                               <div class="main-menu d-flex align-items-center justify-content-end">
  60.                                   <nav>
  61.                                       <ul id="navigation">
  62.                                           <li><a href="login.html">Login</a></li>
  63.                                           <a href="signup.html" class="genric-btn primary circle">Sign-Up</a>
  64.                                       </ul>
  65.                                   </nav>
  66.                               </div>
  67.                           </div>
  68.                           <div class="col-12">
  69.                               <div class="mobile_menu d-block d-lg-none"></div>
  70.                           </div>
  71.                       </div>
  72.                   </div>
  73.  
  74.               </div>
  75.           </div>
  76.       </div>
  77.   </header>
  78.     <!-- header-end -->
  79.    
  80.     <div class="sidebar1 checkout-text bold-text">
  81. <?php
  82.     $conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
  83.     if ($conn->connect_error) {
  84.       die("Connection failed: " . $conn->connect_error);
  85.     }
  86.     $sql = "SELECT * FROM destination";
  87.     $result = $conn->query($sql);
  88.     if ($result->num_rows > 0) {
  89.       while($row = $result->fetch_assoc()) {
  90.         echo '<a href="#' . strtolower($row["name"]) . '">&#8226;<span>' . $row["name"] . "</span></a>";
  91.       }
  92.     }
  93.     $conn->close();
  94. ?>
  95.     </div>
  96.     <?php
  97.         $conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
  98.         if ($conn->connect_error) {
  99.           die("Connection failed: " . $conn->connect_error);
  100.         }
  101.         $sql = "SELECT * FROM destination";
  102.         $result = $conn->query($sql);
  103.  
  104.     if ($result->num_rows > 0) {
  105.       while($row = $result->fetch_assoc()) {
  106.         echo '<div class="header"><br>';
  107.         echo   '<div class="modal-center">';
  108.         echo     '<br>';
  109.         echo     '<h1 id="'. strtolower($row["name"]) .'">'  . $row["name"] . "</h1>";
  110.         echo   '</div>';
  111.         echo '</div>';
  112.         echo '<br>';
  113.         echo '<br>';
  114.         $products = $conn->query("SELECT * FROM product WHERE destinationId=" . $row['id']);
  115.         if ($products->num_rows > 0) {
  116.           while($productRow = $products->fetch_assoc()) {
  117.             $product_images = $conn->query("SELECT * FROM product_images WHERE productId=" . $productRow["id"]);
  118.             if ($product_images->num_rows > 0) {
  119.               $images = array();
  120.               while($imageRow = $product_images->fetch_assoc()) {
  121.                 array_push($images, $imageRow);
  122.               }
  123.               echo '<div class="container-booking">';
  124.               echo   '<form name="item" class="row" method="POST" action="checkout.php">';
  125.               echo     '<div class="col-4">';
  126.               echo       '<div class="row">';
  127.               echo         '<img src="' . $images[0]["path"] . '"/><br>';
  128.               echo       '</div>';
  129.               echo       '<div class="row">';
  130.               echo         '<center>';
  131.               echo         '<br>';
  132.               echo         '<img class="col-3" src="'. $images[1]['path'] .'"/>';
  133.               echo         '<img class="col-3" src="'. $images[2]['path'] .'"/>';
  134.               echo         '<img class="col-3" src="'. $images[3]['path'] .'"/>';
  135.               echo       '</div>';
  136.               echo       '<div class="row">';
  137.               echo         '<center>';
  138.               echo         '<br>';
  139.               echo         '<img class="col-3" src="'. $images[4]['path'] .'"/>';
  140.               echo         '<img class="col-3" src="'. $images[5]['path'] .'"/>';
  141.               echo         '<img class="col-3" src="'. $images[6]['path'] .'"/>';
  142.               echo       '</div>';
  143.               echo     '</div>';
  144.               echo     '<div class="col-8">';
  145.               echo       '<div class="row">';
  146.               echo         '<h3>' . $productRow["name"] . "</h3>";
  147.               echo       '</div>';
  148.               echo       '<div class="row">';
  149.               echo         '<p>' . $productRow["description"] . "</p>";
  150.               echo       '</div>';
  151.               echo       '<br>';
  152.               echo       '<div class="row">';
  153.               echo         '<div class="col-5 ticket-info">';
  154.               echo           '<div class="form-group row">';
  155.               echo             '<label for="datetime-booking-date" style="color:black" class="col-6 col-form-label">Booking Date</label>';
  156.               echo             '<div class="col-6">';
  157.               echo               '<input class="form-control" type="date" name="date" id="date-booking-date" required>';
  158.               echo             '</div>';
  159.               echo           '</div>';
  160.               echo           '<div class="form-group row">';
  161.               echo             '<label for="book-quantity" style="color:black" class="col-6 col-form-label">Quantity</label>';
  162.               echo             '<div class="col-6">';
  163.               echo               '<input class="form-control" type="number" name="quantity" min="0" max="20" id="book-quantity" required>';
  164.               echo             '</div>';
  165.               echo           '</div>';
  166.               echo         '</div>';
  167.               echo         '<div class="col-3"></div>';
  168.               echo         '<div class="col-4">';
  169.               echo           '<div class="row col-12">';
  170.               echo           '<h2>&#8369 ' . $productRow["price"] . "</h2>";
  171.               echo         '</div>';
  172.               echo         '<div class="row">';
  173.               echo           '<input type="submit" class="selector col-5 btn-design1" value="Add to cart"/>';
  174.               echo           '<div class="col-1"></div>';
  175.               echo           '<button type="button" class="selector col-5 btn-design">Book now</button>';
  176.               echo         '</div>';
  177.               echo       '</div>';
  178.               echo     '</div>';
  179.               echo   '</div>';
  180.               echo   '<input type="hidden" name="id" value="'. $productRow["id"] .'">';
  181.               echo '</form>';
  182.               echo '</div>';
  183.               echo '<br>';
  184.               echo '<br>';
  185.             }
  186.           }
  187.         }
  188.       }
  189.     }
  190.     $conn->close();
  191.     ?>
  192.  
  193.  
  194. <script>
  195.       if ( window.history.replaceState ) {
  196.         window.history.replaceState( null, null, window.location.href );
  197.     }
  198.   $(document).ready(function () {
  199.  
  200.       $('sidebar1 > a')
  201.               .click(function (e) {
  202.           $('sidebar1 > a')
  203.               .removeClass('active');
  204.           $(this).addClass('active');
  205.       });
  206.   });
  207. </script>
  208. </body>
  209. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement