<?php require_once('header.php'); ?>
<?php if($session_id==1 || $allPermissions['zone_master']['read']=="1"){ ?>
<section class="content" style="background-color: white;">
    <div class="row">
		<div class="col-md-4" style="text-align: left;">
			<h4><i class="fa fa-map-marker"></i> Zone Details</h4>
		</div>
		<div class="col-md-8" style="text-align: right;"> 
		<?php if($session_id==1 || $allPermissions['zone_master']['create']=="1"){ ?>
		    <a href="zone.php" class="btn btn-success btn-sm"><i class="fa fa-plus"></i> Create New Zone</a>
		    <?php } ?>
		    <a href="index.php" class="btn btn-warning btn-sm"><i class="fa fa-arrow-left"></i> Back to Home</a>
		</div>
	</div> 
    
	<div class="row">
		<div class="col-md-12">
			<div>
			<div class="box-body table-responsive">
					<table id="employee-grid"  class="table table-bordered table-striped">
						<thead>
							<tr>
								<th width="30">S.No</th>
								<th>Actions</th>
								<th>Zone Name</th>
								<th>Description</th>
								<th>Status</th>
							</tr>
						</thead>
					</table>
				</div>
			</div>
		</div>
	</div>
</section>

<div class="modal fade" id="confirm-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">Are you sure?</h4>
            </div>
            <div class="modal-body">
                <p>Are you sure want to delete this item?</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                <a class="btn btn-danger btn-ok">Delete</a>
            </div>
        </div>
    </div>
</div>

<?php } ?>
<?php require_once('footer.php'); ?>

<script type="text/javascript">
$(document).ready(function(){
    getData();
});


function getData(){
	var dataTable = $('#employee-grid').DataTable( {
		"processing": true,
		"serverSide": true,    
        "destroy":true,
        "ajax":{
			url : "data-tables/zone-data-table.php",
			type: "post", 
			error: function(){ 
				$(".employee-grid-error").html("");
				$("#employee-grid").append('<tbody class="employee-grid-error"><tr><th colspan="10" style="text-align;center;">No data found in the server</th></tr></tbody>');
				$("#employee-grid_processing").css("display","none");
			}
		}
	} );
    }
</script>