
<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="main.css">
    <link rel="stylesheet" href="/css/master.css">
    <link rel="stylesheet" href="form.css">
    <link rel="stylesheet" href="table.css">
    <title>view All Guest</title>
  </head>
  <body>
    <?php
    require 'database.php';





    // echo "Haha.. Connected successfully";
    $sql = "SELECT *
    FROM guest
    WHERE GuestDate = CURDATE()" ;

    $results = mysqli_query($conn, $sql);

    if ($results === false) {
      // code...
      echo mysqli_error($conn);
    } else {
      // code...
      $viewGuests= mysqli_fetch_all($results, MYSQLI_ASSOC);



    }

     ?>
     <div class="field">



      <?php require 'header.php'; ?>
           <?php if (empty($viewGuests)):?>
             <p>No Guest found</p>
           <?php else: ?>
           <ul>
             <?php foreach ($viewGuests as $Guest):  ?>
            <div class="field">


             <table id="Guests">
               <tr>
                 <th>First Name</th>
                 <th> Last Name</th>
                 <th> Phone Number</th>
               </tr>

               <tr>
                 <td><?= $Guest['GuestFirstName'] ?></td>
                 <td><?= $Guest['GuestLastName'] ?></td>
                 <td><?= $Guest['GuestPhoneNumber'] ?></td>
               </tr>
             </table>
           <?php endforeach; ?>
           </ul>
         <?php endif; ?>

         <?php require 'footer.php' ?>
         </div>
         </div>


  </body>
</html>
