Preview: gallery.php
Size: 4.33 KB
/home/ostadcom/public_html/gallery.php
<?php
session_start();
include "management/php/functions.php";
$menu = "gallery";
?>
<!doctype html>
<html lang="fa">
<head>
<title>گالری تصاویر|گروه کارآفرینان استاد</title>
<meta name="description" content="">
<?php include 'head.php'; ?>
</head>
<body style="direction: rtl;text-align: right">
<header class="header-area">
<?php include "menu.php"; ?>
</header>
<?php include "modals.php"; ?>
<div class="page-title-area">
<div class="container">
<div class="page-title-content">
<h1>گالری تصاویر</h1>
<ul>
<li>
<a href="index.php">صفحه اصلی
</a>
</li>
<li class="active">گالری تصاویر</li>
</ul>
</div>
</div>
</div>
<section id="blog" class="blog-area pt-5 pb-100">
<div class="container">
<div class="row">
<?php
$per_page = 12;
if(isset($_GET['page'])) {
$page = $_GET['page'];
} else {
$page = 1;
}
$start = $per_page * $page;
$start = $start - $per_page;
$gallery = $connect -> prepare("select * from `tbl_gallery` where `delete_flag` = 0 order by `id` desc limit ".$start.",".$per_page." ");
$gallery -> execute();
if($gallery -> rowCount() > 0){
while($galleryRows = $gallery -> fetch(PDO::FETCH_ASSOC)){
?>
<div class="col-lg-4 col-md-6">
<div class="single-blog gallery-items">
<a href="gallery-detail.php?id=<?php echo $galleryRows['id']; ?>">
<img src="<?php echo $galleryRows['image']; ?>" alt="<?php echo $galleryRows['title']; ?>">
</a>
<a href="gallery-detail.php?id=<?php echo $galleryRows['id']; ?>">
<h3><?php echo $galleryRows['title']; ?></h3>
</a>
<a href="gallery-detail.php?id=<?php echo $galleryRows['id']; ?>" class="btn btn-info">تصاویر بیشتر</a>
</div>
</div>
<?php
}
}
?>
<div class="col-12">
<div class="pagination-area text-center">
<?php
$sql1 = "SELECT * FROM `tbl_gallery` WHERE `delete_flag` = 0";
$query = $connect->query($sql1);
$number = $query->rowCount();
$total_page = (ceil($number / $per_page));
if($total_page>1){
for($i=1;$i<=$total_page;$i++){
if($i==$page) {
echo "<span class='page-numbers current' aria-current='page'>$i</span>";
}
else {
echo "<a class='page-numbers' href=\"?page=".$i."\">".$i."</a>";
}
}
}
?>
</div>
</div>
</div>
</div>
</section>
<?php include "footer.php"; ?>
<div class="go-top">
<i class="bx bx-chevrons-up"></i>
<i class="bx bx-chevrons-up"></i>
</div>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<!--<script src="assets/js/bootstrap.bundle.min.js"></script>-->
<script src="assets/js/meanmenu.min.js"></script>
<script src="assets/js/owl.carousel.min.js"></script>
<script src="assets/js/wow.min.js"></script>
<script src="assets/js/form-validator.min.js"></script>
<script src="assets/js/contact-form-script.js"></script>
<script src="assets/js/ajaxchimp.min.js"></script>
<script src="assets/js/range-slider.min.js"></script>
<script src="assets/js/custom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/js/umd/util.js"></script>
<script>
$('.carousel').carousel();
</script>
</body>
</html>
Directory Contents
Dirs: 22 × Files: 54