Current Directory: /home/u930863517/domains/limraevents.com/public_html/php
Viewing File: /home/u930863517/domains/limraevents.com/public_html/php/gallery.php
<?php
include_once "./db.php";
if(isset($_POST["limit"], $_POST["start"]))
{
// $query = "SELECT * FROM `gallery` ORDER BY `id` DESC LIMIT ".$_POST["start"].", ".$_POST["limit"]."";
$query = "SELECT * FROM `gallery` ORDER BY `id` DESC LIMIT ".$_POST["start"].", ".$_POST["limit"]."";
$result = mysqli_query($conn, $query);
$flag = 0;
while($row = mysqli_fetch_array($result))
{
if($row['status'] == "Published"){
$flag = 1;
echo '
<a href = "'.substr($row['originalImage'], 4).'" class="popup-link">
<div class="image-wrapper">
<div class="image" style="background: url('.substr($row['thumbnailImage'], 4).')">
</div>
<div class="text">
<h5> '.$row['imageTitle'].' </h5>
<p> '.$row['imageCategory'].' </p>
</div>
</div>
</a>
';
}
}
if($flag == 1){
echo "
<script>
$('.photo-grid .popup-link').magnificPopup({
type: 'image',
gallery: { enabled: true }
});
</script>
";
}
}