ok
Direktori : /home2/selectio/www/lilyexpresslive/software/admin/ |
Current File : /home2/selectio/www/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'); } ?>