0) $grundpreis = $tmpGrundpreis; list($tmpGrundpreis, $plzpreis2) = getPrice($zipcode2, $zipcode3, $cs_invmode_default); if ($tmpGrundpreis > 0) $grundpreis = $tmpGrundpreis; list($tmpGrundpreis, $plzpreis3) = getPrice($zipcode3, $zipcode4, $cs_invmode_default); if ($tmpGrundpreis > 0) $grundpreis = $tmpGrundpreis; list($tmpGrundpreis, $plzpreis4) = getPrice($zipcode4, $zipcode5, $cs_invmode_default); if ($tmpGrundpreis > 0) $grundpreis = $tmpGrundpreis; list($tmpGrundpreis, $plzpreis5) = getPrice($zipcode5, $zipcode6, $cs_invmode_default); if ($tmpGrundpreis > 0) $grundpreis = $tmpGrundpreis; $fullprice = $grundpreis + $plzpreis1 + $plzpreis2 + $plzpreis3 + $plzpreis4 + $plzpreis5; $valign = "center"; $area_names1 = ""; $area_names2 = ""; $area_names3 = ""; $area_names4 = ""; $area_names5 = ""; $area_price1 = ""; $area_price2 = ""; $area_price3 = ""; $area_price4 = ""; $area_price5 = ""; $area_fullprice = ""; // ... dann PLZ-Preise ermitteln! if ($hq_id == 3): $valign = "bottom"; $area_name1 = getAreaName($zipcode1); $area_name2 = getAreaName($zipcode2); $area_name3 = getAreaName($zipcode3); $area_name4 = getAreaName($zipcode4); $area_name5 = getAreaName($zipcode5); $area_name6 = getAreaName($zipcode6); $area_names1 = "" . "VON $area_name1 NACH $area_name2" . ""; $area_names2 = "" . "VON $area_name2 NACH $area_name3" . ""; $area_names3 = "" . "VON $area_name3 NACH $area_name4" . ""; $area_names4 = "" . "VON $area_name4 NACH $area_name5" . ""; $area_names5 = "" . "VON $area_name5 NACH $area_name6" . ""; list($tmpGrundpreis, $area_price1) = getPrice($zipcode1, $zipcode2, 1); list($tmpGrundpreis, $area_price2) = getPrice($zipcode2, $zipcode3, 1); list($tmpGrundpreis, $area_price3) = getPrice($zipcode3, $zipcode4, 1); list($tmpGrundpreis, $area_price4) = getPrice($zipcode4, $zipcode5, 1); list($tmpGrundpreis, $area_price5) = getPrice($zipcode5, $zipcode6, 1); $area_fullprice = $grundpreis + $area_price1 + $area_price2 + $area_price3 + $area_price4 + $area_price5; endif; echo "\n" . "\n" . "\n" . "Mi2ju: Preisanfrage\n" . "\n" . "\n" . "\n" . "" . " \n" . " \n" . "\n" . " \n" . " \n" . "
\n" . " VON PLZ \n" . " NACH PLZ \n" . "
$area_names1
\n" . ($hq_id == 3 ? formatPrice($area_price1) . "
" : "") . "" . formatPrice($plzpreis1) . "
" . "
\n" . " VON PLZ \n" . " NACH PLZ \n" . "
$area_names2
\n" . ($hq_id == 3 ? formatPrice($area_price2) . "
" : "") . "" . formatPrice($plzpreis2) . "
" . "
\n" . " VON PLZ \n" . " NACH PLZ \n" . "
$area_names3
\n" . ($hq_id == 3 ? formatPrice($area_price3) . "
" : "") . "" . formatPrice($plzpreis3) . "
" . "
\n" . " VON PLZ \n" . " NACH PLZ \n" . "
$area_names4
\n" . ($hq_id == 3 ? formatPrice($area_price4) . "
" : "") . "" . formatPrice($plzpreis4) . "
" . "
\n" . " VON PLZ \n" . " NACH PLZ \n" . "
$area_names5
\n" . ($hq_id == 3 ? formatPrice($area_price5) . "
" : "") . "" . formatPrice($plzpreis5) . "
" . "
\n" . " MIT FAHRZEUG " . " \n" . "

\n" . ($hq_id == 3 ? formatPrice($grundpreis) . "
" : "") . "" . formatPrice($grundpreis) . "
" . "
\n" . "Gesamtpreis: " . "

\n" . ($hq_id == 3 ? "" . formatPrice($area_fullprice) . "
" : "") . "" . formatPrice($fullprice) . "
" . "
\n" . "
" . " \n" . " \n" . "" . "
\n" . "\n" . "\n" . "\n"; function getPrice($zipcode1, $zipcode2, $cs_invmode = -1) { global $db, $hq_id, $vht_id; if (strlen($zipcode1) == 5 && strlen($zipcode2) == 5 && is_numeric($zipcode1) && is_numeric($zipcode2)): if ($cs_invmode > -1): $cs_id = $cs_invmode * -1; else: $cs_id = 0; endif; // $cs_id decides about invmode // if 0, then default invmode from hq_id is taken // for Berlin, $cs_id directly takes invmode in negative form (in order to distinguish from ordinary cs_id, that always are postive) $today = getdate(); $jb_ordertime = $today['year'] . "-" . $today['mon'] . "-" . $today['mday'] . " " . $today['hours'] . ":" . $today['minutes'] . ":" . $today['seconds']; // Grundpreis // Servicetype-Name (Fahrrad etc.) $srvt_name = $db->getOne( "SELECT mt_value FROM metatype WHERE mt_sort = '$vht_id' AND mt_type = 'vehicletype'"); list ($grundpreis, $fd, $customer_specific) = saveServiceCosts("Grundpreis", $srvt_name, $hq_id, $cs_id, 0 /* $jb_id */, 0, $jb_ordertime, 0 /* count */, 1 /* $costsplit_count */, 1 /* $getPriceOnly */, false /* $jb_cash */, "0" /* $csc_id_payer */, 0 /* $jb_storno */, false /* zipcode1 */, false /* zipcode2 */, false); //$fullPrice += $fp * ((100-$fd)/100); //$discount_sign = ($fd > 0 || $customer_specific || $discount_sign == "*" ? "*" : ""); // PLZ-Preis list ($plzpreis, $fd, $customer_specific) = saveServiceCosts($zipcode1, $zipcode2, $hq_id, $cs_id, 0 /* $jb_id */, 0, $jb_ordertime, 0 /* count */, 1 /* $costsplit_count */, 1 /* $getPriceOnly */, false /* $jb_cash */, "0" /* $csc_id_payer */, 0 /* $jb_storno */, false /* zipcode1 */, false /* zipcode2 */, true); //$fullPrice += $fp * ((100-$fd)/100); //$discount_sign = ($fd > 0 || $customer_specific || $discount_sign == "*" ? "*" : ""); else: $zipcode1 = ""; $zipcode2 = ""; $grundpreis = 0; $plzpreis = 0; endif; return array($grundpreis, $plzpreis); } function formatPrice($thePrice) { if (strlen($thePrice) > 0): return str_replace(".", ",", sprintf("%01.2f", $thePrice)) . " EUR"; else: return ""; endif; } ?>