Mini Shell
<!DOCTYPE html>
<html lang="en">
<head>
<title>ภาพกิจกรรมทั้งหมด English Program|โรงเรียนเทศบาลวัดชัยชุมพล | CCP</title>
<meta name="description" content="ภาพกิจกรรมทั้งหมด | English Program | โรงเรียนเทศบาลวัดชัยชุมพล | Watchaichumpol municipality school">
<?php include 'head.php'; ?>
<style>
/* HERO */
.hero-section{
position: relative;
padding: 16px 0 22px;
overflow: hidden;
color: #fff;
background: radial-gradient(1200px 400px at 20% 20%, rgba(255,255,255,.18), transparent 55%),
linear-gradient(135deg, #6a5af9 0%, #7b6cff 50%, #8f85ff 100%);
box-shadow: 0 10px 26px rgba(106, 90, 249, 0.22);
}
.hero-section h1{ margin:0; font-size:24px; font-weight:600; letter-spacing:.3px; }
.hero-section::before{
content:""; position:absolute; inset:-40px; pointer-events:none;
background:
radial-gradient(600px 260px at 75% 35%, rgba(255,255,255,.16), transparent 60%),
radial-gradient(420px 220px at 20% 75%, rgba(255,255,255,.10), transparent 62%),
repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0px, rgba(255,255,255,.08) 1px, transparent 1px, transparent 14px);
opacity:.75; transform: rotate(-2deg);
}
.hero-wave{ position:absolute; left:0; right:0; bottom:-1px; height:32px; line-height:0; }
.hero-wave svg{ width:100%; height:100%; display:block; }
.hero-wave path{ fill:#fff; }
/* ทำรูปในกริดให้สวยขึ้น (ยังใช้โครง gallery เดิมของธีม) */
.probootstrap-gallery .grid-item a{
display:block;
border-radius: 18px;
overflow:hidden;
box-shadow: 0 12px 26px rgba(0,0,0,.10);
background:#fff;
}
.probootstrap-gallery .grid-item img{
width:100%;
height: 230px; /* ปรับได้ */
object-fit: cover;
display:block;
}
/* PAGINATION FIX */
.site-pageination.pagination-clean{
list-style:none !important;
padding:0 !important;
margin:26px 0 10px !important;
display:flex !important;
justify-content:center !important;
align-items:center !important;
gap:10px !important;
flex-wrap:wrap !important;
width:100% !important;
}
.site-pageination.pagination-clean li,
.site-pageination.pagination-clean li:before,
.site-pageination.pagination-clean li:after{
list-style:none !important;
content:none !important;
background:none !important;
float:none !important;
width:auto !important;
margin:0 !important;
padding:0 !important;
}
.site-pageination.pagination-clean > li{ display:inline-flex !important; }
.site-pageination.pagination-clean > li > a,
.site-pageination.pagination-clean > li > span{
display:inline-flex !important;
align-items:center !important;
justify-content:center !important;
height:40px !important;
min-width:44px !important;
padding:0 14px !important;
border-radius:999px !important;
border:1px solid rgba(0,0,0,.12) !important;
background:#fff !important;
color:#333 !important;
font-weight:700 !important;
text-decoration:none !important;
line-height:1 !important;
transition:all .2s ease;
}
.site-pageination.pagination-clean > li > a:hover{
background:rgba(22,163,74,.10) !important;
border-color:rgba(22,163,74,.35) !important;
color:#16a34a !important;
}
.site-pageination.pagination-clean > li.active > a{
background:#16a34a !important;
border-color:#16a34a !important;
color:#fff !important;
}
.site-pageination.pagination-clean > li.disabled > a{ pointer-events:none !important; opacity:.45 !important; }
.site-pageination.pagination-clean > li.dots > span{
border:0 !important; background:transparent !important; min-width:auto !important; padding:0 6px !important;
}
</style>
</head>
<body>
<div class="probootstrap-page-wrapper">
<?php include 'header.php'; ?>
<section class="probootstrap-section probootstrap-section-colored hero-section">
<div class="container">
<div class="row">
<div class="col-md-12 text-left section-heading probootstrap-animate">
<h1>School Gallery</h1>
</div>
</div>
</div>
<div class="hero-wave" aria-hidden="true">
<svg viewBox="0 0 1440 160" preserveAspectRatio="none">
<path d="M0,96 C240,160 480,32 720,96 C960,160 1200,32 1440,96 L1440,160 L0,160 Z"></path>
</svg>
</div>
</section>
<?php
// แบ่งหน้า
$rows = 9;
$sqlnum = "SELECT COUNT(*) AS cnt FROM news WHERE newstype_id = '003'";
$result = mysqli_query($link, $sqlnum);
$row = mysqli_fetch_assoc($result);
$total_rows = (int)$row['cnt'];
$total_page = max(1, (int)ceil($total_rows / $rows));
$page = isset($_GET['page']) ? (int)$_GET['page'] : 1;
$page = max(1, min($page, $total_page));
$start = ($page - 1) * $rows;
$newstype_id = '003';
$sql_type = "SELECT * FROM news
INNER JOIN newstype ON news.newstype_id = newstype.newstype_id
WHERE news.newstype_id = '$newstype_id'
ORDER BY news_id DESC
LIMIT $start, $rows";
$result_type = mysqli_query($link, $sql_type);
?>
<section class="probootstrap-section probootstrap-bg-white">
<div class="container">
<!-- ✅ ต้องวาง wrapper พวกนี้ “นอก while” เพื่อให้เป็นกริดจริง -->
<div class="portfolio-feed three-cols">
<div class="grid-sizer"></div>
<div class="gutter-sizer"></div>
<div class="probootstrap-gallery">
<?php while ($row_type = mysqli_fetch_array($result_type)) { ?>
<?php
// ✅ คำนวณ data-size ให้ตรงกับรูปจริง (แก้รูปไม่ขึ้นใน Lightbox)
$rel = 'admin/images/' . $row_type['news_images'];
$abs = __DIR__ . '/' . $rel;
$w = 1200; $h = 800; // fallback
if (file_exists($abs)) {
$info = @getimagesize($abs);
if ($info && isset($info[0], $info[1])) { $w = (int)$info[0]; $h = (int)$info[1]; }
}
?>
<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject" class="grid-item probootstrap-animate">
<a href="admin/images/<?php echo $row_type['news_images']; ?>" itemprop="contentUrl" data-size="1000x632">
<img src="admin/images/<?php echo $row_type['news_images']; ?>" itemprop="thumbnail" alt="Free Bootstrap Template by ProBootstrap.com" />
</a>
<figcaption itemprop="caption description">Image caption here</figcaption>
</figure>
<?php } ?>
</div>
</div>
<!-- PAGINATION -->
<div class="text-center">
<ul class="site-pageination pagination-clean">
<li class="<?php echo ($page <= 1) ? 'disabled' : ''; ?>">
<a href="photos_event.php?page=<?php echo max(1, $page - 1); ?>">
<i class="fa fa-angle-left"></i> ก่อนหน้า
</a>
</li>
<?php
$startPage = max(1, $page - 2);
$endPage = min($total_page, $page + 2);
if ($startPage > 1) {
echo '<li><a href="gallery.php?page=1">1</a></li>';
if ($startPage > 2) echo '<li class="dots"><span>...</span></li>';
}
for ($i = $startPage; $i <= $endPage; $i++) {
$active = ($page == $i) ? 'active' : '';
echo '<li class="'.$active.'"><a href="gallery.php?page='.$i.'">'.$i.'</a></li>';
}
if ($endPage < $total_page) {
if ($endPage < $total_page - 1) echo '<li class="dots"><span>...</span></li>';
echo '<li><a href="gallery.php?page='.$total_page.'">'.$total_page.'</a></li>';
}
?>
<li class="<?php echo ($page >= $total_page) ? 'disabled' : ''; ?>">
<a href="gallery.php?page=<?php echo min($total_page, $page + 1); ?>">
ถัดไป <i class="fa fa-angle-right"></i>
</a>
</li>
</ul>
</div>
</div>
</section>
<?php include 'footer.php'; ?>
</div>
<script src="js/scripts.min.js"></script>
<script src="js/main.min.js"></script>
<script src="js/custom.js"></script>
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<div class="pswp__bg"></div>
<div class="pswp__scroll-wrap">
<div class="pswp__container">
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--share" title="Share"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)"></button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)"></button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
<a href="admin/images/<?php echo $row_type['news_images']; ?>" itemprop="contentUrl" data-size="<?php echo $w . 'x' . $h; ?>">
</body>
</html>
Zerion Mini Shell 1.0