Exemplo n.º 1
0
function mods_letter_array($ord)
{
    $ord->ingredients_arrays();
    $letters = array();
    foreach ($ord->ingredients['available'] as $name => $ingredid) {
        $ingr = new ingredient($ingredid);
        if (!$ingr->get('visible') && !get_conf(__FILE__, __LINE__, "invisible_show")) {
            continue;
        }
        $char = ucfirst($name[0]);
        if (!in_array($char, $letters)) {
            $letters[] = $char;
        }
    }
    return $letters;
}
 function table_row_name($arr)
 {
     $dish = new dish($arr['dishid']);
     $dishname = $dish->name($_SESSION['language']);
     $deleted = $arr['deleted'];
     $orderid = $arr['id'];
     if ($arr['dishid'] == MOD_ID) {
         $modingred = $arr['ingredid'];
         $ingr = new ingredient($modingred);
         $moddeddishname = $ingr->name($_SESSION['language']);
         // say if it's added or subtracted
         if ($arr['operation'] == 1) {
             $dishname = "    " . ucfirst(phr('PLUS'));
         } elseif ($arr['operation'] == -1) {
             $dishname = "    " . ucfirst(phr('MINUS'));
         }
         $dishname .= " " . $moddeddishname;
         // and finally consider any optional info (lot/few)
         if ($arr['ingred_qty'] == 1) {
             $dishname .= " " . ucfirst(phr('LOT'));
         } elseif ($arr['ingred_qty'] == -1) {
             $dishname .= " " . ucfirst(phr('FEW'));
         }
         // gets the original ingred price (from ingreds table)
         // if the original price is 0 and the actual price is 0
         // then it means that the ingred has passed through the autocalc system
         // and we let the waiter know this, so he could check the prices.
         $modingredprice = $ingr->get('price');
         //$modingredprice=get_db_data(__FILE__,__LINE__,$_SESSION['common_db'],"ingreds","price",$modingred);
         if ($modingredprice == 0 && $arr['price'] != 0) {
             $dishname .= " (auto)";
         }
     }
     if ($arr['dishid'] == SERVICE_ID) {
         $dishname = ucfirst(phr('SERVICE_FEE'));
     }
     return $dishname;
 }