PATH:
home4
/
theinves
/
public_html
/
seshaasschool.com
/
Editing: gallery.php
<?php include 'header.php'; $statement_images = $pdo->prepare("SELECT * FROM tbl_images WHERE status=1 and category=? and year=?"); $statement_images->execute(array($_GET['cat_id'], $_GET['year_id'])); $images_results = $statement_images->fetchAll(PDO::FETCH_ASSOC); $images_totalDatas = $statement_images->rowCount(); $statement_category = $pdo->prepare("SELECT * FROM tbl_category WHERE id=?"); $statement_category->execute(array($_GET['cat_id'])); $category_results = $statement_category->fetchAll(PDO::FETCH_ASSOC); $category_totalDatas = $statement_category->rowCount(); if($category_totalDatas>0){ $gallery_title = $category_results[0]['name']; }else{ $gallery_title = ""; } ?> <style> .page-banner-area.bg-2 { background-image: url(icons/gallery/gallery.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; } </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="events-area bg-f4f6f9"> <div class="container" style="padding: 80px 0px 80px 0px;"> <?php if($images_totalDatas>0){ ?> <center><h3><b><?=$gallery_title?></b></h3></center> <div class="row justify-content-center" style="padding: 20px;"> <?php foreach($images_results as $images){ $video_url = isset($images['video_url']) ? trim($images['video_url']) : '' ; $video_title = isset($images['video_title']) ? $images['video_title'] : '' ; // Convert YouTube watch/shorts/youtu.be links to embed URL for iframe if(!empty($video_url)){ if(preg_match('/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/shorts\/)([A-Za-z0-9_-]+)/', $video_url, $yt)){ $video_url = 'https://www.youtube.com/embed/'.$yt[1]; }elseif(preg_match('/youtube\.com\/embed\/([A-Za-z0-9_-]+)/', $video_url, $yt)){ $video_url = 'https://www.youtube.com/embed/'.$yt[1]; } } if(!empty($video_url) && !empty($video_title)){ ?> <div class="col-lg-6 col-md-6" data-aos="fade-up" data-aos-duration="1200" data-aos-delay="200" data-aos-once="true" > <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="#"> <iframe width="536" height="320" src="<?=htmlspecialchars($video_url, ENT_QUOTES)?>" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen> </iframe> </a> <div class="campus-content" style="height: 130px; text-align: center;"> <a href="#"><h3><?=$video_title?></h3></a> </div> </div> </div> <?php }else{ ?> <div class="col-lg-4 col-md-6" data-aos="fade-up" data-aos-duration="1200" data-aos-delay="200" data-aos-once="true" > <a href="<?=$images['image']?>" target="_BLANK"> <div class="single-events-card" style='background-image: url("<?=$images['image']?>"); background-color: #cccccc; height: 250px; background-size: cover;'> <!--<div class="events-image"> <a href="<?//=$images['image']?>" target="_BLANK"> <img src="<?//=$images['image']?>" alt="Seshaas School"> </a> </div>--> </div> </a> </div> <?php } } ?> </div> <?php }else{ ?> <center><b style="color: red;">No Records Found</b></center> <?php } ?> </div> </div> <?php include 'footer.php' ?> <script> $(document).ready(function(){ startingFunc(); }); function startingFunc(){ $("#banner_content").hide(); } $(document).ready(function(){ $(".page-banner-area").mouseover(function(){ $("#banner_content").show(); }); $(".page-banner-area").mouseout(function(){ $("#banner_content").hide(); }); }); </script>
SAVE
CANCEL