Server Address : 2a02:4780:a:760:0:37cc:13e2:3
Web Server : LiteSpeed
Uname : Linux uk-fast-web660.main-hosting.eu 5.14.0-570.55.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Oct 21 05:27:51 EDT 2025 x86_64
PHP Version : 7.4.33
<?php
require 'top.inc.php';
if(isset($_GET['type']) && $_GET['type']!=''){
$type=get_safe_value($conn,$_GET['type']);
if($type=='delete'){
$id=get_safe_value($conn,$_GET['id']);
$get_img="select img_url from slideshow where id='$id'";
$res=mysqli_query($conn,$get_img);
$row=mysqli_fetch_assoc($res);
unlink(SERVER_PATH."/images/slideshow/".$row['img_url']);
//Deleting from database
$delete_sql="delete from slideshow where id='$id'";
mysqli_query($conn,$delete_sql);
}
}
$sql="select * from slideshow";
$res=mysqli_query($conn,$sql);
?>
<div class="content pb-0">
<div class="orders">
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<h4 class="box-title">Slideshow </h4>
<h4 class="box-link"><a href="manage_slideshow.php">Add Slideshow</a> </h4>
</div>
<div class="card-body--">
<div class="table-stats order-table ov-h">
<table class="table ">
<thead>
<tr>
<th class="serial">#</th>
<th>Image</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$i=1;
while($row=mysqli_fetch_assoc($res)){?>
<tr>
<td class="serial"><?php echo $i; ?></td>
<td><img src="<?php echo SITE_PATH."/images/slideshow/".$row['img_url']?>" alt=""></td>
<td>
<?php
echo "<span class='badge badge-edit'><a href='manage_slideshow.php?id=".$row['id']."' >Edit</a></span> ";
echo "<span class='badge badge-delete'><a href='?type=delete&id=".$row['id']."' >Delete</a></span>";
?>
</td>
</tr>
<?php $i++; } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php require 'footer.inc.php';?>