ЁЯУБ File Manager
Editing:
/home/u882412079/domains/margdarshanam.org/public_html/image-gallery.php
<?php $page_title = "рдЪрд┐рддреНрд░ рдЧреИрд▓рд░реА (Image Gallery) - рдорд╛рд░реНрдЧрджрд░реНрд╢рдирдореН"; $active_page = "image-gallery"; include 'header.php'; ?> <!-- Header Banner --> <header id="page-top" class="blog-banner" style="background: linear-gradient(rgba(26, 35, 126, 0.88), rgba(13, 71, 161, 0.92)), url('images/page_bg.jpg') no-repeat center center / cover; padding: 75px 0; text-align: center; color: #ffffff;"> <div class="container"> <div class="row text-center"> <div class="col-sm-12"> <h4 style="font-family: 'Poppins', sans-serif; color: #ffb300; font-weight: 500; font-size: 1rem; text-transform: uppercase; letter-spacing: 1px;"> <a href="index.php" style="color: #ffb300; text-decoration: none;">Home</a> / <a href="#" style="color: #ffb300; text-decoration: none;">Gallery</a> / Images </h4> <h3 style="font-family: 'Tiro Devanagari Hindi', serif; font-size: 2.4rem; font-weight: 700; color: #ffffff; margin-top: 10px;">рдЪрд┐рддреНрд░ рдЧреИрд▓рд░реА (Image Gallery)</h3> </div> </div> </div> </header> <!-- Custom Styles for Image Gallery --> <style> .gallery-section { padding: 60px 0 80px; background-color: #f9fbfd; } .gallery-filter-wrap { margin-bottom: 35px; text-align: center; } .gallery-filter-btn { padding: 8px 22px; margin: 4px 6px; border-radius: 30px; border: 2px solid #1a237e; background: #ffffff; color: #1a237e; font-family: 'Poppins', sans-serif; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; outline: none; } .gallery-filter-btn.active, .gallery-filter-btn:hover { background: #1a237e; color: #ffffff; box-shadow: 0 4px 15px rgba(26, 35, 126, 0.25); } .gallery-card { position: relative; border-radius: 12px; overflow: hidden; background: #ffffff; box-shadow: 0 6px 20px rgba(0,0,0,0.06); transition: transform 0.3s ease, box-shadow 0.3s ease; height: 100%; display: flex; flex-direction: column; } .gallery-card:hover { transform: translateY(-7px); box-shadow: 0 14px 30px rgba(26, 35, 126, 0.16); } .gallery-img-wrap { position: relative; height: 250px; overflow: hidden; background-color: #eaeff5; } .gallery-img-wrap img { width: 100%; height: 250px; object-fit: cover; transition: transform 0.5s ease; } .gallery-card:hover .gallery-img-wrap img { transform: scale(1.08); } .gallery-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, rgba(26, 35, 126, 0.75) 0%, rgba(245, 124, 0, 0.75) 100%); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.35s ease; text-decoration: none !important; } .gallery-card:hover .gallery-overlay { opacity: 1; } .gallery-zoom-icon { width: 52px; height: 52px; border-radius: 50%; background: #ffffff; color: #1a237e; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; box-shadow: 0 6px 20px rgba(0,0,0,0.25); transform: scale(0.8); transition: transform 0.3s ease; } .gallery-card:hover .gallery-zoom-icon { transform: scale(1); } .gallery-card-info { padding: 14px 18px; border-top: 1px solid #f0f0f0; background: #ffffff; flex-grow: 1; display: flex; flex-direction: column; justify-content: center; } .gallery-card-title { font-family: 'Tiro Devanagari Hindi', serif; font-size: 1.15rem; font-weight: 700; color: #1a237e; margin: 0 0 4px; line-height: 1.4; } .gallery-card-meta { font-family: 'Poppins', sans-serif; font-size: 0.85rem; color: #f57c00; font-weight: 600; } .empty-gallery-box { background: #ffffff; border: 2px dashed #cbd5e1; border-radius: 16px; padding: 50px 30px; text-align: center; margin: 40px auto; max-width: 600px; } .empty-gallery-box i { font-size: 3.5rem; color: #ffb300; margin-bottom: 15px; } .empty-gallery-box h4 { font-family: 'Tiro Devanagari Hindi', serif; font-size: 1.5rem; color: #1a237e; font-weight: 700; } </style> <!-- Main Gallery Section --> <section class="gallery-section"> <div class="container"> <!-- Section Header --> <div class="base-header text-center" style="margin-bottom: 40px;"> <h2 style="font-family: 'Tiro Devanagari Hindi', sans-serif; font-size: 2.2rem; color: #1a237e; font-weight: 700;">рдорд╛рд░реНрдЧрджрд░реНрд╢рдирдореН рд╕рдВрд╕реНрдерд╛рди - рдЭрд▓рдХрд┐рдпрд╛рдБ рдПрд╡рдВ рдЪрд┐рддреНрд░</h2> <p class="hindi-text" style="max-width: 820px; margin: 15px auto 0; font-size: 1.1rem; color: #555;"> рдорд╛рд░реНрдЧрджрд░реНрд╢рдирдореН рд╕рдВрд╕реНрдерд╛рди рджреНрд╡рд╛рд░рд╛ рдЖрдпреЛрдЬрд┐рдд рд╡рд┐рднрд┐рдиреНрди рд╕рд╛рдВрд╕реНрдХреГрддрд┐рдХ, рд╢реИрдХреНрд╖рдгрд┐рдХ, рдЖрдзреНрдпрд╛рддреНрдорд┐рдХ, рд╢реЛрдз рдПрд╡рдВ рд╕рдорд╛рдЬ рд╕реЗрд╡рд╛ рдЧрддрд┐рд╡рд┐рдзрд┐рдпреЛрдВ рдХреА рд╕реНрдорд░рдгреАрдп рдЭрд▓рдХрд┐рдпрд╛рдБред </p> </div> <?php $images = []; $years = []; $titles = []; if (isset($conn)) { try { // Fetch image titles dictionary if table exists try { $tStmt = $conn->prepare("SELECT * FROM image_gallery_title ORDER BY id DESC"); $tStmt->execute(); $tResult = $tStmt->fetchAll(); foreach ($tResult as $tRow) { $titles[$tRow['id']] = $tRow['title']; } } catch(Exception $e) { // Ignore if image_gallery_title table not present } // Fetch all active images $query = $conn->prepare("SELECT * FROM image_gallery WHERE is_deleted = 'no' OR is_deleted IS NULL ORDER BY id DESC"); $query->execute(); $images = $query->fetchAll(); } catch(Exception $e) { // Fallback query if is_deleted column missing try { $query = $conn->prepare("SELECT * FROM image_gallery ORDER BY id DESC"); $query->execute(); $images = $query->fetchAll(); } catch(Exception $e) { $images = []; } } } // Collect unique years for filter tabs if (!empty($images)) { foreach ($images as $imgRow) { if (!empty($imgRow['year'])) { $yr = trim($imgRow['year']); if (!in_array($yr, $years)) { $years[] = $yr; } } } rsort($years); } ?> <?php if (!empty($years) && count($years) > 1): ?> <!-- Filter Tabs --> <div class="gallery-filter-wrap"> <button class="gallery-filter-btn active" data-filter="all">рд╕рднреА рдЪрд┐рддреНрд░ (All)</button> <?php foreach ($years as $yr): ?> <button class="gallery-filter-btn" data-filter="<?php echo htmlspecialchars($yr); ?>"><?php echo htmlspecialchars($yr); ?></button> <?php endforeach; ?> </div> <?php endif; ?> <div class="row projects-list" id="galleryContainer"> <?php if (!empty($images) && count($images) > 0) { foreach ($images as $value) { $feature_img = $value['feature_img']; $yr = !empty($value['year']) ? trim($value['year']) : ''; $title_id = !empty($value['image_gallery_title_id']) ? $value['image_gallery_title_id'] : null; $img_title = ($title_id && isset($titles[$title_id])) ? $titles[$title_id] : ''; ?> <div class="col-lg-4 col-md-6 col-12 gallery-item-col" data-year="<?php echo htmlspecialchars($yr); ?>" style="margin-bottom: 30px;"> <div class="gallery-card"> <div class="gallery-img-wrap"> <img src="<?php echo htmlspecialchars($feature_img); ?>" alt="<?php echo !empty($img_title) ? htmlspecialchars($img_title) : 'Margadarshanam Gallery Image'; ?>" loading="lazy"> <a class="gallery-overlay popup-img" href="<?php echo htmlspecialchars($img_url); ?>" title="<?php echo htmlspecialchars($img_title); ?>"> <div class="gallery-zoom-icon"> <i class="fa fa-search-plus"></i> </div> </a> </div> <?php if (!empty($img_title) || !empty($yr)): ?> <div class="gallery-card-info"> <?php if (!empty($img_title)): ?> <h5 class="gallery-card-title"><?php echo htmlspecialchars($img_title); ?></h5> <?php endif; ?> <?php if (!empty($yr)): ?> <div class="gallery-card-meta"> <i class="fa fa-calendar" style="margin-right: 4px;"></i> <?php echo htmlspecialchars($yr); ?> </div> <?php endif; ?> </div> <?php endif; ?> </div> </div> <?php } } else { ?> <div class="col-12"> <div class="empty-gallery-box"> <i class="fa fa-picture-o"></i> <h4>рдЪрд┐рддреНрд░ рдЧреИрд▓рд░реА рд╢реАрдШреНрд░ рд╣реА рдЕрдкрдбреЗрдЯ рдХреА рдЬрд╛рдПрдЧреА</h4> <p class="hindi-text" style="color: #666; margin-top: 10px;">рд╕рдВрд╕реНрдерд╛рди рдХреА рдЧрддрд┐рд╡рд┐рдзрд┐рдпреЛрдВ рдХреЗ рдЪрд┐рддреНрд░ рд╢реАрдШреНрд░ рд╣реА рдЕрдкрд▓реЛрдб рдХрд┐рдП рдЬрд╛ рд░рд╣реЗ рд╣реИрдВред рдХреГрдкрдпрд╛ рдХреБрдЫ рд╕рдордп рдкрд╢реНрдЪрд╛рдд рдкреБрдирдГ рджреЗрдЦреЗрдВред</p> </div> </div> <?php } ?> </div> </div> </section> <?php include 'footer.php'; ?> <!-- Gallery Filter & Lightbox Script --> <script> $(document).ready(function() { // Initialize Lightbox Popup if Magnific Popup library exists if (typeof $.fn.magnificPopup !== 'undefined') { $('.popup-img').magnificPopup({ type: 'image', gallery: { enabled: true, navigateByImgClick: true, preload: [0,1] }, zoom: { enabled: true, duration: 300, easing: 'ease-in-out' }, image: { tError: '<a href="%url%">The image #%curr%</a> could not be loaded.' } }); } // Interactive Year / Category Filter $('.gallery-filter-btn').on('click', function() { $('.gallery-filter-btn').removeClass('active'); $(this).addClass('active'); var filterValue = $(this).attr('data-filter'); if (filterValue === 'all') { $('.gallery-item-col').fadeIn(350); } else { $('.gallery-item-col').hide(); $('.gallery-item-col[data-year="' + filterValue + '"]').fadeIn(350); } }); }); </script>
Save
Cancel