
<?PHP

# STOP HERE 
#################################################################### 
# THIS CODE IS USED TO CONNECT TO THE MYSQL DATABASE 
include"config.php";
$RepairStatus=$_POST['RepairStatus'];


//$password=$_POST['password'];
$hidden=$_POST['hidden'];

if ($RepairStatus=='UnderDiagonsis'){
$UnderDiagonosis=date("Y/m/d") ;
$query="update repair set RepairStatus='$RepairStatus',UnderDiagonosis='$UnderDiagonosis' where RepairId='$hidden'";
}

if ($RepairStatus=='Fixed'){
$FixedOn=date("Y/m/d") ;
$query="update repair set RepairStatus='$RepairStatus',FixedOn='$FixedOn' where RepairId='$hidden'";
}

elseif($RepairStatus=='Discharge'){
$DischargeDate=date("Y/m/d") ;
$query="update repair set RepairStatus='$RepairStatus', DischargeDate='$DischargeDate' where RepairId='$hidden'";
}


$link=mysqli_query($conn,$query) or die('Error, failed to select records'); 

header("location: RepairStatusList.php");
?>







