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: flash-news-api.php
<?php ob_start(); session_start(); include "../config/config.php"; $conditions=""; $id = $_REQUEST['id']; ?> <style> /* section { text-align: center; margin-top: 2.5%; } .scroll-arrow { width: 10%; display: inline-block; position: relative; vertical-align: middle; cursor: pointer; padding:0; margin:0; opacity: 0.5; font-size:34px; transition: 0.2s; } .scroll-arrow:hover { transition: 0.2s; opacity:1; } ul { width: 70%; scroll-behavior: smooth; display: inline-block; position: relative; vertical-align: middle; text-align: center; overflow-x: scroll; overflow-y: hidden; white-space: nowrap; -webkit-overflow-scrolling: touch; } ul::-webkit-scrollbar { display: none; } li { list-style: none; display: inline-block; position: relative; vertical-align: middle; width: 20%; margin-left: 1.5%; margin-right: 1.5%; transition: 0.2s; } li, img { width: 380px; } li:hover { transition: 0.2s; filter: grayscale(0); }*/ </style> <style> * { /*margin: 0; padding: 0; box-sizing: border-box;*/ } body { /*display: flex; align-items: center; justify-content: center;*/ } /* IMAGE */ .image-container { overflow-x: hidden; max-width: 768px; } .image-wrapper { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - (1.5rem * (var(--per-view) - 1))) / var(--per-view)); grid-gap: 1.5rem; position: relative; left: 0; transition: .3s; } .image-wrapper > * { aspect-ratio: 4 / 3; } .imgg { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: .5rem; } /* IMAGE */ </style> <div class="container"> <?php $statement = $pdo->prepare("SELECT * FROM `tbl_flash_news` WHERE 1=1 and id=?"); $statement->execute(array($id)); $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]['title']."</center>"; foreach ($emp_data as $data){ ?> <!--<section> <div class="scroll-arrow" id="scroll-left"> ← </div> <ul id="imgList"> <li><img src="https://images.pexels.com/photos/34950/pexels-photo.jpg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260"/></li> <li><img src="https://images.pexels.com/photos/34950/pexels-photo.jpg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260"/></li> <li><img src="https://images.pexels.com/photos/34950/pexels-photo.jpg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260"/></li> <li><img src="https://images.pexels.com/photos/34950/pexels-photo.jpg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260"/></li> <li><img src="https://images.pexels.com/photos/34950/pexels-photo.jpg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260"/></li> <li><img src="https://images.pexels.com/photos/34950/pexels-photo.jpg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260"/></li> </ul> <div class="scroll-arrow" id="scroll-right" onclick="scrollRight()"> → </div> </section>--> <?php $statements = $pdo->prepare("SELECT * FROM `tbl_flash_news_images` WHERE 1=1 and flash_news_id=?"); $statements->execute(array($id)); $emp_datas = $statements->fetchAll(PDO::FETCH_ASSOC); $totalDatas = $statements->rowCount(); if($totalDatas>0){ echo '<div class="image-container"> <div class="image-wrapper">'; foreach($emp_datas as $img){ ?> <div> <img src="<?=$img['image']?>" class="imgg" alt=""> </div> <?php } echo "</div> </div>"; } ?> <?php } }else{ ?> <?php } ?> </div>
Save