hi,
i was having hard time thinking what's wrong with my code. if PrjCode is empty it displays "Incomplete" and if MapNumber is empty it dispalys "Forgot to input MapNumber". however, if RegHrsBox, OTHrsBox, PStatusBox are empty or 0 it still inserts data in my database. What I would like to do is if RegHrsBox,OTHrsBox,PStatusBox are empty then display "ZeroValue" but if RegHrsBox is empty but the OTHrsBox is not empty and PStatusBox,PrjCode and MapNumber are not empty then it will insert the data. Same also if RegHrsBox is not empty but the OTHrsBox is empty and PStatusBox,PrjCode and MapNumber are not empty then it will insert the data.
if ($_POST["addButtonUp"]=="ADD")
{
//select from database
if (!($selectNewPinRec2==0))
{
if ($_POST["PrjCode"]!="" && ...)
{
if ($_POST["MapNumber"]=="0" ¦¦ ...)
{
if ($_POST["RegHrsBox"]=="0.00" ¦¦ ...)
{
if ($_POST["OTHrsBox"]=="0.00" ¦¦ ...)
{
if ($_POST["PStatusBox"]=="00%" ¦¦ ...)
{
echo "ZeroValue";
}
else
{
//insert data into database
}
}
}
else
{
echo "Forgot to input MapNumber";
}
}
else
{
//insert data into database
}
}
else
{
echo "Incomplete";
}
}
else
{
echo "NoRecord";
}
}
hoping you could help me.