View file admin/designation-delete.php

File size: 674B
<?php require_once('header.php'); ?>

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

<?php

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

	header('location: designation.php');
?>