MINI Sh3ll
<?php
include('include/session.php');
include('config/mysql_crud.php');
$db = new Database();
$db->connect();
$db->select('our_hosts','*',NULL,'flag=0','position ASC');
$our_hosts = $db->getResult();
?>
<!DOCTYPE html>
<html lang="en">
<?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>Our Hosts</small></h2>
</div>
<div class="col-md-4 col-lg-4">
<div class="pull-right"><a href="our_hosts_add.php" class="btn btn-success"><i class="icon-plus-sign"></i> Add Our Host </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>Designation </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($our_hosts as $our_host){
?>
<tr id="listItem_<?php echo $our_host['id']; ?>">
<td><?php echo $i; ?></td>
<td><?php echo html_entity_decode($our_host['host_name'],ENT_QUOTES)?> </td>
<td><?php echo html_entity_decode($our_host['designation'],ENT_QUOTES)?> </td>
<td><a class="btn btn-warning edit<?php echo $our_host['id']; ?>" rel="<?php echo $our_host['id']; ?>" href="our_hosts_edit.php?id=<?php echo $our_host['id']; ?>">Edit</a></td>
<td><a class="btn btn-danger global_delete del<?php echo $our_host['id']; ?>" rel="<?php echo $our_host['id']; ?>" bel="our_hosts" 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_our_hosts.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