<?php include("db.php"); ?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="bootstrap-4.6.2-dist/css/bootstrap.min.css">
</head>
<body>
    <table class="table table-striped">
        <thead>
          <tr>
            <th scope="col">SURNAME</th>
            <th scope="col">OTHERNAME</th>
             <th scope="col">Deparment</th>
             <th scope="col">Date of Birth</th>
            <th scope="col">Residential Address</th>
              <th scope="col">Postal Address</th>
                <th scope="col">Place of Birth </th>
                <th scope="col">State of Origin</th>
                    <th scope="col">LGA </th>
                    <th scope="col">Blood Group </th>
                    <th scope="col">illness </th>
                    <th scope="col">phone Number</th>
                    <th scope="col">Email</th>
                    <th scope="col">Name of Parents/Guardian</th>
                    <th scope="col">Mother</th>
                    <th scope="col">Address</th>
                    <th scope="col">Occupation of Father</th>
                    <th scope="col">Occupation of Mother</th>
                    <th scope="col">Occupation of Guardian</th>        
                    <th scope="col">Phone Number: Father</th>        
                    <th scope="col">Father</th>               
                        <th scope="col">Mother</th>        
                        <th scope="col">Guardian</th>        
                        <th scope="col"> Parent Passport</th>        
                            <th scope="col">Student Passport</th>   
                            <th scope="col">Operations</th>    
                  </tr>
                  </thead>
<tbody>
<?php
$sql= "select * from hostel_table";
$result=mysqli_query($db,$sql);
if($result){
  while($row=mysqli_fetch_assoc($result)){

    $surname =$row['surname'];
    $othernames=$row['othernames'];
    $department=$row['department'];
    $dob =$row['dob'];
    $residential_address=$row['residential_address'];
    $postal_address=$row['postal_address'];
    $place_birth=$row['place_birth'];
    $state_origin=$row['state_origin'];
    $LGA =$row['LGA'];
    $blood_group=$row['blood_group'];
    $illness =$row['illness'];
    $phone=$row['phone'];
    $email =$row['email'];
    $fname=$row['fname'];
    $mother=$row['mother'];
    $aaddress=$row['aaddress'];
    $nameguardian=$row['nameguardian'];
    $occfather=$row['occfather'];
    $occmother=$row['occmother'];
    $occguardian=$row['occguardian'];
    $phoneall=$row['phoneall'];
    $fathername=$row['fathername'];
    $mothername=$row['mothername'];
    $guardian=$row['guardian'];
    $parentpass=$row['parentpass'];
    $Studentpass=$row['Studentpass'];
    echo'
  <tr>
  
    <td>'.$surname.'</td>
    <td>'.$othernames.'</td>
    <td>'.$department.'</td>
    <td>'.$dob.'</td>
    <td>'.$residential_address.'</td>
    <td>'.$postal_address.'</td>
    <td>'.$place_birth.'</td>
    <td>'.$state_origin.'</td>
    <td>'.$LGA.'</td>
    <td>'.$blood_group.'</td>
    <td>'.$illness.'</td>
    <td>'.$phone.'</td>
    <td>'.$email.'</td>
    <td>'.$fname.'</td>
    <td>'.$mother.'</td>
    <td>'.$aaddress.'</td>
    <td>'.$nameguardian.'</td>
    <td>'.$occfather.'</td>
    <td>'.$occmother.'</td>
    <td>'.$occguardian.'</td>
    <td>'.$phoneall.'</td>
    <td>'.$fathername.'</td>
    <td>'.$mothername.'</td>
    <td>'.$guardian.'</td>
    <td>'.$parentpass.'</td>
    <td>'.$Studentpass.'</td>
    <td>
    <button><a href="">Update</a></button>
    <button><a href="">Delete</a><button>
    </td>
  </tr>';
  }
}
?>

</tbody>
</table>
    </body>
</html>
