1. Import
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
[Dolphin]
|
||||
Timestamp=2009,9,24,0,28,20
|
||||
ViewMode=1
|
||||
@@ -0,0 +1,374 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* check_jb_permanent.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
/*
|
||||
*
|
||||
* Dieses Skript muss vom PDA-Server aufgerufen werden (per php Shell-Aufruf),
|
||||
* wenn er einen Job DAS ERSTE MAL "anfässt", damit Folgeaufträgen von
|
||||
* Daueraufträgen erzeugt werden
|
||||
*
|
||||
* Es wird geprüft, ob der Job ein Dauerauftrag ist:
|
||||
* - wenn ja, wird automatisch der Folgeauftrag generiert, WENN noch nicht
|
||||
* vorhanden
|
||||
* - wenn nein, dann passiert nix
|
||||
*
|
||||
* ACHTUNG: Die Storno-Problematik ist hier noch nicht berücksichtigt!
|
||||
*
|
||||
* Parameter:
|
||||
* in: jb_id (Klartext)
|
||||
* out: nix; es wird nur der Folgeauftrag in die DB geschrieben,
|
||||
* wenn job in kb_id Dauerauftrag ist
|
||||
*
|
||||
* Beispiel-Aufruf: php.exe -q -c c:\Programme\Server\php check_jb_permanent.php 4711
|
||||
*
|
||||
* TOBEDONE: Feiertagsproblematik nicht praxisnah gelöst -> Klärungsbedarf vorhanden
|
||||
* (Bsp.: Wöchentlicher Dauerauftrag wird auf übernächste Woche verschoben, wenn
|
||||
* nächste Woche an dem normalen nächsten Termin ein Feiertag ist ...)
|
||||
* Es wird zur Zeit auch noch nicht geprüft, ob der nächste Termin nicht schon längst verstrichen ist!
|
||||
*/
|
||||
|
||||
// Execution-Time for script
|
||||
set_time_limit(0);
|
||||
|
||||
// diese Art der Bearbeitung schafft leider nur ca. einen Auftrag pro SEKUNDE,
|
||||
// mit set_time_limit (300) können ca. 250 Aufträge bearbeitet werden
|
||||
//set_time_limit (300);
|
||||
include_once("../include/dbglobal.inc.php");
|
||||
$hq_id = $HTTP_GET_VARS["hq_id"];
|
||||
if ($hq_id == ""):
|
||||
// writeLog_("../log/check_jb_permanent_standing_", "Fehler: 'hq_id' fehlt!");
|
||||
// exit();
|
||||
$hq_id = HQ_ID_DEFAULT;
|
||||
endif;
|
||||
include_once("../include/inc_check_publicholiday.inc.php");
|
||||
include_once("../include/caglobal.inc.php");
|
||||
$ph = getPublicHolidays(getDateTime("year"), "1", "0");
|
||||
|
||||
// "get_saved_tour.php" holt die Daten eines gespeicherten Jobs $jb_id
|
||||
// voher muss aber die jobList initialisiert werden (macht sonst javascript)
|
||||
//echo $argc;
|
||||
//$jb_id = $argv[1];
|
||||
//var_dump ($argv);
|
||||
//var_dump ( ini_get("register_argc_argv"));
|
||||
$jb_id = getenv ("JB_ID");
|
||||
$jb_finishtime = getenv ("JB_FINISHTIME_DAY") . " " . getenv ("JB_FINISHTIME_TIME");
|
||||
//$jb_id = $HTTP_GET_VARS["jb_id"];
|
||||
|
||||
if ($jb_id == "")
|
||||
{
|
||||
$yesterday = getdate(mktime(0, 0, 0, date("m"), date("d") - 1, date("Y")));
|
||||
$jb_finishtime_start = $yesterday['year'] . "-" . sprintf("%02d", $yesterday['mon']) . "-" . sprintf("%02d", $yesterday['mday']) . " 00:00:01";
|
||||
// $jb_finishtime_start = "2005-08-30 00:00:01";
|
||||
|
||||
// Endless loop
|
||||
while (TRUE):
|
||||
|
||||
// Set execution time for keepalive
|
||||
$currentTime = getDateTime("0");
|
||||
updateStmt("keepalive", "ka_process", "standing_orders", array("ka_lastexecutiontime", $currentTime),"");
|
||||
|
||||
$today = getdate();
|
||||
$today_date = $today['year'] . "-" . sprintf("%02d", $today['mon']) . "-" . sprintf("%02d", $today['mday']);
|
||||
|
||||
// JB_ID nicht angegeben -> kein expliziter Aufruf
|
||||
// Alle Daueraufträge finden, die erledigt sind
|
||||
$sqlquery = "SELECT job.jb_id, job.jb_finishtime FROM job WHERE ((jb_storno != 3 AND jb_storno != 4) OR jb_storno IS NULL) " .
|
||||
" AND job.jb_status = 2 AND jb_permanent IN (1, 2, 3, 4, 5, 6, 7, 8, 9) AND (jb_id_copy_permanent IS NULL OR jb_id_copy_permanent = 0) " .
|
||||
" AND (job.jp_permenddat >= '$today_date" . " 00:00:00' OR job.jp_permenddat IS NULL OR job.jp_permenddat = '00.00.0000 00:00:00')" .
|
||||
" ORDER BY job.jb_id";
|
||||
writeLog_("../log/check_jb_permanent_standing_", "Querying for finished jobs to be continued [$sqlquery]");
|
||||
$res = $db->query($sqlquery);
|
||||
if (DB::isError($res))
|
||||
myDie ("$PHP_SELF: '$sqlquery' : " . $res->getMessage());
|
||||
while ($row = $res->fetch_assoc())
|
||||
{
|
||||
if ($row["jb_id"] != "")
|
||||
{
|
||||
// writeCmd($row["jb_id"]);
|
||||
// $jobList = array();
|
||||
copy_job($row["jb_id"], $row["jb_finishtime"]);
|
||||
// Aufruf des Batch
|
||||
// $ausgabe = system("..\jobs\check_jb_permanent.cmd " . $row["jb_id"] . " " . $row["jb_finishtime"] . " >>..\log\check_jb_permanent.stdout", $result);
|
||||
// echo "Result:", $result;
|
||||
// echo "Ausgabe:", $ausgabe;
|
||||
}
|
||||
}
|
||||
|
||||
// Weitere Funktion:
|
||||
// Wenn zwischenzeitlich Kommissionsnummern eingetragen wurden, dann werden diese
|
||||
// vom PDAServer nicht im Rechnungstext eingetragen. Es muss also (einmal am Tag)
|
||||
// der Rechnungstext aller eledigten Aufträge neu erzeugt werden!
|
||||
// Das wird der Einfachheit halber gleich hier eledigt.
|
||||
$today = getdate();
|
||||
$now = $today['year'] . "-" . sprintf("%02d", $today['mon']) . "-" . sprintf("%02d", $today['mday']) . " " .
|
||||
sprintf("%02d", $today['hours']) . ":" . sprintf("%02d", $today['minutes'] . ":" . sprintf("%02d", $today['seconds']));
|
||||
$jb_finishtime_today = $today['year'] . "-" . sprintf("%02d", $today['mon']) . "-" . sprintf("%02d", $today['mday']) . " 00:00:01";
|
||||
if ($jb_finishtime_today > $jb_finishtime_start && $jb_finishtime_today < $now):
|
||||
// Alle Aufträge seit dem letzten Mal finden, die erledigt sind
|
||||
$sqlquery = "SELECT job.jb_id, job.jb_finishtime FROM job WHERE ((jb_storno != 3 AND jb_storno != 4) OR jb_storno IS NULL) " .
|
||||
" AND job.jb_status = 2 AND (jb_finishtime BETWEEN '$jb_finishtime_start' AND '$jb_finishtime_today') ORDER BY job.jb_id";
|
||||
writeLog_("../log/check_jb_permanent_invtext_", "Querying for finished jobs to rebuild `jb_invtext` [$sqlquery]");
|
||||
$res = $db->query($sqlquery);
|
||||
if (DB::isError($res))
|
||||
myDie ("$PHP_SELF: '$sqlquery' : " . $res->getMessage());
|
||||
while ($row = $res->fetch_assoc())
|
||||
{
|
||||
if ($row["jb_id"] != "")
|
||||
{
|
||||
writeLog_("../log/check_jb_permanent_invtext_", "Writing new invoice text in job " . $row["jb_id"] . " (jb_finishtime: '". $row["jb_finishtime"] . "', \$jb_finishtime_start: '$jb_finishtime_start', \$jb_finishtime_today = '$jb_finishtime_today')");
|
||||
mk_jb_invtext($row["jb_id"], true);
|
||||
$dummy = $db->query("UPDATE job SET jb_freetext_2 = '' WHERE jb_id = " . $row["jb_id"]);
|
||||
}
|
||||
}
|
||||
$jb_finishtime_start = $jb_finishtime_today;
|
||||
endif;
|
||||
|
||||
// Noch eine weitere Funktion:
|
||||
// Javascript-Arrays mit selten veränderlichen Variablen werden in eine extra .js-Datei geschrieben, die
|
||||
// mind. einmal am Tag upgedatet werden sollte
|
||||
include("../jobs/job_options.js.inc.php");
|
||||
|
||||
sleep(500);
|
||||
endwhile; // Endless loop
|
||||
} else {
|
||||
// JB_ID angegeben -> expliziter Aufruf
|
||||
// Nur den angegebenen Auftrag verarzten
|
||||
$jobList = array();
|
||||
copy_job($jb_id, $jb_finishtime);
|
||||
|
||||
}
|
||||
|
||||
function copy_job($jb_id, $jb_finishtime)
|
||||
{
|
||||
global $db, $hq_id, $jobList;
|
||||
|
||||
$tmpJobList = array();
|
||||
$tmpJobListJoin = array();
|
||||
|
||||
// writeLog_("../log/check_jb_permanent_standing_", "Duplicating job " . $jb_id . ", finishtime " . $jb_finishtime);
|
||||
// echo $jb_id . "<br>\n";
|
||||
|
||||
for ($i = 0; $i < 6; $i++):
|
||||
$tmpJobList[$i] = array();
|
||||
for ($j = 0; $j < 9; $j++)
|
||||
$tmpJobList[$i][$j] = "";
|
||||
$tmpJobListJoin[$i] = implode("²", $tmpJobList[$i]);
|
||||
endfor;
|
||||
$jobList = implode("¹", $tmpJobListJoin);
|
||||
|
||||
$check_jb_permanent_flag = true;
|
||||
include("../jobs/get_saved_tour.php");
|
||||
//echo "$jb_id, $csc_id, $vht_id, $jb_weight, $jb_ordertime, $jb_reserv, 3, $vht_id, " .
|
||||
// "$cr_id_order, $jb_waitstorno, $jb_waittime, $jb_fixprice, $csc_id_payer </ br>\n";
|
||||
//echo "'$jobList'\n";
|
||||
|
||||
// Ist aktueller Job ein Dauerauftrag?
|
||||
if (in_array($jb_permanent, array(4, 5, 6, 7, 8, 9))
|
||||
|| (in_array($jb_permanent, array(1, 2, 3)) && $jb_permanent2 != "0000000"))
|
||||
{
|
||||
//echo "$jb_id '$jb_permanent'</ br>\n";
|
||||
// gültiger Dauerauftragsparameter vorhanden
|
||||
|
||||
// Auswertung des Dauerauftrags-Parameters:
|
||||
// Neuberechnung des Reservierungsdatums (benötigen Kalenderfunktionen)
|
||||
include_once("../include/calendar.inc.php");
|
||||
$tempDate = array($jahr, sprintf("%d", $monat), sprintf("%d", $tag));
|
||||
$tempDateMonth = array($jahr, sprintf("%d", $monat));
|
||||
//echo "$jahr.$monat.$tag<br>";
|
||||
|
||||
//myDie ($jb_permanent);
|
||||
|
||||
writeLog_("../log/check_jb_permanent_standing_", "* Continuing: jb_id = $jb_id, jb_permanent = $jb_permanent, jb_finishtime = $jb_finishtime, jb_ordertime = $jahr-$monat-$tag $stunde:$minute:00, jb_permanent2 = $jb_permanent2, jp_permenddat = $jp_permenddat");
|
||||
switch ($jb_permanent)
|
||||
{
|
||||
// die ersten drei Fälle werden gleich behandelt, da es hier nur auf den Wert in jb_permanent2 ankommt
|
||||
case 1: // werktags
|
||||
case 2: // werktags mit Samstag
|
||||
case 3: // täglich
|
||||
do {
|
||||
$tempDate = addDaysComplete($tempDate[0], $tempDate[1], $tempDate[2], 1);
|
||||
// Nummer des nächgsten Wochentages ermitteln
|
||||
$dayNo = date("w", mktime(0, 0, 0, $tempDate[1], $tempDate[2], $tempDate[0]));
|
||||
// Nummer umrechnen, damit mit dem Wert in jb_permanent2 verglichen werden kann
|
||||
// date() : Montag = 1, Dienstag = 2, ..., Samstag = 6, Sonntag = 0
|
||||
// jb_permanent2: Montag = 0, Dienstag = 1, ..., Samstag = 5, Sonntag = 6
|
||||
if ($dayNo == 0):
|
||||
$dayNo = 6;
|
||||
else:
|
||||
$dayNo -= 1;
|
||||
endif;
|
||||
writeLog_("../log/check_jb_permanent_standing_", " next date: " . $tempDate[0] . "-" . $tempDate[1] . "-" . $tempDate[2] . ", dayNo: $dayNo");
|
||||
// Überprüfen, ob der nächste Wochentag in jb_permanent2 vorhanden ist
|
||||
$jb_permanent_ok = false;
|
||||
if (substr($jb_permanent2, $dayNo, 1) == "1")
|
||||
$jb_permanent_ok = true;
|
||||
} while (isPublicHoliday($tempDate[0], $tempDate[1], $tempDate[2]) != ""
|
||||
|| !$jb_permanent_ok);
|
||||
break;
|
||||
case 4: // wöchentlich
|
||||
$tempDate = addDaysComplete($tempDate[0], $tempDate[1], $tempDate[2], 7);
|
||||
while (isPublicHoliday($tempDate[0], $tempDate[1], $tempDate[2]) != "")
|
||||
$tempDate = addDaysComplete($tempDate[0], $tempDate[1], $tempDate[2], 1);
|
||||
break;
|
||||
case 5: // vierzehntägig
|
||||
$tempDate = addDaysComplete($tempDate[0], $tempDate[1], $tempDate[2], 14);
|
||||
while (isPublicHoliday($tempDate[0], $tempDate[1], $tempDate[2]) != "")
|
||||
$tempDate = addDaysComplete($tempDate[0], $tempDate[1], $tempDate[2], 1);
|
||||
break;
|
||||
case 6: // monatlich
|
||||
$tempDateMonth = addMonths($tempDateMonth[0], $tempDateMonth[1], 1);
|
||||
$tempDate[0] = $tempDateMonth[0];
|
||||
$tempDate[1] = $tempDateMonth[1];
|
||||
if ($tempDate[2] > daysPerMonth($tempDateMonth[0], $tempDateMonth[1]))
|
||||
$tempDate[2] = daysPerMonth($tempDateMonth[0], $tempDateMonth[1]);
|
||||
while (isPublicHoliday($tempDate[0], $tempDate[1], $tempDate[2]) != "")
|
||||
$tempDate = addDaysComplete($tempDate[0], $tempDate[1], $tempDate[2], 1);
|
||||
break;
|
||||
case 7: // monatlich zum Monatsende
|
||||
$tempDateMonth = addMonths($tempDateMonth[0], $tempDateMonth[1], 1);
|
||||
$tempDate[0] = $tempDateMonth[0];
|
||||
$tempDate[1] = $tempDateMonth[1];
|
||||
$tempDate[2] = daysPerMonth($tempDateMonth[0], $tempDateMonth[1]);
|
||||
while (isPublicHoliday($tempDate[0], $tempDate[1], $tempDate[2]) != "")
|
||||
$tempDate = addDaysComplete($tempDate[0], $tempDate[1], $tempDate[2], -1);
|
||||
break;
|
||||
case 8: // vierzehntätig zum Monatsende (15. und 31.)
|
||||
if ($tempDate[2] < 20):
|
||||
// nächster Termin ist Monatsende desselben Monats
|
||||
// wie monatlich zum Monatsende
|
||||
$tempDate[0] = $tempDateMonth[0];
|
||||
$tempDate[1] = $tempDateMonth[1];
|
||||
$tempDate[2] = daysPerMonth($tempDateMonth[0], $tempDateMonth[1]);
|
||||
while (isPublicHoliday($tempDate[0], $tempDate[1], $tempDate[2]) != "")
|
||||
$tempDate = addDaysComplete($tempDate[0], $tempDate[1], $tempDate[2], -1);
|
||||
break;
|
||||
else:
|
||||
// nächster Termin ist der 15. des nächsten Monats
|
||||
$tempDateMonth = addMonths($tempDateMonth[0], $tempDateMonth[1], 1);
|
||||
$tempDate[0] = $tempDateMonth[0];
|
||||
$tempDate[1] = $tempDateMonth[1];
|
||||
$tempDate[2] = 15;
|
||||
while (isPublicHoliday($tempDate[0], $tempDate[1], $tempDate[2]) != "")
|
||||
$tempDate = addDaysComplete($tempDate[0], $tempDate[1], $tempDate[2], -1);
|
||||
break;
|
||||
endif;
|
||||
// case 9: // quartalsweise
|
||||
// do
|
||||
// $tempDateMonth = addMonths($tempDateMonth[0], $tempDateMonth[1], 3);
|
||||
// while (isPublicHoliday($tempDateMonth[0], $tempDateMonth[1], $tempDate[2]) != "");
|
||||
// $tempDate[0] = $tempDateMonth[0];
|
||||
// $tempDate[1] = $tempDateMonth[1];
|
||||
// break;
|
||||
// case 10: // halbjährlich
|
||||
// do
|
||||
// $tempDateMonth = addMonths($tempDateMonth[0], $tempDateMonth[1], 6);
|
||||
// while (isPublicHoliday($tempDateMonth[0], $tempDateMonth[1], $tempDate[2]) != "");
|
||||
// $tempDate[0] = $tempDateMonth[0];
|
||||
// $tempDate[1] = $tempDateMonth[1];
|
||||
// break;
|
||||
// case 11: // jährlich
|
||||
// do
|
||||
// $tempDateMonth = addMonths($tempDateMonth[0], $tempDateMonth[1], 12);
|
||||
// while (isPublicHoliday($tempDateMonth[0], $tempDateMonth[1], $tempDate[2]) != "");
|
||||
// $tempDate[0] = $tempDateMonth[0];
|
||||
// $tempDate[1] = $tempDateMonth[1];
|
||||
}
|
||||
$jb_ordertime_old = "";
|
||||
// Alten Tag, Monat, Jahr für log_file speichern
|
||||
// Überprüfen, ob der Dauerauftrag nicht schon an seinem Enddatum angekomen ist!
|
||||
list($endejahr, $endemonat, $endetag, $dummy1, $dummy2) = getValsFromDate($jp_permenddat);
|
||||
if (mktime(0, 0, 0, $tempDate[1], $tempDate[2], $tempDate[0])
|
||||
< mktime(0, 0, 0, $endemonat, $endetag, $endejahr) || trim($jp_permenddat) == "") {
|
||||
$jobListOri = $jobList;
|
||||
$jahr = $tempDate[0]; // ermittelten Tag, Monat, Jahr setzen
|
||||
$monat = sprintf("%02d", $tempDate[1]);
|
||||
$tag = sprintf("%02d", $tempDate[2]);
|
||||
$cr_id_order = $cr_id_permanent; // Kurier löschen bzw. usrsprünglichen Wunschkurier wieder einstellen
|
||||
// jb_status wird daher = 9 gesetzt (kein Kurier eingetragen)
|
||||
//echo "$jahr.$monat.$tag<br>";
|
||||
// jetzt wird das Senden eines jobs mit dem neuen Datum "simuliert",
|
||||
// woraufhin der Auftrag neu gespeichert wird
|
||||
$toursubmit = "Senden"; // Senden simulieren
|
||||
$csc_id_orderer = '0'; // Zentralenmodus
|
||||
// $hq_id = 1; // Hansetrans
|
||||
$getPriceOnly = 0; // Keine Nur-Preisabfrage
|
||||
$jb_id_copy = $jb_id;
|
||||
$jb_id = ""; // jetzt neuer Auftrag
|
||||
// Als emp_id (eingebender Mitarbeiter) wird 0 eingetragen,
|
||||
// da niemand angemeldet ist
|
||||
// $jb_globaljob = 0; // darf natürlich niemals an alle Kuriere gehen!!!
|
||||
$jb_status_manual = 0;
|
||||
if (MASK_MANUAL_DISPOSITION == "1"):
|
||||
$jb_status_manual = 1;
|
||||
endif;
|
||||
include("../jobs/job_options.php");
|
||||
$jb_tourname = getFieldValueFromId("job", "jb_id", $jb_id_copy, "jb_tourname");
|
||||
updateStmt("job", "jb_id", $jb_id_copy, array("jb_id_copy", $jb_id, "jb_id_copy_permanent", $jb_id, "jb_tourname", NULL));
|
||||
updateStmt("job", "jb_id", $jb_id, array("cr_id_permanent", $cr_id_permanent, "jb_tourname", $jb_tourname));
|
||||
if ($cr_id_permanent != "" && $cr_id_permanent != 0)
|
||||
updateStmt("job", "jb_id", $jb_id, array("cr_sid", $cr_id_permanent));
|
||||
// überprüfen, ob sich die tx_id nicht zwischenzeitlich geändert hat...
|
||||
$cmp_tx_id = $db->getOne("SELECT cmp.tx_id FROM company AS cmp, customer AS cs WHERE cs.hq_id = '$hq_id' AND cmp.cmp_id = cs.cmp_id AND cs.cs_id = $csc_id_payer");
|
||||
if ($cmp_tx_id > 0):
|
||||
//echo "SELECT cmp.tx_id FROM company AS cmp, customer AS cs WHERE cs.hq_id = '$hq_id' AND cmp.cmp_id = cs.cmp_id AND cs.cs_id = $csc_id_payer";
|
||||
//echo "csc_id_payer: '$csc_id_payer'";
|
||||
//echo "cmp_tx_id: '$cmp_tx_id'";
|
||||
//echo "jb_sales_tax_rate: " . $db->getOne("SELECT tx_value FROM tax WHERE tx_id = '$cmp_tx_id'");
|
||||
//echo "jb_sales_tax_rate_sign: " . $db->getOne("SELECT tx_sign FROM tax WHERE tx_id = '$cmp_tx_id'");
|
||||
updateStmt("job", "jb_id", $jb_id,
|
||||
array("jb_sales_tax_rate", $db->getOne("SELECT tx_value FROM tax WHERE tx_id = '$cmp_tx_id'"),
|
||||
"jb_sales_tax_rate_sign", $db->getOne("SELECT tx_sign FROM tax WHERE tx_id = '$cmp_tx_id'")));
|
||||
endif;
|
||||
writeLog_("../log/check_jb_permanent_standing_", "Continuation: jb_id = $jb_id, jb_permanent = $jb_permanent, jb_ordertime = $jb_ordertime, jb_permanent2 = $jb_permanent2, jp_permenddat = $jp_permenddat: $statusMessageTxt");
|
||||
} else {
|
||||
writeLog_("../log/check_jb_permanent_standing_", "NO CONTINUATION (finishdate reached): jb_id = $jb_id, jb_permanent = $jb_permanent, jb_permanent2 = $jb_permanent2, jp_permenddat = $jp_permenddat, jb_ordertime = $jb_ordertime: $statusMessageTxt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//function delCmd() {
|
||||
// $fileHandle = @fopen("../log/call_check_jb_permanent.cmd", 'w');
|
||||
// @fclose($fileHandle);
|
||||
// return;
|
||||
//}
|
||||
|
||||
//function writeCmd($jb_id) {
|
||||
// $fileHandle = @fopen("../log/call_check_jb_permanent.cmd", 'a');
|
||||
// @fwrite($fileHandle, "call check_jb_permanent.cmd " . $jb_id . "\n");
|
||||
// @fclose($fileHandle);
|
||||
// return;
|
||||
//}
|
||||
|
||||
function isPublicHoliday($year, $month, $day)
|
||||
{
|
||||
global $ph;
|
||||
|
||||
for ($i = 0; $i < count($ph); $i++):
|
||||
if ($ph[$i][0] == $year && $ph[$i][1] == $month && $ph[$i][2] == $day):
|
||||
writeLog_("../log/check_jb_permanent_standing_", " isPublicHoliday($year, $month, $day) = true");
|
||||
return true;
|
||||
endif;
|
||||
endfor;
|
||||
writeLog_("../log/check_jb_permanent_standing_", " isPublicHoliday($year, $month, $day) = false");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Funktion wird in get_saved_tour.php benötigt
|
||||
function setJobList($tourNo, $fldNo, $newVal)
|
||||
{
|
||||
global $jobList;
|
||||
//echo "$tourNo, $fldNo, $newVal <br>\n";
|
||||
$tmpJobListJoin = explode("¹", $jobList);
|
||||
$tmpJobList = explode("²", $tmpJobListJoin[$tourNo - 1]);
|
||||
$tmpJobList[$fldNo] = $newVal;
|
||||
$tmpJobListJoin[$tourNo - 1] = implode("²", $tmpJobList);
|
||||
$jobList = implode("¹", $tmpJobListJoin);
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,242 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* csc_list.php
|
||||
*
|
||||
* Autor: Marc Vollmann
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
|
||||
include_once ("../include/mcglobal.inc.php");
|
||||
include_once ("../include/auth.inc.php");
|
||||
|
||||
|
||||
// Check HTTP-Parameters
|
||||
getSecHttpVars("1",array("f_act", "customerId", "cscIdRoot", "cscIdActual",
|
||||
"f_name", "f_comp", "f_comp2", "f_street", "f_hsno", "f_zipcode",
|
||||
"f_city", "f_country", "f_remark", "f_person",
|
||||
"orderClause", "tourNo", "statusMessage"));
|
||||
|
||||
// Select user-type for mode of security check
|
||||
$userType = getFieldValueFromId("user","usr_id",$usr_id,"usr_type");
|
||||
|
||||
// Check authentication verifying emmployee an his/her costcenter- and customer-association
|
||||
if ( !( ($userType == "1" && $cscIdRoot != "") || authCheck($hq_id,$usr_id,$emp_id,$cscIdRoot,$customerId,$cscIdActual) ) ) :
|
||||
die ("$PHP_SELF: Access denied!");
|
||||
endif;
|
||||
|
||||
// Generate search-resultset
|
||||
if ($f_act == "search") :
|
||||
|
||||
// *********************************************************************
|
||||
// * Selection of the costcenters of the current customer for the list *
|
||||
// *********************************************************************
|
||||
$whereClause = "";
|
||||
if ($f_name != "") : $whereClause .= "csc.csc_name LIKE '" . $f_name . "%'"; endif;
|
||||
if ($whereClause != "" && $f_comp != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_comp != "") : $whereClause .= "cscad.cscad_comp LIKE '" . $f_comp . "%'"; endif;
|
||||
if ($whereClause != "" && $f_comp2 != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_comp2 != "") : $whereClause .= "cscad.cscad_comp2 LIKE '" . $f_comp2 . "%'"; endif;
|
||||
if ($whereClause != "" && $f_street != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_street != "") : $whereClause .= "ad.ad_street LIKE '" . $f_street . "%'"; endif;
|
||||
if ($whereClause != "" && $f_hsno != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_hsno != "") : $whereClause .= "cscad.cscad_hsno LIKE '" . $f_hsno . "%'"; endif;
|
||||
if ($whereClause != "" && $f_zipcode != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_zipcode != "") : $whereClause .= "ad.ad_zipcode LIKE '" . $f_zipcode . "%'"; endif;
|
||||
if ($whereClause != "" && $f_city != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_city != "") : $whereClause .= "ad.ad_city LIKE '" . $f_city . "%'"; endif;
|
||||
if ($whereClause != "" && $f_country != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_country != "") : $whereClause .= "ad.ad_country LIKE '" . $f_country . "%'"; endif;
|
||||
if ($whereClause != "" && $f_remark != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_remark != "") : $whereClause .= "cscad.cscad_remark LIKE '" . $f_remark . "%'"; endif;
|
||||
if ($whereClause != "" && $f_person != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_person != "") : $whereClause .= "cscad.cscad_person LIKE '" . $f_person . "%'"; endif;
|
||||
|
||||
|
||||
// Check authentication
|
||||
if ($whereClause != "" && $f_cmp_authenticated == "1") : $whereClause .= " AND "; endif;
|
||||
if ($f_cmp_authenticated == "1") : $whereClause .= "cmp.cmp_authenticated LIKE '" . $f_cmp_authenticated . "%'"; endif;
|
||||
|
||||
if ($whereClause != "") : $whereClause = " AND " . $whereClause; endif;
|
||||
|
||||
if ($orderClause == "") : $orderClause = "cscad.cscad_comp, ad.ad_street"; endif;
|
||||
|
||||
|
||||
// ***********************************************************************
|
||||
// * Selection of the costcenter based on a search by companyname-prefix *
|
||||
// ***********************************************************************
|
||||
$sqlquery = "SELECT csc.csc_id, csc.csc_name," .
|
||||
" cscad.ad_id, cscad.cscad_comp, cscad.cscad_comp2, cscad.cscad_hsno," .
|
||||
" cscad.cscad_remark, cscad.cscad_person, ad.ad_street, ad.ad_zipcode, ad.ad_city, ad.ad_country"
|
||||
. " FROM customer AS cs, costcenter AS csc, costcenteraddress AS cscad, address AS ad"
|
||||
. " WHERE cs.hq_id = '$hq_id' AND"
|
||||
. " cs.cs_id = '$customerId' AND"
|
||||
. " cs.cs_id = csc.cs_id AND"
|
||||
. " csc.csc_id = cscad.csc_id AND"
|
||||
. " cscad.adt_id = '4' AND"
|
||||
. " cscad.ad_id = ad.ad_id "
|
||||
. $whereClause
|
||||
. " ORDER BY " . $orderClause;
|
||||
|
||||
$result = $db->query($sqlquery);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: '$sqlquery'" . $result->getMessage());
|
||||
|
||||
$numOfCostcenters = 0;
|
||||
$out = "";
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$numOfCostcenters++;
|
||||
|
||||
$v_ad_id = $row["ad_id"];
|
||||
$v_ad_street = $row["ad_street"];
|
||||
$v_ad_zipcode = $row["ad_zipcode"];
|
||||
$v_ad_city = $row["ad_city"];
|
||||
$v_ad_country = $row["ad_country"];
|
||||
$v_csc_id = $row["csc_id"];
|
||||
$v_csc_name = $row["csc_name"];
|
||||
$v_cscad_comp = $row["cscad_comp"];
|
||||
$v_cscad_comp2 = $row["cscad_comp2"];
|
||||
$v_cscad_hsno = $row["cscad_hsno"];
|
||||
$v_cscad_remark = $row["cscad_remark"];
|
||||
$v_cscad_person = $row["cscad_person"];
|
||||
|
||||
$out .= "<tr class=\"f10bp1\">";
|
||||
// $out .= "<td class=\"f10bp1_red\"> $v_csc_name </td> ";
|
||||
$out .= "<td> " . "<a href=\"javascript:finishPage('".$v_csc_id."','".$v_csc_name."','".$v_cscad_comp."','".$v_cscad_comp2."','".$v_ad_street."','".$v_cscad_hsno."','".$v_ad_zipcode."','".$v_ad_city."','".$v_ad_country."','".$v_cscad_remark."','".$v_cscad_person."');\">"
|
||||
. $v_csc_name . "</a>" . "</td>";
|
||||
$out .= "<td> $v_cscad_comp </td> ";
|
||||
$out .= "<td> $v_ad_street </td> ";
|
||||
$out .= "<td> $v_cscad_hsno </td> ";
|
||||
$out .= "<td> $v_ad_zipcode </td> ";
|
||||
$out .= "<td> $v_ad_city </td> ";
|
||||
$out .= "<td> $v_cscad_remark </td> ";
|
||||
$out .= "<td> $v_cscad_person </td> ";
|
||||
// $out .= "<td> " . "<a href=\"javascript:finishPage('".$v_csc_name."','".$v_cscad_comp."','".$v_cscad_comp2."','".$v_ad_street."','".$v_cscad_hsno."','".$v_ad_zipcode."','".$v_ad_city."','".$v_ad_country."','".$v_cscad_remark."','".$v_cscad_person."');\">"
|
||||
// . "<img src=\"../images/arrow_right.jpg\" border=\"0\" height=\"10\" width=\"25\">"
|
||||
// . "</a>" . "</td>";
|
||||
$out .= "</tr>\n";
|
||||
endwhile;
|
||||
|
||||
$result->free();
|
||||
endif;
|
||||
?>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>votian: Kostenstellen-Auswahl</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/phoenix.css">
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var statusMessage = "<?php echo $statusMessage ?>";
|
||||
var tourNo = "<?php echo $tourNo ?>";
|
||||
|
||||
var v_comp = '';
|
||||
var v_comp2 = '';
|
||||
var v_street = '';
|
||||
var v_hsno = '';
|
||||
var v_zipcode = '';
|
||||
var v_city = '';
|
||||
var v_country = '';
|
||||
var v_remark = '';
|
||||
var v_person = '';
|
||||
|
||||
//opener.parent.frames[2].isCurrentlySubmitting = false;
|
||||
|
||||
function finishPage(csc_id,name,comp,comp2,street,hsno,zipcode,city,country,remark,person) {
|
||||
v_csc_id = csc_id;
|
||||
v_name = name;
|
||||
v_comp = comp;
|
||||
v_comp2 = comp2;
|
||||
v_street = street;
|
||||
v_hsno = hsno;
|
||||
v_zipcode = zipcode;
|
||||
v_city = city;
|
||||
v_country = country;
|
||||
v_remark = remark;
|
||||
v_person = person;
|
||||
// alert(v_csc_id + ' ' + v_name + ' ' + v_comp + ' ' + v_comp2 + ' ' + v_street + ' ' + v_hsno + ' ' + v_zipcode + ' ' + v_city + ' ' + v_country + ' ' + v_remark + ' ' + v_person);
|
||||
opener.setJobList(tourNo, opener.jl_csc_id, v_csc_id);
|
||||
opener.setJobList(tourNo, opener.jl_tr_comp, v_comp);
|
||||
opener.setJobList(tourNo, opener.jl_tr_person, v_person);
|
||||
opener.setJobList(tourNo, opener.jl_ad_street, v_street);
|
||||
opener.setJobList(tourNo, opener.jl_tr_hsno, v_hsno);
|
||||
opener.setJobList(tourNo, opener.jl_ad_zipcode, v_zipcode);
|
||||
opener.setJobList(tourNo, opener.jl_ad_city, v_city);
|
||||
opener.setJobList(tourNo, opener.jl_tr_remark, v_remark);
|
||||
// opener.refreshFormFields();
|
||||
self.setTimeout("opener.refreshFormFields()", 100);
|
||||
//opener.setCurTourNo(tourNo);
|
||||
//opener.parent.frames[1].document.forms[1].elements[0].focus();
|
||||
// opener.checkSendTour();
|
||||
self.setTimeout("opener.checkSendTour()", 150);
|
||||
// self.close();
|
||||
self.setTimeout("self.close()", 200);
|
||||
};
|
||||
|
||||
function displayStatusMessage() {
|
||||
if (statusMessage != "") {
|
||||
alert(statusMessage);
|
||||
}
|
||||
};
|
||||
-->
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onLoad="displayStatusMessage();">
|
||||
<form action="csc_list.php" method="post">
|
||||
<input type="hidden" name="f_act" value="">
|
||||
<input type="hidden" name="customerId" value="<?php echo $customerId ?>">
|
||||
<input type="hidden" name="cscIdRoot" value="<?php echo $cscIdRoot ?>">
|
||||
<input type="hidden" name="cscIdActual" value="<?php echo $cscIdActual ?>">
|
||||
<input type="hidden" name="orderClause" value="<?php echo $orderClause ?>">
|
||||
<input type="hidden" name="tourNo" value="<?php echo $tourNo ?>">
|
||||
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td class="f12bp1_red">
|
||||
Kostenstellen<br><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="javascript:document.forms[0].f_act.value='search';document.forms[0].submit();">Suchen</a>
|
||||
<br><br>
|
||||
<table class="f8np1" border="1" cellpadding="0">
|
||||
<tr>
|
||||
<td><input type="text" name="f_name" value="<?php echo $f_name ?>" size="15"></td>
|
||||
<td><input type="text" name="f_comp" value="<?php echo $f_comp ?>" size="15"></td>
|
||||
<td><input type="text" name="f_street" value="<?php echo $f_street ?>" size="25"></td>
|
||||
<td><input type="text" name="f_hsno" value="<?php echo $f_hsno ?>" size="5"></td>
|
||||
<td><input type="text" name="f_zipcode" value="<?php echo $f_zipcode ?>" size="5"></td>
|
||||
<td><input type="text" name="f_city" value="<?php echo $f_city ?>" size="20"></td>
|
||||
<td><input type="text" name="f_remark" value="<?php echo $f_remark ?>" size="20"></td>
|
||||
<td><input type="text" name="f_person" value="<?php echo $f_person ?>" size="20"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='csc.csc_name';document.forms[0].f_act.value='search';document.forms[0].submit();">Kostenstelle</a></td>
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='cscad.cscad_comp';document.forms[0].f_act.value='search';document.forms[0].submit();">Firma</a></td>
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='ad.ad_street';document.forms[0].f_act.value='search';document.forms[0].submit();">Straße</a></td>
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='cscad.cscad_hsno';document.forms[0].f_act.value='search';document.forms[0].submit();">Hausnr.</a></td>
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='ad.ad_zipcode';document.forms[0].f_act.value='search';document.forms[0].submit();">PLZ</a></td>
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='ad.ad_city';document.forms[0].f_act.value='search';document.forms[0].submit();">Ort</a></td>
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='cscad.cscad_remark';document.forms[0].f_act.value='search';document.forms[0].submit();">Bemerkung</a></td>
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='cscad.cscad_person';document.forms[0].f_act.value='search';document.forms[0].submit();">Person</a></td>
|
||||
</tr>
|
||||
<?php echo $out ?>
|
||||
</table>
|
||||
<br><br>
|
||||
Anzahl Einträge: <?php echo $numOfCostcenters ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* get_address.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
//require_once("HTML/IT.php");
|
||||
include_once("../include/caglobal.inc.php");
|
||||
include_once("../include/global.inc.php");
|
||||
|
||||
// This page is called by job_edit.js in function "moveToTour"
|
||||
|
||||
// Javascript-Funktionen im temporären Fenster ändern die Adresswerte im Eingabeformular
|
||||
$javascript = "var curTourNo = opener.getCurTourNo();\n";
|
||||
|
||||
// Kostenstellennummern von Start und Ziel sind Parameter
|
||||
list ($csc_id1, $csc_id2) = getHttpVars(array("csc_id1", "csc_id2"));
|
||||
if ($csc_id1 == "" && $csc_id2 == "") reportDie ("$PHP_SELF: Parameter 'csc_id1' und 'csc_id2' fehlen!", false);
|
||||
|
||||
// csc_id1:
|
||||
if ($csc_id1 != ""):
|
||||
// Adress-ID und Hausnummer der Start-Kostenstelle holen
|
||||
list($von_ad_id, $von_ad_hsno, $von_comp, $von_remark, $von_person) =
|
||||
insertAddress("", "", "", $csc_id1);
|
||||
// Strasse, PLZ und Ort von Start holen
|
||||
list($von_ad_city, $von_ad_zipcode, $von_ad_street) = getFieldsValueFromId(
|
||||
"address", "ad_id", $von_ad_id, array("ad_city", "ad_zipcode", "ad_street"));
|
||||
// Sets the relevant openers of the current tour
|
||||
$javascript .= setJavascriptOpenerJobList("curTourNo",
|
||||
array(JL_TR_COMP => $von_comp, JL_TR_PERSON => $von_person,
|
||||
JL_AD_STREET => $von_ad_street, JL_TR_HSNO => $von_ad_hsno,
|
||||
JL_AD_ZIPCODE => $von_ad_zipcode, JL_AD_CITY => $von_ad_city,
|
||||
JL_TR_REMARK => $von_remark));
|
||||
endif;
|
||||
|
||||
// csc_id2:
|
||||
if ($csc_id2 != ""):
|
||||
list($nach_ad_id, $nach_ad_hsno, $nach_comp, $nach_remark, $nach_person) =
|
||||
insertAddress("", "", "", $csc_id2);
|
||||
list($nach_ad_city, $nach_ad_zipcode, $nach_ad_street) = getFieldsValueFromId(
|
||||
"address", "ad_id", $nach_ad_id, array("ad_city", "ad_zipcode", "ad_street"));
|
||||
$javascript .= setJavascriptOpenerJobList("curTourNo + 1",
|
||||
array(JL_TR_COMP => $nach_comp, JL_TR_PERSON => $nach_person,
|
||||
JL_AD_STREET => $nach_ad_street, JL_TR_HSNO => $nach_ad_hsno,
|
||||
JL_AD_ZIPCODE => $nach_ad_zipcode, JL_AD_CITY => $nach_ad_city,
|
||||
JL_TR_REMARK => $nach_remark));
|
||||
endif;
|
||||
|
||||
$javascript .= javascriptOpenerRefreshAndClose();
|
||||
|
||||
// Inhalt des temporären Fensters erzeugen und ausgeben
|
||||
//$tpl = new IntegratedTemplate();
|
||||
//$tpl->loadTemplatefile(GETDATAHTMLTPL, true, true);
|
||||
//$tpl->setCurrentBlock("javascript");
|
||||
//$tpl->setVariable("_javascript_", $javascript);
|
||||
//$tpl->parseCurrentBlock("javascript");
|
||||
//$tpl->show();
|
||||
$output = file_get_contents(GETDATAHTMLTPL);
|
||||
$output = str_replace("{_javascript_}", $javascript, $output);
|
||||
echo $output;
|
||||
?>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* get_couriers.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
//require_once("HTML/IT.php");
|
||||
include_once("../include/caglobal.inc.php");
|
||||
include_once("../include/global.inc.php");
|
||||
|
||||
list ($zipcode, $jb_id, $hq_id_string) = getHttpVars(array("zipcode", "jb_id", "hq_id_string"));
|
||||
|
||||
//$cr_id_order_list = "var cr_id_order_list = new Array();\n";
|
||||
//$cr_id_order_list2 = "var cr_id_order_list2 = new Array();\n";
|
||||
include_once("../jobs/job_courier.inc.php");
|
||||
$cr_id_order_list = str_replace("var cr_id_order_list", "opener.cr_id_order_list", $cr_id_order_list);
|
||||
$cr_id_order_list2 = str_replace("var cr_id_order_list2", "opener.cr_id_order_list2", $cr_id_order_list2);
|
||||
$vht_id_str_js = str_replace("vht_id_str", "opener.vht_id_str", $vht_id_str_js);
|
||||
$vht_id_str_js = str_replace("var opener.vht_id_str", "opener.vht_id_str", $vht_id_str_js);
|
||||
|
||||
$js_args = "";
|
||||
if (isset($jb_id) && $jb_id != "")
|
||||
$js_args = $jb_id . ", '" . $zipcode . "'" . ", '" . $hq_id_string . "'";
|
||||
$javascript =
|
||||
"opener.MASK_COURIER_SORT_BY_OCCUPIED =\"" . MASK_COURIER_SORT_BY_OCCUPIED . "\";\n" .
|
||||
$cr_id_order_list .
|
||||
$cr_id_order_list2 .
|
||||
$vht_id_str_js .
|
||||
"//opener.isCurrentlySubmitting = false;\n" .
|
||||
"opener.mk_cr_id_list(" . $js_args . ");\n" .
|
||||
"self.close();\n";
|
||||
|
||||
//echo $javascript;
|
||||
// Inhalt des temporären Fensters erzeugen und ausgeben
|
||||
//$tpl = new IntegratedTemplate();
|
||||
//$tpl->loadTemplatefile(GETDATAHTMLTPL, true, true);
|
||||
//$tpl->setCurrentBlock("javascript");
|
||||
//$tpl->setVariable("_javascript_", $javascript);
|
||||
//$tpl->parseCurrentBlock("javascript");
|
||||
//$tpl->show();
|
||||
$output = file_get_contents(GETDATAHTMLTPL);
|
||||
$output = str_replace("{_javascript_}", $javascript, $output);
|
||||
echo $output;
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,30 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>votian: Auftragserfassung - Hole Daten...</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/phoenix.css">
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
<!-- BEGIN javascript -->
|
||||
{_javascript_}
|
||||
<!-- END javascript -->
|
||||
-->
|
||||
</script>
|
||||
<noscript>
|
||||
<center>
|
||||
<b><br>JavaScript ist nicht verfügbar. Bitte aktivieren Sie JavaScript<br><br>
|
||||
in Ihrem Browser, damit diese Seite ordnungsgemäß funktioniert!</b><br><br>
|
||||
</center>
|
||||
</noscript>
|
||||
</head>
|
||||
<body>
|
||||
<table border=0 height=95% width=100% align=center cellspacing=0 cellpadding=0 vspace=0 hspace=0>
|
||||
<tr>
|
||||
<td align=center>
|
||||
<b>Hole Daten...</b>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,472 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* get_saved_tour.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
include_once("../include/caglobal.inc.php");
|
||||
include_once("../include/global.inc.php");
|
||||
include_once("../include/auth.inc.php");
|
||||
//$phpVersion = substr(phpversion(), 0, 3);
|
||||
//if ($phpVersion >= "7.0"):
|
||||
// require_once("../PEAR/HTML/Template/IT.php");
|
||||
//else:
|
||||
// require_once("HTML/IT.php");
|
||||
//endif;
|
||||
|
||||
// Decision to use the archive or normal tables
|
||||
list ($dbhistory) = getHttpVars(array("dbhistory"));
|
||||
getDBNames($dbhistory);
|
||||
if ($dbh_jb == "")
|
||||
$dbh_jb = "job";
|
||||
if ($dbh_tr == "")
|
||||
$dbh_tr = "tour";
|
||||
|
||||
// Name der Tabellen
|
||||
if (!(isset($_copy_jobs_flag) && $_copy_jobs_flag == true) || (isset($jb_storno) && $jb_storno > 0) ||
|
||||
(isset($_copy_jobs_flag_ori) && $_copy_jobs_flag_ori == true)):
|
||||
$_job_table = $dbh_jb;
|
||||
$_tour_table = $dbh_tr;
|
||||
else:
|
||||
$_job_table = "job_backup";
|
||||
$_tour_table = "tour_backup";
|
||||
endif;
|
||||
// Job-ID des Auftrags ist Parameter
|
||||
// checken, ob jb_id schon definiert (gesetzt, wenn von "check_jb_permanent.php" aufgerufen)
|
||||
if (!(isset($check_jb_permanent_flag) && $check_jb_permanent_flag == true))
|
||||
list ($jb_id, $cr_sid_none, $consider_manual_disp, $jb_copy, $no_dates) = getHttpVars(array("jb_id", "cr_sid", "consider_manual_disp", "jb_copy", "no_dates"));
|
||||
if ($jb_id == "") reportDie ("$PHP_SELF: Parameter 'jb_id' fehlt!", false);
|
||||
|
||||
// gespeicherte Job-Daten holen
|
||||
list($csc_id, $vht_id, $jb_weight, $jb_crvh_length, $jb_crvh_width, $jb_crvh_height, $jb_crvh_position, $jb_ordertime, $jb_reserv, $jb_permanent, $vht_id,
|
||||
$cr_sid, $cr_id_order, $jb_waitstorno, $jb_waittime, $jb_fixprice, $jb_serviceprice, $jb_cr_price, $csc_id_payer, $csc_id_payer_cash,
|
||||
/*$jb_type,*/ $jb_globaljob, $jb_freetext_1, $jb_payment, $jb_permanent2,
|
||||
$jb_sales_tax_rate, $jb_sales_tax_rate_sign, $jp_permenddat, $jb_cr_filter, $jb_cr_filter_opt,
|
||||
$jb_locktime, $jb_lockuser, $jb_status, $cr_id_permanent, $jb_incomplete, $jb_export_time, $jb_dispoinfo, $jb_commission_no) = // $jb_status wird bei der nachträglichen Änderung einer Tour benötigt
|
||||
getFieldsValueFromId($_job_table, "jb_id", $jb_id,
|
||||
array("csc_id", "vht_id", "jb_weight", "jb_crvh_length", "jb_crvh_width", "jb_crvh_height", "jb_crvh_position", "jb_ordertime", "jb_reserv", "jb_permanent",
|
||||
"vht_id", "cr_sid", "cr_id_order", "jb_waitstorno", "jb_waittime", "jb_fixprice", "jb_serviceprice", "jb_cr_subprice", "csc_id_payer", "csc_id_payer_cash",
|
||||
/*"jb_type",*/ "jb_globaljob", "jb_freetext_1", "jb_payment", "jb_permanent2",
|
||||
"jb_sales_tax_rate", "jb_sales_tax_rate_sign", "jp_permenddat", "jb_cr_filter", "jb_cr_filter_opt",
|
||||
"jb_locktime", "jb_lockuser", "jb_status", "cr_id_permanent", "jb_incomplete", "jb_export_time", "jb_dispoinfo", "jb_commission_no"));
|
||||
if (MASK_CR_PRICE_MODE == "1") {
|
||||
$jb_cr_serviceprice = $db->getOne("SELECT gdc_content FROM genericdatacontainer WHERE gdc_obj_type = 'jb' AND gdc_obj_id = $jb_id AND gdc_gen_fieldname = 'jb_cr_serviceprice'");
|
||||
}
|
||||
$jb_price_km = $db->getOne("SELECT jbprc_price FROM jobprice WHERE jb_id = " . $jb_id . " AND mt_sort = 15");
|
||||
$job_is_exported = (trim($jb_export_time) != "" ? true : false);
|
||||
$jb_job_jam = $db->getOne("SELECT gdc_content FROM genericdatacontainer WHERE gdc_obj_type = 'jb' AND gdc_obj_id = " . $jb_id . " AND gdc_gen_fieldname = 'jb_job_jam'");
|
||||
$jb_jam_waittime = "";
|
||||
if (trim($jb_job_jam) != ""):
|
||||
if ($jb_reserv == 1):
|
||||
$tmpCsIdPayer = getFieldValueFromId("costcenter", "csc_id", $csc_id_payer, "cs_id");
|
||||
$jb_jam_waittime = $db->getOne("SELECT cs_jb_jam_waittime_minutes from customer WHERE cs_id = " . $tmpCsIdPayer);
|
||||
if ($jb_jam_waittime == 0):
|
||||
$jb_jam_waittime = getParameterValue("0", "CS_JB_JAM_WAITTIME_AD_HOC_DEFAULT", "0"); endif;
|
||||
else:
|
||||
$jb_jam_waittime = (strtotime($jb_job_jam) - strtotime($jb_ordertime)) / 60;
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// Prüfen, ob Datensatz gesperrt bzw. neue Sperre setzen
|
||||
if (!(isset($_copy_jobs_flag) && $_copy_jobs_flag == true)):
|
||||
$job_is_locked = false;
|
||||
$locktime = date("Y-m-d H:i:s");
|
||||
if ($jb_locktime != "" && $jb_locktime != "0000-00-00 00:00:00" && $jb_lockuser != $usr_id):
|
||||
//echo "'$jb_lockuser' == '$usr_id'";
|
||||
// Datensatz ist gesperrt; überprüfen, ob Sperrzeit bereits abgelaufen
|
||||
$jb_locktime_arr = getValsFromDate($jb_locktime);
|
||||
$locktime_expired = date("Y-m-d H:i:s",
|
||||
mktime($jb_locktime_arr[3], $jb_locktime_arr[4] + MASK_LOCKTIME_TIMEOUT, $jb_locktime_arr[5], $jb_locktime_arr[1], $jb_locktime_arr[2], $jb_locktime_arr[0]));
|
||||
if ($locktime <= $locktime_expired):
|
||||
// Timeout noch nicht abgelaufen: Datensatz ist gesperrt
|
||||
$job_is_locked = true;
|
||||
endif;
|
||||
endif;
|
||||
if ($job_is_locked != true):
|
||||
// Datensatz ist noch nicht gespert, jetzt aber für anderweitige Benutzer sperren
|
||||
updateStmt("job", "jb_id", $jb_id, array("jb_locktime", $locktime, "jb_lockuser", $usr_id));
|
||||
endif;
|
||||
endif;
|
||||
|
||||
if ($jb_weight == "") $jb_weight = "0";
|
||||
if ($jb_payment == 0) $jb_payment = "";
|
||||
if ($jb_fixprice == 0) $jb_fixprice = "";
|
||||
if ($jb_serviceprice == 0) $jb_serviceprice = "";
|
||||
if ($jb_cr_price == 0) $jb_cr_price = "";
|
||||
//$jb_fixprice = str_replace(".00", "", $jb_fixprice);
|
||||
$jb_fixprice = str_replace(".", ",", $jb_fixprice);
|
||||
$jb_serviceprice = str_replace(".", ",", $jb_serviceprice);
|
||||
|
||||
if (!isset($csc_id_order) || $csc_id_order == 0) $csc_id_order = "";
|
||||
if ($jb_waittime != "")
|
||||
list($jb_waittime_jahr, $jb_waittime_monat, $jb_waittime_tag,
|
||||
$jb_waittime_hour, $jb_waittime_minute) = getValsFromDate($jb_waittime);
|
||||
else
|
||||
$jahr = $monat = $tag = $stunde = $minute = "";
|
||||
if ($no_dates != true && ($jb_reserv == 1 || $jb_permanent != "")):
|
||||
list($jahr, $monat, $tag, $stunde, $minute) = getValsFromDate($jb_ordertime);
|
||||
list($endejahr, $endemonat, $endetag, $dummy1, $dummy2) = getValsFromDate($jp_permenddat);
|
||||
else:
|
||||
$jahr = $monat = $tag = $stunde = $minute = "";
|
||||
$endejahr = $endemonat = $endetag = "";
|
||||
endif;
|
||||
|
||||
// Zoneneinträge holen
|
||||
$km_price_params = "";
|
||||
$sqlquery = "SELECT trs_srv_name FROM tourservice WHERE trs_srvt_name = 'z' AND jb_id = " . $jb_id;
|
||||
$res = $db->query($sqlquery);
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlquery': " . $res->getMessage());
|
||||
while ($row = $res->fetch_assoc()):
|
||||
$km_price_params .= ($km_price_params != "" ? " + " : "") . $row['trs_srv_name'];
|
||||
endwhile;
|
||||
$res->free();
|
||||
|
||||
// Km-Preis Parameter holen
|
||||
$javascript_zone = "";
|
||||
if ($km_price_params != "") {
|
||||
$tr_mediationarea_names = "";
|
||||
$sqlquery = "SELECT tr_mediationarea_name FROM tour WHERE jb_id = " . $jb_id;
|
||||
$res = $db->query($sqlquery);
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlquery': " . $res->getMessage());
|
||||
while ($row = $res->fetch_assoc()):
|
||||
$tr_mediationarea_names .= ($tr_mediationarea_names != "" ? "," : "") . $row['tr_mediationarea_name'];
|
||||
endwhile;
|
||||
$res->free();
|
||||
$km_price_params = $jb_price_km . "|" . $km_price_params . "||zone|" . $tr_mediationarea_names;
|
||||
$javascript_zone = "opener.parent.job_options.fixprice_was_zone = true;\n";
|
||||
if (isset($no_dates) && $no_dates == "true") {
|
||||
$jb_fixprice = "";
|
||||
$jb_cr_price = "";
|
||||
}
|
||||
} else {
|
||||
$km_price_params = $db->getOne("SELECT trs_srvt_name FROM tourservice WHERE trs_srv_name = 'Fixpreis' AND jb_id = " . $jb_id);
|
||||
}
|
||||
//$cr_sid = "";
|
||||
//if ($cr_id_order != "")
|
||||
// $cr_sid = $db->getOne(
|
||||
// "SELECT crvh_sid FROM courier_vehicle WHERE cr_id = '$cr_id_order'");
|
||||
//// "SELECT crvh_sid FROM courier_vehicle WHERE cr_id = '$cr_id_order' AND hq_id = '$hq_id'");
|
||||
if ((getParameterValue($emp_id, "MODE_COPY_JOB")) == "1" && $cr_sid != "0")
|
||||
$cr_sid_none = $cr_sid;
|
||||
|
||||
// Javascript-Funktionen im temporären Fenster ändern die Werte im Eingabeformular
|
||||
// Job-Tour Frame
|
||||
$jb_sales_tax_rate_sign = $db->getOne("SELECT tx_id FROM tax WHERE tx_sign = '$jb_sales_tax_rate_sign'");
|
||||
$javascript = setJavascriptOpenerFormVals("job_options", "tourOptions",
|
||||
array("cr_id_order" => ($cr_sid_none == "none" ? "" : $cr_sid), "vht_id" => $vht_id, "jb_weight" => $jb_weight,
|
||||
"jb_crvh_length" => $jb_crvh_length, "jb_crvh_width" => $jb_crvh_width, "jb_crvh_height" => $jb_crvh_height, "jb_crvh_position" => $jb_crvh_position,
|
||||
"jb_permanent" => $jb_permanent, "savedTour" => "", "jb_fixprice" => $jb_fixprice,
|
||||
"jb_serviceprice" => $jb_serviceprice, "jb_cr_price" => $jb_cr_price,
|
||||
"jb_tourname_hidden" => getFieldValueFromId($_job_table, "jb_id", $jb_id, "jb_tourname"),
|
||||
"jb_tourname_hidden_vht_id" => $vht_id,
|
||||
"jb_freetext_1" => my_str_check($jb_freetext_1), "jb_cr_filter" => $jb_cr_filter,
|
||||
"jb_dispoinfo" => my_str_check($jb_dispoinfo),
|
||||
"jb_cr_filter_opt" => $jb_cr_filter_opt, "jb_permanent2_hidden" => $jb_permanent2,
|
||||
"jb_sales_tax_rate" => $jb_sales_tax_rate, "jb_sales_tax_rate_sign" => $jb_sales_tax_rate_sign,
|
||||
"km_price_params" => $km_price_params
|
||||
));
|
||||
|
||||
if (MASK_CR_PRICE_MODE == "1") {
|
||||
$javascript .= setJavascriptOpenerFormVals("job_options", "tourOptions", array("jb_cr_serviceprice" => $jb_cr_serviceprice));
|
||||
}
|
||||
$javascript .=
|
||||
"if (typeof(opener.parent.job_options.document.tourOptions.jb_permanent) != 'undefined') {\n" .
|
||||
" opener.checkJb_permanent();\n" .
|
||||
" opener.setDateTimeFields(\"job_options\", \"tourOptions\", \"$tag\", \"$monat\", \"$jahr\", \"$stunde\", \"$minute\", \"tag\", \"monat\", \"jahr\", \"stunde\", \"minute\", \"jb_permanent\");\n" .
|
||||
"} else {\n" .
|
||||
" opener.setDateTimeFields(\"job_options\", \"tourOptions\", \"$tag\", \"$monat\", \"$jahr\", \"$stunde\", \"$minute\", \"tag\", \"monat\", \"jahr\", \"stunde\", \"minute\", \"\");\n" .
|
||||
"}\n" .
|
||||
"if (typeof(opener.parent.job_options.document.tourOptions.endetag) != 'undefined')\n" .
|
||||
" opener.setDateTimeFields(\"job_options\", \"tourOptions\", \"$endetag\", \"$endemonat\", \"$endejahr\", \"\", \"\", \"endetag\", \"endemonat\", \"endejahr\", \"\", \"\", \"\");\n" .
|
||||
"if(typeof(opener.parent.job_tour.document.tourForm.jb_freetextButton) != 'undefined') {" .
|
||||
" if (\"" . my_str_check($jb_freetext_1) . "\" == \"\")\n" .
|
||||
" opener.parent.job_tour.document.tourForm.jb_freetextButton.value = \"Text\";\n" .
|
||||
" else\n" .
|
||||
" opener.parent.job_tour.document.tourForm.jb_freetextButton.value = \"Text*\"\n;" .
|
||||
"}";
|
||||
if (MASK_WAITTIME_ENABLED == "1"):
|
||||
$javascript .= setJavascriptOpenerFormVals("job_options", "tourOptions",
|
||||
array(
|
||||
"jb_waittime_hour" => $jb_waittime_hour, "jb_waittime_minute" => $jb_waittime_minute
|
||||
));
|
||||
endif;
|
||||
$javascript .= $javascript_zone;
|
||||
|
||||
// Job-Options Frame initialisieren
|
||||
$javascript .=
|
||||
setJavascriptOpenerDisabled("job_options", "tourOptions", "jb_tourname_overwrite",
|
||||
((trim(getFieldValueFromId($_job_table, "jb_id", $jb_id, "jb_tourname")) != "") ? "false" : "true")) .
|
||||
setJavascriptOpenerChecked("job_options", "tourOptions", "jb_waitstorno",
|
||||
(($jb_waitstorno != "1") ? "false" : "true")) .
|
||||
setJavascriptOpenerDisabled("job_options", "tourOptions", "jb_permanent",
|
||||
(($jb_reserv == 1 || $jb_permanent != "") ? "false" : "true")) .
|
||||
setJavascriptOpenerChecked("job_options", "tourOptions", "jb_permanent2_0",
|
||||
((substr($jb_permanent2, 0, 1) != "1") ? "false" : "true")) .
|
||||
setJavascriptOpenerChecked("job_options", "tourOptions", "jb_permanent2_1",
|
||||
((substr($jb_permanent2, 1, 1) != "1") ? "false" : "true")) .
|
||||
setJavascriptOpenerChecked("job_options", "tourOptions", "jb_permanent2_2",
|
||||
((substr($jb_permanent2, 2, 1) != "1") ? "false" : "true")) .
|
||||
setJavascriptOpenerChecked("job_options", "tourOptions", "jb_permanent2_3",
|
||||
((substr($jb_permanent2, 3, 1) != "1") ? "false" : "true")) .
|
||||
setJavascriptOpenerChecked("job_options", "tourOptions", "jb_permanent2_4",
|
||||
((substr($jb_permanent2, 4, 1) != "1") ? "false" : "true")) .
|
||||
setJavascriptOpenerChecked("job_options", "tourOptions", "jb_permanent2_5",
|
||||
((substr($jb_permanent2, 5, 1) != "1") ? "false" : "true")) .
|
||||
setJavascriptOpenerChecked("job_options", "tourOptions", "jb_permanent2_6",
|
||||
((substr($jb_permanent2, 6, 1) != "1") ? "false" : "true")) .
|
||||
// setJavascriptOpenerChecked("job_options", "tourOptions", "jb_type",
|
||||
// (($jb_type != "1") ? "false" : "true")) .
|
||||
setJavascriptOpenerChecked("job_options", "tourOptions", "jb_globaljob",
|
||||
(($jb_globaljob != "1") ? "false" : "true")) .
|
||||
"if (typeof(opener.parent.job_tour.document.tourForm.jb_permanent) != 'undefined') \n" .
|
||||
" opener.checkJb_permanent2();\n" .
|
||||
"opener.initJobList();\n" .
|
||||
"if (typeof(opener.parent.job_options.document.tourOptions.cr_id_order) != 'undefined') \n" .
|
||||
" opener.checkCr_id_order();\n";
|
||||
|
||||
$i = 1;
|
||||
$payer_found = false;
|
||||
do {
|
||||
// gespeicherte Tour-Daten holen
|
||||
if (existsEntry($_tour_table, array("jb_id", $jb_id, "tr_sort", $i))):
|
||||
$tourFound = 1;
|
||||
list($csc_id, $tr_comp, $tr_person, $ad_street, $tr_hsno,
|
||||
$ad_zipcode, $ad_city, $ad_country, $tr_remark, $tr_status, $tr_ware_from_to, $tr_commission_no, $tr_mediationarea_id, $tr_status, $tr_sign, $tr_signname, $tr_finishtime, $tr_id) =
|
||||
getTourData($jb_id, $i, $dbh_tr);
|
||||
// 17.02.2026: Bei Konserven soll die erste Ko.-Nr. als $jb_commission_no übernommen werden wenn vorhanden und letztere leer
|
||||
if ((isset($no_dates) && $no_dates == "true") && $jb_commission_no == "" && my_str_check($tr_commission_no) != "")
|
||||
$jb_commission_no = my_str_check($tr_commission_no);
|
||||
$tr_tracking = "";
|
||||
$gdc_content = $db->getOne("SELECT gdc_content FROM genericdatacontainer WHERE gdc_obj_type = 'tr' AND gdc_gen_fieldname = 'tr_tracking' AND gdc_obj_id = " . $tr_id);
|
||||
if ($gdc_content != "") {
|
||||
$gdc_content_arr = explode("|", $gdc_content);
|
||||
$tr_tracking = $gdc_content_arr[0];
|
||||
}
|
||||
$is_payer = (($csc_id_payer == $csc_id && $csc_id_payer != CSC_ID_PAYER_CASH) || $csc_id_payer_cash == $csc_id) ? "true" : "false";
|
||||
//$javascript .=
|
||||
//"alert($is_payer + \",\" + $csc_id + \",\" + $csc_id_payer + \",\" + $csc_id_payer_cash);";
|
||||
$javascript .= setJavascriptOpenerJobList($i - 1,
|
||||
array(JL_CSC_ID => $csc_id, JL_TR_COMP => $tr_comp, JL_TR_PERSON => $tr_person,
|
||||
JL_AD_STREET => $ad_street, JL_TR_HSNO => $tr_hsno, JL_AD_COUNTRY => $ad_country, JL_AD_ZIPCODE => $ad_zipcode,
|
||||
JL_AD_CITY => $ad_city, JL_TR_REMARK => $tr_remark, JL_CSC_ID_PAYER => $is_payer,
|
||||
JL_TR_COMMISSION_NO => my_str_check($tr_commission_no),
|
||||
JL_TR_TRACKING => my_str_check($tr_tracking),
|
||||
JL_TR_MEDIATIONAREA_ID => $tr_mediationarea_id,
|
||||
JL_TR_WARE_TO => ($tr_ware_from_to == 1 || $tr_ware_from_to == 3 ? "true" : "false"),
|
||||
JL_TR_WARE_FROM => ($tr_ware_from_to == 2 || $tr_ware_from_to == 3 ? "true" : "false")));
|
||||
if ($is_payer == "true"): $payer_found = true; endif;
|
||||
// wenn von "check_jb_permanent.php" aufgerufen, muss joblist-Array aufgebaut werden
|
||||
if (isset($check_jb_permanent_flag) && $check_jb_permanent_flag == true):
|
||||
setJobList($i, JL_CSC_ID, $csc_id);
|
||||
setJobList($i, JL_TR_COMP, $tr_comp);
|
||||
setJobList($i, JL_TR_PERSON, $tr_person);
|
||||
setJobList($i, JL_AD_STREET, $ad_street);
|
||||
setJobList($i, JL_TR_HSNO, $tr_hsno);
|
||||
setJobList($i, JL_AD_COUNTRY, $ad_country);
|
||||
setJobList($i, JL_AD_ZIPCODE, $ad_zipcode);
|
||||
setJobList($i, JL_AD_CITY, $ad_city);
|
||||
setJobList($i, JL_TR_REMARK, $tr_remark);
|
||||
setJobList($i, JL_TR_TRACKING, my_str_check($tr_tracking));
|
||||
setJobList($i, JL_TR_WARE_TO, ($tr_ware_from_to == 1 || $tr_ware_from_to == 3 ? "true" : "false"));
|
||||
setJobList($i, JL_TR_WARE_FROM, ($tr_ware_from_to == 2 || $tr_ware_from_to == 3 ? "true" : "false"));
|
||||
setJobList($i, JL_CSC_ID_PAYER, $is_payer);
|
||||
// setJobList($i, JL_TR_COMMISSION_NO, $tr_commission_no);
|
||||
setJobList($i, JL_HIDE_TR_REMARK, "true");
|
||||
if (defined('JL_MEDIATIONAREA_ID'))
|
||||
setJobList($i, JL_MEDIATIONAREA_ID, $tr_mediationarea_id);
|
||||
if ($jb_payment == 0):
|
||||
$jb_costsplit = "false";
|
||||
$jb_cash = "false";
|
||||
endif;
|
||||
if ($jb_payment == 1):
|
||||
$jb_costsplit = "true";
|
||||
$jb_cash = "false";
|
||||
endif;
|
||||
if ($jb_payment == 2):
|
||||
$jb_costsplit = "false";
|
||||
$jb_cash = "true";
|
||||
endif;
|
||||
if ($javascript_zone != ""):
|
||||
$jb_fixprice = 0;
|
||||
$jb_cr_price = 0;
|
||||
endif;
|
||||
else:
|
||||
$javascript .= javascriptAdd_cs_eid($csc_id, "opener.");
|
||||
endif;
|
||||
else:
|
||||
$tourFound = 0;
|
||||
endif;
|
||||
$i++;
|
||||
} while ($tourFound == 1);
|
||||
$javascript .=
|
||||
"if (typeof(opener.parent.job_tour.document.tourForm.jb_commission_no) != 'undefined') {\n" .
|
||||
" opener.parent.job_tour.document.tourForm.jb_commission_no.value = \"" . $jb_commission_no . "\";\n" .
|
||||
" opener.check_jb_commission_no();\n" .
|
||||
"}\n" .
|
||||
setJavascriptOpenerFormVals("job_options", "tourOptions",
|
||||
array(
|
||||
"jb_commission_no_hidden" => $jb_commission_no
|
||||
)
|
||||
);
|
||||
|
||||
// möglichen Kostensplit beachten
|
||||
/* für Zentrale Hansetrans: Barzahlung */
|
||||
if ($jb_payment == 1 || ($jb_payment == 0 && MASK_CASH_PAYER_SELECT == "1"))
|
||||
$javascript .=
|
||||
"if (typeof(opener.parent.job_tour.document.tourForm.jb_costsplit) != 'undefined') {" .
|
||||
" opener.parent.job_tour.document.tourForm.jb_costsplit.checked = true;\n" .
|
||||
" opener.checkCostsplit();\n}\n";
|
||||
// Kostenteilung, Barzahlungsarie berücksichtigen
|
||||
$comp_payer = "";
|
||||
if ($csc_id_payer != -1 && $csc_id_payer != 0 && (CSC_ID_PAYER_CASH != "" && $csc_id_payer != CSC_ID_PAYER_CASH)):
|
||||
// wenn der Payer nicht in der Joblist gefunden wurde und
|
||||
// csc_id_payer weder Kostenteilung noch Barzahlung enthält
|
||||
// dann ist der Zahler in csc_id_payer der Drittzahler!!!
|
||||
// Da muss nun auch noch ein Name gefunden werden.
|
||||
if (!$payer_found):
|
||||
$comp_payer = $db->getOne(
|
||||
"SELECT cmp.cmp_comp FROM company AS cmp, customer AS cs, costcenter AS csc" .
|
||||
" WHERE cmp.cmp_id = cs.cmp_id AND cs.cs_id = csc.cs_id AND csc.csc_id = '$csc_id_payer'");
|
||||
$comp_payer = my_str_check_js($comp_payer);
|
||||
$javascript .= javascriptAdd_cs_eid($csc_id_payer, "opener.");
|
||||
endif;
|
||||
$javascript .=
|
||||
"if (opener.parent.job_tour.is_customer) {opener.setCsc_id_payer('$csc_id_payer', opener.get_comp('$csc_id_payer'));}\n";
|
||||
endif;
|
||||
|
||||
// Kurierfilter berücksichtigen
|
||||
$jb_cr_filter_list = array_merge(explode(",", $jb_cr_filter), explode(",", $jb_cr_filter_opt));
|
||||
|
||||
// Erst alle Kurierfilter zurücksetzen
|
||||
$javascript .=
|
||||
"for (var i = 0; i < opener.parent.job_options.cfl.length; i++)\n" .
|
||||
" opener.parent.job_options.cfl[i][3] = 0;\n" .
|
||||
"var filterStr = \"Filter\";";
|
||||
// Alle Kurierfilter neu setzen
|
||||
for ($i = 0; $i < count($jb_cr_filter_list); $i++)
|
||||
{
|
||||
$javascript .=
|
||||
"for (var i = 0; i < opener.parent.job_options.cfl.length; i++)\n" .
|
||||
"{\n" .
|
||||
" if (opener.parent.job_options.cfl[i][0] == \"" . trim($jb_cr_filter_list[$i]) . "\")\n" .
|
||||
" {\n" .
|
||||
" opener.parent.job_options.cfl[i][3] = 1;\n" .
|
||||
" if (opener.parent.job_options.is_in_customer_filters(opener.parent.job_options.cfl[i][0]))\n" .
|
||||
" filterStr = \"Filter*\";" .
|
||||
" break;\n" .
|
||||
" }\n" .
|
||||
"}\n";
|
||||
}
|
||||
|
||||
$javascript .=
|
||||
"if (typeof(opener.parent.job_options.document.tourOptions.jb_cr_filterButton) != 'undefined')\n {" .
|
||||
"opener.parent.job_options.document.tourOptions.jb_cr_filterButton.value = filterStr;\n" .
|
||||
"}";
|
||||
|
||||
// Wenn Barzahlung, dann Checkbox ankreuzen
|
||||
if ($jb_payment == 2)
|
||||
$javascript .=
|
||||
"if (typeof(opener.parent.job_tour.document.tourForm.jb_cash) != 'undefined')\n {" .
|
||||
" opener.parent.job_tour.document.tourForm.jb_cash.checked = true;\n" .
|
||||
" opener.checkCash();\n" .
|
||||
"}";
|
||||
else
|
||||
$javascript .=
|
||||
"if (typeof(opener.parent.job_tour.document.tourForm.jb_cash) != 'undefined')\n {" .
|
||||
" opener.parent.job_tour.document.tourForm.jb_cash.checked = false;\n" .
|
||||
" opener.checkCash();\n" .
|
||||
"}";
|
||||
|
||||
$waittimefiels = "";
|
||||
if (MASK_WAITTIME_ENABLED == "1"):
|
||||
$waittimefiels =
|
||||
"opener.parent.job_options.document.tourOptions.jb_waittime_hour.disabled = false;\n" .
|
||||
"opener.parent.job_options.document.tourOptions.jb_waittime_minute.disabled = false;\n";
|
||||
endif;
|
||||
|
||||
// Wenn der Originalaufrag einen Festpreis hatte und ein Discount berücksichtigt wurde,
|
||||
// dann muss die entsprechende Checkbox gesetzt sein!
|
||||
$javascript .=
|
||||
"opener.parent.job_options.discount_default = true;\n";
|
||||
if ($jb_fixprice != "0" || $jb_serviceprice != "0"):
|
||||
if ($db->getOne("SELECT trs_discount FROM tourservice WHERE jb_id = '$jb_id' AND (trs_srv_name = 'Fixpreis' OR trs_srv_name = 'Servicepreis') AND trs_discount > 0") > 0):
|
||||
// $javascript .=
|
||||
// "opener.parent.job_options.document.tourOptions.jb_discount.disabled = false;\n" .
|
||||
// "opener.parent.job_options.document.tourOptions.jb_discount.checked = true;\n";
|
||||
else:
|
||||
$javascript .=
|
||||
"opener.parent.job_options.discount_default = false;\n";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
$javascript .=
|
||||
"opener.parent.job_options.is_exported = " . ($job_is_exported ? "true" : "false") . ";\n";
|
||||
|
||||
$javascript .=
|
||||
"opener.parent.job_options.document.tourOptions.tag.disabled = false;\n" .
|
||||
"opener.parent.job_options.document.tourOptions.monat.disabled = false;\n" .
|
||||
"opener.parent.job_options.document.tourOptions.jahr.disabled = false;\n" .
|
||||
"opener.parent.job_options.document.tourOptions.stunde.disabled = false;\n" .
|
||||
"opener.parent.job_options.document.tourOptions.minute.disabled = false;\n" .
|
||||
"if (typeof(opener.parent.job_options.document.tourOptions.jb_permanent) != 'undefined')\n" .
|
||||
" opener.parent.job_options.document.tourOptions.jb_permanent.disabled = false;\n" .
|
||||
$waittimefiels .
|
||||
"if (typeof(opener.parent.job_options.document.tourOptions.jb_globaljob) != 'undefined')\n {" .
|
||||
" opener.parent.job_options.document.tourOptions.jb_globaljob.checked = false;\n" .
|
||||
" opener.parent.job_options.document.tourOptions.jb_globaljob.disabled = false; }\n" .
|
||||
"if (typeof(opener.parent.job_options.document.tourOptions.jb_status_manual) != 'undefined')\n" .
|
||||
" opener.parent.job_options.document.tourOptions.jb_status_manual.disabled = false;\n" .
|
||||
(($consider_manual_disp == 1 && MASK_MANUAL_DISPOSITION == "1")
|
||||
? "if (typeof(opener.parent.job_options.document.tourOptions.jb_status_manual) != 'undefined')\n" .
|
||||
" opener.parent.job_options.document.tourOptions.jb_status_manual.checked = true;\n"
|
||||
: "if (typeof(opener.parent.job_options.document.tourOptions.jb_status_manual) != 'undefined')\n" .
|
||||
" opener.parent.job_options.document.tourOptions.jb_status_manual.checked = false;\n") .
|
||||
"opener.checkAfterwards();\n" .
|
||||
($jb_incomplete == 1
|
||||
? "if (typeof(opener.parent.job_options.document.tourOptions.jb_incomplete) != 'undefined')\n" .
|
||||
"opener.parent.job_options.document.tourOptions.jb_incomplete.checked = true;\n"
|
||||
: "if (typeof(opener.parent.job_options.document.tourOptions.jb_incomplete) != 'undefined')\n" .
|
||||
"opener.parent.job_options.document.tourOptions.jb_incomplete.checked = false;\n") .
|
||||
// "opener.parent.job_options.document.tourOptions.crSidList.disabled = false;\n" .
|
||||
// "opener.parent.job_options.document.tourOptions.cr_id_order.disabled = false;\n" .
|
||||
// "opener.parent.job_options.document.tourOptions.jb_waitstorno.disabled = false;\n" .
|
||||
//"alert(\"$jb_incomplete\");\n" .
|
||||
//"alert(opener.parent.job_options.document.tourOptions.jb_dispoinfo.value);\n" .
|
||||
"if (opener.parent.job_tour.is_customer) {opener.resetSignificantPriceValues();}\n" .
|
||||
"opener.parent.job_options.document.tourOptions.jb_jam_waittime.value = '" . $jb_jam_waittime . "';\n" .
|
||||
"opener.writeJob();\n" .
|
||||
"var curTourNo = 0;\n" .
|
||||
($job_is_locked ? "opener.parent.job_options.setTimeout('job_is_locked()', 100);\n" : "") .
|
||||
($jb_copy == "true" ? "opener.parent.job_options.setTimeout('duplicateJob()', 100);\n" : "")
|
||||
. javascriptOpenerRefreshAndClose();
|
||||
|
||||
//
|
||||
// checken ob von "check_jb_permanent.php" aufgerufen
|
||||
// wenn ja, dann keine HTML-Ausgabe
|
||||
//
|
||||
if (!(isset($check_jb_permanent_flag) && $check_jb_permanent_flag == true)):
|
||||
// Inhalt des temporären Fensters erzeugen und ausgeben
|
||||
// if ($phpVersion >= "7.0"):
|
||||
// $tpl = new HTML_Template_IT();
|
||||
// else:
|
||||
// $tpl = new IntegratedTemplate();
|
||||
// endif;
|
||||
// $tpl->loadTemplatefile(GETDATAHTMLTPL, true, true);
|
||||
// $tpl->setCurrentBlock("javascript");
|
||||
// $tpl->setVariable("_javascript_", $javascript);
|
||||
////echo $javascript; die();
|
||||
// $tpl->parseCurrentBlock("javascript");
|
||||
// $tpl->show();
|
||||
$output = file_get_contents(GETDATAHTMLTPL);
|
||||
$output = str_replace("{_javascript_}", $javascript, $output);
|
||||
echo $output;
|
||||
endif;
|
||||
|
||||
// Für 'check_jb_permanent.php' muss jb_freetext clean sein!
|
||||
$jb_freetext_1 = my_str_check($jb_freetext_1);
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* getTournames.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
//require_once("HTML/IT.php");
|
||||
include_once("../include/caglobal.inc.php");
|
||||
trace_execution_time_start();
|
||||
include_once("../include/global.inc.php");
|
||||
|
||||
list ($csc_id) = getHttpVars(array("csc_id"));
|
||||
|
||||
// gespeicherte Touren darf nicht mehr disabled sein, da durch die Auswahl der Referesh ausgelöst wird!
|
||||
//$savedTour_disabled = ($savedTour_options == "") ? "disabled" : "";
|
||||
$savedTour_disabled = "";
|
||||
|
||||
// gespeicherte Tournamen der übergebenen Kostenstelle holen
|
||||
// wenn Kostenstelle Barzahler, dann nur Touren, in denen kein Zahler (in csc_id_payer_cash) eingetragen ist!
|
||||
if ($csc_id == CSC_ID_PAYER_CASH):
|
||||
$sqlStmt =
|
||||
"SELECT jb_id, jb_tourname FROM job WHERE (csc_id_payer = '$csc_id' AND csc_id_payer_cash = '0') AND LENGTH(jb_tourname) > 0 ORDER BY jb_tourname";
|
||||
else:
|
||||
$sqlStmt =
|
||||
"SELECT jb_id, jb_tourname FROM job WHERE (csc_id_payer = '$csc_id' OR (csc_id_payer_cash = '$csc_id' AND csc_id_payer_cash != '0')) AND LENGTH(jb_tourname) > 0 ORDER BY jb_tourname";
|
||||
endif;
|
||||
$result = $db->query($sqlStmt);
|
||||
if (DB::isError($result))
|
||||
reportDie ("$PHP_SELF: <br>$sqlStmt<br>" . $result->getMessage());
|
||||
//$javascript = "";
|
||||
$javascript .=
|
||||
"opener.savedTour_options = '';\n";
|
||||
$i = 0;
|
||||
while ($row = $result->fetch_assoc()):
|
||||
// Javascript-Code, der die aktuelle neue Option einträgt
|
||||
// $javascript .=
|
||||
// "var newOption".$row['jb_id']." = new Option('" . htmlentities($row['jb_tourname']) . "', '" . htmlentities($row['jb_id']) . "', false, false);\n";
|
||||
// $javascript .=
|
||||
// "opener.savedTour_options[" . $i++ . "] = newOption".$row['jb_id'].";\n";
|
||||
// wg. einem f***ing Bug im IE funzt der folgende Code net (in Mozillla geht's), deshalb der Umweg oben
|
||||
// "opener.parent.job_options.document.tourOptions.savedTour.options[" .
|
||||
// " opener.parent.job_options.document.tourOptions.savedTour.options.length] = newOption".$row['jb_id'].";\n";
|
||||
$javascript .= "if (opener.savedTour_options != '') opener.savedTour_options = opener.savedTour_options + '³';\n";
|
||||
$javascript .= "opener.savedTour_options = opener.savedTour_options + '" .
|
||||
str_replace('\'', '\\\'', $row['jb_tourname']) . "³" . $row['jb_id'] . "';\n";
|
||||
$i++;
|
||||
endwhile;
|
||||
$result->free();
|
||||
$javascript .=
|
||||
"opener.parent.job_options.document.tourOptions.jb_tourname.value = \"\";\n";
|
||||
$javascript .=
|
||||
"opener.savedTour_options_length = $i;\n";
|
||||
|
||||
//$javascript .=
|
||||
// "alert(".$csc_id.");\n";
|
||||
// Job-Options Frame initialisieren
|
||||
$javascript .=
|
||||
// "opener.setTimeout('checkJb_tourname_workaround()', 1000);\n" .
|
||||
"opener.checkJb_tourname_workaround();\n" .
|
||||
"opener.parent.job_options.isCurrentlySubmitting = false;\n" .
|
||||
"self.close();\n";
|
||||
//echo $javascript;
|
||||
// Inhalt des temporären Fensters erzeugen und ausgeben
|
||||
//$tpl = new IntegratedTemplate();
|
||||
//$tpl->loadTemplatefile(GETDATAHTMLTPL, true, true);
|
||||
//$tpl->setCurrentBlock("javascript");
|
||||
//$tpl->setVariable("_javascript_", $javascript);
|
||||
//$tpl->parseCurrentBlock("javascript");
|
||||
//$tpl->show();
|
||||
$output = file_get_contents(GETDATAHTMLTPL);
|
||||
$output = str_replace("{_javascript_}", $javascript, $output);
|
||||
writeLog_("../log/job_options_", trace_execution_time_stop() . " '../jobs/get_tournames.php' executed: \$csc_id=$csc_id , \$i=$i");
|
||||
echo $output;
|
||||
?>
|
||||
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>votian</title>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta name="description" content="votian"> <meta name="keywords" content="votian">
|
||||
<meta http-equiv="refresh" content="0; URL=../index.php">
|
||||
<link rel="stylesheet" type="text/css" href="css/phoenix.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body bgcolor="#FFFFFA" leftmargin="1" topmargin="1" marginwidth="0" marginheight="0" link="#990000" vlink="#990000" alink="#990000">
|
||||
<a href="../index.php">Bitte hier klicken, wenn Sie nicht automatisch weitergeleitet werden...</a>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,636 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* jb_edit_batch.php
|
||||
*
|
||||
* Autor: Marc Vollmann
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
|
||||
include_once ("../include/mcglobal.inc.php");
|
||||
include_once ("../include/auth.inc.php");
|
||||
include_once ("../geo/geocode.inc.php");
|
||||
include_once ("../include/caglobal.inc.php");
|
||||
|
||||
|
||||
// Check HTTP-Parameters
|
||||
getSecHttpVars("1",array("f_act", "customerId", "cscIdRoot", "cscIdActual",
|
||||
"f_srvpaa_mode", "f_del_assoc", "f_jbb_sort",
|
||||
"g_cs_id", "g_csc_id", "g_csc_name", "initCsSearch", "f_filter", "statusMessage"));
|
||||
|
||||
$numOfEditRows = 20;
|
||||
$numOfInputFieldsPerRows = 10;
|
||||
$numOfRows = 0;
|
||||
// Init input fields
|
||||
$timeToEditHourDefault = "10";
|
||||
$timeToEditMinuteDefault = "00";
|
||||
|
||||
for ($i = 1; $i <= $numOfEditRows; $i++) :
|
||||
for ($j = 1; $j <= $numOfInputFieldsPerRows; $j++) :
|
||||
getSecHttpVars("1",array("f_field_" . $i . "_" . $j));
|
||||
endfor;
|
||||
endfor;
|
||||
|
||||
// Select user-type for mode of security check
|
||||
$userType = getFieldValueFromId("user","usr_id",$usr_id,"usr_type");
|
||||
|
||||
// Check authentication verifying emmployee an his/her costcenter- and customer-association
|
||||
if ( !( ($userType == "1") || authCheck($hq_id,$usr_id,$emp_id,$cscIdRoot,$customerId,$cscIdActual) ) ) : die ("$PHP_SELF: Access denied!"); endif;
|
||||
|
||||
// Get the rights of the employee logged in and check the accessibility
|
||||
if (!authCheckEmployeeRights($emp_id, "7")) : die ("$PHP_SELF: Access denied!"); endif;
|
||||
|
||||
// Get company data
|
||||
$g_cmp_id = getFieldValueFromId("customer", "cs_id", $g_cs_id, "cmp_id");
|
||||
$g_cs_eid = getFieldValueFromId("customer", "cs_id", $g_cs_id, "cs_eid");
|
||||
$g_cmp_comp = getFieldValueFromId("company", "cmp_id", $g_cmp_id, "cmp_comp");
|
||||
$g_cmp_comp2 = getFieldValueFromId("company", "cmp_id", $g_cmp_id, "cmp_comp2");
|
||||
|
||||
// Filter
|
||||
$currentYear = getDateTime("year");
|
||||
$lfdToEditShow = "checked";
|
||||
$yearToEditShow = "";
|
||||
$timeToEditShow = "";
|
||||
if ($f_filter != "") :
|
||||
if (!(array_search("lfdToEditShow",$f_filter) === FALSE)) : $lfdToEditShow = "checked"; endif;
|
||||
if (!(array_search("yearToEditShow",$f_filter) === FALSE)) : $yearToEditShow = "checked"; endif;
|
||||
if (!(array_search("timeToEditShow",$f_filter) === FALSE)) : $timeToEditShow = "checked"; endif;
|
||||
endif;
|
||||
|
||||
|
||||
// Get $f_jbb_id from $f_jbb_sort and $g_cs_id
|
||||
function getJbbData($sqlField = "jbb_id") {
|
||||
global $db, $PHP_SELF, $f_jbb_sort, $g_cs_id;
|
||||
$retVal = "";
|
||||
if ($f_jbb_sort != "" && $g_cs_id != "") :
|
||||
$retVal = $db->getOne("SELECT " . $sqlField . " FROM jobbatch WHERE cs_id = '" . $g_cs_id . "' AND jbb_sort = '" . $f_jbb_sort . "'");
|
||||
endif;
|
||||
return $retVal;
|
||||
}
|
||||
$f_jbb_id = getJbbData("jbb_id");
|
||||
|
||||
// echo "g_cs_id: " . $g_cs_id . "<br>g_cs_eid: " . $g_cs_eid . "<br>f_jbb_id: " . $f_jbb_id . "<br>f_jbb_sort: " . $f_jbb_sort . "<br>";
|
||||
|
||||
|
||||
// Store new jobs
|
||||
if ($f_act == "storeJobs") :
|
||||
if ($g_cs_id != "") :
|
||||
|
||||
// Get data for storing the job
|
||||
$currentTime = getDateTime("0");
|
||||
$usrId = getFieldValueFromId("employee", "emp_id", $emp_id, "usr_id");
|
||||
|
||||
// Check for absolute customer discount
|
||||
$csDiscountAbsolute = getFieldValueFromId("customer", "cs_id", $g_cs_id, "cs_discount");
|
||||
|
||||
$rowComplete = array();
|
||||
$vhtId = array(); $crId = array(); $crSid = array(); $cscIdPayer = array(); $jbFinishtime = array(); $price = array();
|
||||
$cmpId = array(); $cmpPostage = array(); $csInvmode = array(); $jbFreetext1 = array(); $txId = array(); $txValue = array();
|
||||
$txSign = array(); $cmpAdId = array(); $cmpHsno = array(); $cmpComp = array(); $cmpComp2 = array();
|
||||
|
||||
// [1.] Iterate all fields and check the row to be complete
|
||||
for ($i = 1; $i <= $numOfEditRows; $i++) :
|
||||
$rowComplete[$i] = FALSE;
|
||||
|
||||
$vhtId[$i] = getFieldValueFromId("couriervehicle", "crvh_sid", ${("f_field_" . $i . "_10")}, "vht_id");
|
||||
$crId[$i] = getFieldValueFromId("couriervehicle", "crvh_sid", ${("f_field_" . $i . "_10")}, "cr_id");
|
||||
$crSid[$i] = ${("f_field_" . $i . "_10")};
|
||||
|
||||
// If paying costcenter does not exist then get the root costcenter
|
||||
if ($g_csc_id == "") :
|
||||
$cscIdPayer[$i] = getFieldValueFromId("customer", "cs_id", $g_cs_id, "csc_id");
|
||||
else :
|
||||
$cscIdPayer[$i] = $g_csc_id;
|
||||
endif;
|
||||
|
||||
if (${("f_field_" . $i . "_4")} == "") : ${("f_field_" . $i . "_4")} = $currentYear; endif;
|
||||
if (${("f_field_" . $i . "_5")} == "") : ${("f_field_" . $i . "_5")} = $timeToEditHourDefault; endif;
|
||||
if (${("f_field_" . $i . "_6")} == "") : ${("f_field_" . $i . "_6")} = $timeToEditMinuteDefault; endif;
|
||||
$jbFinishtime[$i] = ${("f_field_" . $i . "_4")} . "-" . pad(${("f_field_" . $i . "_3")},2) . "-" . pad(${("f_field_" . $i . "_2")},2) . " " .
|
||||
pad(${("f_field_" . $i . "_5")},2) . ":" . pad(${("f_field_" . $i . "_6")},2) . ":00";
|
||||
|
||||
$lfd[$i] = ${("f_field_" . $i . "_1")};
|
||||
if (!is_numeric($lfd[$i])) : $lfd[$i] = ""; endif;
|
||||
|
||||
$price[$i] = str_replace (",", ".", ${("f_field_" . $i . "_9")});
|
||||
$cmpId[$i] = getFieldValueFromId("customer", "cs_id", $g_cs_id, "cmp_id");
|
||||
$cmpPostage[$i] = getFieldValueFromId("company", "cmp_id", $cmpId[$i], "cmp_postage");
|
||||
$csInvmode[$i] = getFieldValueFromId("customer", "cs_id", $g_cs_id, "cs_invmode");
|
||||
$trCommissionNo[$i] = my_str_check_js(${("f_field_" . $i . "_8")});
|
||||
$jbInvoiceText[$i] = my_str_check_js(${("f_field_" . $i . "_7")});
|
||||
$jbFreetext1[$i] = $jbInvoiceText[$i]; // . " " . $trCommissionNo[$i];
|
||||
$txId[$i] = getFieldValueFromId("company", "cmp_id", $cmpId[$i], "tx_id");
|
||||
$txValue[$i] = getFieldValueFromId("tax", "tx_id", $txId[$i], "tx_value");
|
||||
$txSign[$i] = getFieldValueFromId("tax", "tx_id", $txId[$i], "tx_sign");
|
||||
$cmpAdId[$i] = getFieldValueFromId("company", "cmp_id", $cmpId[$i], "ad_id");
|
||||
$cmpHsno[$i] = getFieldValueFromId("company", "cmp_id", $cmpId[$i], "cmp_hsno");
|
||||
$cmpComp[$i] = getFieldValueFromId("company", "cmp_id", $cmpId[$i], "cmp_comp");
|
||||
$cmpComp2[$i] = getFieldValueFromId("company", "cmp_id", $cmpId[$i], "cmp_comp2");
|
||||
|
||||
if ($vhtId[$i] != "" && $crId[$i] != "" && $crSid[$i] != "" && $cscIdPayer[$i] != "" && $jbFinishtime[$i] != "" &&
|
||||
$price[$i] != "" && is_numeric($price[$i]) && $cmpId[$i] != "" && $jbFreetext1[$i] != "" && $cmpAdId[$i] != "" &&
|
||||
$cmpComp[$i] != "") :
|
||||
|
||||
$rowComplete[$i] = TRUE;
|
||||
endif;
|
||||
endfor;
|
||||
|
||||
// Transaction control starts here
|
||||
TA("B");
|
||||
|
||||
// [2.] Generate a new list ($f_jbb_id == "") with current timestamp or use an old one
|
||||
// and check if at least one job has to be stored
|
||||
if ($f_jbb_sort == "") :
|
||||
$atLeastOneJobOk = FALSE;
|
||||
$atLeastOneJobNotOk = FALSE;
|
||||
for ($i = 1; $i <= $numOfEditRows; $i++) :
|
||||
if ($rowComplete[$i]) :
|
||||
$atLeastOneJobOk = TRUE;
|
||||
else :
|
||||
$atLeastOneJobNotOk = TRUE;
|
||||
endif;
|
||||
endfor;
|
||||
if ($atLeastOneJobOk) :
|
||||
|
||||
// Get maximum list number of the special customer from jbb_sort
|
||||
$f_jbb_sort = getMaxOfField("jobbatch", "jbb_sort", "cs_id = '" . $g_cs_id . "'");
|
||||
if (is_numeric($f_jbb_sort)) :
|
||||
++$f_jbb_sort; // Increment because of the next free number
|
||||
else :
|
||||
$f_jbb_sort = "1";
|
||||
endif;
|
||||
|
||||
insertStmt("jobbatch", array("cs_id", $g_cs_id, "jbb_sort", $f_jbb_sort, "jbb_createtime", $currentTime));
|
||||
$f_jbb_id = getLastInsertId(); // IMPORTANT to use parameter $f_jbb_id because of loop and following search below... !!!
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// [3.] Iterate all jobs and insert
|
||||
for ($i = 1; $i <= $numOfEditRows; $i++) :
|
||||
|
||||
if ($rowComplete[$i]) :
|
||||
|
||||
// Check for absolute customer discount
|
||||
/*
|
||||
if ($csDiscountAbsolute > 0.00) :
|
||||
$price[$i] = ($price[$i] * ((100 - $csDiscountAbsolute) / 100));
|
||||
endif;
|
||||
*/
|
||||
|
||||
insertStmt("job", array("hq_id", $hq_id, "vht_id", $vhtId[$i], "csc_id_payer", $cscIdPayer[$i], "jb_payment", "0",
|
||||
"jb_ordertime", $jbFinishtime[$i], "cr_id", $crId[$i], "cr_sid", $crSid[$i], "cr_id_order", $crId[$i],
|
||||
"jb_taketime", $jbFinishtime[$i], "jb_status", "2", "jb_autoranking", "0",
|
||||
"jb_finishtime", $jbFinishtime[$i], "emp_id", $usrId, "jb_fixprice", $price[$i], "jb_totalprice", $price[$i],
|
||||
"jb_postage", $cmpPostage[$i], "jb_invmode", $csInvmode[$i], "jb_freetext_1", $jbFreetext1[$i],
|
||||
"jb_sales_tax_rate", $txValue[$i], "jb_sales_tax_rate_sign", $txSign[$i],
|
||||
"jb_booktime", $currentTime));
|
||||
$jbIdNew = getLastInsertId();
|
||||
|
||||
insertStmt("tour", array("jb_id", $jbIdNew, "ad_id", $cmpAdId[$i], "tr_sort", "1", "tr_comp", $cmpComp[$i], "tr_comp2", $cmpComp2[$i],
|
||||
"tr_hsno", $cmpHsno[$i], "csc_id", $cscIdPayer[$i], "tr_status", "1", "tr_signname", "Listenbuchung",
|
||||
"tr_finishtime", $jbFinishtime[$i], "tr_commission_no", $trCommissionNo[$i]));
|
||||
|
||||
insertStmt("tourservice", array("jb_id", $jbIdNew, "csc_id", $cscIdPayer[$i], "tr_sort", "0",
|
||||
"srv_id", "0", "trs_srv_name", "Fixpreis", "srvt_id", "0", "trs_srvt_name", "",
|
||||
"trs_price", $price[$i], "trs_discount", $csDiscountAbsolute));
|
||||
|
||||
// Write logdata into log database
|
||||
writeToLogDB("1",$hq_id,$jbIdNew,$usrId,$crId[$i],$crSid[$i],"","");
|
||||
|
||||
|
||||
|
||||
// Take lfd of the input field and get maximum of the lfd of the special list if nessassary
|
||||
$jbblLfdMaxval = $lfd[$i];
|
||||
if ($jbblLfdMaxval == "") :
|
||||
$jbblLfdMaxval = getMaxOfField("jobbatchlist", "jbbl_lfd", "jbb_id = '" . $f_jbb_id . "'");
|
||||
if (is_numeric($jbblLfdMaxval)) :
|
||||
++$jbblLfdMaxval; // Increment because of the next free number
|
||||
else :
|
||||
$jbblLfdMaxval = "1";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
insertStmt("jobbatchlist", array("jbb_id", $f_jbb_id, "jbbl_lfd", $jbblLfdMaxval, "jb_id", $jbIdNew));
|
||||
|
||||
// Generate invoice text
|
||||
mk_jb_invtext($jbIdNew, false);
|
||||
|
||||
// Reset input fields of the row stored correctly
|
||||
for ($j = 1; $j <= $numOfInputFieldsPerRows; $j++) :
|
||||
${("f_field_" . $i . "_" . $j)} = '';
|
||||
endfor;
|
||||
endif;
|
||||
endfor;
|
||||
|
||||
TA("C");
|
||||
TA("E");
|
||||
|
||||
$f_act = "loadSpecialListOfCustomer";
|
||||
else :
|
||||
$statusMessage = "Sie haben noch keinen Kunden ausgewählt!";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
|
||||
// Show all lists of the customer
|
||||
$outStoredBatchListsOfCustomer = "";
|
||||
if ($f_act == "getListsOfCustomer") :
|
||||
if ($g_cs_id != "") :
|
||||
|
||||
// Only for output get length of the max jbb_sort value for pad()
|
||||
$jbbSortPadlLength = strlen(getMaxOfField("jobbatch", "jbb_sort", "cs_id = '" . $g_cs_id . "'"));
|
||||
if ($jbbSortPadlLength == "0") : $jbbSortPadlLength = "1"; endif;
|
||||
|
||||
// Get lists of the customer
|
||||
$sqlquery = "SELECT jbb.jbb_id, jbb.cs_id, jbb.jbb_sort, jbb.jbb_createtime " .
|
||||
" FROM jobbatch AS jbb" .
|
||||
" WHERE jbb.cs_id = '" . $g_cs_id . "' " .
|
||||
" ORDER BY jbb.jbb_createtime DESC";
|
||||
|
||||
$result = $db->query($sqlquery);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$outStoredBatchListsOfCustomer .= "<a href=\"javascript:finishPage('loadSpecialListOfCustomer','" . $row["jbb_sort"] . "');\">" .
|
||||
pad($row["jbb_sort"],$jbbSortPadlLength) . " - " . formatOutput($row["jbb_createtime"],"datetime","3") . "</a><br>";
|
||||
endwhile;
|
||||
$result->free();
|
||||
|
||||
if ($outStoredBatchListsOfCustomer != "") :
|
||||
$outStoredBatchListsOfCustomer = "<br><br>Listenbestand: <br><br>" . $outStoredBatchListsOfCustomer . "<br><br>";
|
||||
|
||||
if ($f_jbb_id != "") :
|
||||
$f_act = "loadSpecialListOfCustomer";
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = "Für den Kunden existiert noch keine Liste!";
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = "Sie haben noch keinen Kunden ausgewählt!";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
|
||||
// Show all jobs of a selected list of the customer
|
||||
$outCurrentListOfCustomer = "";
|
||||
if ($f_act == "loadSpecialListOfCustomer") :
|
||||
if ($g_cs_id != "") :
|
||||
if ($f_jbb_id != "") :
|
||||
|
||||
$sqlquery = "SELECT jbbl.jbbl_lfd, jb.jb_id, jb.jb_export_time, jb.jb_finishtime, jb.jb_freetext_1, jb.cr_sid, tr.tr_commission_no, csc.csc_name,"
|
||||
. " " . $priceFormular . " AS price"
|
||||
. " FROM jobbatch AS jbb, jobbatchlist AS jbbl, tour AS tr, job AS jb LEFT JOIN tourservice AS trs ON trs.jb_id = jb.jb_id, costcenter AS csc"
|
||||
. " WHERE jbb.jbb_id = '" . $f_jbb_id . "' AND"
|
||||
. " jbb.jbb_id = jbbl.jbb_id AND"
|
||||
. " jbbl.jb_id = jb.jb_id AND"
|
||||
. " jb.jb_id = tr.jb_id AND"
|
||||
. " tr.tr_sort = '1' AND"
|
||||
. " jb.csc_id_payer = csc.csc_id "
|
||||
. " GROUP BY trs.jb_id"
|
||||
. " ORDER BY jbbl.jbbl_lfd";
|
||||
|
||||
$result = $db->query($sqlquery);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
|
||||
$out = "";
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$numOfRows++;
|
||||
|
||||
$out .= "<tr class=\"f10np1\">";
|
||||
$out .= "<td align=\"center\"> ". $row["jbbl_lfd"] . "</td> ";
|
||||
|
||||
$tmpDateTime = formatOutput($row["jb_finishtime"],"datetime","3");
|
||||
$out .= "<td align=\"center\"> ". substr($tmpDateTime,0,8) . "</td>";
|
||||
$out .= "<td align=\"center\"> ". substr($tmpDateTime,11,5) . "</td>";
|
||||
$out .= "<td> ". $row["jb_freetext_1"] . "<br>[Kst.: " . $row["csc_name"] . "]</td> ";
|
||||
$out .= "<td> ". $row["tr_commission_no"] . "</td> ";
|
||||
$out .= "<td align=\"right\"> ". formatOutput($row["price"],"float_rounded_2") . " </td> ";
|
||||
$out .= "<td align=\"center\"> ". $row["cr_sid"] . "</td> ";
|
||||
$out .= "<td align=\"center\">";
|
||||
if ($row["jb_export_time"] == "" || $row["jb_export_time"] == "0000-00-00 00:00:00") :
|
||||
$out .= "<a href=\"../jobs/job_edit.php?jb_id=" . ec($row[jb_id]) . "\" target=\"_blank\">" . $row[jb_id] . "</a>";
|
||||
else :
|
||||
$out .= "Exportiert";
|
||||
endif;
|
||||
$out .= "</td>";
|
||||
$out .= "</tr>\n";
|
||||
endwhile;
|
||||
$result->free();
|
||||
|
||||
$outCurrentListOfCustomer = $f_jbb_sort . " - " . formatOutput(getJbbData("jbb_createtime"),3);
|
||||
else :
|
||||
$statusMessage = "Es wurde entweder keine Liste gewählt ODER Eingaben sind für die Anlage eine neue Liste nicht korrekt!";
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = "Sie haben noch keinen Kunden ausgewählt!";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
|
||||
// **********************
|
||||
// * Define edit fields *
|
||||
// **********************
|
||||
|
||||
// Get maximum of the lfd of the special list
|
||||
$jbblLfdMaxval = 0;
|
||||
if ($g_cs_id != "" && $f_jbb_id != "") :
|
||||
$jbblLfdMaxval = getMaxOfField("jobbatchlist", "jbbl_lfd", "jbb_id = '" . $f_jbb_id . "'");
|
||||
endif;
|
||||
|
||||
$outEditFields = "";
|
||||
for ($i = 1; $i <= $numOfEditRows; $i++) :
|
||||
|
||||
$outEditFields .= "<tr>";
|
||||
|
||||
${("f_field_" . $i . "_1")} = $jbblLfdMaxval + $i;
|
||||
$outEditFields .= "<td valign=\"top\"><input type=\"text\" name=\"f_field_" . $i . "_1\" value=\"" . ${("f_field_" . $i . "_1")} . "\" size=\"3\" onBlur=\"checkDate(this,'lfd','" . $i . "','1')\" " . ($lfdToEditShow == "" ? "disabled" : "") . "></td>";
|
||||
|
||||
$outEditFields .= "<td valign=\"top\">";
|
||||
$outEditFields .= "<input type=\"text\" name=\"f_field_" . $i . "_2\" value=\"" . ${("f_field_" . $i . "_2")} . "\" size=\"2\" maxlength=\"2\" onBlur=\"checkDate(this,'day','" . $i . "','2')\">";
|
||||
$outEditFields .= "<input type=\"text\" name=\"f_field_" . $i . "_3\" value=\"" . ${("f_field_" . $i . "_3")} . "\" size=\"2\" maxlength=\"2\" onBlur=\"checkDate(this,'month','" . $i . "','3')\">";
|
||||
|
||||
// Preset of the year
|
||||
if (${("f_field_" . $i . "_4")} == "") : ${("f_field_" . $i . "_4")} = $currentYear; endif;
|
||||
$outEditFields .= "<input type=\"text\" name=\"f_field_" . $i . "_4\" value=\"" . ${("f_field_" . $i . "_4")} . "\" size=\"4\" maxlength=\"4\" onBlur=\"checkDate(this,'year','" . $i . "','4')\" " . ($yearToEditShow == "" ? "disabled" : "") . ">";
|
||||
|
||||
$outEditFields .= "</td>";
|
||||
$outEditFields .= "<td valign=\"top\">";
|
||||
|
||||
// Preset of the hour
|
||||
if (${("f_field_" . $i . "_5")} == "") : ${("f_field_" . $i . "_5")} = $timeToEditHourDefault; endif;
|
||||
$outEditFields .= "<input type=\"text\" name=\"f_field_" . $i . "_5\" value=\"" . ${("f_field_" . $i . "_5")} . "\" size=\"2\" maxlength=\"2\" onBlur=\"checkDate(this,'hour','" . $i . "','5')\" " . ($timeToEditShow == "" ? "disabled" : "") . ">";
|
||||
|
||||
// Preset of the hour
|
||||
if (${("f_field_" . $i . "_6")} == "") : ${("f_field_" . $i . "_6")} = $timeToEditMinuteDefault; endif;
|
||||
$outEditFields .= "<input type=\"text\" name=\"f_field_" . $i . "_6\" value=\"" . ${("f_field_" . $i . "_6")} . "\" size=\"2\" maxlength=\"2\" onBlur=\"checkDate(this,'minute','" . $i . "','6')\" " . ($timeToEditShow == "" ? "disabled" : "") . ">";
|
||||
|
||||
$outEditFields .= "</td>";
|
||||
$outEditFields .= "<td valign=\"top\"><textarea name=\"f_field_" . $i . "_7\" cols=\"45\" rows=\"2\">" . ${("f_field_" . $i . "_7")} . "</textarea><br><br></td>";
|
||||
$outEditFields .= "<td valign=\"top\"><input type=\"text\" name=\"f_field_" . $i . "_8\" value=\"" . ${("f_field_" . $i . "_8")} . "\" size=\"10\"></td>";
|
||||
$outEditFields .= "<td valign=\"top\"><input type=\"text\" name=\"f_field_" . $i . "_9\" value=\"" . ${("f_field_" . $i . "_9")} . "\" size=\"7\"></td>";
|
||||
$outEditFields .= "<td valign=\"top\"><input type=\"text\" name=\"f_field_" . $i . "_10\" value=\"" . ${("f_field_" . $i . "_10")} . "\" size=\"10\"></td>";
|
||||
$outEditFields .= "<td valign=\"top\"><a href=\"javascript:clearJobFields('" . $i . "');\">Zurücksetzen</a></td>";
|
||||
$outEditFields .= "</tr>";
|
||||
endfor;
|
||||
?>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>votian: Auftragsstapelverarbeitung</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/phoenix.css">
|
||||
|
||||
<script src="../include/searchLists.js" type="text/javascript"></script>
|
||||
<script src="../include/checkFormTags.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var statusMessage = "<?php echo $statusMessage ?>";
|
||||
|
||||
function displayStatusMessage() {
|
||||
if (statusMessage != "") {
|
||||
alert(statusMessage);
|
||||
}
|
||||
};
|
||||
|
||||
function clearJobFields(line) {
|
||||
for (var i = 1; i <= <?php echo $numOfInputFieldsPerRows ?>; i++) {
|
||||
eval('document.forms[0].f_field_' + line + '_' + i).value = '';
|
||||
};
|
||||
};
|
||||
|
||||
function clearFields() {
|
||||
for (var j = 1; j <= <?php echo $numOfEditRows ?>; j++) {
|
||||
clearJobFields(j);
|
||||
eval('document.forms[0].f_field_' + j + '_1').value = j;
|
||||
eval('document.forms[0].f_field_' + j + '_4').value = <?php echo $currentYear ?>;
|
||||
eval('document.forms[0].f_field_' + j + '_5').value = <?php echo $timeToEditHourDefault ?>;
|
||||
eval('document.forms[0].f_field_' + j + '_6').value = <?php echo $timeToEditMinuteDefault ?>;
|
||||
}
|
||||
document.forms[0].f_act.value = '';
|
||||
document.forms[0].f_jbb_sort.value = '';
|
||||
}
|
||||
|
||||
function searchCs() {
|
||||
searchCsCscGeneric('111000000000111');
|
||||
}
|
||||
|
||||
function finishPage(mode,jbb_sort) {
|
||||
if (mode == 'storeJobs') {
|
||||
if (document.forms[0].g_cs_id.value != '') {
|
||||
if (confirm('Möchten Sie die eingetragenen Neuaufträge speichern?')) {
|
||||
document.forms[0].f_act.value = mode;
|
||||
document.forms[0].submit();
|
||||
}
|
||||
} else {
|
||||
alert('Sie müssen zuvor bitte einen Kunden wählen!');
|
||||
}
|
||||
}
|
||||
if (mode == 'getListsOfCustomer') {
|
||||
// if (confirm('Möchten Sie die Listen einsehen?')) {
|
||||
document.forms[0].f_act.value = mode;
|
||||
document.forms[0].submit();
|
||||
// }
|
||||
}
|
||||
if (mode == 'loadSpecialListOfCustomer') {
|
||||
if (document.forms[0].g_cs_id.value != '') {
|
||||
if (confirm('Möchten Sie die Liste laden?')) {
|
||||
document.forms[0].f_act.value = mode;
|
||||
document.forms[0].f_jbb_sort.value = jbb_sort;
|
||||
document.forms[0].submit();
|
||||
}
|
||||
} else {
|
||||
alert('Sie müssen zuvor bitte einen Kunden wählen!');
|
||||
}
|
||||
}
|
||||
if (mode == 'clearPage') {
|
||||
if (confirm('Möchten Sie die komplette Seite zurücksetzen?')) {
|
||||
document.location.href = "jb_edit_batch.php";
|
||||
}
|
||||
}
|
||||
if (mode == 'clearPageAndCustomerSearch') {
|
||||
if (document.forms[0].g_cs_id.value != '' && document.forms[0].f_jbb_sort.value != '') {
|
||||
if (confirm('Möchten Sie einen neuen Kunden wählen? Die Seiteninformationen gehen verloren!')) {
|
||||
document.location.href = "jb_edit_batch.php?initCsSearch=1";
|
||||
}
|
||||
} else {
|
||||
clearFields();
|
||||
searchCs();
|
||||
};
|
||||
}
|
||||
if (mode == 'newCustomerList') {
|
||||
if (document.forms[0].g_cs_id.value != '' && document.forms[0].f_jbb_sort.value != '') {
|
||||
if (confirm('Möchten Sie eine neue Liste beginnen?')) {
|
||||
clearFields();
|
||||
document.forms[0].submit();
|
||||
}
|
||||
} else {
|
||||
if (document.forms[0].g_cs_id.value == '') {
|
||||
alert('Es ist kein Kunde ausgewählt!');
|
||||
} else {
|
||||
clearFields();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function checkDate(checkObj,mode,i,j) {
|
||||
var resetValue = checkDateFields(checkObj,mode);
|
||||
if (resetValue) {
|
||||
eval('document.forms[0].f_field_' + i + '_' + j).value = '';
|
||||
eval('document.forms[0].f_field_' + i + '_' + j).focus();
|
||||
}
|
||||
}
|
||||
|
||||
function setFieldEditStatus(checkObj,mode) {
|
||||
|
||||
var doContinue = true;
|
||||
if (checkObj.checked == false) {
|
||||
doContinue = false;
|
||||
if (confirm('Achtung: Beim Deaktivieren werden alle Einträge der Spalte zurückgesetzt! Fortfahren?')) {
|
||||
doContinue = true;
|
||||
} else {
|
||||
checkObj.checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (doContinue) {
|
||||
for (var i = 1; i <= <?php echo $numOfEditRows ?>; i++) {
|
||||
if (mode == 'lfd') {
|
||||
if (checkObj.checked == true) {
|
||||
eval('document.forms[0].f_field_' + i + '_1').disabled = false;
|
||||
} else {
|
||||
eval('document.forms[0].f_field_' + i + '_1').disabled = true;
|
||||
}
|
||||
}
|
||||
if (mode == 'year') {
|
||||
if (checkObj.checked == true) {
|
||||
eval('document.forms[0].f_field_' + i + '_4').disabled = false;
|
||||
} else {
|
||||
eval('document.forms[0].f_field_' + i + '_4').disabled = true;
|
||||
eval('document.forms[0].f_field_' + i + '_4').value = <?php echo $currentYear ?>;
|
||||
}
|
||||
}
|
||||
if (mode == 'time') {
|
||||
if (checkObj.checked == true) {
|
||||
eval('document.forms[0].f_field_' + i + '_5').disabled = false;
|
||||
eval('document.forms[0].f_field_' + i + '_6').disabled = false;
|
||||
} else {
|
||||
eval('document.forms[0].f_field_' + i + '_5').disabled = true;
|
||||
eval('document.forms[0].f_field_' + i + '_6').disabled = true;
|
||||
eval('document.forms[0].f_field_' + i + '_5').value = <?php echo $timeToEditHourDefault ?>;
|
||||
eval('document.forms[0].f_field_' + i + '_6').value = <?php echo $timeToEditMinuteDefault ?>;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function showPageStatus() {
|
||||
alert('g_cs_id: ' + document.forms[0].g_cs_id.value);
|
||||
alert('g_csc_id: ' + document.forms[0].g_csc_id.value);
|
||||
alert('g_csc_name: ' + document.forms[0].g_csc_name.value);
|
||||
alert('f_jbb_sort: ' + document.forms[0].f_jbb_sort.value);
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onLoad="displayStatusMessage(); <?php if ($initCsSearch == "1") : echo "searchCs();" ; endif; ?>">
|
||||
<form action="jb_edit_batch.php" method="post">
|
||||
<input type="hidden" name="f_act" value="">
|
||||
<input type="hidden" name="customerId" value="<?php echo $customerId ?>">
|
||||
<input type="hidden" name="cscIdRoot" value="<?php echo $cscIdRoot ?>">
|
||||
<input type="hidden" name="cscIdActual" value="<?php echo $cscIdActual ?>">
|
||||
<input type="hidden" name="g_cs_id" value="<?php echo $g_cs_id ?>">
|
||||
<input type="hidden" name="f_jbb_sort" value="<?php echo $f_jbb_sort ?>">
|
||||
<input type="hidden" name="g_csc_id" value="<?php echo $g_csc_id ?>">
|
||||
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td class="f12bp1_red">
|
||||
Liste der Firma:
|
||||
<input type="text" name="g_cmp_comp" value="<?php echo $g_cmp_comp ?>" size="30" readonly >
|
||||
<input type="text" name="g_cmp_comp2" value="<?php echo $g_cmp_comp2 ?>" size="30" readonly >
|
||||
<input type="text" name="g_cs_eid" value="<?php echo $g_cs_eid ?>" size="10" readonly >
|
||||
<input type="text" name="g_csc_name" value="<?php echo $g_csc_name ?>" size="25" readonly >
|
||||
|
||||
<input type="button" <?php echo $htmlClass01 ?> value="Kunde suchen" onClick="finishPage('clearPageAndCustomerSearch');">
|
||||
<!-- <input type="button" value="!!!" onClick="showPageStatus();"> -->
|
||||
<br><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<!-- Search, reset and store -->
|
||||
<br><br>
|
||||
<a href="javascript:finishPage('clearPage');">Seite komplett zurücksetzen</a>
|
||||
|
||||
<a href="javascript:finishPage('getListsOfCustomer');">Listen des Kunden</a>
|
||||
|
||||
<a href="javascript:finishPage('newCustomerList');">Neue Liste des Kunden beginnen</a>
|
||||
|
||||
|
||||
<input type="button" name="action" value="Neuaufträge speichern" onClick="javascript:finishPage('storeJobs');">
|
||||
|
||||
<!--
|
||||
<a href="javascript:document.forms[0].f_act.value='search';document.forms[0].submit();">Suchen</a>
|
||||
|
||||
<a href="javascript:clearJobFields('0');">Suchfelder zurücksetzen</a>
|
||||
|
||||
-->
|
||||
|
||||
<br><br>
|
||||
|
||||
<?php echo $outStoredBatchListsOfCustomer ?>
|
||||
|
||||
<br><br>
|
||||
|
||||
<span class="f10bp1_red">
|
||||
Aktuelle Liste: <?php echo $outCurrentListOfCustomer ?>
|
||||
</span>
|
||||
|
||||
|
||||
<!--
|
||||
<input type="checkbox" name="f_filter[]" value="lfdToEditShow" onClick="javascript:setFieldEditStatus(this,'lfd');" <?php echo $lfdToEditShow ?>> Spalte Lfd aktiviert
|
||||
|
||||
-->
|
||||
<input type="checkbox" name="f_filter[]" value="yearToEditShow" onClick="javascript:setFieldEditStatus(this,'year');" <?php echo $yearToEditShow ?>> Spalte Jahreszahl aktiviert
|
||||
|
||||
<input type="checkbox" name="f_filter[]" value="timeToEditShow" onClick="javascript:setFieldEditStatus(this,'time');" <?php echo $timeToEditShow ?>> Spalten Uhrzeit aktiviert
|
||||
<br><br>
|
||||
|
||||
|
||||
<!-- Input fields for new jobs-->
|
||||
<table class="f8np1" border="1" cellpadding="0">
|
||||
<tr>
|
||||
<td>Lfd</td> <td>Datum</td> <td>Uhrzeit</td> <td>Auftrag / Tourenverlauf</td> <td>Kst./Referenz</td> <td>Betrag</td> <td>Fahrzeug</td>
|
||||
<!--
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='ad_street, srvpaa.srvpaa_hsno_from';document.forms[0].f_act.value='search';document.forms[0].submit();">Straße</a></td>
|
||||
<td> </td>
|
||||
-->
|
||||
</tr>
|
||||
|
||||
<?php echo $outEditFields ?>
|
||||
|
||||
<!-- Stored jobs -->
|
||||
<?php echo $out ?>
|
||||
</table>
|
||||
|
||||
<!--
|
||||
<br><br>
|
||||
Anzahl Einträge: <?php echo $numOfRows ?><?php if ($numOfRows == "0" && $f_act == "search" && $statusMessage == "") : echo " (Keine Einträge gefunden.)"; endif; ?>
|
||||
-->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,330 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* jb_search_list.php
|
||||
*
|
||||
* Autor: Marc Vollmann
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
include_once ("../include/mcglobal.inc.php");
|
||||
include_once ("../include/auth.inc.php");
|
||||
|
||||
// Get the rights of the employee logged in and check the accessibility
|
||||
if (!(authCheckEmployeeRights($emp_id, "0") || authCheckEmployeeRights($emp_id, "7"))) : die ("$PHP_SELF: Access denied!"); endif;
|
||||
|
||||
// Select user-type for mode of security check
|
||||
$userType = getFieldValueFromId("user","usr_id",$usr_id,"usr_type");
|
||||
|
||||
// Check authentication verifying emmployee an his/her costcenter- and customer-association
|
||||
if ( !( ($userType == "1") || authCheck($hq_id,$usr_id,$emp_id,$cscIdRoot,$customerId,$cscIdActual) ) ) :
|
||||
die ("$PHP_SELF: Access denied!");
|
||||
endif;
|
||||
|
||||
// Check HTTP-Parameters
|
||||
getSecHttpVars("1",array("f_act", "generic", "f_mode", "companyId", "orderClause", "statusMessage", "f_cmp_authenticated", "f_searchmode", "f_cmp_match",
|
||||
"f_jb_id", "f_days", "f_cmp_comp", "f_cmp_comp2", "f_cs_eid", "f_usr_name", "f_usr_phone", "f_usr_email", "f_csc_name", "f_csc_is_extern",
|
||||
"f_street", "f_hsno", "f_zipcode", "f_city", "f_country", "f_remark", "f_person", "tourno"));
|
||||
|
||||
$numOfRows = 0;
|
||||
$htmlClass01 = "class=\"smaller\""; // input,select
|
||||
|
||||
if ($f_searchmode == "") : $f_searchmode = "1"; endif;
|
||||
if ($f_csc_is_extern == "") : $f_csc_is_extern = "0"; endif;
|
||||
|
||||
|
||||
$f_jb_id = trim($f_jb_id);
|
||||
if (!is_numeric($f_jb_id)) : $f_jb_id = ""; endif;
|
||||
|
||||
$f_days = trim($f_days);
|
||||
if ($f_days == "" || !is_numeric($f_days)) : $f_days = "0"; endif;
|
||||
|
||||
$f_cmp_comp = trim($f_cmp_comp);
|
||||
$f_cmp_comp2 = trim($f_cmp_comp2);
|
||||
$f_cmp_match = trim($f_cmp_match);
|
||||
$f_cs_eid = trim($f_cs_eid);
|
||||
$f_csc_name = trim($f_csc_name);
|
||||
$f_usr_name = trim($f_usr_name);
|
||||
$f_usr_phone = trim($f_usr_phone);
|
||||
$f_usr_email = trim($f_usr_email);
|
||||
$f_street = trim($f_street);
|
||||
$f_hsno = trim($f_hsno);
|
||||
$f_zipcode = trim($f_zipcode);
|
||||
$f_city = trim($f_city);
|
||||
$f_country = trim($f_country);
|
||||
$f_remark = trim($f_remark);
|
||||
$f_person = trim($f_person);
|
||||
|
||||
// if called e.g. by the first time with empty search-fields
|
||||
$searchValues = $f_jb_id . $f_cmp_comp . $f_cmp_comp2 . $f_cmp_match . $f_cs_eid . $f_csc_name . $f_street . $f_hsno . $f_zipcode . $f_city . $f_country . $f_remark . $f_person;
|
||||
// $searchValues .= $f_usr_name . $f_usr_phone . $f_usr_email;
|
||||
|
||||
// Generate search-resultset
|
||||
if ($f_act == "search" && $searchValues != "") :
|
||||
|
||||
if (strlen($f_jb_id) > 0 || strlen($f_cmp_comp) > 2 || strlen($f_cmp_comp2) > 2 || strlen($f_cmp_match) > 2 || strlen($f_cs_eid) > 2 || strlen($f_csc_name) > 0 ||
|
||||
strlen($f_street) > 2 || strlen($f_hsno) > 0 || strlen($f_zipcode) > 2 || strlen($f_city) > 2 ||
|
||||
strlen($f_remark) > 2 || strlen($f_person) > 2) :
|
||||
|
||||
// *******************************************
|
||||
// * Selection of the customers for the list *
|
||||
// *******************************************
|
||||
if ($f_searchmode == "1") : $prefix = "%"; else : $prefix = ""; endif;
|
||||
$whereClause = "";
|
||||
if ($f_jb_id != "") : $whereClause .= "jb.jb_id = '" . $f_jb_id . "'"; endif;
|
||||
if ($whereClause != "" && $f_cmp_comp != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_cmp_comp != "") : $whereClause .= "tr.tr_comp LIKE '" . $prefix . $f_cmp_comp . "%'"; endif;
|
||||
if ($whereClause != "" && $f_cmp_comp2 != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_cmp_comp2 != "") : $whereClause .= "tr.tr_comp2 LIKE '" . $prefix . $f_cmp_comp2 . "%'"; endif;
|
||||
if ($whereClause != "" && $f_cmp_match != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_cmp_match != "") : $whereClause .= "cmp.cmp_match LIKE '" . $prefix . $f_cmp_match . "%'"; endif;
|
||||
if ($whereClause != "" && $f_cs_eid != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_cs_eid != "") : $whereClause .= "cs.cs_eid LIKE '" . $prefix . $f_cs_eid . "%'"; endif;
|
||||
if ($whereClause != "" && $f_csc_name != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_csc_name != "") : $whereClause .= "csc.csc_name LIKE '" . $prefix . $f_csc_name . "%'"; endif;
|
||||
// if ($whereClause != "" && $f_usr_name != "") : $whereClause .= " AND "; endif;
|
||||
// if ($f_usr_name != "") : $whereClause .= "usr.usr_name LIKE '" . $prefix . $f_usr_name . "%'"; endif;
|
||||
// if ($whereClause != "" && $f_usr_phone != "") : $whereClause .= " AND "; endif;
|
||||
// if ($f_usr_phone != "") : $whereClause .= "usr.usr_phone LIKE '" . $prefix . $f_usr_phone . "%'"; endif;
|
||||
// if ($whereClause != "" && $f_usr_email != "") : $whereClause .= " AND "; endif;
|
||||
// if ($f_usr_email != "") : $whereClause .= "usr.usr_email LIKE '" . $prefix . $f_usr_email . "%'"; endif;
|
||||
if ($whereClause != "" && $f_cmp_iln != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_cmp_iln != "") : $whereClause .= "cmp.cmp_iln LIKE '" . $prefix . $f_cmp_iln . "%'"; endif;
|
||||
if ($whereClause != "" && $f_cmp_tax_idno != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_cmp_tax_idno != "") : $whereClause .= "cmp.cmp_tax_idno LIKE '" . $prefix . $f_cmp_tax_idno . "%'"; endif;
|
||||
if ($whereClause != "" && $f_cmp_bank != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_cmp_bank != "") : $whereClause .= "cmp.cmp_bank LIKE '" . $prefix . $f_cmp_bank . "%'"; endif;
|
||||
if ($whereClause != "" && $f_cmp_bankno != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_cmp_bankno != "") : $whereClause .= "cmp.cmp_bankno LIKE '" . $prefix . $f_cmp_bankno . "%'"; endif;
|
||||
if ($whereClause != "" && $f_cmp_bankacc != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_cmp_bankacc != "") : $whereClause .= "cmp.cmp_bankacc LIKE '" . $prefix . $f_cmp_bankacc . "%'"; endif;
|
||||
if ($whereClause != "" && $f_street != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_street != "") : $whereClause .= "ad.ad_street LIKE '" . $f_street . "%'"; endif;
|
||||
if ($whereClause != "" && $f_hsno != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_hsno != "") : $whereClause .= "tr.tr_hsno LIKE '" . $f_hsno . "%'"; endif;
|
||||
if ($whereClause != "" && $f_zipcode != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_zipcode != "") : $whereClause .= "ad.ad_zipcode LIKE '" . $f_zipcode . "%'"; endif;
|
||||
if ($whereClause != "" && $f_city != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_city != "") : $whereClause .= "ad.ad_city LIKE '" . $f_city . "%'"; endif;
|
||||
if ($whereClause != "" && $f_country != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_country != "") : $whereClause .= "ad.ad_country LIKE '" . $f_country . "%'"; endif;
|
||||
if ($whereClause != "" && $f_remark != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_remark != "") : $whereClause .= "tr.tr_remark LIKE '" . $f_remark . "%'"; endif;
|
||||
if ($whereClause != "" && $f_person != "") : $whereClause .= " AND "; endif;
|
||||
if ($f_person != "") : $whereClause .= "tr.tr_person LIKE '" . $f_person . "%'"; endif;
|
||||
|
||||
|
||||
// Past days to search in...
|
||||
// if ($f_days > 0) :
|
||||
|
||||
// Set the current timestamp to store the data
|
||||
$fromDateRange = date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d") - $f_days ,date("Y")));
|
||||
|
||||
if ($whereClause != "") : $whereClause .= " AND "; endif;
|
||||
$whereClause .= "jb.jb_ordertime >= '$fromDateRange' ";
|
||||
// endif;
|
||||
|
||||
// Check authentication
|
||||
if ($whereClause != "" && $f_cmp_authenticated == "1") : $whereClause .= " AND "; endif;
|
||||
if ($f_cmp_authenticated == "1") : $whereClause .= "cmp.cmp_authenticated LIKE '" . $f_cmp_authenticated . "%'"; endif;
|
||||
|
||||
if ($whereClause != "") : $whereClause .= " AND "; endif;
|
||||
|
||||
if ($orderClause == "") : $orderClause = "jb.jb_ordertime"; endif;
|
||||
|
||||
|
||||
$sqlquery = "SELECT jb.jb_id, jb.jb_ordertime,"
|
||||
. " tr.tr_comp, tr.tr_comp2, tr.tr_hsno, tr.tr_remark, tr.tr_person,"
|
||||
. " csc.csc_id, csc.csc_name, cs.cs_id, cs.cs_eid,"
|
||||
. " cmp.cmp_id, cmp.cmp_comp, cmp.cmp_comp2, cmp.cmp_authenticated, cmp.cmp_match,"
|
||||
. " ad.ad_street, ad.ad_zipcode, ad.ad_city, ad.ad_country"
|
||||
. " FROM job AS jb, tour AS tr, address AS ad,"
|
||||
. " customer AS cs, costcenter AS csc, company AS cmp"
|
||||
. " WHERE " . $whereClause
|
||||
. " (ISNULL(jb.jb_export_time) OR (jb.jb_export_time = '0000-00-00 00:00:00')) AND"
|
||||
. " jb.jb_id = tr.jb_id AND"
|
||||
. " jb.hq_id = '$hq_id' AND"
|
||||
. " tr.tr_sort = '1' AND"
|
||||
. " tr.ad_id = ad.ad_id AND"
|
||||
. " jb.csc_id_payer = csc.csc_id AND"
|
||||
. " csc.cs_id = cs.cs_id AND"
|
||||
. " cs.hq_id = '$hq_id' AND"
|
||||
. " cmp.cmp_id = cs.cmp_id"
|
||||
. " ORDER BY " . $orderClause;
|
||||
|
||||
$result = $db->query($sqlquery);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: '$sqlquery'" . $result->getMessage());
|
||||
|
||||
// Table with header
|
||||
while ($row = $result->fetch_assoc()):
|
||||
|
||||
$numOfRows++;
|
||||
|
||||
$tableOfRows .= "<tr>";
|
||||
|
||||
$tableOfRows .= "<td> <a href=\"javascript:finishPage('" . ec($row["jb_id"]) . "');\">" . $row["jb_id"] . "</a></td>";
|
||||
|
||||
$tableOfRows .= "<td> " . substr($row["tr_comp"], 0, 30) . "</td>";
|
||||
// $tableOfRows .= "<td> <a href=\"javascript:finishPage('" . $row["cs_id"] . "','" . $row["csc_id"] . "');\">" . substr($row["tr_comp"], 0, 15) . "</a></td>";
|
||||
|
||||
$tableOfRows .= "<td> " . substr($row["tr_comp2"], 0, 15) . "</td>";
|
||||
$tableOfRows .= "<td> " . substr($row["cs_eid"], 0, 11) . "</td>";
|
||||
|
||||
$tableOfRows .= "<td> " . substr($row["csc_name"], 0, 30) . "</td>";
|
||||
// $tableOfRows .= "<td> <a href=\"javascript:finishPage('" . $row["cs_id"] . "','" . $row["csc_id"] . "','" . $row["csc_name"] . "','" . $row["tr_comp"] . "','" . $row["tr_comp2"] . "','" . $row["ad_street"] . "','" . $row["tr_hsno"] . "','" . $row["ad_zipcode"] . "','" . $row["ad_city"] . "','" . $row["ad_country"] . "','" . $row["tr_remark"] . "','" . $row["tr_person"] . "','" . $tourno . "');\">" . substr($row["csc_name"], 0, 20) . "</a></td>";
|
||||
|
||||
$tableOfRows .= "<td> " . substr($row["cmp_match"], 0, 30) . "</td>";
|
||||
|
||||
// $tableOfRows .= "<td> " . substr($row["usr_name"], 0, 30) . "</td>";
|
||||
// $tableOfRows .= "<td> " . substr($row["usr_phone"], 0, 20) . "</td>";
|
||||
// $tableOfRows .= "<td> " . substr($row["usr_email"], 0, 30) . "</td>";
|
||||
|
||||
$tableOfRows .= "<td> " . substr($row["ad_street"], 0, 20) . "</td>";
|
||||
$tableOfRows .= "<td> " . substr($row["tr_hsno"], 0, 5) . "</td>";
|
||||
$tableOfRows .= "<td> " . substr($row["ad_zipcode"], 0, 5) . "</td>";
|
||||
$tableOfRows .= "<td> " . substr($row["ad_city"], 0, 20) . "</td>";
|
||||
$tableOfRows .= "<td> " . substr($row["tr_remark"], 0, 20) . "</td>";
|
||||
$tableOfRows .= "<td> " . substr($row["tr_person"], 0, 20) . "</td>";
|
||||
|
||||
$authImgName = "circle_red.jpg";
|
||||
if ($row["cmp_authenticated"] == "1") : $authImgName = "circle_green.jpg"; endif;
|
||||
$tableOfRows .= "<td align=\"center\"><img src=\"../images/" . $authImgName . "\" border=\"0\" height=\"10\" width=\"25\"></td>";
|
||||
|
||||
$tableOfRows .= "</tr>";
|
||||
endwhile;
|
||||
$result->free();
|
||||
|
||||
|
||||
else :
|
||||
$statusMessage = "Bei Eingabe weniger als 3 Zeichen in mindestens einem Feld erfolgt keine Suche! Mind. ein Zeichen bei Kostenstelle reicht aus!";
|
||||
endif;
|
||||
endif;
|
||||
?>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>votian: Suchliste Jobs</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/phoenix.css">
|
||||
|
||||
<script src="../include/checkFormTags.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var statusMessage = "<?php echo $statusMessage ?>";
|
||||
|
||||
function displayStatusMessage() {
|
||||
if (statusMessage != "") {
|
||||
alert(statusMessage);
|
||||
}
|
||||
};
|
||||
|
||||
function finishPage(jb_id) {
|
||||
opener.parent.document.location.href = "../jobs/job_edit.php?jb_id=" + jb_id;
|
||||
self.setTimeout("self.close()", 100);
|
||||
// self.close();
|
||||
};
|
||||
|
||||
function clearFields() {
|
||||
document.forms[0].f_jb_id.value = '';
|
||||
document.forms[0].f_cmp_comp.value = '';
|
||||
document.forms[0].f_cmp_comp2.value = '';
|
||||
document.forms[0].f_cmp_match.value = '';
|
||||
document.forms[0].f_cs_eid.value = '';
|
||||
document.forms[0].f_csc_name.value = '';
|
||||
document.forms[0].f_street.value = '';
|
||||
document.forms[0].f_hsno.value = '';
|
||||
document.forms[0].f_zipcode.value = '';
|
||||
document.forms[0].f_city.value = '';
|
||||
document.forms[0].f_remark.value = '';
|
||||
document.forms[0].f_person.value = '';
|
||||
};
|
||||
-->
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onLoad="displayStatusMessage();">
|
||||
<form action="../jobs/jb_search_list.php" method="post">
|
||||
<input type="hidden" name="f_act" value="">
|
||||
<input type="hidden" name="orderClause" value="<?php echo $orderClause ?>">
|
||||
<input type="hidden" name="tourno" value="<?php echo $tourno ?>">
|
||||
<input type="hidden" name="generic" value="<?php echo $generic ?>">
|
||||
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td class="f12bp1_red">
|
||||
Aufträge<br><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="javascript:document.forms[0].f_act.value='search';document.forms[0].submit();"> Suchen </a>
|
||||
|
|
||||
<a href="javascript:clearFields();">Felder zurücksetzen</a>
|
||||
|
|
||||
Option:
|
||||
<input type="radio" name="f_searchmode" value="0" <?php if ($f_searchmode == "0") : echo "checked"; endif; ?>> Präfix
|
||||
<input type="radio" name="f_searchmode" value="1" <?php if ($f_searchmode == "1") : echo "checked"; endif; ?>> Teilwort
|
||||
|
|
||||
Suche in zurückliegenden Tagen (0 = heute): <input type="text" <?php echo $htmlClass01 ?> name="f_days" value="<?php echo $f_days ?>" size="3" onchange="javascript:checkNumRanges(document.forms[0].f_days,0,100,'Bitte geben Sie an, wieviele Tage in der Vergangenheit gesucht werden soll!');">
|
||||
<br><br>
|
||||
<table class="f8np1" border="1" cellpadding="0">
|
||||
<tr>
|
||||
<td><input type="text" <?php echo $htmlClass01 ?> name="f_jb_id" value="<?php echo $f_jb_id ?>" size="5"></td>
|
||||
<td><input type="text" <?php echo $htmlClass01 ?> name="f_cmp_comp" value="<?php echo $f_cmp_comp ?>" size="30"></td>
|
||||
<td><input type="text" <?php echo $htmlClass01 ?> name="f_cmp_comp2" value="<?php echo $f_cmp_comp2 ?>" size="15"></td>
|
||||
<td><input type="text" <?php echo $htmlClass01 ?> name="f_cs_eid" value="<?php echo $f_cs_eid ?>" size="11"></td>
|
||||
<td><input type="text" <?php echo $htmlClass01 ?> name="f_csc_name" value="<?php echo $f_csc_name ?>" size="25"></td>
|
||||
<td><input type="text" <?php echo $htmlClass01 ?> name="f_cmp_match" value="<?php echo $f_cmp_match ?>" size="30"></td>
|
||||
|
||||
<!-- <td><input type="text" <?php echo $htmlClass01 ?> name="f_usr_name" value="<?php echo $f_usr_name ?>" size="15"></td> -->
|
||||
<!-- <td><input type="text" <?php echo $htmlClass01 ?> name="f_usr_phone" value="<?php echo $f_usr_phone ?>" size="20"></td> -->
|
||||
<!-- <td><input type="text" <?php echo $htmlClass01 ?> name="f_usr_email" value="<?php echo $f_usr_email ?>" size="30"></td> -->
|
||||
|
||||
<td><input type="text" <?php echo $htmlClass01 ?> name="f_street" value="<?php echo $f_street ?>" size="25"></td>
|
||||
<td><input type="text" <?php echo $htmlClass01 ?> name="f_hsno" value="<?php echo $f_hsno ?>" size="5"></td>
|
||||
<td><input type="text" <?php echo $htmlClass01 ?> name="f_zipcode" value="<?php echo $f_zipcode ?>" size="5"></td>
|
||||
<td><input type="text" <?php echo $htmlClass01 ?> name="f_city" value="<?php echo $f_city ?>" size="20"></td>
|
||||
<td><input type="text" <?php echo $htmlClass01 ?> name="f_remark" value="<?php echo $f_remark ?>" size="20"></td>
|
||||
<td><input type="text" <?php echo $htmlClass01 ?> name="f_person" value="<?php echo $f_person ?>" size="20"></td>
|
||||
|
||||
<td><a href="javascript:document.forms[0].f_act.value='search';document.forms[0].submit();"> Suchen </a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='jb.jb_id';document.forms[0].f_act.value='search';document.forms[0].submit();"> Auftrag </a></td>
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='tr.tr_comp';document.forms[0].f_act.value='search';document.forms[0].submit();"> Firma </a></td>
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='tr.tr_comp2';document.forms[0].f_act.value='search';document.forms[0].submit();"> Firma2 </a></td>
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='cs.cs_eid';document.forms[0].f_act.value='search';document.forms[0].submit();"> ExtID </a></td>
|
||||
|
||||
<!-- <td><a href="javascript:document.forms[0].orderClause.value='csc2.csc_name';document.forms[0].f_act.value='search';document.forms[0].submit();"> Kostenstelle </a></td> -->
|
||||
<!-- <td><a href="javascript:document.forms[0].orderClause.value='usr.usr_name';document.forms[0].f_act.value='search';document.forms[0].submit();"> Ansprechpartner </a></td> -->
|
||||
<!-- <td><a href="javascript:document.forms[0].orderClause.value='usr.usr_phone';document.forms[0].f_act.value='search';document.forms[0].submit();"> Telefon </a></td> -->
|
||||
<!-- <td><a href="javascript:document.forms[0].orderClause.value='usr.usr_email';document.forms[0].f_act.value='search';document.forms[0].submit();"> E-Mail </a></td> -->
|
||||
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='csc.csc_name';document.forms[0].f_act.value='search';document.forms[0].submit();"> Kostenstelle </a></td>
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='cmp.cmp_match';document.forms[0].f_act.value='search';document.forms[0].submit();"> Freitext </a></td>
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='ad.ad_street';document.forms[0].f_act.value='search';document.forms[0].submit();"> Straße (1. Etappe)</a></td>
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='tr.tr_hsno';document.forms[0].f_act.value='search';document.forms[0].submit();"> Hausnr.</a></td>
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='ad.ad_zipcode';document.forms[0].f_act.value='search';document.forms[0].submit();"> PLZ</a></td>
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='ad.ad_city';document.forms[0].f_act.value='search';document.forms[0].submit();"> Ort (1. Etappe)</a></td>
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='tr.tr_remark';document.forms[0].f_act.value='search';document.forms[0].submit();"> Bemerkung</a></td>
|
||||
<td><a href="javascript:document.forms[0].orderClause.value='tr.tr_person';document.forms[0].f_act.value='search';document.forms[0].submit();"> Person</a></td>
|
||||
|
||||
<td> Freigabe </td>
|
||||
</tr>
|
||||
<?php echo $tableOfRows ?>
|
||||
</table>
|
||||
<br><br>
|
||||
Anzahl Einträge: <?php echo $numOfRows ?><?php if ($numOfRows == "0" && $f_act == "search" && $statusMessage == "") : echo " (Keine Einträge gefunden.)"; endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* job_accesskeys.inc.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
define ("_JB_GLOBALJOB_ACCESSKEY_", "a"); // An alle Kuriere (job_options)
|
||||
define ("_JB_CASH_ACCESSKEY_", "b"); // Barzahlung (job_tour)
|
||||
define ("_DUPLICATEJOBBUTTON_ACCESSKEY_", "c"); // Suchen: nach Jobs (job_tour)
|
||||
define ("_BEZAHLERFIRMABUTTON_ACCESSKEY_", "d"); // Suchen: Drittzahler (job_tour)
|
||||
define ("_AFTERWARDS_ACCESSKEY_", "e"); // Nacherfassung (job_options)
|
||||
//define ("_JB_TYPE_ACCESSKEY_", "f"); // Frühauftrag (job_options)
|
||||
define ("_ACCEPT_ALL_ADDRESSES_ACCESSKEY_", "f"); // fehlerhafte Adressen akzeptieren (job_tour)
|
||||
define ("_VONADRESSBUTTON_ACCESSKEY_", "g"); // Suchen: von Adresse (job_tour)
|
||||
define ("_NACHADRESSBUTTON_ACCESSKEY_", "h"); // Suchen: nach Adresse (job_tour)
|
||||
define ("_JB_CR_FILTER_ACCESSKEY_", "i"); // Kurierfilter
|
||||
define ("_JB_INCOMPLETE_ACCESSKEY_", "j"); // Noch unvollständig
|
||||
//define ("_SEARCHOLDJOBBUTTON_ACCESSKEY_", "j"); // Suchen: nach Jobs (job_tour)
|
||||
define ("_CRSIDLIST_ACCESSKEY_", "k"); // Kurierliste (job_options)
|
||||
define ("_WASTE1BUTTON_ACCESSKEY_", "l"); // links löschen (job_tour)
|
||||
define ("_JB_STATUS_MANUAL_ACCESSKEY_", "m"); // Manuelle Disposition
|
||||
define ("_NACHFIRMABUTTON_ACCESSKEY_", "n"); // Suchen: nach Firma (job_tour)
|
||||
define ("_VON_TR_REMARK_BUTTON_ACCESSKEY_", "o"); // Bemerkungsfeld links Texteingabe
|
||||
define ("_NACH_TR_REMARK_BUTTON_ACCESSKEY_", "p"); // Bemerkungsfeld rechts Texteingabe
|
||||
define ("_JB_FREETEXTBUTTON_ACCESSKEY_", "q"); // Rechnungstext (job_tour)
|
||||
define ("_WASTE2BUTTON_ACCESSKEY_", "r"); // rechts löschen (job_tour)
|
||||
define ("_TOURSUBMIT_ACCESSKEY_", "s"); // Auftrag senden (job_options)
|
||||
define ("_JB_COSTSPLIT_ACCESSKEY_", "t"); // Kosten splitten (job_tour)
|
||||
define ("_VON_TR_COMMISSION_NO_ACCESSKEY_", "u"); // (job_tour)
|
||||
define ("_VONFIRMABUTTON_ACCESSKEY_", "v"); // Suchen: von Firma (job_tour)
|
||||
define ("_NACH_TR_COMMISSION_NO_ACCESSKEY_", "w"); // (job_tour)
|
||||
define ("_NEXTBUTTON_ACCESSKEY_", "x"); // vor (job_tour)
|
||||
define ("_PREVBUTTON_ACCESSKEY_", "y"); // zurück (job_tour)
|
||||
define ("_SWITCHBUTTON_ACCESSKEY_", "z"); // vertauschen (job_tour)
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* job_courier.inc.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
// Sortierfunktion für Arrays aus ranking.inc.php für usort-Sortierung
|
||||
function cmp_usort ($a, $b) {
|
||||
// erst PLZ-Vergleich
|
||||
if (trim($a[4]) == trim($b[4])):
|
||||
// dann Uhrzeit-Vergleich
|
||||
if (trim($a[5]) == trim($b[5])):
|
||||
return 0;
|
||||
else:
|
||||
return (trim($a[5]) < trim($b[5])) ? -1 : 1;
|
||||
endif;
|
||||
endif;
|
||||
return (trim($a[4]) < trim($b[4])) ? -1 : 1;
|
||||
}
|
||||
|
||||
// Vergleich zweier Arrays aus ranking.inc.php anhand der cr_ids
|
||||
function my_array_diff($a, $b)
|
||||
{
|
||||
$ret_arr = array();
|
||||
$found = false;
|
||||
|
||||
foreach($a as $a_val) {
|
||||
$found = false;
|
||||
foreach($b as $b_val) {
|
||||
if (trim($a_val[1]) == trim($b_val[1])):
|
||||
$found = true;
|
||||
break;
|
||||
endif;
|
||||
}
|
||||
if (!$found)
|
||||
$ret_arr[] = $a_val;
|
||||
}
|
||||
return($ret_arr);
|
||||
}
|
||||
|
||||
//function cmp_udiff ($a, $b) {
|
||||
// // cr_sid-Vergleich
|
||||
// if (trim($a[1]) == trim($b[1])):
|
||||
// return 0;
|
||||
// endif;
|
||||
// return (trim($a[1]) < trim($b[1])) ? -1 : 1;
|
||||
//}
|
||||
|
||||
// Die Liste der favorisierten und geblockten Kuriere liefert leider nur cr_ids zurück,
|
||||
// deshalb muss die vollständige Liste hier erstellt werden
|
||||
function get_complete_courier_data($cr_id_order_list_temp)
|
||||
{
|
||||
global $db, $hq_id;
|
||||
|
||||
$sqlInClause = "";
|
||||
if ($cr_id_order_list_temp == "" || count($cr_id_order_list_temp) == 0):
|
||||
$cr_id_order_list_temp = Array();
|
||||
else:
|
||||
$sqlInClause = " cr.cr_id IN (" . implode(",", $cr_id_order_list_temp) . ") AND";
|
||||
$sqlQuery =
|
||||
"SELECT cr.cr_id, cr.cr_sid, cr.cr_eid, mt.mt_value, cr.cr_locationzipcode, cr.cr_availabletime, crvh.crvh_filter, cr.cr_occupied"
|
||||
. " FROM courier AS cr, couriervehicle AS crvh, metatype AS mt, company AS cmp"
|
||||
. " WHERE " . $sqlInClause
|
||||
. " cr.hq_id = '" . $hq_id . "' AND"
|
||||
. " cr.cr_sid != '' AND"
|
||||
. " cr.cmp_id = cmp.cmp_id AND"
|
||||
. " cr.cr_id = crvh.cr_id AND"
|
||||
. " cr.cr_sid = crvh.crvh_sid AND"
|
||||
. " crvh.vht_id = mt.mt_sort AND"
|
||||
. " mt.mt_type = 'vehicletype' "
|
||||
. " ORDER BY cr.cr_available ASC, cr.cr_locationzipcode ASC, cr.cr_availabletime ASC";
|
||||
$res = $db->query($sqlQuery);
|
||||
$cr_id_order_list_temp = array();
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlQuery'" . $res->getMessage());
|
||||
while ($row = $res->fetch_assoc()):
|
||||
$cr_id_order_list_temp[] = array(
|
||||
$row["cr_id"],
|
||||
$row["cr_sid"],
|
||||
$row["cr_eid"],
|
||||
$row["mt_value"],
|
||||
$row["cr_locationzipcode"],
|
||||
$row["cr_availabletime"],
|
||||
$row["crvh_filter"],
|
||||
$row["cr_occupied"],
|
||||
);
|
||||
endwhile;
|
||||
$res->free();
|
||||
endif;
|
||||
return $cr_id_order_list_temp;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,520 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* job_courier.inc.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
// Die Kuriernummern werden in ein JavaScript-Array geschrieben,
|
||||
// damit die Gültigkeit schon online geprüft werden kann
|
||||
// Es stehen normalerweise alle Kuriere zur Verfügung (Wunschkurier);
|
||||
// wenn allerdings hq.hq_workmode == "1" (Disposition erwünscht),
|
||||
// dann nur eingeschränkte Auswahl (sortiert nach angemeldetem PLZ-Bereich,
|
||||
// Ranking nach Anmeldezeit, nur angemeldete Kuriere)
|
||||
include_once("../include/auth.inc.php");
|
||||
include_once("../include/ranking.inc.php");
|
||||
include_once("../include/caglobal.inc.php");
|
||||
include_once("../jobs/job_courier.inc.lib.php");
|
||||
include_once("../include/global.inc.php");
|
||||
|
||||
trace_execution_time_start();
|
||||
|
||||
$cr_id_order_list = "var cr_id_order_list=[";
|
||||
$cr_id_order_list2 = "var cr_id_order_list2=[";
|
||||
$vht_id_str_js = "var vht_id_str=new Array();\n";
|
||||
|
||||
$hq_workmode = getFieldValueFromId("headquarters", "hq_id", "$hq_id", "hq_workmode");
|
||||
//if ($hq_workmode == "2" && $hq_id != 1):
|
||||
// Wenn jb_id gesetzt, dann kommt der Aufruf aus der Auftragsliste
|
||||
if (isset($jb_id) && $jb_id != "" && isset($zipcode) && $zipcode != ""):
|
||||
// Auftragsliste -> Kuriere sortieren
|
||||
//die("\"$zipcode\", \"1111100\", $jb_id");
|
||||
$cr_id_order_list_temp_all = getCourierByRanking("$zipcode", "1111100", $jb_id);
|
||||
// Favorisierte Kuriere
|
||||
$cr_id_order_list_favoured = get_complete_courier_data($cr_id_order_list_temp_all[2]);
|
||||
// favorisierte Kuriere
|
||||
usort ($cr_id_order_list_favoured, "cmp_usort");
|
||||
if (MASK_COURIER_SORT_BY_OCCUPIED == "1"):
|
||||
array_unshift($cr_id_order_list_favoured, array("*", "<b>- bevorzugte</b>"));
|
||||
else:
|
||||
array_unshift($cr_id_order_list_favoured, array("*", "<b>Bevorzugte Kuriere</b>"));
|
||||
endif;
|
||||
// geblockte Kuriere
|
||||
$cr_id_order_list_blocked = get_complete_courier_data($cr_id_order_list_temp_all[1]);
|
||||
usort ($cr_id_order_list_blocked, "cmp_usort");
|
||||
if (MASK_COURIER_SORT_BY_OCCUPIED == "1"):
|
||||
array_unshift($cr_id_order_list_blocked, array("*", "<b>- gesperrte</b>"));
|
||||
else:
|
||||
array_unshift($cr_id_order_list_blocked, array("*", "<b>Gesperrte Kuriere</b>"));
|
||||
endif;
|
||||
// Kuriere im Vermittlungsbereich
|
||||
$cr_id_order_list_area = $cr_id_order_list_temp_all[3];
|
||||
if ($cr_id_order_list_area == "")
|
||||
$cr_id_order_list_area = Array();
|
||||
usort ($cr_id_order_list_area, "cmp_usort");
|
||||
if (MASK_COURIER_SORT_BY_OCCUPIED == "1"):
|
||||
if (MODE_INTERMEDIATION == 1): // Bremen
|
||||
array_unshift($cr_id_order_list_area, array("*", "<b>- im Vermittlungsbereich</b>"));
|
||||
elseif(MODE_INTERMEDIATION == 2 || MODE_INTERMEDIATION == 3): // Hamburg, Berlin
|
||||
$srvpa_name = $db->getOne(
|
||||
"SELECT srvpa.srvpa_name FROM serviceplzareamapping AS srvpam, serviceplz AS srvp, serviceplzarea AS srvpa" .
|
||||
" WHERE srvp.srvp_id = srvpam.srvp_id AND srvpam.srvpa_id = srvpa.srvpa_id AND srvp.srvp_plz = '$zipcode'");
|
||||
$srvpa_longname = $db->getOne(
|
||||
"SELECT srvpa.srvpa_longname FROM serviceplzareamapping AS srvpam, serviceplz AS srvp, serviceplzarea AS srvpa" .
|
||||
" WHERE srvp.srvp_id = srvpam.srvp_id AND srvpam.srvpa_id = srvpa.srvpa_id AND srvp.srvp_plz = '$zipcode'");
|
||||
array_unshift($cr_id_order_list_area, array("*", "<b>- im Vermittlungsbereich $srvpa_name (" . $srvpa_longname . ")</b>"));
|
||||
endif;
|
||||
else:
|
||||
if (MODE_INTERMEDIATION == 1): // Bremen
|
||||
array_unshift($cr_id_order_list_area, array("*", "<b>Kuriere im Vermittlungsbereich</b>"));
|
||||
elseif(MODE_INTERMEDIATION == 2 || MODE_INTERMEDIATION == 3): // Hamburg, Berlin
|
||||
$srvpa_name = $db->getOne(
|
||||
"SELECT srvpa.srvpa_name FROM serviceplzareamapping AS srvpam, serviceplz AS srvp, serviceplzarea AS srvpa" .
|
||||
" WHERE srvp.srvp_id = srvpam.srvp_id AND srvpam.srvpa_id = srvpa.srvpa_id AND srvp.srvp_plz = '$zipcode'");
|
||||
$srvpa_longname = $db->getOne(
|
||||
"SELECT srvpa.srvpa_longname FROM serviceplzareamapping AS srvpam, serviceplz AS srvp, serviceplzarea AS srvpa" .
|
||||
" WHERE srvp.srvp_id = srvpam.srvp_id AND srvpam.srvpa_id = srvpa.srvpa_id AND srvp.srvp_plz = '$zipcode'");
|
||||
array_unshift($cr_id_order_list_area, array("*", "<b>Kuriere im Vermittlungsbereich $srvpa_name (" . $srvpa_longname . ")</b>"));
|
||||
endif;
|
||||
endif;
|
||||
// Kuriere in der Vermittlungsbereich-Nachbarschaft
|
||||
if (MODE_INTERMEDIATION == 1): // Bremen
|
||||
$cr_id_order_list_neighbourhood = $cr_id_order_list_temp_all[4];
|
||||
if ($cr_id_order_list_neighbourhood == "")
|
||||
$cr_id_order_list_neighbourhood = Array();
|
||||
usort ($cr_id_order_list_neighbourhood, "cmp_usort");
|
||||
elseif(MODE_INTERMEDIATION == 2 || MODE_INTERMEDIATION == 3): // Hamburg, Berlin
|
||||
for($i = 1; $i <= AUTORANKING_NEIGHBOUR_LEVEL; $i++):
|
||||
$cr_id_order_list_temp_all[$i] = getCourierByRanking("$zipcode", "0100100000", $jb_id, $i);
|
||||
$cr_id_order_list_neighbourhoods[$i] = $cr_id_order_list_temp_all[$i][4];
|
||||
if ($cr_id_order_list_neighbourhoods[$i] == "")
|
||||
$cr_id_order_list_neighbourhoods[$i] = Array();
|
||||
usort ($cr_id_order_list_neighbourhoods[$i], "cmp_usort");
|
||||
endfor;
|
||||
endif;
|
||||
if (MASK_COURIER_SORT_BY_OCCUPIED == "1"):
|
||||
if (MODE_INTERMEDIATION == 1): // Bremen
|
||||
array_unshift($cr_id_order_list_neighbourhood, array("*", "<b>- in der Nachbarschaft</b>"));
|
||||
elseif(MODE_INTERMEDIATION == 2 || MODE_INTERMEDIATION == 3): // Hamburg, Berlin
|
||||
for($i = 1; $i <= AUTORANKING_NEIGHBOUR_LEVEL; $i++):
|
||||
$srvpa_name = $db->getOne(
|
||||
"SELECT srvpa.srvpa_name FROM serviceplzneighbourarea AS srvpna, serviceplz AS srvp, serviceplzarea AS srvpa" .
|
||||
" WHERE srvpna.srvpna_sort = $i AND srvp.srvp_id = srvpna.srvp_id AND srvpna.srvpa_id = srvpa.srvpa_id AND srvp.srvp_plz = '$zipcode'");
|
||||
$srvpa_longname = $db->getOne(
|
||||
"SELECT srvpa.srvpa_longname FROM serviceplzneighbourarea AS srvpna, serviceplz AS srvp, serviceplzarea AS srvpa" .
|
||||
" WHERE srvpna.srvpna_sort = $i AND srvp.srvp_id = srvpna.srvp_id AND srvpna.srvpa_id = srvpa.srvpa_id AND srvp.srvp_plz = '$zipcode'");
|
||||
array_unshift($cr_id_order_list_neighbourhoods[$i], array("*", "<b>- in der Nachbarschaft $srvpa_name (" . $srvpa_longname . ")</b>"));
|
||||
endfor;
|
||||
endif;
|
||||
else:
|
||||
if (MODE_INTERMEDIATION == 1): // Bremen
|
||||
array_unshift($cr_id_order_list_neighbourhood, array("*", "<b>Kuriere in der Nachbarschaft</b>"));
|
||||
elseif(MODE_INTERMEDIATION == 2 || MODE_INTERMEDIATION == 3): // Hamburg, Berlin
|
||||
for($i = 1; $i <= AUTORANKING_NEIGHBOUR_LEVEL; $i++):
|
||||
$srvpa_name = $db->getOne(
|
||||
"SELECT srvpa.srvpa_name FROM serviceplzneighbourarea AS srvpna, serviceplz AS srvp, serviceplzarea AS srvpa" .
|
||||
" WHERE srvpna.srvpna_sort = $i AND srvp.srvp_id = srvpna.srvp_id AND srvpna.srvpa_id = srvpa.srvpa_id AND srvp.srvp_plz = '$zipcode'");
|
||||
$srvpa_longname = $db->getOne(
|
||||
"SELECT srvpa.srvpa_longname FROM serviceplzneighbourarea AS srvpna, serviceplz AS srvp, serviceplzarea AS srvpa" .
|
||||
" WHERE srvpna.srvpna_sort = $i AND srvp.srvp_id = srvpna.srvp_id AND srvpna.srvpa_id = srvpa.srvpa_id AND srvp.srvp_plz = '$zipcode'");
|
||||
array_unshift($cr_id_order_list_neighbourhoods[$i], array("*", "<b>- in der Nachbarschaft $srvpa_name (" . $srvpa_longname . ")</b>"));
|
||||
endfor;
|
||||
endif;
|
||||
endif;
|
||||
// Alle Kuriere
|
||||
$cr_id_order_list_absolutely_all = $cr_id_order_list_temp_all[0];
|
||||
if ($cr_id_order_list_absolutely_all == "")
|
||||
$cr_id_order_list_absolutely_all = Array();
|
||||
// Die Liste aller Kuriere soll nur die enthalten, die nicht bereits in den ersten Listen enthalten sind
|
||||
if (MODE_INTERMEDIATION == 1): // Bremen
|
||||
elseif(MODE_INTERMEDIATION == 2 || MODE_INTERMEDIATION == 3): // Hamburg, Berlin
|
||||
$cr_id_order_list_neighbourhood = Array();
|
||||
for($i = 1; $i <= AUTORANKING_NEIGHBOUR_LEVEL; $i++):
|
||||
$cr_id_order_list_neighbourhood = array_merge($cr_id_order_list_neighbourhood, $cr_id_order_list_neighbourhoods[$i]);
|
||||
endfor;
|
||||
//print_r($cr_id_order_list_neighbourhoods[1]);
|
||||
//echo "1";
|
||||
//print_r($cr_id_order_list_neighbourhoods[2]);
|
||||
//echo "2";
|
||||
//print_r($cr_id_order_list_neighbourhoods[3]);
|
||||
//echo "3";
|
||||
//print_r($cr_id_order_list_neighbourhood);
|
||||
//reportDie ();
|
||||
endif;
|
||||
$cr_id_order_list_rest = my_array_diff ($cr_id_order_list_absolutely_all, array_merge($cr_id_order_list_favoured, $cr_id_order_list_area, $cr_id_order_list_neighbourhood, $cr_id_order_list_blocked));
|
||||
usort ($cr_id_order_list_rest, "cmp_usort");
|
||||
if (MASK_COURIER_SORT_BY_OCCUPIED == "1"):
|
||||
array_unshift($cr_id_order_list_rest, array("*", "<b>- restliche verfügbare</b>"));
|
||||
else:
|
||||
array_unshift($cr_id_order_list_rest, array("*", "<b>Anderweitige verfügbare Kuriere</b>"));
|
||||
endif;
|
||||
$cr_id_order_list_temp = array_merge ($cr_id_order_list_favoured, $cr_id_order_list_area, $cr_id_order_list_neighbourhood, $cr_id_order_list_rest, $cr_id_order_list_blocked);
|
||||
else:
|
||||
// Auftragserfassung -> alle Kuriere (auch unangemeldet wg. Auftragsnacherfassung)
|
||||
$sqlQuery =
|
||||
"SELECT cr.cr_id, cr.cr_eid, mt.mt_value, cr.cr_locationzipcode, cr.cr_availabletime, crvh.crvh_filter, crvh.crvh_sid "
|
||||
. " FROM courier AS cr, couriervehicle AS crvh, metatype AS mt, company AS cmp"
|
||||
. " WHERE "
|
||||
. " cr.hq_id = '" . $hq_id . "' AND"
|
||||
. " crvh.crvh_sid != '' AND"
|
||||
. " cr.cmp_id = cmp.cmp_id AND"
|
||||
. " cmp.cmp_authenticated = '1' AND"
|
||||
. " cr.cr_id = crvh.cr_id AND" // Quickhack wg. Fehler in der Kurierverwaltung!!!
|
||||
// . " cr.cr_sid = crvh.crvh_sid AND"
|
||||
. " crvh.vht_id = mt.mt_sort AND"
|
||||
. " mt.mt_type = 'vehicletype' "
|
||||
. " ORDER BY crvh.crvh_sid";
|
||||
$res = $db->query($sqlQuery);
|
||||
$cr_id_order_list_temp = array();
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlQuery'" . $res->getMessage());
|
||||
while ($row = $res->fetch_assoc()):
|
||||
$cr_id_order_list_temp[] = array(
|
||||
$row["cr_id"],
|
||||
$row["crvh_sid"],
|
||||
$row["cr_eid"],
|
||||
$row["mt_value"],
|
||||
$row["cr_locationzipcode"],
|
||||
$row["cr_availabletime"],
|
||||
$row["crvh_filter"]
|
||||
);
|
||||
endwhile;
|
||||
$res->free();
|
||||
// Spezieller Verbuchungskurier von Hansetrans
|
||||
// $cr_id_order_list_temp[] = array(87, "1888", 283128, "", "", "", "");
|
||||
endif;
|
||||
|
||||
// Die Fahrzeugtabelle laden, damit nicht für jeden Kurier das Fahrzeug einzeln aus der DB geladen werden muss
|
||||
$vehicletypes = array();
|
||||
$vehicletype_ids = array();
|
||||
$sqlQuery = "SELECT mt_sort, mt_value FROM metatype WHERE mt_type = 'vehicletype'";
|
||||
$res = $db->query($sqlQuery);
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlQuery': " . $res->getMessage());
|
||||
while ($row = $res->fetch_assoc()):
|
||||
$vehicletypes[$row["mt_sort"]] = $row["mt_value"];
|
||||
$vehicletype_ids[$row["mt_value"]] = $row["mt_sort"];
|
||||
endwhile;
|
||||
$res->free();
|
||||
|
||||
// bei occupied Kurieren sollen die aktuellen Aufträge angezeigt werden
|
||||
if (isset($jb_id) && $jb_id != "" && isset($zipcode) && $zipcode != ""):
|
||||
list($csc_id, $tr_comp, $tr_person, $ad_street, $tr_hsno,
|
||||
$ad_zipcode, $ad_city, $tr_remark, $tr_status, $tr_ware_from_to) =
|
||||
getTourData($jb_id, 1, "tour");
|
||||
if (MASK_COURIER_SORT_BY_OCCUPIED == "1"):
|
||||
array_unshift($cr_id_order_list_temp, array("*", "<tr><td align=left valign=center><B>KURIERE OHNE AUFTRAG</B><\/td><\/tr>"));
|
||||
endif;
|
||||
$cur_vht_id_job = $db->getOne("SELECT vht_id FROM job WHERE jb_id = '" . $jb_id . "'");
|
||||
// $cur_vht_id_value_job = $db->getOne("SELECT mt_value FROM metatype WHERE mt_sort = " . $cur_vht_id_job . " AND mt_type = 'vehicletype'");
|
||||
$cur_vht_id_value_job = $vehicletypes[$cur_vht_id_job];
|
||||
array_unshift($cr_id_order_list_temp, array("#", "<b>Auftrag Nr. "
|
||||
. "<a href=\\\"javascript:popupWindow('../admin/jb_detail.php?job_id=" . $jb_id . "','Auftrag','scrollbars=yes,width=800,height=500');\\\"><i>$jb_id</i></a>"
|
||||
. ", Start: " .
|
||||
"$tr_comp" . (trim($tr_person) != "" ? ", $tr_person" : "") . ", $ad_street $tr_hsno, $ad_zipcode $ad_city; Fahrzeug: $cur_vht_id_value_job</b>" .
|
||||
"<table border=0 align=center width=100% cellspacing=0 cellpadding=0 vspace=0 hspace=0>" .
|
||||
"<tr><td align=left valign=center><a href=\\\"javascript:popupWindow('../admin/push_autoranking.php?jb_id=" . $jb_id . "','Auftrag','resizable=no,scrollbars=no,width=250,height=10')\\\"><i>" . "(In automatische Vermittlung einstellen)" . "</i></a>" .
|
||||
"</td><td align=right valign=center>" .
|
||||
// Uhrzeit/Aktualisieren
|
||||
"Stand: <span style=\\\"color:red\\\">" . date("H:i:s") . "</span> Uhr" .
|
||||
"<i><a href=\\\"javascript:reloadMe()\\\"> (Aktualisieren)</a></i></td></tr></table>"));
|
||||
endif;
|
||||
|
||||
// Alle Kuriere finden, die KEINE newbies sind... (d.h. erster eledigter Job innerhalb von MASK_COURIER_NEWBIE_TIME Tagen in der Vergangenheit)
|
||||
|
||||
$newbie_date = getdate(mktime(0, 0, 0, date("m"), date("d") - MASK_COURIER_NEWBIE_TIME, date("Y")));
|
||||
$newbie_date_sql = $newbie_date['year'] . "-" . sprintf("%02d", $newbie_date['mon']) . "-" . sprintf("%02d", $newbie_date['mday']) . " 23:59:59";
|
||||
$newbie_cr_sids = array();
|
||||
$sqlQuery = "SELECT cr_id, MIN(jb_ordertime) AS min_jb_ordertime FROM job WHERE jb_status = 2 AND cr_id IS NOT NULL AND cr_id != '' GROUP BY cr_id ORDER BY min_jb_ordertime ASC";
|
||||
$res = $db->query($sqlQuery);
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlQuery': " . $res->getMessage());
|
||||
while ($row = $res->fetch_assoc()):
|
||||
if ($row["min_jb_ordertime"] < $newbie_date_sql)
|
||||
$newbie_cr_sids[$row["cr_id"]] = 1;
|
||||
else
|
||||
break;
|
||||
endwhile;
|
||||
$res->free();
|
||||
|
||||
// Alle laufenden Aufträge laden, damit nicht für jeden Kurier die DB einzeln abgefrägt werden muss
|
||||
|
||||
$job_ids_sql = "";
|
||||
$current_jobs = array();
|
||||
$sqlQuery = "SELECT jb_id, jb_ordertime, cr_sid FROM job WHERE jb_status = 0 OR jb_status = 1 ORDER BY cr_sid, jb_id ASC";
|
||||
$res = $db->query($sqlQuery);
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlQuery': " . $res->getMessage());
|
||||
while ($row = $res->fetch_assoc()):
|
||||
$current_jobs[$row["cr_sid"]][] = array($row["jb_id"], $row["jb_ordertime"]);
|
||||
if ($job_ids_sql != "")
|
||||
$job_ids_sql .= ",";
|
||||
$job_ids_sql .= "'" . $row["jb_id"] . "'";
|
||||
endwhile;
|
||||
$res->free();
|
||||
|
||||
$current_tours = array();
|
||||
if ($job_ids_sql != ""):
|
||||
$sqlQuery = "SELECT tour.jb_id, tour.tr_sort, tour.tr_status, address.ad_zipcode FROM tour, address WHERE tour.jb_id IN ($job_ids_sql) AND tour.ad_id = address.ad_id ORDER BY tour.jb_id, tour.tr_sort ASC";
|
||||
$res = $db->query($sqlQuery);
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlQuery': " . $res->getMessage());
|
||||
while ($row = $res->fetch_assoc()):
|
||||
$current_tours[$row["jb_id"]][] = array($row["tr_sort"], $row["tr_status"], $row["ad_zipcode"]);
|
||||
endwhile;
|
||||
$res->free();
|
||||
endif;
|
||||
|
||||
// Jeden Kurier einzeln verarzten
|
||||
$i1 = 0;
|
||||
$i2 = 1;
|
||||
$cr_id_order_list2 .= "\"*<tr><td align=left valign=center><B>KURIERE MIT AUFTRAG</B><\/td><\/tr>" . "\"";
|
||||
for($i = 0; $i < count($cr_id_order_list_temp); $i++):
|
||||
if ($cr_id_order_list_temp[$i][0] != "*" && $cr_id_order_list_temp[$i][0] != "#" && $cr_id_order_list_temp[$i][0] != "~"):
|
||||
list($dummy_year, $dummy_month, $dummy_day, $hours, $minutes) =
|
||||
getValsFromDate(trim($cr_id_order_list_temp[$i][5]));
|
||||
// courierfilter
|
||||
// $curFilter = substr(trim($cr_id_order_list_temp[$i][6]), 1, strlen(trim($cr_id_order_list_temp[$i][6])) - 2);
|
||||
// if ($curFilter != "")
|
||||
// $curFilter = " (" . $curFilter . ")";
|
||||
// find jobs of occupied couriers
|
||||
// if ($cr_id_order_list_temp[$i][7] == 1):
|
||||
// $sqlQuery =
|
||||
// "SELECT jb_id, jb_ordertime FROM job WHERE cr_sid = '" . $cr_id_order_list_temp[$i][1] . "' AND (jb_status = 0 OR jb_status = 1 AND (jb_globaljob IS NULL OR jb_globaljob = 0)) ORDER BY jb_id ASC";
|
||||
// $sqlQuery =
|
||||
// "SELECT jb_id, jb_ordertime FROM job WHERE cr_sid = '" . $cr_id_order_list_temp[$i][1] . "' AND (jb_status = 0 OR jb_status = 1) ORDER BY jb_id ASC";
|
||||
// $res = $db->query($sqlQuery);
|
||||
// if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlQuery'" . $res->getMessage());
|
||||
$cr_id_order_list_temp[$i][7] = "";
|
||||
$cr_is_occupied = false;
|
||||
// while ($row = $res->fetch_assoc()):
|
||||
if ($current_jobs[$cr_id_order_list_temp[$i][1]] != ""):
|
||||
foreach($current_jobs[$cr_id_order_list_temp[$i][1]] as $current_job) {
|
||||
$plz_str = "";
|
||||
// $max_tr_sort = $db->getOne("SELECT max(tr_sort) FROM tour WHERE jb_id = '" . $row["jb_id"] . "'");
|
||||
//echo "Honk: " . $row["jb_id"] . $max_tr_sort . "<br>\n";
|
||||
// for ($j = 1; $j <= $max_tr_sort; $j++):
|
||||
if ($current_tours[$current_job[0]] != ""):
|
||||
foreach($current_tours[$current_job[0]] as $current_tour) {
|
||||
// $ad_zipcode =
|
||||
// $db->getOne("SELECT ad_zipcode FROM address WHERE ad_id = '" .
|
||||
// $db->getOne("SELECT ad_id FROM tour WHERE tr_sort = '" . $j . "' AND jb_id = '" . $row["jb_id"] . "'")
|
||||
// . "'");
|
||||
// $tr_status =
|
||||
// $db->getOne("SELECT tr_status FROM tour WHERE tr_sort = '" . $j . "' AND jb_id = '" . $row["jb_id"] . "'");
|
||||
$cur_zipcode = ($current_tour[1] == "1" ? "<span style=\\\"color:red\\\">" . $current_tour[2] . "</span>" : $current_tour[2]);
|
||||
$plz_str .= ($plz_str == "" ? $cur_zipcode : "->" . $cur_zipcode);
|
||||
//echo "i:$i<br>\n";
|
||||
//echo $plz_str;
|
||||
}
|
||||
endif;
|
||||
// endfor;
|
||||
// $start_plz =
|
||||
// $db->getOne("SELECT ad_zipcode FROM address WHERE ad_id = '" .
|
||||
// $db->getOne("SELECT ad_id FROM tour WHERE tr_sort = '1' AND jb_id = '" . $row["jb_id"] . "'")
|
||||
// . "'");
|
||||
// $ziel_plz = "";
|
||||
// if ($db->getOne("SELECT max(tr_sort) FROM tour WHERE jb_id = '" . $row["jb_id"] . "'") > 1):
|
||||
// $ziel_plz =
|
||||
// $db->getOne("SELECT ad_zipcode FROM address WHERE ad_id = '" .
|
||||
// $db->getOne("SELECT ad_id FROM tour WHERE tr_sort = '" .
|
||||
// $db->getOne("SELECT max(tr_sort) FROM tour WHERE jb_id = '" . $row["jb_id"] . "'") .
|
||||
// "' AND jb_id = '" . $row["jb_id"] . "'") . "'");
|
||||
// endif;
|
||||
if ($plz_str != "")
|
||||
$plz_str = " (" . $plz_str . ")";
|
||||
$curFilter = "";
|
||||
$jb_ordertimeStr = "";
|
||||
// $jb_ordertime_vals = getValsFromDate($row["jb_ordertime"]);
|
||||
$jb_ordertime_vals = getValsFromDate($current_job[1]);
|
||||
$today = getdate();
|
||||
if ($today['mon'] != $jb_ordertime_vals[1] || $today['mday'] != $jb_ordertime_vals[2]):
|
||||
// Kurier hat Auftrag für nachfolgenden Tag aufgenommen, d.h. er gilt nicht als besetzt
|
||||
$jb_ordertimeStr = " <span style=\\\"color:green\\\">(" . sprintf("%02d", $jb_ordertime_vals[2]) . "." . sprintf("%02d", $jb_ordertime_vals[1])
|
||||
. "., " . sprintf("%02d", $jb_ordertime_vals[3]) . ":" . sprintf("%02d", $jb_ordertime_vals[4]) . ")</span>";
|
||||
else:
|
||||
// Kurier hat Auftrag für heutigen Tag aufgenommen, gilt erstmal als besetzt
|
||||
$row = array();
|
||||
$row["jb_id"] = $current_job[0];
|
||||
$row["jb_ordertime"] = $current_job[1];
|
||||
$job_is_occupied = checkCrIsOccupied($row);
|
||||
if (!$cr_is_occupied)
|
||||
$cr_is_occupied = $job_is_occupied;
|
||||
// prüfen, ob Auftragsdatum heute in der Zukunft liegt
|
||||
if (($jb_ordertime_vals[3] > $today['hours']) || ($jb_ordertime_vals[3] == $today['hours'] && $jb_ordertime_vals[4] > $today['minutes'])):
|
||||
// prüfen, ob Vorlaufzeit schon erreicht
|
||||
if (!$job_is_occupied):
|
||||
$jb_ordertimeStr = " <span style=\\\"color:green\\\">(" . sprintf("%02d", $jb_ordertime_vals[3]) . ":" . sprintf("%02d", $jb_ordertime_vals[4]) . ")</span>";
|
||||
endif;
|
||||
endif;
|
||||
endif;
|
||||
if ($cr_id_order_list_temp[$i][7] == ""):
|
||||
$cr_id_order_list_temp[$i][7] = "<\/a>, <span style=\\\"color:red\\\">aktueller Auftrag:</span> ";
|
||||
else:
|
||||
$cr_id_order_list_temp[$i][7] .= ", ";
|
||||
endif;
|
||||
$cr_id_order_list_temp[$i][7] .=
|
||||
"<a href=\\\"javascript:popupWindow('../admin/jb_detail.php?job_id=" . $current_job[0] . "','Auftrag','scrollbars=yes,width=800,height=500');\\\"><i>" . $current_job[0] . $plz_str . $jb_ordertimeStr . "</i></a>";
|
||||
}
|
||||
endif;
|
||||
// endwhile;
|
||||
// $res->free();
|
||||
// else:
|
||||
// $cr_id_order_list_temp[$i][7] = "";
|
||||
// endif;
|
||||
$plzString = trim($cr_id_order_list_temp[$i][4]);
|
||||
if ($plzString == "")
|
||||
$plzString = "00000";
|
||||
|
||||
// if ($hq_id == 3)
|
||||
// $plzString .= " " . getAreaName($cr_id_order_list_temp[$i][4], 1);
|
||||
|
||||
if ($cr_is_occupied)
|
||||
$plzString = "<span style=\\\"color:red\\\">" . $plzString . "</span>";
|
||||
$leadingStr = "";
|
||||
$leadingStr = " " . $plzString . ", " . $hours . ":" . $minutes . " - ";
|
||||
if (trim($hours) == "")
|
||||
$hours = "00";
|
||||
if (trim($minutes) == "")
|
||||
$minutes = "00";
|
||||
// Auftragserfassung: Zusätzlich Datum anzeigen, wenn nicht heute
|
||||
if (!(isset($jb_id) && $jb_id != "" && isset($zipcode) && $zipcode != "")):
|
||||
$leadingStr = " " . $plzString . ",<span style=\\\"color:red\\\"> " . $hours . ":" . $minutes . " (" . sprintf("%02d", $dummy_day) . "." . sprintf("%02d", $dummy_month) . ".)</span>" . " - ";
|
||||
if ($today['mday'] == $dummy_day && $today['mon'] == $dummy_month && $today['year'] == $dummy_year)
|
||||
$leadingStr = " " . $plzString . ", " . $hours . ":" . $minutes . " (" . sprintf("%02d", $dummy_day) . "." . sprintf("%02d", $dummy_month) . ".)" . " - ";
|
||||
endif;
|
||||
$tmp_cr_sid = trim($cr_id_order_list_temp[$i][1]);
|
||||
if ($newbie_cr_sids[trim($cr_id_order_list_temp[$i][0])] != 1):
|
||||
$tmp_cr_sid = "<span style=\\\"color:#9999FF\\\">" . $tmp_cr_sid . "<\/span>";
|
||||
endif;
|
||||
$tmpCourierStr =
|
||||
"\"" . $leadingStr .
|
||||
"<i><b>" . $tmp_cr_sid . "</b>, " . trim($cr_id_order_list_temp[$i][3]) .
|
||||
"<i>" . $curFilter . "</i>" . $cr_id_order_list_temp[$i][7] . "\"";
|
||||
|
||||
// Wenn MASK_COURIER_SORT_BY_OCCUPIED gesetzt, dann müssen die Kuriere nach occupied-status sortiert werden
|
||||
if (MASK_COURIER_SORT_BY_OCCUPIED == "1"):
|
||||
if ($cr_is_occupied != true || !(isset($jb_id) && $jb_id != "" && isset($zipcode) && $zipcode != "")):
|
||||
if ($i1++ > 0) $cr_id_order_list .= ",\n";
|
||||
$cr_id_order_list .= /* "cr_id_order_list[" . $i1++ . "] = " . */ $tmpCourierStr;
|
||||
else:
|
||||
if ($i2++ > 0) $cr_id_order_list2 .= ",\n";
|
||||
$cr_id_order_list2 .= /* "cr_id_order_list2[" . $i2++ . "] = " . */ $tmpCourierStr;
|
||||
endif;
|
||||
else:
|
||||
if ($i1++ > 0) $cr_id_order_list .= ",\n";
|
||||
$cr_id_order_list .= /* "cr_id_order_list[" . $i1++ . "] = " . */ $tmpCourierStr;
|
||||
endif;
|
||||
// Abgleich der Fahrzeugtypen Kurier/Auftrag
|
||||
$vht_id_str = "";
|
||||
// $cur_vht_id_job = $db->getOne("SELECT vht_id FROM job WHERE jb_id = '" . $jb_id . "'");
|
||||
// $cur_vht_id_value_job = $db->getOne("SELECT mt_value FROM metatype WHERE mt_sort = " . $cur_vht_id_job . " AND mt_type = 'vehicletype'");
|
||||
// $cur_vht_id_courier = $db->getOne("SELECT mt_sort FROM metatype WHERE mt_value = '" . $cr_id_order_list_temp[$i][3] . "' AND mt_type = 'vehicletype'");
|
||||
$cur_vht_id_courier = $vehicletype_ids[$cr_id_order_list_temp[$i][3]];
|
||||
if ($cur_vht_id_job > $cur_vht_id_courier)
|
||||
$vht_id_str = "\\n\\nACHTUNG: Fahrzeug passt nicht! (Angefordert: " . $cur_vht_id_value_job . ", zuweisen: " . $cr_id_order_list_temp[$i][3] . ")";
|
||||
if ($cur_vht_id_job < $cur_vht_id_courier)
|
||||
$vht_id_str = "\\n\\n(Fahrzeug angefordert: " . $cur_vht_id_value_job . ", zuweisen: " . $cr_id_order_list_temp[$i][3] . ")";
|
||||
if ($vht_id_str != "")
|
||||
// $vht_id_str_js .= "vht_id_str[] = " . "new Array(\"" . $cr_id_order_list_temp[$i][1] . "\", \"" . $vht_id_str . "\");\n";
|
||||
// else
|
||||
// $vht_id_str_js .= "vht_id_str[] = " . "new Array(\"" . $cr_id_order_list_temp[$i][1] . "\", \"\");\n";
|
||||
$vht_id_str_js .= "vht_id_str[\"" . $cr_id_order_list_temp[$i][1] . "\"] = \"" . $vht_id_str . "\";\n";
|
||||
else
|
||||
$vht_id_str_js .= "vht_id_str[\"" . $cr_id_order_list_temp[$i][1] . "\"] = \"\";\n";
|
||||
else:
|
||||
if ($i1++ > 0) $cr_id_order_list .= ",\n";
|
||||
$cr_id_order_list .= "\"" . trim($cr_id_order_list_temp[$i][0]) . trim($cr_id_order_list_temp[$i][1]) . "\"";
|
||||
if (MASK_COURIER_SORT_BY_OCCUPIED == "1" && $cr_id_order_list_temp[$i][0] != "#" && trim($cr_id_order_list_temp[$i][1]) != "<tr><td align=left valign=center><B>KURIERE OHNE AUFTRAG</B><\/td><\/tr>"):
|
||||
if ($i2++ > 0) $cr_id_order_list2 .= ",\n";
|
||||
$cr_id_order_list2 .= "\"" . trim($cr_id_order_list_temp[$i][0]) . trim($cr_id_order_list_temp[$i][1]) . "\"";
|
||||
endif;
|
||||
endif;
|
||||
endfor;
|
||||
|
||||
if ($hq_workmode != "2" || $hq_id == 1):
|
||||
// $hq_distancecalc = getFieldValueFromId("headquarters", "hq_id", "$hq_id", "hq_distancecalc");
|
||||
// if ($hq_workmode == "1" && $hq_distancecalc == "1"):
|
||||
// $res = $db->query("SELECT cr.cr_sid, cr.cr_locationzipcode, cr.cr_availabletime, srvp.srvp_latitude, srvp.srvp_longitude, cr.cr_occupied, mt.mt_value" .
|
||||
// " FROM courier AS cr, serviceplz AS srvp, couriervehicle AS crvh, metatype AS mt" .
|
||||
// " WHERE cr.hq_id = '$hq_id' AND" .
|
||||
// " cr.cr_locationzipcode = srvp.srvp_plz AND" .
|
||||
// " cr.cr_available = 1 AND" .
|
||||
// " cr.cr_id = crvh.cr_id AND" .
|
||||
// " cr.cr_sid = crvh.crvh_sid AND" .
|
||||
// " crvh.vht_id = mt.mt_sort AND" .
|
||||
// " mt.mt_type = 'vehicletype' " .
|
||||
// " ORDER BY cr.cr_locationzipcode ASC, cr.cr_availabletime ASC");
|
||||
// elseif ($hq_workmode == "1" || $hq_workmode == "0" || $hq_id == 1):
|
||||
// $res = $db->query("SELECT cr.cr_sid, cr.cr_locationzipcode, cr.cr_availabletime, cr.cr_occupied, mt.mt_value" .
|
||||
// " FROM courier AS cr, couriervehicle AS crvh, metatype AS mt" .
|
||||
// " WHERE cr.hq_id = '$hq_id' AND" .
|
||||
// " cr.cr_available = 1 AND" .
|
||||
// " cr.cr_id = crvh.cr_id AND" .
|
||||
// " cr.cr_sid = crvh.crvh_sid AND" .
|
||||
// " crvh.vht_id = mt.mt_sort AND" .
|
||||
// " mt.mt_type = 'vehicletype' " .
|
||||
// " ORDER BY cr.cr_locationzipcode ASC, cr.cr_availabletime ASC");
|
||||
// endif;
|
||||
// if (DB::isError($res))
|
||||
// reportDie ("$PHP_SELF: 'SELECT cr_sid ...' :" . $res->getMessage());
|
||||
// $plz_geo_list = array();
|
||||
// $i = 0;
|
||||
// while ($row = $res->fetch_assoc()):
|
||||
// // Kuriere einsammeln
|
||||
// if ($hq_workmode == "1" || $hq_id == 1):
|
||||
// list($dummy_year, $dummy_month, $dummy_day, $hours, $minutes) =
|
||||
// getValsFromDate($row["cr_availabletime"]);
|
||||
// $cr_occupied_sign = ($row["cr_occupied"] > 0) ? "*" : "";
|
||||
// $cr_id_order_list .= "cr_id_order_list[" . $i++ . "] = \"" . trim($row["cr_sid"]) . " - " . trim($row["mt_value"]) .
|
||||
// $cr_occupied_sign . " (" . trim($row["cr_locationzipcode"]) . ", " . $hours . ":" . $minutes . ")\";\n";
|
||||
// // Liste der Koordinaten (nur wenn hq_distancecalc = 1)
|
||||
// if ($hq_distancecalc == "1"):
|
||||
// $plz_geo_list[$row["cr_locationzipcode"]] = array($row["srvp_latitude"] , $row["srvp_longitude"]);
|
||||
// // save courier-zipcodes for search of surrounding zipcodes below
|
||||
// // we want to avoid duplicate querys for duplicate courier-zipcodes
|
||||
// endif;
|
||||
// else:
|
||||
// $cr_id_order_list .= "cr_id_order_list[" . $i++ . "] = \"" . trim($row["cr_sid"]) . "\";\n";
|
||||
// endif;
|
||||
// endwhile;
|
||||
// $res->free();
|
||||
|
||||
// /** Searches for valid PLZs, that are in a specified radius around the PLZ of each courier.
|
||||
// Nur wenn hq_workmode = 1 und hq_distancecalc = 1␍// */␍// if ($hq_workmode == "1" && $hq_distancecalc == "1"):
|
||||
// $plz_key_list = array_keys($plz_geo_list);
|
||||
// foreach($plz_key_list as $zipcode)
|
||||
// {
|
||||
// $query = "SELECT srvp_plz, srvp_latitude, srvp_longitude" .␍// " FROM serviceplz WHERE srvp_valid = 1 AND " .
|
||||
// "(ACOS((SIN(" . deg2rad($plz_geo_list[$zipcode][0]) . ")*SIN(RADIANS(srvp_latitude))) + " .␍// "(COS(" . deg2rad($plz_geo_list[$zipcode][0]) . ")*COS(RADIANS(srvp_latitude))*COS(RADIANS(srvp_longitude)-" .
|
||||
// deg2rad($plz_geo_list[$zipcode][1]) . "))) * " . GEO_EARTH_RADIUS . ") < " . MAXIMUM_SEARCH_RADIUS;
|
||||
// $res_geo = $db->query($query);
|
||||
// if (DB::isError($res_geo))
|
||||
// reportDie ("$PHP_SELF: '$query': " . $res_geo->getMessage());
|
||||
// while ($row = $res_geo->fetch_assoc()):
|
||||
// $plz_geo_list[$row["srvp_plz"]] = array($row["srvp_latitude"] , $row["srvp_longitude"]);
|
||||
// endwhile;
|
||||
// $res_geo->free();
|
||||
// }
|
||||
// endif;
|
||||
|
||||
endif;
|
||||
|
||||
$cr_id_order_list .= "];\n";
|
||||
$cr_id_order_list2 .= "];\n";
|
||||
|
||||
if (isset($jb_id) && $jb_id != "" && isset($zipcode) && $zipcode != ""):
|
||||
writeLog_("../log/job_courier_cur_", trace_execution_time_stop() . " job_courier.inc.php executed: \$jb_id = $jb_id, couriers: " . count($cr_id_order_list_temp) . ", vehicletype: $cur_vht_id_value_job" . ", \$usr_id = $usr_id");
|
||||
else:
|
||||
writeLog_("../log/job_courier_", trace_execution_time_stop() . " job_courier.inc.php executed: \$jb_id = $jb_id, couriers: " . count($cr_id_order_list_temp) . ", vehicletype: $cur_vht_id_value_job" . ", \$usr_id = $usr_id");
|
||||
endif;
|
||||
//// Gesperrte / gewünschte Kuriere der Kunden
|
||||
//$res = $db->query("SELECT cs_id, cr_id, cscr_relation FROM customercourier ORDER BY cr_id");
|
||||
//if (DB::isError($res))
|
||||
// reportDie ("$PHP_SELF: 'SELECT cs_id, cr_id, cscr_relation FROM customercourier ORDER BY cr_id': " . $res->getMessage());
|
||||
//$customercourier_list = "var customercourier_list = new Array();\n";
|
||||
//$i = 0;
|
||||
//while ($row = $res->fetch_assoc()):
|
||||
// $customercourier_list .= "customercourier_list[" . $i++ . "] = " .
|
||||
// "new Array(" . $row["cs_id"] . ", " . $row["cr_id"] . ", " . $row["cscr_relation"] . ");\n";
|
||||
//endwhile;
|
||||
//$res->free();
|
||||
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* job_edit.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
include_once("../include/caglobal.inc.php");
|
||||
include_once ("../include/auth.inc.php");
|
||||
include_once("../include/global.inc.php");
|
||||
//if ($phpVersion >= "7.0"):
|
||||
// require_once("../PEAR/HTML/Template/IT.php");
|
||||
//else:
|
||||
// require_once("HTML/IT.php");
|
||||
//endif;
|
||||
|
||||
// für Nacherfassungen und nachträgliche Änderungen von Aufträgen
|
||||
// wenn job_id übergeben: Nachträgliche Änderung eines Auftrages
|
||||
//list ($csc_id, $jb_id) =
|
||||
getSecHttpVars("1", array("csc_id", "jb_id", "dbhistory"));
|
||||
list ($jb_copy) = getHttpVars(array("jb_copy"));
|
||||
list ($csc_id_start) = getHttpVars(array("csc_id_start"));
|
||||
|
||||
if ($jb_id != ""):
|
||||
$what_is_this = "Auftragsänderung (Nr. $jb_id)";
|
||||
$csc_id = getFieldValueFromId("job", "jb_id", "$jb_id", "csc_id");
|
||||
else:
|
||||
$what_is_this = "Auftragserfassung";
|
||||
endif;
|
||||
|
||||
if ($csc_id != ""):
|
||||
// csc_id übergeben: Auftragseingabe durch die Zentrale
|
||||
// oder festgelegt durch jb_id (siehe oben)
|
||||
$csc_id_orderer = $csc_id;
|
||||
else:
|
||||
// nix csc_id übergeben: Normaler Auftrag so wie es sich gehört
|
||||
$usr_id = $HTTP_SESSION_VARS['usr_id'];
|
||||
$usr_type = getFieldValueFromId("user", "usr_id", "$usr_id", "usr_type");
|
||||
if ($usr_type == 2):
|
||||
// customer (employee)
|
||||
// Auftraggebende Kostenstelle wird aus angemeldetem employee ermittelt
|
||||
$csc_id_orderer = $db->getOne("SELECT csc_id FROM employee WHERE emp_id = '$emp_id'");
|
||||
elseif ($usr_type == 1):
|
||||
// headquarter
|
||||
$csc_id_orderer = 0;
|
||||
else:
|
||||
// sysadmin or courier -> not allowed to put jobs in the system
|
||||
reportDie ("$PHP_SELF: Ungültiger 'usr_type': '$usr_type'", false);
|
||||
endif;
|
||||
endif;
|
||||
|
||||
//if ($phpVersion >= "7.0"):
|
||||
// $tpl = new HTML_Template_IT();
|
||||
//else:
|
||||
// $tpl = new IntegratedTemplate();
|
||||
//endif;
|
||||
//$tpl->loadTemplatefile("job_edit.tpl.htm", true, true);
|
||||
$output = file_get_contents("job_edit.tpl.htm");
|
||||
//$tpl->setCurrentBlock("csc_id_orderer");
|
||||
$output = str_replace("{_csc_id_orderer_}", ec($csc_id_orderer), $output);
|
||||
$output = str_replace("{_what_is_this_}", $what_is_this, $output);
|
||||
$output = str_replace("{_jb_id_}", ec($jb_id), $output);
|
||||
$output = str_replace("{_jb_copy_}", $jb_copy, $output);
|
||||
$output = str_replace("{_dbhistory_}", $dbhistory, $output);
|
||||
$output = str_replace("{_csc_id_start_}", $csc_id_start, $output);
|
||||
//$tpl->parseCurrentBlock("csc_id_orderer");
|
||||
//$tpl->show();
|
||||
echo $output;
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,40 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>votian: Auftragserfassung</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta name="description" content="votian Auftragserfassung"> <meta name="keywords" content="votian Auftragserfassung">
|
||||
<script type="text/javascript">
|
||||
self.moveTo(0, 0);
|
||||
self.resizeTo(screen.width,screen.height);
|
||||
this.iname="job_edit";
|
||||
top.opener.top.job_edit=this;
|
||||
var Start=new Date();
|
||||
var Startzeit=Start.getTime();
|
||||
function unloadFunc(){
|
||||
if(parent.job_options.jb_id!=""&&parent.job_options.jb_id!="killMe")
|
||||
{
|
||||
self.location.href="job_unlock.php?jb_id="+parent.job_options.jb_id;
|
||||
for(var i=0;i<=100000;i++)
|
||||
{
|
||||
var Ende=new Date();
|
||||
var Endzeit=Ende.getTime();
|
||||
var Aufenthalt=Math.floor((Endzeit-Startzeit)/ 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<frameset rows="35,*,250,120" border=0 onUnload="unloadFunc()">
|
||||
<!-- BEGIN csc_id_orderer -->
|
||||
<frame src="job_header.php?csc_id_orderer={_csc_id_orderer_}&what_is_this={_what_is_this_}" name="job_header" scrolling="no" marginwidth=0 marginheight=0>
|
||||
<frame src="job_tour.php?csc_id_orderer={_csc_id_orderer_}" name="job_tour" scrolling="no" marginwidth=0 marginheight=0>
|
||||
<frame src="job_options.php?csc_id_orderer={_csc_id_orderer_}&jb_id={_jb_id_}&jb_copy={_jb_copy_}&csc_id_start={_csc_id_start_}&dbhistory={_dbhistory_}" name="job_options" scrolling="no" marginwidth=0 marginheight=0>
|
||||
<frame src="job_tour_list.htm" name="job_tour_list" scrolling="no" marginwidth=0 marginheight=0>
|
||||
<!-- END csc_id_orderer -->
|
||||
<noframes>
|
||||
<p>Diese Seite benutzt Frames. Bitte benutzen Sie einen Browser, der Frames darstellen kann
|
||||
(z.B. Internet Explorer ab Version 3.0 oder Netscape ab Version 2.0).</p>
|
||||
</noframes>
|
||||
</frameset>
|
||||
</html>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* job_header.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
include_once("../include/caglobal.inc.php");
|
||||
include_once("../include/global.inc.php");
|
||||
include_once ("../include/auth.inc.php");
|
||||
//if ($phpVersion >= "7.0"):
|
||||
// require_once("../PEAR/HTML/Template/IT.php");
|
||||
//else:
|
||||
// require_once("HTML/IT.php");
|
||||
//endif;
|
||||
|
||||
getSecHttpVars("1", array("csc_id_orderer"));
|
||||
list ($what_is_this, $reload_couriers) = getHttpVars(array("what_is_this", "reload_couriers"));
|
||||
if ($csc_id_orderer == "" && $csc_id_orderer != '0') reportDie ("$PHP_SELF: Parameter 'csc_id_orderer' fehlt!", false);
|
||||
if ($csc_id_orderer != '0'):
|
||||
// Kundenaufrag
|
||||
$cs_id = getFieldValueFromId("costcenter", "csc_id", "$csc_id_orderer", "cs_id");
|
||||
$cmp_id = getFieldValueFromId("customer", "cs_id", "$cs_id", "cmp_id");
|
||||
$cmp_comp = getFieldValueFromId("company", "cmp_id", "$cmp_id", "cmp_comp");
|
||||
$csc_name = getFieldValueFromId("costcenter", "csc_id", "$csc_id_orderer", "csc_name");
|
||||
else:
|
||||
// Zentralenauftrag
|
||||
$hq_id = $HTTP_SESSION_VARS['hq_id'];
|
||||
$cmp_id = getFieldValueFromId("headquarters", "hq_id", "$hq_id", "cmp_id");
|
||||
$cmp_comp = getFieldValueFromId("company", "cmp_id", "$cmp_id", "cmp_comp");
|
||||
$csc_name = getFieldValueFromId("company", "cmp_id", "$cmp_id", "cmp_comp2");
|
||||
endif;
|
||||
|
||||
//if ($phpVersion >= "7.0"):
|
||||
// $tpl = new HTML_Template_IT();
|
||||
//else:
|
||||
// $tpl = new IntegratedTemplate();
|
||||
//endif;
|
||||
//$tpl->loadTemplatefile("job_header.tpl.htm", true, true);
|
||||
$output = file_get_contents("job_header.tpl.htm");
|
||||
//$tpl->setCurrentBlock("javascript");
|
||||
|
||||
// $reload_couriers ist nur beim ersten Aufruf nicht gesetzt
|
||||
if ($reload_couriers == "1"):
|
||||
include_once("job_courier.inc.php");
|
||||
$output = str_replace("{_cr_id_order_list_}",
|
||||
"function updateCr_id_order_list(){\n" .
|
||||
"var cr_id_order_list = new Array();\n" .
|
||||
$cr_id_order_list .
|
||||
"parent.job_options.cr_id_order_list = cr_id_order_list;\n" .
|
||||
"parent.job_options.when = \"" . date("H:i") . "\";\n" .
|
||||
"parent.job_options.whenString = \"(Stand: <span style=\\\"color:red\\\">" . date("H:i") . "</span> Uhr)<br><br>\\n\";\n" .
|
||||
"}\n", $output);
|
||||
else:
|
||||
$output = str_replace("{_cr_id_order_list_}",
|
||||
"function updateCr_id_order_list(){\n" .
|
||||
"}\n", $output);
|
||||
endif;
|
||||
|
||||
$output = str_replace("{_csc_id_orderer_}", ec($csc_id_orderer), $output);
|
||||
$output = str_replace("{_what_is_this_}", $what_is_this, $output);
|
||||
$output = str_replace("{_auto_refresh_}", MASK_AUTO_REFRESH, $output);
|
||||
//$tpl->parseCurrentBlock("javascript");
|
||||
|
||||
$what_is_this_split = split(" ", $what_is_this);
|
||||
if (trim($what_is_this_split[0]) == "Auftragsänderung" || trim($what_is_this_split[0]) == "Auftragsänderung")
|
||||
$what_is_this = "<span style=\"color:red\">" . $what_is_this . " $cmp_comp ($csc_name)" . "</span>";
|
||||
else
|
||||
$what_is_this .= " $cmp_comp ($csc_name)";
|
||||
//$tpl->setCurrentBlock("kundenname");
|
||||
$output = str_replace("{_kundenname_}", $what_is_this, $output);
|
||||
//$tpl->parseCurrentBlock("kundenname");
|
||||
//$tpl->show();
|
||||
echo $output;
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,90 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>votian: Auftragserfassung</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/phoenix.css">
|
||||
<script src="../include/lib_global.js" type="text/javascript"></script>
|
||||
<script src="../include/key_events_content.js" language="JavaScript1.2" type="text/javascript"></script>
|
||||
<script for="document" event="onkeydown()" language="JScript" type="text/jscript">
|
||||
<!--
|
||||
{
|
||||
if(window.event.altKey&&event.keyCode>=49&&event.keyCode<=57){
|
||||
actionMapEvent(window.event,event.keyCode);
|
||||
}
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
<!-- BEGIN javascript -->
|
||||
var job_tour_isLoading=true;
|
||||
{_cr_id_order_list_}
|
||||
var auto_refresh="{_auto_refresh_}";
|
||||
function startTimeout()
|
||||
{
|
||||
if(auto_refresh=="1"){
|
||||
updateCr_id_order_list();
|
||||
self.setTimeout("startReload()",60000);
|
||||
}
|
||||
}
|
||||
function startReload()
|
||||
{
|
||||
self.location.href="job_header.php?csc_id_orderer={_csc_id_orderer_}&what_is_this={_what_is_this_}&reload_couriers=1";
|
||||
}
|
||||
<!-- END javascript -->
|
||||
-->
|
||||
</script>
|
||||
<noscript>
|
||||
<center>
|
||||
<b><br>JavaScript ist nicht verfügbar. Bitte aktivieren Sie JavaScript<br><br>
|
||||
in Ihrem Browser, damit diese Seite ordnungsgemäß funktioniert!</b><br><br>
|
||||
</center>
|
||||
</noscript>
|
||||
</head>
|
||||
<body onLoad="startTimeout()">
|
||||
<table border=0 height=95% width=100% align="center" cellspacing=0 cellpadding=0 vspace=0 hspace=0>
|
||||
<tr>
|
||||
<td width=10%>
|
||||
<img src="../images/empty.gif" border=0 height=2>
|
||||
</td>
|
||||
<td width=80%>
|
||||
<img src="../images/empty.gif" border=0 height=2>
|
||||
</td>
|
||||
<td width=10%>
|
||||
<img src="../images/empty.gif" border=0 height=2>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td align="center" valign=center>
|
||||
<table border=0 height=95% width=100% align="center" cellspacing=0 cellpadding=0 vspace=0 hspace=0>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<div class="f12bp1">
|
||||
<!-- BEGIN kundenname -->
|
||||
{_kundenname_}
|
||||
<!-- END kundenname -->
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<img src="../images/empty.gif" border="0" height="2">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
job_header_isLoading=false;
|
||||
-->
|
||||
</script>
|
||||
@@ -0,0 +1,414 @@
|
||||
var cfl=[["AH", "Anhänger", "1", 0],
|
||||
["FH", "Flughafenprüfung", "1", 0],
|
||||
["L2", "2 Tonnen Nutzlast", "1", 0],
|
||||
["RZ", "Rechnung zur Zentrale", "2", 0],
|
||||
["AK", "Anhängerkupplung", "1", 0],
|
||||
["FK", "Fremdkurier", "2", 0],
|
||||
["L3", "3 Tonnen Nutzlast", "1", 0],
|
||||
["SA", "Schiffsanlieferung", "2", 0],
|
||||
["AL", "Bote unerwünscht", "2", 0],
|
||||
["FP", "Festpreis !!!!", "2", 0],
|
||||
["L4", "4 Tonnen Nutzlast", "1", 0],
|
||||
["SB", "Stadtbote", "1", 0],
|
||||
["AN", "Angefordert", "2", 0],
|
||||
["FT", "Flügeltüren", "1", 0],
|
||||
["L5", "5 Tonnen Nutzlast", "1", 0],
|
||||
["SD", "Servicedienstleistung", "1", 0],
|
||||
["AP", "Abplanbar", "1", 0],
|
||||
["FZ", "Führungszeugnis", "1", 0],
|
||||
["L6", "6 Tonnen Nutzlast", "1", 0],
|
||||
["SE", "Steckdose 24 Volt", "1", 0],
|
||||
["AS", "Arbeitsschuhe", "1", 0],
|
||||
["GA", "Geldauslage bis 100,-", "1", 0],
|
||||
["LA", "Luftanschluss", "1", 0],
|
||||
["SK", "Sackkarre", "1", 0],
|
||||
["AT", "Autotelefon", "1", 0],
|
||||
["GB", "Grosser Bus", "1", 0],
|
||||
["LB", "Auslieferbestätigung", "1", 0],
|
||||
["SL", "Schwere Lasten", "1", 0],
|
||||
["BA", "besondere Anfahrt", "0", 0],
|
||||
["GF", "Gefahrengutaus.", "1", 0],
|
||||
["LG", "Luftgefedert", "1", 0],
|
||||
["SM", "Submissionserfahrung", "1", 0],
|
||||
["BI", "Biker", "1", 0],
|
||||
["GU", "Gurte", "1", 0],
|
||||
["LI", "Liste", "2", 0],
|
||||
["SP", "Sonderpreis", "1", 0],
|
||||
["BK", "Bike-Auftrag", "1", 0],
|
||||
["HB", "Hebebühne", "1", 0],
|
||||
["LL", "Lichtleiste", "1", 0],
|
||||
["TA", "Terminauftrag", "2", 0],
|
||||
["BS", "Seitlich beladbar", "1", 0],
|
||||
["HD", "Hochdach", "1", 0],
|
||||
["LZ", "Lieferschein zur Zentrale", "2", 0],
|
||||
["TH", "Tragehilfe", "1", 0],
|
||||
["BU", "Bus", "1", 0],
|
||||
["HH", "Hebebühne hintergekl.", "1", 0],
|
||||
["MB", "männlicher Bote", "1", 0],
|
||||
["TP", "Tauschpaletten", "1", 0],
|
||||
["BZ", "Barzahler", "2", 0],
|
||||
["HU", "Hebebühne untergeklappt", "1", 0],
|
||||
["MH", "Möbelhunt", "1", 0],
|
||||
["UR", "Umklappbare Rückbank", "1", 0],
|
||||
["CK", "Computerkenntnisse", "1", 0],
|
||||
["HW", "Hubwagen", "1", 0],
|
||||
["NF", "Neutrales Fahrzeug!", "1", 0],
|
||||
["W", "weiblich", "1", 0],
|
||||
["DE", "Decken", "1", 0],
|
||||
["K2", "Führerscheinklasse 2", "1", 0],
|
||||
["PA", "Personalausweis", "1", 0],
|
||||
["ZB", "Zugangsberechtigung", "1", 0],
|
||||
["E", "Eilauftrag", "2", 0],
|
||||
["KA", "Kastenwagen", "1", 0],
|
||||
["PK", "Plane oder Koffer", "2", 0],
|
||||
["ZG", "Zurrgurte", "1", 0],
|
||||
["EC", "EC-Karte ab 100,- ausl.", "1", 0],
|
||||
["KF", "Kofferfahrzeug", "1", 0],
|
||||
["PL", "Plane", "1", 0],
|
||||
["ZL", "Zurrlaschen", "1", 0],
|
||||
["ED", "Edscha", "1", 0],
|
||||
["KK", "Kugelkopf-Kupplung", "1", 0],
|
||||
["PR", "PLZ-Preisermittlung", "2", 0],
|
||||
["ZO", "Zollkenntnisse", "1", 0],
|
||||
["EN", "Englisch", "1", 0],
|
||||
["KO", "Kombi", "1", 0],
|
||||
["PT", "Pritsche", "1", 0],
|
||||
["ZV", "Zollverschluß", "1", 0],
|
||||
["EZ", "Einzelrechnung", "2", 0],
|
||||
["KR", "Kranfahrzeug", "1", 0],
|
||||
["RF", "Auftrag", "1", 0],
|
||||
[" ", " ", "0", 0],
|
||||
["FA", "Frühauftrag", "1", 0],
|
||||
["L1", "1 Tonne Nutzlast", "1", 0],
|
||||
["RK", "Rockinger Kupplung", "1", 0],
|
||||
[" ", " ", "0", 0]];
|
||||
var sales_tax_rate_sign_list = [["3", "19.00"],["2", "19.00"],["1", "0.00"],["4", "19.00"]];
|
||||
var ph=["20050101",
|
||||
"20050102",
|
||||
"20050108",
|
||||
"20050109",
|
||||
"20050115",
|
||||
"20050116",
|
||||
"20050122",
|
||||
"20050123",
|
||||
"20050129",
|
||||
"20050130",
|
||||
"20050205",
|
||||
"20050206",
|
||||
"20050212",
|
||||
"20050213",
|
||||
"20050219",
|
||||
"20050220",
|
||||
"20050226",
|
||||
"20050227",
|
||||
"20050305",
|
||||
"20050306",
|
||||
"20050312",
|
||||
"20050313",
|
||||
"20050319",
|
||||
"20050320",
|
||||
"20050325",
|
||||
"20050326",
|
||||
"20050327",
|
||||
"20050328",
|
||||
"20050402",
|
||||
"20050403",
|
||||
"20050409",
|
||||
"20050410",
|
||||
"20050416",
|
||||
"20050417",
|
||||
"20050423",
|
||||
"20050424",
|
||||
"20050430",
|
||||
"20050501",
|
||||
"20050505",
|
||||
"20050507",
|
||||
"20050508",
|
||||
"20050514",
|
||||
"20050515",
|
||||
"20050516",
|
||||
"20050521",
|
||||
"20050522",
|
||||
"20050528",
|
||||
"20050529",
|
||||
"20050604",
|
||||
"20050605",
|
||||
"20050611",
|
||||
"20050612",
|
||||
"20050618",
|
||||
"20050619",
|
||||
"20050625",
|
||||
"20050626",
|
||||
"20050702",
|
||||
"20050703",
|
||||
"20050709",
|
||||
"20050710",
|
||||
"20050716",
|
||||
"20050717",
|
||||
"20050723",
|
||||
"20050724",
|
||||
"20050730",
|
||||
"20050731",
|
||||
"20050806",
|
||||
"20050807",
|
||||
"20050813",
|
||||
"20050814",
|
||||
"20050820",
|
||||
"20050821",
|
||||
"20050827",
|
||||
"20050828",
|
||||
"20050903",
|
||||
"20050904",
|
||||
"20050910",
|
||||
"20050911",
|
||||
"20050917",
|
||||
"20050918",
|
||||
"20050924",
|
||||
"20050925",
|
||||
"20051001",
|
||||
"20051002",
|
||||
"20051003",
|
||||
"20051008",
|
||||
"20051009",
|
||||
"20051015",
|
||||
"20051016",
|
||||
"20051022",
|
||||
"20051023",
|
||||
"20051029",
|
||||
"20051030",
|
||||
"20051105",
|
||||
"20051106",
|
||||
"20051112",
|
||||
"20051113",
|
||||
"20051119",
|
||||
"20051120",
|
||||
"20051126",
|
||||
"20051127",
|
||||
"20051203",
|
||||
"20051204",
|
||||
"20051210",
|
||||
"20051211",
|
||||
"20051217",
|
||||
"20051218",
|
||||
"20051224",
|
||||
"20051225",
|
||||
"20051226",
|
||||
"20051231",
|
||||
"20060101",
|
||||
"20060107",
|
||||
"20060108",
|
||||
"20060114",
|
||||
"20060115",
|
||||
"20060121",
|
||||
"20060122",
|
||||
"20060128",
|
||||
"20060129",
|
||||
"20060204",
|
||||
"20060205",
|
||||
"20060211",
|
||||
"20060212",
|
||||
"20060218",
|
||||
"20060219",
|
||||
"20060225",
|
||||
"20060226",
|
||||
"20060304",
|
||||
"20060305",
|
||||
"20060311",
|
||||
"20060312",
|
||||
"20060318",
|
||||
"20060319",
|
||||
"20060325",
|
||||
"20060326",
|
||||
"20060401",
|
||||
"20060402",
|
||||
"20060408",
|
||||
"20060409",
|
||||
"20060414",
|
||||
"20060415",
|
||||
"20060416",
|
||||
"20060417",
|
||||
"20060422",
|
||||
"20060423",
|
||||
"20060429",
|
||||
"20060430",
|
||||
"20060501",
|
||||
"20060506",
|
||||
"20060507",
|
||||
"20060513",
|
||||
"20060514",
|
||||
"20060520",
|
||||
"20060521",
|
||||
"20060525",
|
||||
"20060527",
|
||||
"20060528",
|
||||
"20060603",
|
||||
"20060604",
|
||||
"20060605",
|
||||
"20060610",
|
||||
"20060611",
|
||||
"20060617",
|
||||
"20060618",
|
||||
"20060624",
|
||||
"20060625",
|
||||
"20060701",
|
||||
"20060702",
|
||||
"20060708",
|
||||
"20060709",
|
||||
"20060715",
|
||||
"20060716",
|
||||
"20060722",
|
||||
"20060723",
|
||||
"20060729",
|
||||
"20060730",
|
||||
"20060805",
|
||||
"20060806",
|
||||
"20060812",
|
||||
"20060813",
|
||||
"20060819",
|
||||
"20060820",
|
||||
"20060826",
|
||||
"20060827",
|
||||
"20060902",
|
||||
"20060903",
|
||||
"20060909",
|
||||
"20060910",
|
||||
"20060916",
|
||||
"20060917",
|
||||
"20060923",
|
||||
"20060924",
|
||||
"20060930",
|
||||
"20061001",
|
||||
"20061003",
|
||||
"20061007",
|
||||
"20061008",
|
||||
"20061014",
|
||||
"20061015",
|
||||
"20061021",
|
||||
"20061022",
|
||||
"20061028",
|
||||
"20061029",
|
||||
"20061104",
|
||||
"20061105",
|
||||
"20061111",
|
||||
"20061112",
|
||||
"20061118",
|
||||
"20061119",
|
||||
"20061125",
|
||||
"20061126",
|
||||
"20061202",
|
||||
"20061203",
|
||||
"20061209",
|
||||
"20061210",
|
||||
"20061216",
|
||||
"20061217",
|
||||
"20061223",
|
||||
"20061224",
|
||||
"20061225",
|
||||
"20061226",
|
||||
"20061230",
|
||||
"20061231"];
|
||||
var fz=[["01108", "01108", "5", "01108 DD-Weixdorf"],
|
||||
["01108", "01113", "8361", "01108 DD-Marsdorf"],
|
||||
["01156", "01117", "8362", "01156 DD-Gompitz"],
|
||||
["01156", "01120", "8363", "01156 DD-Mobschatz"],
|
||||
["01156", "01156", "10", "01156 DD-Altfranken"],
|
||||
["01326", "01326", "27", "01326 DD-A"],
|
||||
["01326", "01327", "8364", "01326 DD-B"],
|
||||
["01328", "01332", "8366", "01328 DD-Pappritz"],
|
||||
["01328", "01333", "8367", "01328 DD-Weißig"],
|
||||
["01328", "01331", "8365", "01328 DD-Schönfeld"],
|
||||
["01328", "01343", "8368", "01328 DD-Rossendorf"],
|
||||
["01445", "01441", "8369", "01445 Radebeul A"],
|
||||
["01445", "01445", "29", "01445 Radebeul B"],
|
||||
["01454", "01442", "8370", "01454 Radeberg"],
|
||||
["01454", "01454", "30", "01454 Wachau-OT Lomnitz"],
|
||||
["01454", "01450", "8371", "01454 Rossendorf"],
|
||||
["01454", "01451", "8372", "01454 Leppersdorf"],
|
||||
["01458", "01452", "8373", "01458 Ottendorf-Okrilla"],
|
||||
["01458", "01453", "8374", "01458 Medingen"],
|
||||
["01705", "01707", "8377", "01705 Freital-B"],
|
||||
["01705", "01705", "53", "01705 Freital"],
|
||||
["01705", "01706", "8376", "01705 Freital-A"],
|
||||
["01723", "01717", "8378", "01723 Kesselsdorf"],
|
||||
["01723", "01718", "8379", "01723 Wilsdruff"],
|
||||
["01728", "01721", "8380", "01723 Bannewitz"],
|
||||
["01728", "01722", "8381", "01728 Bannewitz"],
|
||||
["01796", "01797", "8383", "01796 Pirna-Neundorf"],
|
||||
["01796", "01796", "67", "01796 Pirna"]];
|
||||
var cr_id_order_list=[" 01705,<span style=\"color:red\"> 10:23 (24.11.)</span> - <i><b>1011</b>, Kombi<i></i>",
|
||||
" 01187,<span style=\"color:red\"> 16:24 (14.11.)</span> - <i><b>1012</b>, Bus<i></i>",
|
||||
" 01067,<span style=\"color:red\"> 12:48 (11.11.)</span> - <i><b>1013</b>, Kastenwagen<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>1014</b>, Großer Bus<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>1015</b>, LKW<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 20:40 (19.11.)</span> - <i><b>1016</b>, Bus<i></i>",
|
||||
" <span style=\"color:red\">.</span>,<span style=\"color:red\"> 11:48 (24.11.)</span> - <i><b>1017</b>, LKW<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=14737','Auftrag','scrollbars=yes,width=800,height=500');\"><i>14737 (01445->65474)</i></a>",
|
||||
" 01099,<span style=\"color:red\"> 11:40 (24.11.)</span> - <i><b>1018</b>, Kastenwagen<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=14805','Auftrag','scrollbars=yes,width=800,height=500');\"><i>14805 (<span style=\"color:red\">01307</span>->01065) <span style=\"color:green\">(24.11., 11:24)</span></i></a>",
|
||||
" 01139,<span style=\"color:red\"> 11:17 (24.11.)</span> - <i><b>1019</b>, Großer Bus<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=14799','Auftrag','scrollbars=yes,width=800,height=500');\"><i>14799 (<span style=\"color:red\">01139</span>->.) <span style=\"color:green\">(24.11., 11:17)</span></i></a>",
|
||||
" 01109,<span style=\"color:red\"> 11:49 (24.11.)</span> - <i><b>1020</b>, PKW<i></i>",
|
||||
" 01237,<span style=\"color:red\"> 15:17 (13.10.)</span> - <i><b>1021</b>, Bus<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>1022</b>, PKW<i></i>",
|
||||
" 01458,<span style=\"color:red\"> 11:41 (24.11.)</span> - <i><b>1023</b>, Bus<i></i>",
|
||||
" 01277,<span style=\"color:red\"> 09:33 (24.11.)</span> - <i><b>1024</b>, Großer Bus<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=14769','Auftrag','scrollbars=yes,width=800,height=500');\"><i>14769 (<span style=\"color:red\">01099</span>-><span style=\"color:red\">01139</span>->H-9027) <span style=\"color:green\">(24.11., 10:00)</span></i></a>",
|
||||
" 01257,<span style=\"color:red\"> 21:02 (23.11.)</span> - <i><b>1025</b>, Bus<i></i>",
|
||||
" 01309,<span style=\"color:red\"> 11:34 (24.11.)</span> - <i><b>1026</b>, Kastenwagen<i></i>",
|
||||
" 01189,<span style=\"color:red\"> 11:48 (24.11.)</span> - <i><b>1027</b>, Großer Bus<i></i>",
|
||||
" 01277,<span style=\"color:red\"> 11:50 (24.11.)</span> - <i><b>1028</b>, Bus<i></i>",
|
||||
" 01169,<span style=\"color:red\"> 11:10 (24.11.)</span> - <i><b>1029</b>, Bus<i></i>",
|
||||
" 01127,<span style=\"color:red\"> 11:38 (24.11.)</span> - <i><b>1030</b>, Kombi<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 11:52 (24.11.)</span> - <i><b>1031</b>, Kastenwagen<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=14493','Auftrag','scrollbars=yes,width=800,height=500');\"><i>14493 (04317->01067) <span style=\"color:green\">(24.11., 11:00)</span></i></a>, <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=14781','Auftrag','scrollbars=yes,width=800,height=500');\"><i>14781 (<span style=\"color:red\">01099</span>->.) <span style=\"color:green\">(24.11., 09:57)</span></i></a>",
|
||||
" 01099,<span style=\"color:red\"> 14:04 (18.10.)</span> - <i><b>1032</b>, Kombi<i></i>",
|
||||
" 01809,<span style=\"color:red\"> 17:45 (15.11.)</span> - <i><b>1033</b>, Bus<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>1034</b>, Bus<i></i>",
|
||||
" 01099,<span style=\"color:red\"> 11:49 (24.11.)</span> - <i><b>1035</b>, PKW<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=14809','Auftrag','scrollbars=yes,width=800,height=500');\"><i>14809 (01099->01239->01099) <span style=\"color:green\">(24.11., 11:48)</span></i></a>",
|
||||
" 01109,<span style=\"color:red\"> 11:25 (24.11.)</span> - <i><b>1036</b>, Bus<i></i>",
|
||||
" 01277,<span style=\"color:red\"> 11:50 (24.11.)</span> - <i><b>1038</b>, Kastenwagen<i></i>",
|
||||
" 01689,<span style=\"color:red\"> 11:44 (24.11.)</span> - <i><b>1039</b>, Großer Bus<i></i>",
|
||||
" 01099,<span style=\"color:red\"> 11:41 (24.11.)</span> - <i><b>1040</b>, PKW<i></i>",
|
||||
" 01945,<span style=\"color:red\"> 11:51 (24.11.)</span> - <i><b>1041</b>, PKW<i></i>",
|
||||
" <span style=\"color:red\">01067</span>,<span style=\"color:red\"> 11:29 (24.11.)</span> - <i><b>1042</b>, Großer Bus<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=14740','Auftrag','scrollbars=yes,width=800,height=500');\"><i>14740 (01445->23611)</i></a>",
|
||||
" .,<span style=\"color:red\"> 10:46 (24.11.)</span> - <i><b>1044</b>, Kastenwagen<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=14775','Auftrag','scrollbars=yes,width=800,height=500');\"><i>14775 (<span style=\"color:red\">01462</span>->.) <span style=\"color:green\">(24.11., 09:31)</span></i></a>",
|
||||
" 01067,<span style=\"color:red\"> 12:48 (11.11.)</span> - <i><b>1045</b>, Bus<i></i>",
|
||||
" 10555,<span style=\"color:red\"> 15:56 (14.11.)</span> - <i><b>1046</b>, Kombi<i></i>",
|
||||
" 01796,<span style=\"color:red\"> 22:02 (19.11.)</span> - <i><b>1048</b>, Bus<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>1049</b>, Bus<i></i>",
|
||||
" 14109,<span style=\"color:red\"> 11:43 (24.11.)</span> - <i><b>1050</b>, Großer Bus<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=14684','Auftrag','scrollbars=yes,width=800,height=500');\"><i>14684 (<span style=\"color:red\">14109</span>->01109) <span style=\"color:green\">(24.11., 08:00)</span></i></a>",
|
||||
" <span style=\"color:red\">01239</span>,<span style=\"color:red\"> 11:30 (24.11.)</span> - <i><b>1051</b>, Großer Bus<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=14642','Auftrag','scrollbars=yes,width=800,height=500');\"><i>14642 (01309->01099)</i></a>",
|
||||
" 01157,<span style=\"color:red\"> 11:50 (24.11.)</span> - <i><b>1053</b>, Kastenwagen<i></i>",
|
||||
" 01277,<span style=\"color:red\"> 12:59 (22.11.)</span> - <i><b>1054</b>, Großer Bus<i></i>",
|
||||
" 01309,<span style=\"color:red\"> 11:39 (18.11.)</span> - <i><b>1055</b>, Kastenwagen<i></i>",
|
||||
" 01217,<span style=\"color:red\"> 17:32 (23.11.)</span> - <i><b>1057</b>, Kombi<i></i>",
|
||||
" 01139,<span style=\"color:red\"> 11:43 (24.11.)</span> - <i><b>1058</b>, Bus<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=14808','Auftrag','scrollbars=yes,width=800,height=500');\"><i>14808 (<span style=\"color:red\">01139</span>->01108) <span style=\"color:green\">(24.11., 11:43)</span></i></a>",
|
||||
" 01309,<span style=\"color:red\"> 17:28 (23.11.)</span> - <i><b>1060</b>, Bus<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 15:25 (06.10.)</span> - <i><b>1062</b>, Kastenwagen<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>1064</b>, Kombi<i></i>",
|
||||
" 01189,<span style=\"color:red\"> 15:28 (14.11.)</span> - <i><b>1065</b>, Bus<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 19:13 (27.10.)</span> - <i><b>1066</b>, Kastenwagen<i></i>",
|
||||
" 01189,<span style=\"color:red\"> 11:31 (24.11.)</span> - <i><b>1069</b>, Kombi<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=14806','Auftrag','scrollbars=yes,width=800,height=500');\"><i>14806 (01309->01307) <span style=\"color:green\">(24.11., 11:27)</span></i></a>",
|
||||
" 01189,<span style=\"color:red\"> 11:47 (24.11.)</span> - <i><b>1070</b>, Großer Bus<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=14726','Auftrag','scrollbars=yes,width=800,height=500');\"><i>14726 (.->01796) <span style=\"color:green\">(24.11., 10:00)</span></i></a>",
|
||||
" 01219,<span style=\"color:red\"> 11:32 (24.11.)</span> - <i><b>1071</b>, Bus<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=14807','Auftrag','scrollbars=yes,width=800,height=500');\"><i>14807 (01257->89537) <span style=\"color:green\">(24.11., 12:00)</span></i></a>",
|
||||
" 01796,<span style=\"color:red\"> 11:45 (24.11.)</span> - <i><b>1072</b>, LKW<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=14755','Auftrag','scrollbars=yes,width=800,height=500');\"><i>14755 (01723->09337->09111) <span style=\"color:green\">(24.11., 08:14)</span></i></a>",
|
||||
" 01159,<span style=\"color:red\"> 11:46 (24.11.)</span> - <i><b>1073</b>, Kastenwagen<i></i>",
|
||||
" 01069,<span style=\"color:red\"> 17:50 (23.11.)</span> - <i><b>1076</b>, Kombi<i></i>",
|
||||
" 01259,<span style=\"color:red\"> 11:29 (24.11.)</span> - <i><b>1077</b>, PKW<i></i>",
|
||||
" 01728,<span style=\"color:red\"> 11:19 (23.11.)</span> - <i><b>1080</b>, Großer Bus<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>1081</b>, PKW<i></i>",
|
||||
" 01099,<span style=\"color:red\"> 10:50 (24.11.)</span> - <i><b>1086</b>, Kombi<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=14783','Auftrag','scrollbars=yes,width=800,height=500');\"><i>14783 (<span style=\"color:red\">01099</span>-><span style=\"color:red\">.</span>->.) <span style=\"color:green\">(24.11., 10:00)</span></i></a>",
|
||||
" 01157,<span style=\"color:red\"> 22:01 (21.10.)</span> - <i><b>1087</b>, Großer Bus<i></i>",
|
||||
" .,<span style=\"color:red\"> 16:50 (21.11.)</span> - <i><b>1089</b>, Großer Bus<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>1090</b>, Kombi<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 19:42 (23.11.)</span> - <i><b>1091</b>, Großer Bus<i></i>",
|
||||
" 01099,<span style=\"color:red\"> 08:46 (24.11.)</span> - <i><b>1092</b>, Bus<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=14763','Auftrag','scrollbars=yes,width=800,height=500');\"><i>14763 (<span style=\"color:red\">02689</span>->99610) <span style=\"color:green\">(24.11., 08:44)</span></i></a>",
|
||||
" 01307,<span style=\"color:red\"> 17:33 (23.11.)</span> - <i><b>1094</b>, Bus<i></i>",
|
||||
" 01139,<span style=\"color:red\"> 00:40 (24.11.)</span> - <i><b>1095</b>, Großer Bus<i></i>",
|
||||
" 01099,<span style=\"color:red\"> 16:48 (23.11.)</span> - <i><b>1096</b>, Kastenwagen<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>1099</b>, Großer Bus<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 08:19 (15.11.)</span> - <i><b>1777</b>, LKW<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>1888</b>, Großer Bus<i></i>",
|
||||
" 01099,<span style=\"color:red\"> 11:40 (24.11.)</span> - <i><b>2018</b>, Kombi<i></i>",
|
||||
" 01217,<span style=\"color:red\"> 17:32 (23.11.)</span> - <i><b>2057</b>, PKW<i></i>",
|
||||
" .,<span style=\"color:red\"> 10:46 (24.11.)</span> - <i><b>2244</b>, Kombi<i></i>",
|
||||
" 01219,<span style=\"color:red\"> 11:32 (24.11.)</span> - <i><b>2271</b>, PKW<i></i>",
|
||||
" 01156,<span style=\"color:red\"> 13:01 (20.10.)</span> - <i><b>schicht</b>, Fahrrad<i></i>",
|
||||
" 01156,<span style=\"color:red\"> 13:01 (20.10.)</span> - <i><b>schicht2</b>, Fahrrad<i></i>"];
|
||||
var cr_id_order_list2=[];
|
||||
var vht_id_str=[];
|
||||
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* job_options.js.inc.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
$check_jb_permanent_flag = true;
|
||||
include_once("../include/dbglobal.inc.php");
|
||||
include_once("../include/inc_check_publicholiday.inc.php");
|
||||
include_once("../include/caglobal.inc.php");
|
||||
include_once("../include/global.inc.php");
|
||||
trace_execution_time_start();
|
||||
|
||||
$hq_id = HQ_ID_DEFAULT;
|
||||
|
||||
$sqlquery = "SELECT tax.tx_id, tax.tx_value FROM tax";
|
||||
$res = $db->query($sqlquery);
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlquery': " . $res->getMessage());
|
||||
$sales_tax_rate_sign_list = "var sales_tax_rate_sign_list = [";
|
||||
$i = 0;
|
||||
while ($row = $res->fetch_assoc()):
|
||||
if ($i++ > 0)
|
||||
$sales_tax_rate_sign_list .= ",";
|
||||
$sales_tax_rate_sign_list .= "[\"" . $row["tx_id"] . "\", \"" . $row["tx_value"] . "\"]";
|
||||
endwhile;
|
||||
$res->free();
|
||||
$sales_tax_rate_sign_list .= "];\n";
|
||||
|
||||
$sqlquery = "SELECT crf_short, crf_text, crf_status FROM courierfilter ORDER BY crf_short";
|
||||
$res = $db->query($sqlquery);
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlquery': " . $res->getMessage());
|
||||
// die Kurier-Filter sollen alphabetisch von oben nach unten statt von links nach rechts sortiert sein...
|
||||
// deshalb erst einmal die Daten aus der Abfrage übernehmen...
|
||||
$crf_rows = array();
|
||||
while ($row = $res->fetch_assoc()):
|
||||
$crf_rows[] = $row;
|
||||
endwhile;
|
||||
$res->free();
|
||||
// ... und dann umsortieren ...
|
||||
// die Filter werden von rechts nach links aufgebaut, also müssen sie hier
|
||||
// erst in die richtige Reihenfolge gebracht werden, so dass am Schluss
|
||||
// die sichtbare Reihenfolge von oben nach unten ist
|
||||
$courierfilter_list = "var cfl=[";
|
||||
$crf_rows_rows = 4; // 4 Spalten
|
||||
$crf_rows_lines = ceil(count($crf_rows) / $crf_rows_rows); // ergibt x Zeilen
|
||||
for ($j = 0; $j < $crf_rows_lines; $j++):
|
||||
for ($k = 0; $k < $crf_rows_rows; $k++):
|
||||
$i = ($k * $crf_rows_lines + $j);
|
||||
if ($courierfilter_list != "var cfl=[")
|
||||
$courierfilter_list .= ",\n";
|
||||
if ($i < count($crf_rows)):
|
||||
$courierfilter_list .=
|
||||
"[\"" . $crf_rows[$i]["crf_short"] . "\", \"" . $crf_rows[$i]["crf_text"] . "\", \"" . $crf_rows[$i]["crf_status"] . "\", 0]";
|
||||
else:
|
||||
$courierfilter_list .=
|
||||
"[\"" . " " . "\", \"" . " " . "\", \"0\", 0]";
|
||||
endif;
|
||||
endfor;
|
||||
endfor;
|
||||
$courierfilter_list .= "];\n";
|
||||
|
||||
$ph_list = getPublicHolidays(getDateTime("year"), "1", "0");
|
||||
$js_ph_list = "var ph=[";
|
||||
$js_ph_list_prev = "";
|
||||
$j = 0;
|
||||
for ($i = 0; $i < count($ph_list); $i++):
|
||||
$js_ph_list_cur = $ph_list[$i][0] . sprintf("%02d", $ph_list[$i][1]) . sprintf("%02d", $ph_list[$i][2]);
|
||||
if ($js_ph_list_prev != $js_ph_list_cur):
|
||||
if ($i > 0)
|
||||
$js_ph_list .= ",\n";
|
||||
$js_ph_list .= "\"" . $js_ph_list_cur . "\"";
|
||||
$js_ph_list_prev = $js_ph_list_cur;
|
||||
endif;
|
||||
endfor;
|
||||
$js_ph_list .= "];\n";
|
||||
|
||||
// get fake-zipcodes from DB
|
||||
$sqlquery = "SELECT distinct srvp1.srvp_plz AS srvp_plz_source, srvp2.srvp_plz AS srvp_plz_target, srva_id, srva2_id, srvsam_name" .
|
||||
" FROM serviceplz AS srvp1, serviceplz AS srvp2, servicesubareamapping AS srvsam" .
|
||||
" WHERE srvp1.srvp_id = srvsam.srva_id AND srvp2.srvp_id = srvsam.srva2_id ORDER BY srvp1.srvp_plz, srvsam_sort";
|
||||
$res = $db->query($sqlquery);
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlquery': " . $res->getMessage());
|
||||
$i = 0;
|
||||
$js_fz_list = "var fz=[";
|
||||
while ($row = $res->fetch_assoc()):
|
||||
if ($i++ > 0)
|
||||
$js_fz_list .= ",\n";
|
||||
$js_fz_list .= "[\"" . $row['srvp_plz_source'] . "\", \"" . $row['srvp_plz_target'] . "\", \""
|
||||
. $row['srva2_id'] . "\", \"" . $row['srvsam_name'] . "\"]";
|
||||
endwhile;
|
||||
$res->free();
|
||||
$js_fz_list .= "];\n";
|
||||
|
||||
// // wenn MASK_AUTO_REFRESH == 0, dann wird die Kurierliste dynamisch (bei Aufruf) aufgebaut
|
||||
// // wenn MASK_AUTO_REFRESH == 1, dann wird die Kurierliste statisch (hier) aufgebaut
|
||||
// if (MASK_AUTO_REFRESH == "1"):
|
||||
include("job_courier.inc.php");
|
||||
$cr_id_order_list .=
|
||||
"var cr_id_order_list2=[];\n" .
|
||||
"var vht_id_str=[];\n";
|
||||
// endif;
|
||||
|
||||
$fileHandle = @fopen("../jobs/job_options.js", 'w');
|
||||
@fwrite($fileHandle, $courierfilter_list . $sales_tax_rate_sign_list . $js_ph_list . $js_fz_list . $cr_id_order_list);
|
||||
@fclose($fileHandle);
|
||||
writeLog_("../log/job_options.js.inc_", trace_execution_time_stop() . " '../jobs/job_options.js' updated");
|
||||
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,212 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* job_tour.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
include_once("../include/global.inc.php");
|
||||
include_once("../include/caglobal.inc.php");
|
||||
include_once("../include/auth.inc.php");
|
||||
include_once("../jobs2/job_accesskeys.inc.php");
|
||||
//if ($phpVersion >= "7.0"):
|
||||
// require_once("../PEAR/HTML/Template/IT.php");
|
||||
//else:
|
||||
// require_once("HTML/IT.php");
|
||||
//endif;
|
||||
|
||||
//list ($csc_id_orderer) =
|
||||
getSecHttpVars("1", array("csc_id_orderer"));
|
||||
if ($csc_id_orderer == "" && $csc_id_orderer != '0') reportDie ("$PHP_SELF: Parameter 'csc_id_orderer' fehlt!", false);
|
||||
$cs_id = getFieldValueFromId("costcenter", "csc_id", "$csc_id_orderer", "cs_id");
|
||||
$csc_id_sel = $csc_id_orderer;
|
||||
$von_csc_id_options = addOptionsFromTable("costcenter, costcenteraddress",
|
||||
"costcenter.csc_id", "costcenter.csc_name", "costcenter.csc_name",
|
||||
"costcenter.csc_id = costcenteraddress.csc_id AND " .
|
||||
"costcenter.cs_id = '$cs_id' AND costcenteraddress.adt_id = '4'", $csc_id_sel);
|
||||
$nach_csc_id_options = addOptionsFromTable("costcenter, costcenteraddress",
|
||||
"costcenter.csc_id", "costcenter.csc_name", "costcenter.csc_name",
|
||||
"costcenter.csc_id = costcenteraddress.csc_id AND " .
|
||||
"costcenter.cs_id = '$cs_id' AND costcenteraddress.adt_id = '4'");
|
||||
|
||||
//if ($phpVersion >= "7.0"):
|
||||
// $tpl = new HTML_Template_IT();
|
||||
//else:
|
||||
// $tpl = new IntegratedTemplate();
|
||||
//endif;
|
||||
//$tpl->loadTemplatefile("job_tour.tpl.htm", true, true);
|
||||
$output = file_get_contents("job_tour.tpl.htm");
|
||||
//$tpl->setCurrentBlock("touroptions");
|
||||
//$tpl->setVariable("_von_csc_id_options_", $von_csc_id_options);
|
||||
$output = str_replace("{_von_csc_id_options_}", $von_csc_id_options, $output);
|
||||
$output = str_replace("{_nach_csc_id_options_}", $nach_csc_id_options, $output);
|
||||
if (getParameterValue($emp_id, "MODE_LATER_JOB") == "1"):
|
||||
$output = str_replace("{EMP_MODE_LATERJOB_START}", "", $output);
|
||||
$output = str_replace("{EMP_MODE_LATERJOB_END}", "", $output);
|
||||
else:
|
||||
$output = str_replace("{EMP_MODE_LATERJOB_START}", "<!--", $output);
|
||||
$output = str_replace("{EMP_MODE_LATERJOB_END}", "-->", $output);
|
||||
endif;
|
||||
|
||||
if (MASK_CASH_PAYER_SELECT != "1"):
|
||||
$output = str_replace("{PAYER_TEXT}", "Rechnungszahler", $output);
|
||||
$output = str_replace("{COSTSPLIT_TEXT}", "Kosten werden aufgeteilt", $output);
|
||||
$output = str_replace("{COSTSPLIT_TITLE}", "Kosten splitten", $output);
|
||||
else:
|
||||
$output = str_replace("{PAYER_TEXT}", "Bezahler", $output);
|
||||
$output = str_replace("{COSTSPLIT_TEXT}", "Rechnungszahlung", $output);
|
||||
$output = str_replace("{COSTSPLIT_TITLE}", "Rechnung an Bezahler", $output);
|
||||
endif;
|
||||
|
||||
if ($csc_id_orderer != '0'):
|
||||
// Kundenauftrag
|
||||
$output = str_replace("{_is_customer_}", "1", $output);
|
||||
$output = str_replace("{CUSTOMER_DISABLED_START}", "<!--", $output);
|
||||
$output = str_replace("{CUSTOMER_DISABLED_END}", "-->", $output);
|
||||
if (MASK_CUSTOMER_SHOW_PRICEQUERY != "1" || getFieldValueFromId("customer", "cs_id", $cs_id, "cs_invmode") == 0):
|
||||
$output = str_replace("{MASK_CUSTOMER_PRICEQUERY_DISABLED_START}", "<!--", $output);
|
||||
$output = str_replace("{MASK_CUSTOMER_PRICEQUERY_DISABLED_END}", "-->", $output);
|
||||
else:
|
||||
$output = str_replace("{MASK_CUSTOMER_PRICEQUERY_DISABLED_START}", "", $output);
|
||||
$output = str_replace("{MASK_CUSTOMER_PRICEQUERY_DISABLED_END}", "", $output);
|
||||
endif;
|
||||
if (MASK_CUSTOMER_SHOW_REMARK != "1"):
|
||||
$output = str_replace("{MASK_CUSTOMER_SHOW_REMARK_DISABLED}", "display:none", $output);
|
||||
else:
|
||||
$output = str_replace("{MASK_CUSTOMER_SHOW_REMARK_DISABLED}", "", $output);
|
||||
endif;
|
||||
if (getFieldValueFromClause("parameter", "par_value", "par_key='MASK_CUST_SET_PAYER_" . $cs_id . "'") != "1"):
|
||||
$output = str_replace("{MASK_CUST_SET_PAYER_DISABLED_START}", "<!--", $output);
|
||||
$output = str_replace("{MASK_CUST_SET_PAYER_DISABLED_END}", "-->", $output);
|
||||
else:
|
||||
$output = str_replace("{MASK_CUST_SET_PAYER_DISABLED_START}", "", $output);
|
||||
$output = str_replace("{MASK_CUST_SET_PAYER_DISABLED_END}", "", $output);
|
||||
endif;
|
||||
if (MASK_CUST_ALL_ADDR_ENABLED != "1"):
|
||||
$output = str_replace("{MASK_CUST_ALL_ADDR_DISABLED_START}", "<!--", $output);
|
||||
$output = str_replace("{MASK_CUST_ALL_ADDR_DISABLED_END}", "-->", $output);
|
||||
else:
|
||||
$output = str_replace("{MASK_CUST_ALL_ADDR_DISABLED_START}", "<!--", $output);
|
||||
$output = str_replace("{MASK_CUST_ALL_ADDR_DISABLED_END}", "-->", $output);
|
||||
endif;
|
||||
if (getFieldValueFromClause("parameter", "par_value", "par_key='MASK_CUST_AD_COUNTRY_DISABLED_" . $cs_id . "'") == "1"):
|
||||
$output = str_replace("{_ad_country_disabled_}", "disabled", $output);
|
||||
else:
|
||||
$output = str_replace("{_ad_country_disabled_}", "", $output);
|
||||
endif;
|
||||
if (getFieldValueFromClause("parameter", "par_value", "par_key='MASK_CS_DONT_SHOW_STANDARD_PRICE_" . $usr_id . "'") == "1" || getParameterValue("0", "CUSTOMER_MASK_CALCULATOR_USAGE_ONLY_" . $cs_id, "0") == "1"):
|
||||
$output = str_replace("{_currentPrice_hidden_}", "style=\"visibility:hidden;\"", $output);
|
||||
$output = str_replace("{STANDARD_PRICE_HIDDEN_START}", "<!--", $output);
|
||||
$output = str_replace("{STANDARD_PRICE_HIDDEN_END}", "-->", $output);
|
||||
else:
|
||||
$output = str_replace("{_currentPrice_hidden_}", "", $output);
|
||||
$output = str_replace("{STANDARD_PRICE_HIDDEN_START}", "", $output);
|
||||
$output = str_replace("{STANDARD_PRICE_HIDDEN_END}", "", $output);
|
||||
endif;
|
||||
else:
|
||||
$output = str_replace("{_is_customer_}", "0", $output);
|
||||
endif;
|
||||
|
||||
$JB_DISPOINFO_ENABLED_CS_IDS = $db->getOne("SELECT par_text FROM parameter WHERE hq_id = " . $hq_id . " AND par_key = 'JB_DISPOINFO_ENABLED_CS_IDS'", $output);
|
||||
if (!in_array ($cs_id, explode(",", $JB_DISPOINFO_ENABLED_CS_IDS))):
|
||||
$output = str_replace("{JB_DISPOINFO_DISABLED_START}", "<!--", $output);
|
||||
$output = str_replace("{JB_DISPOINFO_DISABLED_END}", "-->", $output);
|
||||
else:
|
||||
$output = str_replace("{JB_DISPOINFO_DISABLED_START}", "", $output);
|
||||
$output = str_replace("{JB_DISPOINFO_DISABLED_END}", "", $output);
|
||||
endif;
|
||||
|
||||
if ($db->getOne("SELECT cs_id from customer WHERE cs_id_parent = " . $cs_id) == "") {
|
||||
$output = str_replace("{THIRDPAYER_DISABLED_START}", "<!--", $output);
|
||||
$output = str_replace("{THIRDPAYER_DISABLED_END}", "-->", $output);
|
||||
} else{
|
||||
$output = str_replace("{THIRDPAYER_DISABLED_START}", "", $output);
|
||||
$output = str_replace("{THIRDPAYER_DISABLED_END}", "", $output);
|
||||
}
|
||||
|
||||
$_von_ad_country_options_ = addOptionsFromTable("phoenix_special.country","cou_iso_2","cou_iso_2","cou_iso_2","cou_continent = '1'","DE");
|
||||
$_nach_ad_country_options_ = addOptionsFromTable("phoenix_special.country","cou_iso_2","cou_iso_2","cou_iso_2","cou_continent = '1'","DE");
|
||||
$output = str_replace("{_von_ad_country_options_}", $_von_ad_country_options_, $output);
|
||||
$output = str_replace("{_nach_ad_country_options_}", $_nach_ad_country_options_, $output);
|
||||
|
||||
// *** TABINDICES ***
|
||||
$ti = 0;
|
||||
$output = str_replace("{_von_cs_comp_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_von_tr_person_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_von_ad_street_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_von_tr_hsno_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_von_ad_country_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_von_ad_zipcode_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_von_ad_city_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_von_tr_remark_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_nach_cs_comp_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_nach_tr_person_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_nach_ad_street_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_nach_tr_hsno_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_nach_ad_country_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_nach_ad_zipcode_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_nach_ad_city_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_nach_tr_remark_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_von_tr_commission_no_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_von_tr_commission_no_accesskey_}", _VON_TR_COMMISSION_NO_ACCESSKEY_, $output);
|
||||
$output = str_replace("{_nach_tr_commission_no_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_nach_tr_commission_no_accesskey_}", _NACH_TR_COMMISSION_NO_ACCESSKEY_, $output);
|
||||
$output = str_replace("{_nach_tr_tracking_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_von_tr_tracking_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_tr_ware_from_von_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_tr_ware_to_von_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_tr_ware_from_nach_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_tr_ware_to_nach_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_payer_from_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_payer_to_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_vonFirmaButton_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_vonFirmaButton_accesskey_}", _VONFIRMABUTTON_ACCESSKEY_, $output);
|
||||
$output = str_replace("{_vonAdressButton_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_vonAdressButton_accesskey_}", _VONADRESSBUTTON_ACCESSKEY_, $output);
|
||||
$output = str_replace("{_von_tr_mediationarea_id_Button_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_von_tr_remark_Button_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_von_tr_remark_Button_accesskey_}", _VON_TR_REMARK_BUTTON_ACCESSKEY_, $output);
|
||||
$output = str_replace("{_hide_von_tr_remark_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_nachFirmaButton_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_nachFirmaButton_accesskey_}", _NACHFIRMABUTTON_ACCESSKEY_, $output);
|
||||
$output = str_replace("{_nachAdressButton_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_nachAdressButton_accesskey_}", _NACHADRESSBUTTON_ACCESSKEY_, $output);
|
||||
$output = str_replace("{_nach_tr_mediationarea_id_Button_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_hide_nach_tr_remark_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_nach_tr_remark_Button_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_nach_tr_remark_Button_accesskey_}", _NACH_TR_REMARK_BUTTON_ACCESSKEY_, $output);
|
||||
$output = str_replace("{_bezahlerFirmaButton_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_bezahlerFirmaButton_accesskey_}", _BEZAHLERFIRMABUTTON_ACCESSKEY_, $output);
|
||||
$output = str_replace("{_jb_cash_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_jb_cash_accesskey_}", _JB_CASH_ACCESSKEY_, $output);
|
||||
$output = str_replace("{_jb_costsplit_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_jb_costsplit_accesskey_}", _JB_COSTSPLIT_ACCESSKEY_, $output);
|
||||
$output = str_replace("{_accept_all_addresses_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_accept_all_addresses_accesskey_}", _ACCEPT_ALL_ADDRESSES_ACCESSKEY_, $output);
|
||||
$output = str_replace("{_prevButton_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_prevButton_accesskey_}", _PREVBUTTON_ACCESSKEY_, $output);
|
||||
$output = str_replace("{_waste1Button_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_waste1Button_accesskey_}", _WASTE1BUTTON_ACCESSKEY_, $output);
|
||||
$output = str_replace("{_switchButton_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_switchButton_accesskey_}", _SWITCHBUTTON_ACCESSKEY_, $output);
|
||||
$output = str_replace("{_waste2Button_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_waste2Button_accesskey_}", _WASTE2BUTTON_ACCESSKEY_, $output);
|
||||
$output = str_replace("{_nextButton_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_nextButton_accesskey_}", _NEXTBUTTON_ACCESSKEY_, $output);
|
||||
$output = str_replace("{_searchOldJobButton_tabindex_}", ++$ti, $output);
|
||||
//$output = str_replace("{_searchOldJobButton_accesskey_}", _SEARCHOLDJOBBUTTON_ACCESSKEY_, $output);
|
||||
$output = str_replace("{_duplicateJobButton_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_getLastJobButton_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_duplicateJobButton_accesskey_}", _DUPLICATEJOBBUTTON_ACCESSKEY_, $output);
|
||||
$output = str_replace("{_jb_freetextButton_tabindex_}", ++$ti, $output);
|
||||
$output = str_replace("{_jb_freetextButton_accesskey_}", _JB_FREETEXTBUTTON_ACCESSKEY_, $output);
|
||||
// *** ***
|
||||
//$tpl->parseCurrentBlock("touroptions");
|
||||
//include("..\jobs\shrink.inc.php");
|
||||
//$html_code = $tpl->get();
|
||||
//echo htmlShrink($html_code, true);
|
||||
//$tpl->show();
|
||||
echo $output;
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,44 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>votian: Auftragserfassung - Tourendaten</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/phoenix.css">
|
||||
</head>
|
||||
<body>
|
||||
<table border=0 width=100% align=center cellspacing=0 cellpadding=0 vspace=0 hspace=0>
|
||||
<tr>
|
||||
<td colspan=3>
|
||||
<hr noshade size="1">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=10%>
|
||||
|
||||
</td>
|
||||
<td width=80% align=center valign=top>
|
||||
<div class=headline2>
|
||||
Tourendaten (Etappen)
|
||||
</div>
|
||||
</td>
|
||||
<td width=10%>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td align=center>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=3>
|
||||
<img src="../images/empty.gif" border=0 height=2>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* getTournames.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
//require_once("HTML/IT.php");
|
||||
include_once("../include/global.inc.php");
|
||||
|
||||
list ($jb_id) = getHttpVars(array("jb_id"));
|
||||
updateStmt("job", "jb_id", $jb_id, array("jb_locktime", NULL, "jb_lockuser", NULL));
|
||||
|
||||
//$tpl = new IntegratedTemplate();
|
||||
//$tpl->loadTemplatefile("job_tour_list.htm", true, true);
|
||||
////$tpl->setCurrentBlock("javascript");
|
||||
////$tpl->setVariable("_auto_refresh_", MASK_AUTO_REFRESH);
|
||||
////$tpl->parseCurrentBlock("javascript");
|
||||
//$tpl->show();
|
||||
$output = file_get_contents("job_tour_list.htm");
|
||||
echo $output;
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,279 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* get_address.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
require_once("HTML/IT.php");
|
||||
include_once("../include/caglobal.inc.php");
|
||||
include_once("../include/global.inc.php");
|
||||
include_once("../include/services_func.inc.php");
|
||||
|
||||
$hq_id = $HTTP_SESSION_VARS['hq_id'];
|
||||
|
||||
list ($zipcode1, $zipcode2, $zipcode3, $zipcode4, $zipcode5, $zipcode6, $vht_id) =
|
||||
getHttpVars(array("zipcode1", "zipcode2", "zipcode3", "zipcode4", "zipcode5", "zipcode6", "vht_id"));
|
||||
//if ($zipcode1 == "" || $zipcode2 == "" || $vht_id == "") myDie ("$PHP_SELF: Parameter fehlt!");
|
||||
|
||||
// Der Normalfall
|
||||
$cs_invmode_default = -1;
|
||||
// Besonderheit in Berlin: Zuerst Bereichs-Preise ermitteln ...
|
||||
if ($hq_id == 3):
|
||||
$cs_invmode_default = 2;
|
||||
endif;
|
||||
|
||||
$grundpreis = 0;
|
||||
list($tmpGrundpreis, $plzpreis1) = getPrice($zipcode1, $zipcode2, $cs_invmode_default);
|
||||
if ($tmpGrundpreis > 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 = "<span style=\"color:red\">" . "VON $area_name1 NACH $area_name2" . "</span>";
|
||||
$area_names2 = "<span style=\"color:red\">" . "VON $area_name2 NACH $area_name3" . "</span>";
|
||||
$area_names3 = "<span style=\"color:red\">" . "VON $area_name3 NACH $area_name4" . "</span>";
|
||||
$area_names4 = "<span style=\"color:red\">" . "VON $area_name4 NACH $area_name5" . "</span>";
|
||||
$area_names5 = "<span style=\"color:red\">" . "VON $area_name5 NACH $area_name6" . "</span>";
|
||||
|
||||
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
|
||||
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n" .
|
||||
"<html lang=\"de\">\n" .
|
||||
"<head>\n" .
|
||||
"<title>Mi2ju: Preisanfrage</title>\n" .
|
||||
"<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/phoenix.css\">\n" .
|
||||
"<script type=\"text/javascript\">\n" .
|
||||
"<!" . "--\n" .
|
||||
"var curZipcode = \"\";\n" .
|
||||
"\n" .
|
||||
"function searchAddress() {\n" .
|
||||
"\n" .
|
||||
"/* switch (curZipcode)\n" .
|
||||
" {\n" .
|
||||
" case 1:\n" .
|
||||
" f_zipcode = document.forms[0].zipcode1.value;\n" .
|
||||
" break;\n" .
|
||||
" case 2:\n" .
|
||||
" f_zipcode = document.forms[0].zipcode2.value;\n" .
|
||||
" break;\n" .
|
||||
" case 3:\n" .
|
||||
" f_zipcode = document.forms[0].zipcode3.value;\n" .
|
||||
" break;\n" .
|
||||
" case 4:\n" .
|
||||
" f_zipcode = document.forms[0].zipcode4.value;\n" .
|
||||
" break;\n" .
|
||||
" case 5:\n" .
|
||||
" f_zipcode = document.forms[0].zipcode5.value;\n" .
|
||||
" break;\n" .
|
||||
" case 6:\n" .
|
||||
" f_zipcode = document.forms[0].zipcode6.value;\n" .
|
||||
" break;\n" .
|
||||
" default:\n" .
|
||||
" f_zipcode = \"\";\n" .
|
||||
" break;\n" .
|
||||
" } */ \n" .
|
||||
" if (curZipcode == \"\") curZipcode = 'price_query1';\n" .
|
||||
" var widthPopupWin = 800;\n" .
|
||||
" var heightPopupWin = 600;\n" .
|
||||
" var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;\n" .
|
||||
" var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;\n" .
|
||||
" var popupWin;\n" .
|
||||
" popupWin = window.open(\"../admin/ad_list.php?f_act=search&f_zipcode=\" /* + f_zipcode */ + \"&tourno=\" + curZipcode, \"\",\"dependent=yes,width=\" + widthPopupWin + \",height=\" + heightPopupWin +\",left=\" + leftPopupWin + \",top=\" + topPopupWin + \",scrollbars=yes,resizable=yes,status=no\");\n" .
|
||||
"}\n" .
|
||||
"\n" .
|
||||
"function doFocus(){\n" .
|
||||
" document.forms[0].zipcode1.focus();\n" .
|
||||
" if (document.forms[0].zipcode6.value == \"\")\n" .
|
||||
" document.forms[0].zipcode6.focus();\n" .
|
||||
" if (document.forms[0].zipcode5.value == \"\")\n" .
|
||||
" document.forms[0].zipcode5.focus();\n" .
|
||||
" if (document.forms[0].zipcode4.value == \"\")\n" .
|
||||
" document.forms[0].zipcode4.focus();\n" .
|
||||
" if (document.forms[0].zipcode3.value == \"\")\n" .
|
||||
" document.forms[0].zipcode3.focus();\n" .
|
||||
" if (document.forms[0].zipcode2.value == \"\")\n" .
|
||||
" document.forms[0].zipcode2.focus();\n" .
|
||||
" if (document.forms[0].zipcode1.value == \"\")\n" .
|
||||
" document.forms[0].zipcode1.focus();\n" .
|
||||
"}\n" .
|
||||
"\n" .
|
||||
"function doDelete(){\n" .
|
||||
" self.location.href=\"../jobs/price_query.php?zipcode1=&zipcode2=&vht_id=" . getFieldValueFromId("headquarters", "hq_id", "$hq_id", "hq_vht_default") . "\";\n" .
|
||||
"}\n" .
|
||||
"\n" .
|
||||
"function updatePrice(){\n" .
|
||||
" if (document.forms[0].zipcode1.value != '' && document.forms[0].zipcode2.value != '')\n" .
|
||||
" self.location.href=\"../jobs/price_query.php?zipcode1=\" + document.forms[0].zipcode1.value + \"&zipcode2=\" + document.forms[0].zipcode2.value + \"&zipcode3=\" + document.forms[0].zipcode3.value + \"&zipcode4=\" + document.forms[0].zipcode4.value + \"&zipcode5=\" + document.forms[0].zipcode5.value + \"&zipcode6=\" + document.forms[0].zipcode6.value + \"&vht_id=\" + document.forms[0].vht_id.value;\n" .
|
||||
"}\n" .
|
||||
"\n" .
|
||||
"//--" . ">\n" .
|
||||
"</script>\n" .
|
||||
"</head>\n" .
|
||||
"<body onload=\"doFocus()\"\n>" .
|
||||
" <table border=0 align=center width=90% cellspacing=0 cellpadding=0 vspace=0 hspace=0>\n" .
|
||||
" <tr>\n" .
|
||||
"<form>\n" .
|
||||
" <td width=70% align=right valign=center>\n" .
|
||||
" VON PLZ <input name=\"zipcode1\" type=\"text\" value=\"" . $zipcode1 . "\" size=\"5\" maxlength=\"5\" class=\"input\"\n" .
|
||||
" onchange=\"updatePrice()\" onFocus=\"curZipcode='price_query1'\">\n" .
|
||||
" NACH PLZ <input name=\"zipcode2\" type=\"text\" value=\"" . $zipcode2 . "\" size=\"5\" maxlength=\"5\" class=\"input\"\n" .
|
||||
" onchange=\"updatePrice()\" onFocus=\"curZipcode='price_query2'\">\n" .
|
||||
" <br>$area_names1<br></td><td width=30% align=right valign=$valign>\n" .
|
||||
($hq_id == 3 ? formatPrice($area_price1) . "<br>" : "") .
|
||||
"<span style=\"color:red\">" . formatPrice($plzpreis1) . "</span><br>" .
|
||||
|
||||
" </td></tr><tr><td align=right valign=center>\n" .
|
||||
" VON PLZ <input name=\"zipcode2_disabled\" type=\"text\" value=\"" . $zipcode2 . "\" size=\"5\" maxlength=\"5\" class=\"input\"\n" .
|
||||
" disabled>\n" .
|
||||
" NACH PLZ <input name=\"zipcode3\" type=\"text\" value=\"" . $zipcode3 . "\" size=\"5\" maxlength=\"5\" class=\"input\"\n" .
|
||||
" onchange=\"updatePrice()\" onFocus=\"curZipcode='price_query3'\">\n" .
|
||||
" <br>$area_names2<br></td><td align=right valign=$valign>\n" .
|
||||
($hq_id == 3 ? formatPrice($area_price2) . "<br>" : "") .
|
||||
"<span style=\"color:red\">" . formatPrice($plzpreis2) . "</span><br>" .
|
||||
|
||||
" </td></tr><tr><td align=right valign=center>\n" .
|
||||
" VON PLZ <input name=\"zipcode3_disabled\" type=\"text\" value=\"" . $zipcode3 . "\" size=\"5\" maxlength=\"5\" class=\"input\"\n" .
|
||||
" disabled>\n" .
|
||||
" NACH PLZ <input name=\"zipcode4\" type=\"text\" value=\"" . $zipcode4 . "\" size=\"5\" maxlength=\"5\" class=\"input\"\n" .
|
||||
" onchange=\"updatePrice()\" onFocus=\"curZipcode='price_query4'\">\n" .
|
||||
" <br>$area_names3<br></td><td align=right valign=$valign>\n" .
|
||||
($hq_id == 3 ? formatPrice($area_price3) . "<br>" : "") .
|
||||
"<span style=\"color:red\">" . formatPrice($plzpreis3) . "</span><br>" .
|
||||
|
||||
" </td></tr><tr><td align=right valign=center>\n" .
|
||||
" VON PLZ <input name=\"zipcode4_disabled\" type=\"text\" value=\"" . $zipcode4 . "\" size=\"5\" maxlength=\"5\" class=\"input\"\n" .
|
||||
" disabled>\n" .
|
||||
" NACH PLZ <input name=\"zipcode5\" type=\"text\" value=\"" . $zipcode5 . "\" size=\"5\" maxlength=\"5\" class=\"input\"\n" .
|
||||
" onchange=\"updatePrice()\" onFocus=\"curZipcode='price_query5'\">\n" .
|
||||
" <br>$area_names4<br></td><td align=right valign=$valign>\n" .
|
||||
($hq_id == 3 ? formatPrice($area_price4) . "<br>" : "") .
|
||||
"<span style=\"color:red\">" . formatPrice($plzpreis4) . "</span><br>" .
|
||||
|
||||
" </td></tr><tr><td align=right valign=center>\n" .
|
||||
" VON PLZ <input name=\"zipcode5_disabled\" type=\"text\" value=\"" . $zipcode5 . "\" size=\"5\" maxlength=\"5\" class=\"input\"\n" .
|
||||
" disabled>\n" .
|
||||
" NACH PLZ <input name=\"zipcode6\" type=\"text\" value=\"" . $zipcode6 . "\" size=\"5\" maxlength=\"5\" class=\"input\"\n" .
|
||||
" onchange=\"updatePrice()\" onFocus=\"curZipcode='price_query6'\">\n" .
|
||||
" <br>$area_names5<br></td><td align=right valign=$valign>\n" .
|
||||
($hq_id == 3 ? formatPrice($area_price5) . "<br>" : "") .
|
||||
"<span style=\"color:red\">" . formatPrice($plzpreis5) . "</span><br>" .
|
||||
|
||||
" </td></tr><tr><td align=right valign=center>\n" .
|
||||
" MIT FAHRZEUG " .
|
||||
" <select name=\"vht_id\" class=\"input\" onchange=\"updatePrice()\">\n" .
|
||||
addOptionsFromTable("metatype", "mt_sort", "mt_value", "mt_sort", "mt_type = 'vehicletype' AND mt_sort > 0", $vht_id) .
|
||||
" </select>\n" .
|
||||
" <br><br></td><td align=right valign=$valign>\n" .
|
||||
($hq_id == 3 ? formatPrice($grundpreis) . "<br>" : "") .
|
||||
"<span style=\"color:red\">" . formatPrice($grundpreis) . "</span><br>" .
|
||||
|
||||
" </td></tr><tr><td align=right valign=center>\n" .
|
||||
"<b>Gesamtpreis: </b>" .
|
||||
" <br><br></td><td align=right valign=center>\n" .
|
||||
($hq_id == 3 ? "<b>" . formatPrice($area_fullprice) . "</b><br>" : "") .
|
||||
"<span style=\"color:red\"><b>" . formatPrice($fullprice) . "</b></span><br>" .
|
||||
|
||||
" </td></tr><tr><td colspan=2 align=center valign=top>\n" .
|
||||
"<br>" .
|
||||
"<input type=\"button\" value=\"Schließen\" onClick=\"self.close()\" accesskey=\"s\"> \n" .
|
||||
"<input type=\"button\" value=\"Rücksetzen\" onClick=\"doDelete()\" accesskey=\"r\"> \n" .
|
||||
"<input type=\"button\" name=\"AdressButton\" value=\"Suche PLZ\" title=\"Suche PLZ\" onclick=\"searchAddress();\">" .
|
||||
" </td>\n" .
|
||||
" </tr>\n" .
|
||||
" </table>\n" .
|
||||
"</form>\n" .
|
||||
"</body>\n" .
|
||||
"</html>\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;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user