get_by_id("meal",$itemid,"cat,ord,name,description1,description,price,price1,price2,image"); if(!$meal) { echo "Menu item not created!"; } else { $cat=$ITEM->get_by_id("cat",$meal["cat"],"name,description,image,ord,ph1,ph2,ph3"); $price_count=((empty($cat["ph1"]))?0:1)+((empty($cat["ph2"]))?0:1)+((empty($cat["ph3"]))?0:1); ?>
'; } echo nl2br($meal["description1"]); ?>
0) { if(!empty($cat["ph1"])) { echo ''.$cat["ph1"].': '; echo format_price($meal["price"]); echo "
\n"; } if(!empty($cat["ph2"])) { echo ''.$cat["ph2"].': '; echo format_price($meal["price1"]); echo "
\n"; } if(!empty($cat["ph3"])) { echo ''.$cat["ph3"].': '; echo format_price($meal["price2"]); echo "
\n"; } } else { echo 'Price:'; echo format_price($meal["price"]); } ?>
0) { $meal_links_path.=(strpos($meal_links_path,'?')!==false)?'&':'?'; $endtag=''; } $cat=$ITEM->get_by_id("cat",$catid,"name,description,image,ord,ph1,ph2,ph3"); if(!$cat) { echo "Category not created!"; } else { $price_count=((empty($cat["ph1"]))?0:1)+((empty($cat["ph2"]))?0:1)+((empty($cat["ph3"]))?0:1); $ewh=array(); $ewh[]="cat=".(int)$catid; $ewh[]="hidden=0"; $ewh=implode(" AND ",$ewh); $meals=$ITEM->list_rows("meal","cat,ord,name,description,description1,price,price1,price2,image",$ewh,"ord,name"); ?> '; } ?>

0) { $price_width=floor(100/$price_count); for($i=1;$i<=((count($meals)<$columns)?count($meals):$columns);$i++) { $r=' '."\n"; $r.=' '."\n"; $r.=' '."\n"; $r.=' '."\n"; $cols[$i]=$r; } } $i=1; foreach($meals as $mealid=>$m) { $oddeven=($oddeven=="_even")?"_odd":"_even"; $endtag=''; if(strlen($meal_links_path)>0) $meallink=''; if(empty($m['description1'])) { if(file_exists('images/custom/td'.$m["id"].'.'.$m["image"]) && $itemimaging) { $meallink=''; } else { $meallink=''; $endtag=''; } } $r=' '."\n"; $r.=' '."\n"; $r.=' '."\n"; $r.=' '."\n"; if(!empty($m["description"]) || !empty($m["image"])) { $r.=' '."\n"; $r.=' \n"; $r.=' '."\n"; } $cols[$i].=$r; $i++; if($i>$columns) { $i=1; } } // for meals in category echo "\n"; reset($cols); foreach($cols as $cc) echo '\n"; echo "\n"; ?>
 '."\n"; $r.=' '."\n"; if(!empty($cat["ph1"])) $r.=' '."\n"; if(!empty($cat["ph2"])) $r.=' '."\n"; if(!empty($cat["ph3"])) $r.=' '."\n"; $r.=' '."\n"; $r.='
'.$cat["ph1"].''.$cat["ph2"].''.$cat["ph3"].'
'.$meallink.$m["name"].$endtag.''; if($price_count>0) { $r.=''."\n"; $r.=' '."\n"; if(!empty($m["price"])) { $r.=' '."\n"; } if(!empty($m["price1"])) { $r.=' '."\n"; } if(!empty($m["price2"])) { $r.=' '."\n"; } $r.='
'; $r.=format_price($m["price"]); $r.=''; $r.=format_price($m["price1"]); $r.=''; $r.=format_price($m["price2"]); $r.='
'; } else { $r.=format_price($m["price"]); $r.='   '; } $r.='
'."\n"; $r.=" \n"; if(!empty($m["image"])) { $r.=' \n"; } $r.=" \n"; $r.=" \n"; $r.="
'.$meallink; if(file_exists('images/custom/td'.$m["id"].'.'.$m["image"]) && $itemimaging) { $r.=''.htmlentities($m['; } $r.=$endtag."\n"; $r.=" ".$m["description"]; $r.="
'."\n".$cc."\n
Easy CafeEngine"; function menu_list($menuid,$columns=1,$cat_links_path='',$meal_links_path='',$menuimaging=true,$catimaging=true,$itemimaging=true) { //****** global $ITEM; $catlink=''; $meallink=''; $endtag=''; if(strlen($meal_links_path)>0) { $meal_links_path.=(strpos($meal_links_path,'?')!==false)?'&':'?'; $endtag=''; } if(strlen($cat_links_path)>0) { $cat_links_path.=(strpos($cat_links_path,'?')!==false)?'&':'?'; $endtag=''; } $menu=$ITEM->get_by_id("menu",$menuid,"name,description,image"); if(!$menu) { echo "Menu not created!"; } else { $categories=$ITEM->list_rows("cat","name,image,ord,ph1,ph2,ph3,description","menu=".(int)$menuid,"ord,name"); $wh=array(); $wh[]="hidden=0"; $max_prices=1; foreach($categories as $i=>$val) { $categories[$i]["price_count"]=((empty($val["ph1"]))?0:1)+((empty($val["ph2"]))?0:1)+((empty($val["ph3"]))?0:1); $max_prices=($categories[$i]["price_count"]>$max_prices)?$categories[$i]["price_count"]:$max_prices; $ewh=$wh; $ewh[]="cat=".$i; $ewh=implode(" AND ",$ewh); $categories[$i]["meals"]=$ITEM->list_rows("meal","cat,ord,name,description,description1,price,price1,price2,image",$ewh,"ord,name"); } if(!empty($menu["image"]) && $menuimaging) echo ''.htmlentities($menu['; ?>

'.$menu["description"].' '; ?> $c) { if(!count($c["meals"])) continue; if(strlen($cat_links_path)>0) { $catlink=''; $endtag=''; } else { $catlink=''; $endtag=''; } echo ' '."\n"; echo ' '."\n"; echo ' '."\n"; echo ' '."\n"; if(!empty($c["description"]) || !empty($c["image"])) { echo ' '."\n"; echo ' '."\n"; echo ' '."\n"; } $cols=array(); if($c["price_count"]>0) { $price_width=floor(100/$c["price_count"]); for($i=1;$i<=((count($c["meals"])<$columns)?count($c["meals"]):$columns);$i++) { $r=' '."\n"; $r.=" \n"; $r.=' '."\n"; $r.=' '."\n"; $cols[$i]=$r; } } $i=1; foreach($c["meals"] as $mealid=>$m) { $oddeven=($oddeven=="_even")?"_odd":"_even"; if(strlen($meal_links_path)>0) { $meallink=''; $endtag=''; } if(empty($m['description1'])) { if(file_exists('images/custom/td'.$m["id"].'.'.$m["image"]) && $itemimaging) { $meallink=''; $endtag=''; } else { $meallink=''; $endtag=''; } } $r=' '."\n"; $r.=' '."\n"; $r.=' '."\n"; $r.=' '."\n"; if(!empty($m["description"]) || !empty($m["image"])) { $r.=' '."\n"; $r.=' \n"; $r.=' '."\n"; } $cols[$i].=$r; $i++; if($i>$columns) $i=1; } // for meals in category echo "\n"; reset($cols); foreach($cols as $cc) echo '\n"; echo "\n"; } //for categories array ?> 0) $base.=(strpos($base,'?')!==false)?'&':'?'; $istart=''; $iend="\n"; if($direction=='v' || $direction=='V') { $istart='\n"; } $menues=$ITEM->list_rows("menu","name,description,ord,image","","ord,name"); foreach($menues as $menuid=>$menudata) { $lnk=''; $na=$lnk.$menudata["name"].''; $tmb=''; if(file_exists('images/custom/tm'.$menudata["id"].'.'.$menudata["image"])) $tmb=$lnk.''.htmlentities($menudata['; switch($thumb_location) { case "1": //thumb below name $cnt=$na."
\n".$tmb; break; case "2": //thumb righter name $cnt=$na." ".$tmb; break; case "3": //thumb above name $cnt=$tmb."
\n".$na; break; case "4": //thumb lefter name $cnt=$tmb." ".$na; break; case "5": // no name $cnt=$tmb; break; default: // no thumb $cnt=$na; } if(!empty($cnt)) echo $istart.$cnt.$iend; } } // end of menu_links function cat_links($menuid,$base='',$direction='',$thumb_location=0) {//************** global $ITEM; if(empty($base)) $base=$_SERVER['PHP_SELF']; if(strlen($base)>0) $base.=(strpos($base,'?')!==false)?'&':'?'; $istart=''; $iend="\n"; if($direction=='v' || $direction=='V') { $istart='\n"; } $cats=$ITEM->list_rows("cat","name,ord,image","menu=".(int)$menuid,"ord,name"); foreach($cats as $catid=>$catdata) { $lnk=''; $na=$lnk.$catdata["name"].''; $tmb=''; if(file_exists('images/custom/tc'.$catdata["id"].'.'.$catdata["image"])) $tmb=$lnk.''.htmlentities($catdata['; switch($thumb_location) { case "1": //thumb below name $cnt=$na."
\n".$tmb; break; case "2": //thumb righter name $cnt=$na." ".$tmb; break; case "3": //thumb above name $cnt=$tmb."
\n".$na; break; case "4": //thumb lefter name $cnt=$tmb." ".$na; break; case "5": // no name $cnt=$tmb; break; default: // no thumb $cnt=$na; } if(!empty($cnt)) echo $istart.$cnt.$iend; } } // end of cat_links ?> Sunflower Garden, Martinez, CA
home banner
Menu – Place your order now, call 925-372-0842