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


<?php
if(!isset($_REQUEST['id'])) {
	header('location: logout.php');
	exit;
} else {
	// Check the id is valid or not
	$statement = $pdo->prepare("SELECT * FROM tbl_hsncode WHERE id=?");
	$statement->execute(array($_REQUEST['id']));
	$total = $statement->rowCount();
	if( $total == 0 ) {
		header('location: logout.php');
		exit;
	}
}
?>

<?php

	// Delete from hsncode
	$statement = $pdo->prepare("DELETE FROM tbl_hsncode WHERE id=?");
	$statement->execute(array($_REQUEST['id']));

	header('location: hsnCode.php');
?>
<?php }else{ ?>
<center><h4 style="color:red;">You don't have permission to delete hsncode this page </h4></center>
<?php } ?>