File "slider-view.php"
Full path: /home/fsibplc/public_html/admin/slider-view.php
File
size: 4.08 B (4.08 KB bytes)
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Editor Back
<?php
include('config/dbcon.php');
include('authentication.php');
//session_start();
include('include/header.php');
?>
<div class="container-fluid px-4">
<div class="row mt-4">
<div class="col-md-12">
<?php include('message.php'); ?>
<div class="card">
<div class="card-header">
<h4>View Sliders<a href="slider-add.php" class="btn btn-primary float-end">Add Slider</a></h4>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table bordered table-striped">
<thead>
<tr>
<th>ID</th>
<th>Title</th>
<th>Image</th>
<th>Status</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
<?php
// $post = "SELECT * FROM posts WHERE status!='2'";
$slider = "SELECT * FROM slider";
$slider_run = mysqli_query($con, $slider);
if(mysqli_num_rows($slider_run)>0)
{
foreach($slider_run as $slider)
{
?>
<tr>
<td><?= $slider['id'] ?></td>
<td><?= $slider['name'] ?></td>
<td>
<img src="../uploads/slider/<?= $slider['image'] ?>" width="60px" height="60px" />
</td>
<td>
<?= $slider['status'] == '1' ? 'Hidden':'Visible' ?>
</td>
<td>
<a href="slider-edit.php?id=<?= $slider['id'] ?>" class="btn btn-success">Edit</a>
</td>
<td>
<form action="code.php" method="POST">
<button type="submit" name="slider_detete_btn" value="<?= $slider['id'] ?>" class="btn btn-danger" onclick='return checkDelete()'>Delete</button>
</form>
</td>
</tr>
<?php
}
}else{
?>
<tr>
<td colspan="7">No Record Found</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function checkDelete(){
return confirm('Are you sure you want to delete this record?');
}
</script>
<?php
include('include/footer.php');
include('include/script.php');
?>