This is a parking lot system.
This is the one of my module. The error in this codes is the status cancel.
I want it the status cancel is will display in my system a color yellow like the status leave but still its not functioning. the reserve , occupied and yellow only us functioning.
<?php include 'dbcon.php';
$result = mysqli_query($con,"SELECT * FROM `zonenumber` WHERE 1");
while ($fetch = mysqli_fetch_array($result))
{
$name = $fetch['name'];
$status = $fetch['status'];
if ($status == 'Cancel') $color = 'yellow';
if ($status == 'Reserved') $color = 'green';
if ($status == 'Occupied') $color = 'red';
if ($status == 'Leave') $color = 'yellow';
if ($color != 'yellow')
{
$print = "javascript:popUp('zonestatus_1.php?id=$name');";
}
else
{
$print = "javascript:alert('There is NO Information Available')";
}
?>
Just a suggestion instead of severl if you could use a swicth statement
and close your while loop