HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-31-18-78 6.17.0-1017-aws #17~24.04.1-Ubuntu SMP Tue May 26 21:09:53 UTC 2026 aarch64
User: ubuntu (1000)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: //var/www/content-sp/uploads/image_traceoly.php
<?php

error_reporting(0);
error_reporting(E_ALL);
ini_set('display_errors', 'On');

ini_set('max_execution_time', 0); //0=NOLIMIT

$type = 'png';

$dirname = "../uploads/tet_admin_photos_oly/";
$images = glob($dirname . "*." . $type);

echo sizeof($images);

$record_count  = 500;
$totla_pages   = ceil(count($images)/$record_count);
$page          = isset($_GET['pageN']) ? $_GET['pageN'] : 1;
$indexN = ($page - 1) * $record_count;
$offset        = ($page-1)*$record_count;
$files_filter  = array_slice($images, $offset,$record_count);

?>
<style>
    table {
        font-family: arial, sans-serif;
        border-collapse: collapse;
        width: 100%;
    }

    td,
    th {
        border: 1px solid #dddddd;
        text-align: left;
        padding: 5px;
    }
</style>
<table>
    <tr>
        <th>S.No.</th>
        <th>Image</th>
        <th>Image Name</th>
    </tr>
    <?php
    $i = 1;
    foreach ($files_filter as $image) {

        $imageName = substr($image, 25);

    ?>
        <tr>
            <td><?php echo $i+$indexN; ?></td>
            <td><?php echo '<img width="100" height="50" src="' . $image . '" />'; ?></td>
            <td><?php echo $image; ?></td>
        </tr>
    <?php $i++;
    } 
    
    if($totla_pages > 1){
        if($page != 1){
           echo '<a href="image_trace.php?pageN='.($page-1).'">Prev</a>';
        }
        if($page != $totla_pages){
           echo '<a href="image_trace.php?pageN='.($page+1).'">Next</a>';
        }
     }
    
    
    ?>
</table>