ok

Mini Shell

Direktori : /home2/selectio/public_html/lilyexpresslive/software/admin/
Upload File :
Current File : /home2/selectio/public_html/lilyexpresslive/software/admin/logistic-delete.php

<?php require_once('header.php'); ?>

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

<?php

    $statement = $pdo->prepare("SELECT * FROM tbl_awb WHERE logistic_id=?");
	$statement->execute(array($_REQUEST['id']));
	$total = $statement->rowCount();

if($total){
    echo ("<script LANGUAGE='JavaScript'>
    window.alert('This Logistic Already Awb List Added Can not Delete!');
    window.location.href='logistics.php';
    </script>");
}else{
    $statement = $pdo->prepare("DELETE FROM tbl_logistic WHERE id=?");
	$statement->execute(array($_REQUEST['id']));
	header('location: logistics.php');
}
	
?>

Zerion Mini Shell 1.0