<?php
include_once("include/main.inc.php");

$offset = isset($_GET['offset']) ? intval($_GET['offset']) : 0;
$limit = isset($_GET['limit']) ? intval($_GET['limit']) : 12;

$certificate_sql = mysqli_query($GLOBALS['dbconn'], "SELECT * FROM gallery_tbl ORDER BY id DESC LIMIT $offset, $limit");

while($catlog_stand = mysqli_fetch_assoc($certificate_sql)) {
?>
    <div class="col">
        <div class="gallery-bx">
            <a data-fancybox="" href="<?=site_url;?>/uploaded-files/gallery/<?=$catlog_stand['gallery_image'];?>" title="<?= $catlog_stand['gallery_title']; ?>" class="img">
                <img src="<?=site_url;?>/uploaded-files/gallery/<?=$catlog_stand['gallery_image'];?>" alt="<?= $catlog_stand['gallery_title']; ?>" title="<?= $catlog_stand['gallery_title']; ?>">
            </a>
            <div class="tx-bx">
                <div class="tt"><?= $catlog_stand['gallery_title']; ?></div>
            </div>
        </div>
    </div>
<?php
}
?>


