PATH:
home4
/
theinves
/
public_html
/
seshaasschool.com
/
Editing: gallery_list.php
<?php include 'header.php'; $year_id = $_GET['year_id']; $statement_category = $pdo->prepare("SELECT * FROM tbl_year_category WHERE id=? ORDER BY name ASC"); $statement_category->execute(array($_GET['y_cat'])); $category_results = $statement_category->fetchAll(PDO::FETCH_ASSOC); $category_totalDatas = $statement_category->rowCount(); if($category_totalDatas>0){ $category_ids = $category_results[0]['category_ids']; } ?> <style> .page-banner-area.bg-2 { background-image: url(icons/history/history_banner.jpg); } .page-banner-area::before { position: absolute; content: ""; height: 100%; width: 100%; left: 0; top: 0; background: none; } .page-banner-content { position: absolute; } .page-banner-area { background-size: cover; background-position: center center; background-repeat: no-repeat; position: relative; padding-top: 200px; padding-bottom: 150px; } .page-banner-area-1.bg-2 { background-image: url(icons/history/history_banner-2.jpg); } .page-banner-area-1 { background-size: cover; background-position: center center; background-repeat: no-repeat; position: relative; padding-top: 200px; padding-bottom: 150px; } .page-banner-area-1::before { position: absolute; content: ""; height: 100%; width: 100%; left: 0; top: 0; background: none; } .single-health-care-card.style2 { position: relative; padding-top: 257px; } .single-health-care-card.style1 .health-care-content { background-color: #fff; max-width: 420px; margin: auto; left: 0; right: 0; position: absolute; bottom: -348px; } @media only screen and (max-width: 991px) { #events-areas{ margin-top:18%; } } </style> <div class="page-banner-area bg-2"> <div class="container"> <div class="page-banner-content"> <h1 id="banner_content" ></h1> </div> </div> </div> <?php include "breadcrumb.php"; ?> <div class="campus-life-area pt-100 pb-70"> <div class="container"> <?php $conditions=""; $conditions.=" and h.category IN ($category_ids)"; $conditions.=" and h.year=".$year_id; $statement = $pdo->prepare("SELECT h.*, h.category as off_cat_id, h.year as off_year_id, tbl_category.name as category_name,tbl_years.name as year_name, COALESCE( (SELECT i.image FROM tbl_images i WHERE i.category=h.category AND i.year=h.year AND i.image!='' AND i.image IS NOT NULL ORDER BY i.id DESC LIMIT 1), h.image ) as thumb_image FROM `tbl_images` h LEFT JOIN tbl_category ON tbl_category.id=h.category LEFT JOIN tbl_years ON tbl_years.id=h.year where h.id!=0 ".$conditions." GROUP BY category, year ORDER BY h.id DESC"); $statement->execute(); $query = $statement->fetchAll(PDO::FETCH_ASSOC); $totalData = $statement->rowCount(); ?> <?php if($totalData>0){ ?> <div class="row justify-content-center"> <?php function url_exists($url) { // Skip slow remote HEAD checks — use image URL directly when present return true; } foreach($query as $category){ $thumb_candidate = !empty($category['thumb_image']) ? $category['thumb_image'] : $category['image']; if ($thumb_candidate != "") { $thumbnails = $thumb_candidate; $thumb_style = ""; }else{ $thumbnails = $site_logo; $thumb_style = "padding: 25px;"; } $category_name = $category['category_name']; $off_cat_id = $category['off_cat_id']; $off_year_id = $category['off_year_id']; ?> <div class="col-lg-4 col-md-6"> <div class="single-campus-card" style="box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px; border-radius: 5px;"> <a href="gallery.php?cat_id=<?=$off_cat_id?>&year_id=<?=$off_year_id?>"> <div class="img" style='background-image: url("<?=$thumbnails?>"); background-color: #cccccc; height: 250px; background-size: cover;'> <!--<img src="<?//=$thumbnails?>" alt="Seshaas School" style="<?//=$thumb_style?>">--> </div> </a> <div class="campus-content" style="height: 130px; text-align: center;"> <a href="gallery.php?cat_id=<?=$off_cat_id?>&year_id=<?=$off_year_id?>"><h3><?=$category_name?></h3></a> </div> </div> </div> <?php } ?> </div> <?php } else { ?> <center><b style="color: red;">No Records Found</b></center> <?php } ?> </div> </div> <?php include 'footer.php';?>
SAVE
CANCEL