<?php require_once('header.php'); ?>
<?php if($allPermissions['hsncode']['read']=="1"){ ?>

<script type="text/javascript" language="javascript" >
			$(document).ready(function() {
			     var client_type = $('#client_type').val();
			     var del=<?=$allPermissions['hsncode']['delete'] ?>;
                    var edit=<?=$allPermissions['hsncode']['update'] ?>;
				var dataTable = $('#hsn_code-grid').DataTable( {
					"processing": true,
					"serverSide": true,
					"ajax":{
						url :"data-tables/hsn-list-data-table.php", // json datasource
						data: {client_type:client_type,del:del,edit:edit},
						type: "post",  // method  , by default get
						error: function(){  // error handling
							$(".hsn_code-grid-error").html("");
							$("#hsn_code-grid").append('<tbody class="hsn_code-grid-error"><tr><th colspan="3">No data found in the server</th></tr></tbody>');
							$("#hsn_code-grid_processing").css("display","none");
							
						}
					}
				} );
			} );
</script>

<section class="content-header">
	<div class="content-header-left form-group" >
		<h1>View HSN Code <?php if($allPermissions['hsncode']['create']=="1"){ ?>&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;<a href="hsnCode-add.php" class="btn btn-danger btn-sm">Add New Hsncode</a><?php } ?></h1>
	</div>
		<div class="col-md-2">
	    <div class="form-group">
    		      <?php if($allPermissions['hsncode']['create']=="1"){ ?> <a class="btn btn-danger btn-sm" href="hsnCodeBulkUpload.php">Bulk Upload</a><?php } ?>
		</div>
	</div>
</section>
<input type="hidden" id="client_type" name="client_type" value="<?php echo $clientType; ?>">
<section class="content">
	<div class="row">
		<div class="col-md-12">
			<div class="box box-info">
				<div class="box-body table-responsive">
					<table id='hsn_code-grid' class="table table-bordered table-striped">
						<thead>
							<tr>
								<th width="30">SL</th>
								<th>Action</th>
								<th>HSN Code</th>
								<th>IGST</th>
								<th>CGST</th>
								<th>SGST</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">
        <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">Delete Confirmation</h4>
            </div>
            <div class="modal-body">
                <p>Are you sure want to delete this HSNCode ?</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-sucess" data-dismiss="modal">Cancel</button>
                <a class="btn btn-sucess btn-ok">Delete</a>
            </div>
        </div>
    </div>
</div>

<?php }else{ ?>
<center><h4 style="color:red;">You don't have permission to view hsncode </h4></center>
<?php } ?>
<?php require_once('footer.php'); ?>