
<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="main1.css">
    <link rel="stylesheet" href="/css/master.css">
    <link rel="stylesheet" href="form.css">
    <link rel="stylesheet" href="../tableview.css">
    <title>view All Children's Attendees</title>
  </head>
  <body>
    <?php
    require '../db.php';





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

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

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



    }

     ?>
     <div class="field">



      <button onclick="print()">print this page</button>
      <h2><center>Currently Check IN</center></h2>

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


             <table id="Guests">
               <tr>
                 <th>Name</th>
                 <th> Date</th>
                 <th> Time</th>
               </tr>

               <tr>
                 <td><?= $Guest['CheckingName'] ?></td>
                 <td><?= $Guest['CheckingDate'] ?></td>
                 <td><?= $Guest['CheckingIn'] ?></td>
               </tr>
             </table>
           <?php endforeach; ?>
           </ul>
         <?php endif; ?>

        
         </div>
         </div>


  </body>
</html>
