<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Birthday</title>
</head>
<body>
    <?php 
    require 'database.php';
    $Month = date('MM'); // will return it in string
   
    $week = date('d');
    
    echo $week;


    // $sql = "SELECT FirstName, LastName
   // FROM person_per WHERE  Where per_BirthMonth LIKE '%$Month%'";
    $sql = "SELECT ChildrenFirstName, to_char(ChildrenDateOfBirth, 'dd') FROM `children` WHERE DAY(ChildrenDateOfBirth) >= DAY(NOW()) ORDER BY ChildrenDateOfBirth ASC;";

    $results = mysqli_query($conn, $sql);
    
   $viewGuests= mysqli_fetch_all($results, MYSQLI_ASSOC);



    

     ?>
     <div class="field">



     

           <?php if (empty($viewGuests)):?>
             <p>No Birthday This Month</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> Day </th>
                 
               </tr>

               <tr>
                 <td><?= $Guest['ChildrenFirstName'] ?></td>
                 <td><?= $Guest['ChildrenLastName'] ?></td>
                 <td>(<?= $Guest['to_char(ChildrenDateOfBirth, dd)'] ?>)</td>
                
               </tr>
             </table>
           <?php endforeach; ?>
           </ul>
         <?php endif; ?>

        
         </div>
         </div>



    ?>
    
</body>
</html>>