<?php
require('top_inc.php');
if (isset($_GET['type']) && $_GET['type']!='') {
$type=get_safe_value($con,$_GET['type']);
if ($type=='status') {
$operation=get_safe_value($con,$_GET['operation']);
$id=get_safe_value($con,$_GET['id']);
if($operation=='active'){
$status='1';
}
else{
$status='0';
}
$update_status="update testimonial set status='$status' where id='$id'";
mysqli_query($con,$update_status);
}
if ($type=='delete') {
$id=get_safe_value($con,$_GET['id']);
$delete_sql="delete from testimonial where id='$id'";
mysqli_query($con,$delete_sql);
}
}
$sql="select * from testimonial";
$res=mysqli_query($con,$sql);
?>
<!-- Header Menu Area End Here -->
<!-- Page Area Start Here -->
<div class="dashboard-page-one">
<?php
require('side_menu.php');
?>
<!-- Sidebar Area End Here -->
<div class="dashboard-content-one">
<!-- Breadcubs Area Start Here -->
<div class="breadcrumbs-area">
<h3>All Product</h3>
<ul>
<li>
<a href="index.html">Home</a>
</li>
<li>Product</li>
</ul>
</div>
<!-- Breadcubs Area End Here -->
<!-- All Subjects Area Start Here -->
<div class="row">
<div class="col-8-xxxl col-12">
<div class="card height-auto">
<div class="card-body">
<div class="heading-layout1">
<div class="item-title">
<h3>All Product</h3>
</div>
</div>
<div class="table-responsive">
<table class="table display data-table text-nowrap">
<thead>
<tr>
<th>#</th>
<th>ID</th>
<th>Name</th>
<th>Designation</th>
<th>Review</th>
<th>Image</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$i=1;
while ($row=mysqli_fetch_assoc($res)) { ?>
<tr>
<td><?php echo $i++; ?></td>
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['digi']; ?></td>
<td><?php echo $row['description']; ?></td>
<td><img src="<?php echo PRODUCT_IMAGE_SITE_PATH.$row['image']; ?> " width="100px"></td>
<td>
<?php
if( $row['status']==1){
echo "<span class='complete'><a href='?type=status&operation=deactive&id=".$row['id']."'>Active</a></span>";
}
else{
echo "<span class='pendding'><a href='?type=status&operation=active&id=".$row['id']."'>Deactive</a></span>";
}
?>
<?php echo"<span class='edit'><a href='manage_products.php?id=".$row['id']."'> Edit</a></span>";
?>
<?php echo"<span class='delete'><a href='?type=delete&id=".$row['id']."'> Delete</a></span>";
?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<?php
require('footer_inc.php');
?>