<?php
session_start();
if(!isset($_SESSION['username']) || !isset($_SESSION['password'])){
 header("Location: index.php");
} 
 //include 'logoff.html';
?>
<?php
$link = mysqli_connect("localhost", "comeadve_glory1", "Safari#@2027$", "comeadve_tdmc");
if($link === false){

        die("ERROR: Could not connect. " . mysqli_connect_error());

    }
	
    $idNumber = mysqli_real_escape_string($link, $_POST['IDNumber']);
	//$idNumber = $_POST['IDNumber'];
	
    $sql = "DELETE FROM dishwasher WHERE IDNumber='$idNumber'";
    if(mysqli_query($link, $sql)){

       // echo "Porter with A/C Number."." ".$idNumber.""." "."Has been removed";
		$msgdd = "Dishwasher with A/C Number."." ".$idNumber.""." "."Has been removed";
        header("location:deleteporter.php?msgdd=$msgdd");
	
    } else{

       // echo "Error !".mysqli_error($link);
		$msgdd = "Error !".mysqli_error($link);
        header("location:deleteporter.php?msgdd=$msgdd");
		
    }

    mysqli_close($link);
?>