|
Posted by haggis on 03/12/06 11:07
Our restaurant is developing a Delivery service and I'm wondering
how to handle the choices the customers will make on-line.
Stripped of the cosmetics, this is the display of the whole menu
(which is compiled from the output of several different menus -
"Starters", "Main Courses", "Salads", etc).
The restaurant is developing a Delivery service and I'm wondering
how to handle the choices the on-line customers will make.
This bare-bones display of the choices works fine -
$TableName="menus";
$Query="SELECT * FROM $TableName order by menu_id";
$Result=mysql_db_query ($DBName, $Query, $Link);
while ($Row=mysql_fetch_array ($Result))
{
$list_of_menus[]=$Row[menu_name];
}
$count=count($list_of_menus);
$count=$count-1;
$n="0";
while ($n<=$count)
{
print("<form method=post action=take_away_handle.php>");
print("<table>");
$TableName=$list_of_menus[$n];
$Query="SELECT * FROM $TableName order by dish_id";
$Result=mysql_db_query ($DBName, $Query, $Link);
while ($Row=mysql_fetch_array ($Result))
{
print("<tr><td>$Row[dish]</td><td>$Row[cost] <input
TYPE=\"checkbox\" NAME=\"$list_of_menus[$]\" VALUE=\"$Row[dish]\">
</td><td><input type=text name=\"number\" size=2></td></tr>");
}
$++;
}
All that works just fine, unrolling the 80-odd dishes in our menu
down the screen, but... how do I handle the output? I'm guessing
it would be best to write each set of customer choices to a file,
its filename being composed of the customer surname, but how do I
handle the blank items? Are they, indeed, passed by the form?
(Guess who's never used check-boxes before? Go on, guess - you'll
never guess...)
TIA.
All that works just fine, unrolling the 80-odd dishes in our menu
down the screen, but... how do I handle the output? I'm guessing
it would be best to write each set of customer choices to a file,
with the filename being the customer name, but how do I handle the
blank items? Are they, indeed, passed by the form?
And how do I handle multiple items (several people ordering
different dishes from the "Main Courses", for instance)?
(Guess who's never used check-boxes before? Go on, guess - you'll
never guess...)
TIA.
Remove _your_teeth_ to reply.
[Back to original message]
|