Viewing file: view_popupimage.php (6.31 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
session_start();
include('includes/header.php');
// Storing session data
$_SESSION["role"];
if(!isset($_SESSION["role"]))
{
header("location:admin_login.php");
?>
<script type="text/javascript">
window.location.href = "admin_login.php";
</script>
<?php
}
else
{
?>
<style>
.inner-block {
padding: 7em 2em 4em 2em;
}
</style>
<div class="page-container">
<div class="left-content">
<div class="mother-grid-inner">
<!--header start here-->
<div class="header-main" style="min-height: 80px;">
<div class="header-left">
<div class="logo-name">
<a href="admin_index.php"> <h3>SICS ADMIN</h3>
</br>
</a>
</div>
<div class="clearfix"> </div>
</div>
<!--notification menu end -->
<div class="profile_details">
<ul>
<li class="dropdown profile_details_drop">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<div class="profile_img">
<span class="prfil-img"><img src="images/p1.png" alt=""> </span>
<div class="user-name">
<p>Srishti Innovative</p>
<span><?php echo $_SESSION["name"];?></span>
</div>
<i class="fa fa-angle-down lnr"></i>
<i class="fa fa-angle-up lnr"></i>
<div class="clearfix"></div>
</div>
</a>
<ul class="dropdown-menu drp-mnu">
<!-- <li> <a href="#"><i class="fa fa-cog"></i> Settings</a> </li>
<li> <a href="#"><i class="fa fa-user"></i> Profile</a> </li> -->
<li> <a href="logout.php"><i class="fa fa-sign-out"></i> Logout</a> </li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--heder end here-->
<!-- script-for sticky-nav -->
<div class="inner-block" >
<h3 style="text-align: left;color: #337ab7;margin-bottom: 1%;">Banner</h3>
<?php
$query = "select * from popup_image order by id desc";
$result = $con->query($query);
?>
<table id="technologies" class="table table-striped table-bordered table-condensed">
<thead style="background: #7ab9f3;">
<tr>
<th>Sl.No</th>
<th>Title</th>
<th>Image</th>
<th>Description</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
$i=1;
while ($row = $result->fetch_assoc()) {
?>
<tr id="row_<?php echo $row["id"]; ?>">
<td><?php echo $i; ?></td>
<td><?php echo $row["title"]; ?></td>
<td><?php if ($row['image']) {
echo '<img src="../popup_image/' . $row['image'] . '" style="width:100px;" />';
} ?>
</td>
<td><?php echo $row["description"]; ?></td>
<td>
<button type="button" data-id="<?php echo $row["id"]; ?>" class="btn btn-danger delete" >Delete </button>
</td>
<?php
$i++;
}
?>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!--slider menu-->
<?php include('includes/sidebar.php'); ?>
<!--slide bar menu end here-->
<?php include('includes/footer.php'); ?>
<script>
$(document).ready(function () {
$('#technologies').DataTable();
var navoffeset = $(".header-main").offset().top;
$(window).scroll(function () {
var scrollpos = $(window).scrollTop();
if (scrollpos >= navoffeset) {
$(".header-main").addClass("fixed");
$(".sidebar-menu").addClass("fixed");
} else {
$(".header-main").removeClass("fixed");
$(".sidebar-menu").removeClass("fixed");
}
});
$('.delete').click(function() {
var id= $(this).data('id');
swal({
title: "Are you sure?",
text: "You want to delete this data?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes",
cancelButtonText: "No",
closeOnConfirm: false,
closeOnCancel: false
},
function(isConfirm){
if (isConfirm) {
$.ajax({
url: 'delete_popup_image.php',
type: "POST",
data: { id:id },
success: function(response) {
if(response!=0){
swal("Successfully deleted !","");
$('#row_'+id).hide();
} else{
swal("Something went wrong !", "", "");
}
}
});
} else {
swal("Cancelled", "", "error");
}
});
});
});
</script>
<?php
}
?>
|