<?php
ini_set('memory_limit', '-1');    
    require_once('config.php');
    require_once('students.php');
    // require '../aws/app/start.php'; // AWS S3 SDK initialization

    // Create an instance of the student class
    $studentObj = new Student($conn);
    
  $studentList = $studentObj->selectImageString(); // Call the method



?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Download Passport</title>
</head>
<body>
    <table>
        <thead>
            <tr>
                <th>S/N</th>
                <th>File Name</th>
                <th>Download</th>
            </tr>
        </thead>
        
        <tbody>
             <?php  
                $serialNumber=0;
                 while ($fetch = mysqli_fetch_assoc($studentList)) {
                    // Assuming pic_name contains the Base64 image string
                    $imageString = $fetch['pic_name'];
                    $serialNumber++;
                
            ?>
                    <tr>
                        <td><?php echo $serialNumber;  ?></td>
                        <td>h</td>
                        <td>
                            <?php echo '<img src="data:image/jpeg;base64,' . $imageString . '" alt="Image" style="height:150px;width:200px;" />'; ?>
                        </td>
                    </tr>
            <?php                    
                }
            ?>
        </tbody>
    </table>
   
     
</body>
</html>
