MINI Sh3ll
<?php
include('include/session.php');
include('config/mysql_crud.php');
$db = new Database();
$db->connect();
$db->select('case_studies','*',NULL,'flag=0','position ASC');
$case_studies = $db->getResult();
?>
<!DOCTYPE html>
<html lang="en">
<style>
span.status_active{background:#19a519; color:#fff; padding:7px 14px;cursor: pointer;}
span.status_inactive{background:#c13d39; color:#fff; padding:7px 8px;cursor: pointer;}
</style>
<?php include('header.php');?>
<body class="nav-md">
<div class="container body">
<div class="main_container">
<?php include('nav.php');?>
<?php include('top_navigation.php');?>
<!-- page content -->
<div class="right_col" role="main">
<div class="">
<div class="clearfix"></div>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<div class="col-md-8 col-lg-8">
<h2> Case Studies </small></h2>
</div>
<div class="col-md-4 col-lg-4">
<div class="pull-right"><a href="case_studies_add.php" class="btn btn-success"><i class="icon-plus-sign"></i> Add Case Study </a></div>
</div>
<div class="clearfix"></div>
</div>
<div id="info" class="col-md-12">Status : Waiting for you to reorder</div>
<br/> <br/>
<?php if(isset($_SESSION['message'])) { ?>
<div class="col-lg-12">
<div class="alert alert-success">
<a href="#" class="close" data-dismiss="alert">×</a>
<strong><?php echo $_SESSION["message"]; ?></strong>
</div>
</div>
<?php unset($_SESSION['message']); } ?>
<div class="x_content">
<table id="datatable-checkbox" class="table table-striped table-bordered bulk_action">
<thead>
<tr>
<th>Sr.</th>
<th>Name</th>
<th>Status </th>
<th>Edit</th>
<th>Delete</th>
<th>Sort</th>
</tr>
</thead>
<tbody id="test-list" style="list-style:none; padding-top:20px;">
<?php
$i=1;
foreach($case_studies as $case_study){
?>
<tr id="listItem_<?php echo $case_study['id']; ?>">
<td> <?php echo $i; ?> </td>
<td> <?php echo html_entity_decode($case_study['name'],ENT_QUOTES) ?> </td>
<td class="text-center">
<?php if($case_study['status']=="0"){ ?>
<span class="status_active global_status" rel="<?php echo $case_study['id']; ?>" bel="case_studies" status_div<?php echo $case_study['id']; ?>"> Active </span>
<?php } else { ?>
<span class="status_inactive global_status" rel="<?php echo $case_study['id']; ?>" bel="case_studies" status_div<?php echo $case_study['id']; ?>"> Inactive </span>
<?php } ?>
</td>
<td><a class="btn btn-warning edit<?php echo $case_study['id']; ?>" rel="<?php echo $case_study['id']; ?>" href="case_studies_edit.php?id=<?php echo $case_study['id']; ?>">Edit</a></td>
<td><a class="btn btn-danger global_delete del<?php echo $case_study['id']; ?>" rel="<?php echo $case_study['id']; ?>" bel="case_studies" href="javascript:void(0)">Delete</a></td>
<td class="handle text-center">
<img src="images/arrow.png" width="30" height="30" alt="move" class="handle" />
</td>
</tr>
<?php $i++; } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /page content -->
<!-- footer content -->
<?php include('footer.php');?>
<!-- /footer content -->
</div>
</div>
<script>
$(document).ready(function() {
$("#test-list").sortable({
handle: '.handle',
update: function() {
var order = $('#test-list').sortable('serialize');
$("#info").load("process_sortable_case_studies.php?" + order, function() {
var kk = 1;
$('.pos_no').each(function() {
$(this).html('Position: <span class= "namestyle" >' + kk + '</span>')
kk = kk + 1;
})
});
}
});
$('body').on('click','.global_delete',function(){
var table=$(this).attr('bel');
var id=$(this).attr('rel');
if(confirm('Are you sure you want to delete it?')==true) {
$.ajax({
type:'POST',
url:'delete.php',
data:'table='+table+'&id='+id,
success:function(){
$('.del'+id).parent().parent().fadeOut('slow');
}
})
}
})
});
</script>
</body>
</html>
OHA YOOOO