<div class="clear"></div> <div class="section group"> <?php if (isset($_GET['depart']) && $_GET['depart'] != '') { $perpage = 10; $current_page = !empty($_GET['page']) ? $_GET['page'] : 1; // echo $current_page; $total_count = $depart_obj->getCountAllImgByDepart($con, $_GET['depart']); $total_count_fetch = mysqli_fetch_array($total_count); // echo $total_count_fetch['num']; $pagnition = new Pagnition($current_page, $total_count_fetch['num'], $perpage); $offset = $pagnition->offset(); // echo 'fdsf' . $offset; $result_set = $depart_obj->selectAllDepartInfoLimited($con, $_GET['depart'], $perpage, $offset); while ($img_info = mysqli_fetch_array($result_set)) { ?> <div class = "gallery_1_of_4 images_1_of_4" style="height:270px ;width:240px" > <a class = "fancybox" href = "admin/images/<?php echo $img_info['name']; ?> " data-fancybox-group = "gallery" title = "<?php echo $img_info['title']; ?> "><img src = "admin/images/<?php echo $img_info['name']; ?> " alt = ""><span> </span></a> <h3><?php echo $img_info['title'];