getOne( "SELECT mt_value FROM metatype WHERE mt_sort = '$vht_id' AND mt_type = 'vehicletype'"); $today = getdate(); $jb_ordertime = $today['year'] . "-" . $today['mon'] . "-" . $today['mday'] . " " . $today['hours'] . ":" . $today['minutes'] . ":" . $today['seconds']; $fuel_markup = str_replace(",", ".", $markup); if ($fuel_markup == ""): $fuel_markup = getFuelMarkup($srvt_name, 0, $hq_id, $jb_ordertime); endif; //echo "'$srvt_name, 0, $hq_id, $jb_ordertime'"; //echo "'$fuel_markup'"; $grundpreis = 0; list($tmpGrundpreis, $plzpreis1) = getPrice($zipcode1, $zipcode2, $cs_invmode_default, $fuel_markup); if ($tmpGrundpreis > 0) $grundpreis = $tmpGrundpreis; list($tmpGrundpreis, $plzpreis2) = getPrice($zipcode2, $zipcode3, $cs_invmode_default, $fuel_markup); if ($tmpGrundpreis > 0) $grundpreis = $tmpGrundpreis; list($tmpGrundpreis, $plzpreis3) = getPrice($zipcode3, $zipcode4, $cs_invmode_default, $fuel_markup); if ($tmpGrundpreis > 0) $grundpreis = $tmpGrundpreis; list($tmpGrundpreis, $plzpreis4) = getPrice($zipcode4, $zipcode5, $cs_invmode_default, $fuel_markup); if ($tmpGrundpreis > 0) $grundpreis = $tmpGrundpreis; list($tmpGrundpreis, $plzpreis5) = getPrice($zipcode5, $zipcode6, $cs_invmode_default, $fuel_markup); 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, $fuel_markup); list($tmpGrundpreis, $area_price2) = getPrice($zipcode2, $zipcode3, 1, $fuel_markup); list($tmpGrundpreis, $area_price3) = getPrice($zipcode3, $zipcode4, 1, $fuel_markup); list($tmpGrundpreis, $area_price4) = getPrice($zipcode4, $zipcode5, 1, $fuel_markup); list($tmpGrundpreis, $area_price5) = getPrice($zipcode5, $zipcode6, 1, $fuel_markup); $area_fullprice = $grundpreis + $area_price1 + $area_price2 + $area_price3 + $area_price4 + $area_price5; endif; $popupWinCode1 =str_replace("\"", "\\\"", str_replace("\n", "\\n", "\n" . "\n" . "\n" . "votian: Eingabe der Abrechnungs-PLZ<\/title>\n" . "<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/phoenix.css.php\">\n" . "<script type=\"text/javascript\">\n" . "<!" . "--\n" . "\n" . "var caller = ")); $popupWinCode2 =str_replace("\"", "\\\"", str_replace("\n", "\\n", ";\n" . "\n" . "function doFocus(){\n" . "while (typeof(document.forms[0].tr_mediationarea_id) == 'undefined');\n" . // " document.forms[1].saveButton.focus();\n" . " document.forms[0].tr_mediationarea_id.focus();\n" . "}\n" . "\n" . "function doSave(){\n" . " switch (caller)\n" . " {\n" . " case 1:\n" . " opener.document.forms[0].zipcode1.value = document.forms[0].tr_mediationarea_id.value;\n" . " break;\n" . " case 2:\n" . " opener.document.forms[0].zipcode2.value = document.forms[0].tr_mediationarea_id.value;\n" . " break;\n" . " case 3:\n" . " opener.document.forms[0].zipcode3.value = document.forms[0].tr_mediationarea_id.value;\n" . " break;\n" . " case 4:\n" . " opener.document.forms[0].zipcode4.value = document.forms[0].tr_mediationarea_id.value;\n" . " break;\n" . " case 5:\n" . " opener.document.forms[0].zipcode5.value = document.forms[0].tr_mediationarea_id.value;\n" . " break;\n" . " case 6:\n" . " opener.document.forms[0].zipcode6.value = document.forms[0].tr_mediationarea_id.value;\n" . " break;\n" . " default:\n" . " break;\n" . " } \n" . " opener.updatePrice(0);\n" . " self.close();\n" . "}\n" . "\n" . "//--" . ">\n" . "<\/script>\n" . "<\/head>\n" . "<body onload=\"doFocus()\">\n" . " <table border=0 align=center height=100% cellspacing=0 cellpadding=0 vspace=0 hspace=0>\n" . " <tr>\n" . " <td align=center valign=top>\n" . "<form action=\"../jobs/price_query.php\" method=\"get\">\n" . "<select name=\"tr_mediationarea_id\" class=\"input\">\n")); $popupWinCode3 = str_replace("\"", "\\\"", str_replace("\n", "\\n", "\n</select>\n" . "</form>\n" . "<form action=\"../jobs/price_query.php\" method=\"get\">\n" . "<input type=\"button\" class=\"button_enabled\" name=\"cancelButton\" value=\"Abbrechen\" onClick=\"self.close()\" accesskey=\"a\"> \n" . "<input type=\"button\" class=\"button_enabled\" name=\"saveButton\" value=\"Übernehmen\" onClick=\"doSave()\" accesskey=\"s\"> \n" . "</form>\n" . " <\/td>\n" . " <\/tr>\n" . " <\/table>\n" . "<\/body>\n" . "<\/html>\n")); echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n" . "<html lang=\"de\">\n" . "<head>\n" . "<title>votian: Preisanfrage\n" . "\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" . " Treibstoffzuschlag: " . "%\n" . "

\n" . "
" . "
\n" . "Gesamtpreis: " . "
" . ($fuel_markup <> 0 ? "(incl. " . str_replace(".", ",", sprintf("%01.2f", $fuel_markup)) . " % Treibstoffzuschlag)" : "") . "
\n" . ($hq_id == 3 ? "" . formatPrice($area_fullprice) . "
" : "") . "" . formatPrice($fullprice) . "
" . "
\n" . "
" . " \n" . " \n" . "" . "
\n" . "\n" . "\n" . "\n"; function getPrice($zipcode1, $zipcode2, $cs_invmode = -1, $fuel_markup) { global $db, $hq_id, $vht_id, $jb_ordertime; 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) // 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, $fpm, $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, $fuel_markup, $fuel_markup, $vht_id); //$fullPrice += $fp * ((100-$fd)/100); //$discount_sign = ($fd > 0 || $customer_specific || $discount_sign == "*" ? "*" : ""); // PLZ-Preis list ($plzpreis, $fd, $fpm, $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, $fuel_markup, $fuel_markup, $vht_id); //$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; } ?>