// GET ALL SPECIALS ON THE SELECTED DATE
function getSpecialsForDate($year, $month, $day) {
?>
$sql = "SELECT * FROM tbl_specials_scheduler WHERE YEAR(spsc_date) = '$year' AND MONTH(spsc_date) = '$month' AND DAY(spsc_date) = '$day' ORDER by spsc_id ASC";
$result = dbQuery($sql);
$numfields = mysql_num_rows($result);
$numfieldsLeft = (6 - $numfields);
if ($numfields <= 6) {
$numfieldsLeft = (6 - $numfields);
echo "
Specials Management:
";
if ($numfields >= 0) {
?>
You have set echo $numfields; ?> out of 6 specials:
supnotesish
| Title |
Type |
Price |
Bev |
Sal |
Modify |
Delete |
}
if ($numfields >= 1) {
while($row = mysql_fetch_array($result)){
extract($row);
?>
| echo $sp_title; ?> |
echo $sp_cat; ?> |
echo $sp_price; ?> |
echo $sp_beverage; ?> |
echo $sp_salad; ?> |
Modify |
);">Delete |
}
}
else if ($numfields == 0) {
?>
|
You have not set any specials for this date.
|
}
echo "";
}
echo "
";
echo "
";
echo "
";
if ($numfieldsLeft >= 1) {
$sql = "SELECT sp_id, sp_title, sp_cat, sp_price, sp_beverage, sp_salad, sp_price
FROM tbl_specials_presets
ORDER BY sp_id";
$result = dbQuery($sql);
?>
You may add up to echo $numfieldsLeft; ?> more specials from your presets:
| Title |
Type |
Price |
Bev |
Sal |
Add |
while($row = mysql_fetch_array($result)){
extract($row);
?>
| echo $sp_title; ?> |
echo $sp_cat; ?> |
echo $sp_price; ?> |
echo $sp_beverage; ?> |
echo $sp_salad; ?> |
);">Add |
}
echo "
";
}
else if ($numfieldsLeft == 0) {
$sql = "SELECT sp_id, sp_title, sp_cat, sp_price, sp_beverage, sp_salad, sp_price
FROM tbl_specials_presets
ORDER BY sp_id";
$result = dbQuery($sql);
?>
Add Presets:
* You have used all echo $numfields; ?> slots; you must delete a set special from the table above before you can add another preset from below:
| Title |
Type |
Price |
Bev |
Sal |
Add |
while($row = mysql_fetch_array($result)){
extract($row);
?>
| echo $sp_title; ?> |
echo $sp_cat; ?> |
echo $sp_price; ?> |
echo $sp_beverage; ?> |
echo $sp_salad; ?> |
Add |
}
echo "
";
}
?>
Quick add:
(it is suggeststed you manage your presets through the menu admin.. specials submitted with quick add cannot contain options and will only be used once (for the date that its inserted) )
}
?>