hi, im a newbie here. im seeking help for my problem. i am also new in php but have some knowledge in sql here's my problem. my boss wants to enable update the baking chamber table once the Estimated End Time reached only. meaning if the end time doesn't meet there will be a pop up on the page that operator cannot finished unless the estimated end time is reached. Please kindly help check my code and see screenshot attached for your reference. Thanks in advanced guys.
if($_POST['submit']=="Bake Finished")
{
$time = strftime('%I:%M %p');
$hours = strftime('%H');
$min = strftime('%M');
$query=mysql_query("SELECT * FROM tbl_baking_chamber");
while($result=mysql_fetch_array($query))
{
$recno=$result['RecNo'];
if(isset($_POST[$recno])!=NULL)
{
mysql_query("UPDATE tbl_baking_chamber set tbl_baking_chamber.TotalTime='$TotalTime' where RecNo='".$recno."'");
mysql_query("UPDATE tbl_baking_chamber set tbl_baking_chamber.EndTime='$CurrentDate - $time' where RecNo='".$recno."'");
mysql_query("UPDATE tbl_baking_chamber set tbl_baking_chamber.Status='Finished' where RecNo='".$recno."'");
}
}
}
if($_POST['submit']=="On Baking" || $_POST['submit']=="Bake Finished")
{
echo "<table class='tbl_Forbaking' cellspacing='1' border='0' width='680'>";
echo "<form action='Applications.php?type=BGABaking' method='post'>";
echo "<tr>";
//echo "<td class='text2' align='center' bgcolor='e3e6e5' height='40'>"."MODEL"."</td>";
echo "<td class='text2' align='center' bgcolor='e3e6e5'>"."SERIAL NUMBER"."</td>";
echo "<td class='text2' align='center' bgcolor='e3e6e5'>"."DEFINED <br> BAKE TIME"."</td>";
echo "<td class='text2' align='center' bgcolor='e3e6e5'>"."BATCH"."</td>";
echo "<td class='text2' align='center' bgcolor='e3e6e5'>"."LOCATION"."</td>";
echo "<td class='text2' align='center' bgcolor='e3e6e5'>"."START TIME"."</td>";
echo "<td class='text2' align='center' bgcolor='e3e6e5'>"."ESTIMATED <br> END TIME"."</td>";
echo "<td class='text2' align='center' bgcolor='e3e6e5'>"."<input type='submit' name='submit' value='Bake Finished' class='btn_Bake'>"."</td>";
$Query = mysql_query("SELECT * FROM tbl_baking_chamber where Status='On Baking'");
$count = mysql_num_rows($Query);
$bgcolor="e3e6e5";
while($result = mysql_fetch_array($Query))
{
if($bgcolor=='e3e6e5')
{
$bgcolor='e9ebea';
}
else
{
$bgcolor='e3e6e5';
}
echo "<tr>";
//echo "<td class='text1' align='center' bgcolor='$bgcolor'>".$result['Model']."</td>";
echo "<td class='text1' align='center' bgcolor='$bgcolor'>".$result['Serial']."</td>";
echo "<td class='text1' align='center' bgcolor='$bgcolor'>".$result['BakingHours']."</td>";
echo "<td class='text1' align='center' bgcolor='$bgcolor'>".$result['Batch']."</td>";
echo "<td class='text1' align='center' bgcolor='$bgcolor'>".$result['Chamber']."</td>";
echo "<td class='text1' align='center' bgcolor='$bgcolor'>".$result['StartTime']."</td>";
echo "<td class='text1' align='center' bgcolor='$bgcolor'>".$result['SEndTime']."</td>";
echo "<td class='text1' align='center' bgcolor='$bgcolor'>"."<input type='checkbox' value='$result[RecNo]' id='$result[RecNo]' name='$result[RecNo]'>"."</td>";
}
echo "</form>";
echo "<tr>";
echo "<td>"."<br/>";
echo "<tr>";
echo "<td class='text4'>"."Total QTY.: $count";
echo "</table>";
}