golden hour
/home4/theinves/public_html/seshaasschool.com/dashboard/ui-api
⬆️ Go Up
Upload
File/Folder
Size
Actions
flash-news-api-2.php
6.21 KB
Del
OK
flash-news-api.php
3.7 KB
Del
OK
flash-news-fms.php
5.62 KB
Del
OK
gallery-ui-api.php
1.68 KB
Del
OK
latest-events-api.php
3.69 KB
Del
OK
Edit: gallery-ui-api.php
<?php ob_start(); session_start(); include "../config/config.php"; $conditions=""; $category = $_REQUEST['category']; $years = $_REQUEST['years']; if($category!=""){ $conditions.=" and tbl_images.category=".$category; } if($years!=""){ $conditions.=" and tbl_images.year=".$years; } ?> <div class="container"> <?php $statement = $pdo->prepare("SELECT tbl_images.*, tbl_category.name as category_name FROM `tbl_images` LEFT JOIN tbl_category ON tbl_category.id=tbl_images.category WHERE 1=1 ".$conditions); $statement->execute(); $emp_data = $statement->fetchAll(PDO::FETCH_ASSOC); $totalData = $statement->rowCount(); if($totalData>0){ echo "<center style='width: 100%; font-size: 35px; font-weight: 600; margin-bottom: 10px;'>".$emp_data[0]['category_name']."</center>"; foreach ($emp_data as $data){ ?> <div class='col-md-2 col-sm-2'> <div class='box'> <a href="<?=$data['image']?>" target="_blank"><img src='<?=$data['image']?>' alt='' style='width: 100%; height: 180px;' loading="lazy"></a> </div> </div> <?php } }else{ ?> <?php } ?> </div> <style> .container{ display: flex; flex-wrap: wrap; justify-content: center; } .box { padding: 5px; } .col-sm-2{ width: 25%; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; margin-top: 20px; } @media screen and (max-width: 500px) { .col-sm-2{ width: 100%; position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; margin-top: 20px; } } </style>
Save