
PK 
<?php
include("header.php");
if($_SESSION["aid"]=='')
{
"<script>window.location='index.php';</script>";
}
@extract($_POST);
// ======Status Update query==========
if(isset($_GET['status']))
{
if($_GET['status']=="1")
{
$sql="UPDATE jeff_banner SET status='0' where id='".$_GET['id']."'";
mysqli_query($conn,$sql);
}
if($_GET['status']=="0")
{
$sql="UPDATE jeff_banner SET status='1' where id='".$_GET['id']."'";
mysqli_query($conn,$sql);
}
}
?>
<html>
<body>
<style>
#header_hover:hover{
background-color:#000 ! important;
}
</style>
<div id="wrapper">
<?php
include('sidebar.php');
?>
<div id="page-wrapper" class="gray-bg">
<?php include('afterlog_top.php'); ?>
<!--------- Title ------------>
<div class="row wrapper border-bottom white-bg page-heading">
<div class="col-lg-10">
<h2>Banner Management</h2>
<ol class="breadcrumb">
<li>
<a href="dashboard.php">Home</a>
</li>
<li class="active">
<strong>Banner Management</strong>
</li>
</ol>
</div>
<div class="col-lg-2">
</div>
</div>
<!--------- End Title ------------>
<div class="wrapper wrapper-content">
<div class="row animated fadeInRight">
<div class="col-md-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<a href="" class="btn btn-danger btn-xs" id="header_hover" ><h5 >Banner Management</h5></a>
<a href="add_banner.php" class="btn btn-primary btn-xs" id="header_hover" ><h5 >Add</h5></a>
<div class="pull-right tooltip-demo ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<a class="close-link">
<i class="fa fa-times"></i>
</a>
</div>
</div>
<!---------------- Form ---------------->
<div class="ibox-content">
<center>
<?php
if(isset($flag)=="success")
{
echo "<font style='text-align:center;color:green;font-size: 15px;'>Banner Added Successfully </font>";
}
if(isset($flag)=="delete")
{
echo "<font style='text-align:center;color:green;font-size: 15px;'>Banner Deleted Successfully </font>";
}
if(isset($flag)=="update")
{
echo "<font style='text-align:center;color:green;font-size: 15px;'>Banner Update Successfully </font>";
}
?>
</center>
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover dataTables-example">
<thead>
<tr>
<th>S.NO</th>
<th>Image</th>
<th>Current Time</th>
<th>status</th>
<th>Edit</th>
<th>Delete</th></tr>
</thead>
<tbody>
<?php
$act=mysqli_query($conn,"select * from jeff_banner ORDER BY id DESC");
$i=0;
while($tb=mysqli_fetch_array($act))
{
$i++;
?>
<tr>
<td style="text-align:center;"><?php echo $i+1;?></td>
<td style="text-align:center;">
<img src="./uploads/banner_img/<?php echo $tb['image'];?>"alt="" height="50" width="175"></td>
<td><?php echo $tb['current_time'];?></td>
<?php
$status_res=$tb['status'];
if($status_res == "0")
{
$status = "InActive";
}
else
{
$status = "Active";
}
?>
<td><a href="banner_management.php?id=<?php echo $tb['id']; ?>&&status=<?php echo $status_res?>"><?php echo $status;?> </a></td>
<td style="text-align:center;">
<a href="edit_banner.php?id=<?php echo $tb['id']; ?>"><img src="img/copy.png" alt="icon"/></a></td>
<td style="text-align:center;">
<a href="delete_banner.php?id=<?php echo $tb['id']; ?>"><img src="img/delete.png" alt="icon"/></a></td>
</tr>
<?php
}
?>
</table>
</div>
<?php
//}
?>
</div>
</div>
</div>
</div>
</div>
<!-------=======================----Footer----------===================------->
<?php include('footer.php');?>
<!----------===================---------- End Footer -----==================------->
</div>
</div>
</body>
</html>
<script>
$(document).ready(function(){
$('.dataTables-example').DataTable({
pageLength: 25,
responsive: true,
dom: '<"html5buttons"B>lTfgitp',
buttons: [
{ extend: 'copy'},
{extend: 'csv'},
{extend: 'excel', title: 'ExampleFile'},
{extend: 'pdf', title: 'ExampleFile'},
{extend: 'print',
customize: function (win){
$(win.document.body).addClass('white-bg');
$(win.document.body).css('font-size', '10px');
$(win.document.body).find('table')
.addClass('compact')
.css('font-size', 'inherit');
}
}
]
});
});
</script>


PK 99