I'm trying to automate our patients meal choices for our galley.
When a patient comes in, a nurse will get their meal choice for the next three meals and enter them into the computer.
It will show up like this:
name Room meal1 meal2 meal3
What I need help with is if there is only one meal for a person (might be waiting for approval to change diet or they may be going home before the 2nd meal), I need the system to put two blank cells in the table so everything lines up right.
The code I have is this which works great if there are three meals entered.
$today_time = date ("H:i");
$food_query = "SELECT fo.*, me.*, mc.* FROM food AS fo INNER JOIN mealchoice AS mc ON fo.Choice=mc.MCID INNER JOIN meal AS me ON me.MID=fo.Meal WHERE Patient = '$nurse_id' AND FDate >= '$current_date' Order By FDate, MID ASC";
$food_query_result = mysql_query($food_query);
if (mysql_num_rows($food_query_result) > 0)
$count = 0;
while ($food_row = mysql_fetch_assoc($food_query_result))
$food_id = $food_row['FID'];
$Meal = $food_row['MealChoice'];
$Choice = $food_row['MealChoice1'];
$Comments = $food_row['Comments'];
if ($count == 3)