<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="form.css">
  <link rel="stylesheet" href="table.css">
  <!-- <link rel="stylesheet" href="main.css"> -->
  <title>View all Attendees</title>
  <link rel="stylesheet" href="tableview.css">
</head>
<body>
<?php
require 'db.php';





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

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

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



}
 ?>

  <?php require 'header.php'; ?>
       <?php if (empty($viewAttendees)):?>
         <p>No Attendeesn found</p>
       <?php else: ?>
       <ul>
         <?php foreach ($viewAttendees as $attendees):  ?>

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

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

     <?php require 'footer.php' ?>

</body>
</html>
