1. Import

This commit is contained in:
2026-03-29 10:34:57 +02:00
parent b0e00c1259
commit a1129565af
4899 changed files with 3007593 additions and 0 deletions

18
html/longhaul/index.html Normal file
View File

@@ -0,0 +1,18 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="de">
<head>
<title>Mi2ju</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="Mi2ju"> <meta name="keywords" content="Mi2ju">
<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>

1250
html/longhaul/jb_detail.php Normal file

File diff suppressed because it is too large Load Diff

1046
html/longhaul/jb_list.php Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,389 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="de">
<head>
<title>AUFTRAGSLISTE</title>
<link rel="stylesheet" type="text/css" href="../css/phoenix.css">
<script src="../include/lib_global.js" type="text/javascript">
</script>
<script src="../include/lib_courier.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>
<!-- BEGIN js_date -->
{_js_date_}
<!-- END js_date -->
<script type="text/javascript">
<!--
// For identification of the window
var iname = "job_list";
var checkReloadCnt = 0;
var refreshStatus = <!-- BEGIN reload_status -->{_reload_status_}<!-- END reload_status -->;
function setRefreshStatus() {
if (document.forms[0].refreshStatusCheckbox.checked == true) {
refreshStatus = 1;
startTimeout();
} else {
refreshStatus = 0;
}
}
function startReload()
{
if (refreshStatus == 1) {
checkReload();
// self.location.reload();
finishPage();
}
}
function checkReload()
{
if (++checkReloadCnt == 300)
{
// alert("Der Server antwortet nicht. Bitte überprüfen Sie\n" +
// "ob Sie noch mit dem Internet verbunden sind!");
// self.close();
}
else
self.setTimeout("checkReload()", 100);
}
// Opens a new (popup-)window with specified parameters
function popupWindow(url,title,config) {
// popup = window.open(url,title,config);
var widthPopupWin = screen.width - 80;
var heightPopupWin = screen.height - 180;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2);
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2);
var popup;
popup = window.open(url,title,
"dependent=yes,width=" + widthPopupWin + ",height=" +
heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin +
",scrollbars=yes");
}
function finishPage() {
for(i=0;i<document.forms[0].jb_status_select.length;++i) {
if (document.forms[0].jb_status_select.options[i].selected == true) {
document.forms[0].jb_status.value=document.forms[0].jb_status_select.options[i].value;
}
};
document.forms[0].submit();
};
function makeStorno(jb_id,jb_permanent,cr_id) {
if (confirm('Auftrag ' + jb_id + ' wirklich stornieren?')) {
document.forms[0].jb_id_storno.value = jb_id;
document.forms[0].f_act.value = 'storno';
if (cr_id != '') {
if (enableCancellationWithCosts == '1') {
if (confirm('Sollen Stornokosten einbezogen werden?')) {
document.forms[0].jb_storno_costs.value = '1';
};
};
};
if (jb_permanent != '' && jb_permanent > 0 && confirm('Soll die Dauerauftragsregel gelöscht werden?')) {
document.forms[0].jb_storno_rhythm.value = '2';
};
finishPage();
};
};
// *** Browse-Limit ***
function setBrowseStartRange(direction) {
var currVal = document.forms[0].f_filter_browse_start.value;
// Skip back
if (direction == 1) {
if (currVal > 0) {
document.forms[0].f_filter_browse_start.value = currVal-1;
finishPage();
};
};
// Skip forward
if (direction == 2) {
document.forms[0].f_filter_browse_start.value = ++currVal;
finishPage();
};
};
// *** Courier-List ***
function setCourier(jb_id,cr_sid) {
document.forms[0].f_jb_id.value = jb_id;
document.forms[0].f_cr_sid.value = cr_sid;
document.forms[0].f_act.value = 'setCourier';
finishPage();
};
var cr_id_order_list = new Array();
<!-- BEGIN javascript -->
{_cr_id_order_list_}
var auto_refresh = "{_auto_refresh_}";
<!-- END javascript -->
function startTimeout()
{
self.setTimeout("startReload()", 60000);
}
var statusMessage = "{_statusmessage_}";
function displayStatusMessage() {
if (statusMessage != "") {
alert(statusMessage);
}
};
// ONLY for scaling the lists (frames)
function finishPageForScaling(maskNumOfWins) {
urlString = "../admin/jb_list_fs.php?maskNumOfWins=" + maskNumOfWins + "&setPercentValues=1";
for(i=1; i<=maskNumOfWins; ++i) {
var tmp = eval("document.forms[0].percentScaleValueWin_" + i + ".value");
urlString = urlString + "&percentScaleValueWin_" + i + "=" + tmp;
}
top.maincontent.location.href = urlString;
document.forms[0].submit();
};
function openCourierStatistics() {
var widthPopupWin = 900;
var heightPopupWin = 700;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
var popupWin;
popupWin = window.open("../statistic/statistic.php?f_act=calculate&f_category=2&f_statistic=10&noStatisticMenu=1&outputColumnMode=1&outputTitle=Auftragsverteilung&specialAligns=l,l,l,l","","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
};
function goAutoranking() {
if (confirm('Sollen die zuzuweisenden Aufträge in die automatische Vermittlung gestellt werden?')) {
document.forms[0].f_act.value = 'goAutoranking';
finishPage();
};
};
function openMfHistory() {
var widthPopupWin = 900;
var heightPopupWin = 700;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
var popupWin;
popupWin = window.open("../admin/mf_history.php","","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
};
function openJobInvoiceAssoc() {
var widthPopupWin = 1200;
var heightPopupWin = 1024;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
var popupWin;
popupWin = window.open("../jobs/jb_inv_assoc.php","","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
};
function openMap() {
var widthPopupWin = 1280;
var heightPopupWin = 1024;
var leftPopupWin = 0;
var topPopupWin = 0;
var popupWin;
popupWin = window.open("../longhaul/jb_longhaul.php","","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
};
function openMap2() {
var widthPopupWin = 1280;
var heightPopupWin = 1024;
var leftPopupWin = 0;
var topPopupWin = 0;
var popupWin;
popupWin = window.open("../longhaul/jb_longhaul.php?useRemoteDB=13","","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
};
function setSortState(sortDirection) {
document.forms[0].f_sort_direction.value = sortDirection;
finishPage();
};
function hqCheckAll(numOfHq) {
for (i = 0; i < numOfHq; i++) {
document.getElementsByName('f_hq_id[]')[i].checked = true;
}
}
function hqUncheckAll(numOfHq) {
for (i = 0; i < numOfHq; i++) {
document.getElementsByName('f_hq_id[]')[i].checked = false;
}
}
-->
</script>
<noscript>
<center>
<b><br>JavaScript ist nicht verf&uuml;gbar. Bitte aktivieren Sie JavaScript<br><br>
in Ihrem Browser, damit diese Seite ordnungsgem&auml;&szlig; funktioniert!</b><br><br>
</center>
</noscript>
</head>
<body onLoad="initForm();startTimeout();displayStatusMessage()">
<form name="jb_list" action="../longhaul/jb_list.php" method="post" target="<!-- BEGIN currentFrameName -->{_currentFrameName_}<!-- END currentFrameName -->">
<input type="hidden" name="customerId" value="<!-- BEGIN customerId -->{_customerId_}<!-- END customerId -->">
<input type="hidden" name="cscIdRoot" value="<!-- BEGIN cscIdRoot -->{_cscIdRoot_}<!-- END cscIdRoot -->">
<input type="hidden" name="cscIdActual" value="<!-- BEGIN cscIdActual -->{_cscIdActual_}<!-- END cscIdActual -->">
<input type="hidden" name="empIdMaster" value="<!-- BEGIN empIdMaster -->{_empIdMaster_}<!-- END empIdMaster -->">
<input type="hidden" name="maskNumOfWin" value="<!-- BEGIN maskNumOfWin -->{_maskNumOfWin_}<!-- END maskNumOfWin -->">
<input type="hidden" name="dbhistory" value="<!-- BEGIN dbhistory -->{_dbhistory_}<!-- END dbhistory -->">
<input type="hidden" name="jb_status" value="">
<input type="hidden" name="jb_sort" value="<!-- BEGIN jb_sort -->{_jb_sort_}<!-- END jb_sort -->">
<input type="hidden" name="f_filter_active" value="1">
<input type="hidden" name="f_filter_browse_start" value="<!-- BEGIN filter_browse_start -->{_filter_browse_start_}<!-- END filter_browse_start -->">
<input type="hidden" name="f_sort_direction" value="<!-- BEGIN f_sort_direction -->{_f_sort_direction_}<!-- END f_sort_direction -->">
<input type="hidden" name="useRemoteDB" value="<!-- BEGIN useRemoteDB -->{_useRemoteDB_}<!-- END useRemoteDB -->">
<!-- SELECTION-FILTERS -->
<table border="0">
<tr>
<td width="240">
<!-- Refresh status of the list -->
<input type="checkbox" name="refreshStatusCheckbox" value="<!-- BEGIN reload_status -->{_reload_status_}<!-- END reload_status -->" onClick="javascript:setRefreshStatus();"> Ref.&nbsp;
<script type="text/javascript">
if (refreshStatus == 1) {
document.forms[0].refreshStatusCheckbox.checked = true;
} else {
document.forms[0].refreshStatusCheckbox.checked = false;
}
</script>
<!-- Job-status -->
<select class="f8np1" name="jb_status_select">
<!-- BEGIN filter_status -->
{_filter_status_}
<!-- END filter_status -->
</select>
</td>
<td width="375">
<!-- BEGIN filter_dateranges -->
{_filter_dateranges_}
<!-- END filter_dateranges -->
</td>
<td width="215">
<!-- ID-range -->
Job von:
<input class="f8np1" type="text" name="job_no_from" value="<!-- BEGIN filter_idranges_from -->{_filter_idranges_from_}<!-- END filter_idranges_from -->" size="5">
bis:
<input class="f8np1" type="text" name="job_no_to" value="<!-- BEGIN filter_idranges_to -->{_filter_idranges_to_}<!-- END filter_idranges_to -->" size="5">
</td>
<td>
<!-- SID -->
&nbsp;&nbsp;Fahrzeug:
<input class="f8np1" type="text" name="f_cr_sid_search" value="<!-- BEGIN filter_crsid -->{_filter_crsid_}<!-- END filter_crsid -->" size="5">
&nbsp;&nbsp;
<!--
<!-- BEGIN special_links -->
{_special_links_}
<!-- END special_links -->
-->
</td>
</tr>
<tr>
<td colspan="4">
<input type="checkbox" name="f_filter[]" value="job_permanent" <!-- BEGIN filter_job_permanent -->{_filter_job_permanent_}<!-- END filter_job_permanent -->> Daueraufträge
&nbsp;&nbsp;
<input type="checkbox" name="f_filter[]" value="job_future" <!-- BEGIN filter_job_future -->{_filter_job_future_}<!-- END filter_job_future -->> Zukünftige
&nbsp;&nbsp;
<!--
<input type="checkbox" name="f_filter[]" value="job_incomplete" <!-- BEGIN filter_job_incomplete -->{_filter_job_incomplete_}<!-- END filter_job_incomplete -->> Nur nachzubearb.
<!-- BEGIN filter_job_only_offer -->{_filter_job_only_offer_}<!-- END filter_job_only_offer -->
&nbsp;&nbsp;&nbsp;
-->
<!-- BEGIN filter_sort_direction -->{_filter_sort_direction_}<!-- END filter_sort_direction -->
&nbsp;&nbsp;&nbsp;
<!-- Search-Button -->
<input class="f8np1" type="button" value="Anzeigen" onClick="finishPage();">
&nbsp;&nbsp;&nbsp;
<!-- BEGIN filter_browse -->{_filter_browse_}<!-- END filter_browse -->
<!-- area-range -->
&nbsp;&nbsp;
Bereich von:
<input class="f8np1" type="text" name="f_area_from" value="<!-- BEGIN filter_areas_from -->{_filter_areas_from_}<!-- END filter_areas_from -->" size="5">
bis:
<input class="f8np1" type="text" name="f_area_to" value="<!-- BEGIN filter_areas_to -->{_filter_areas_to_}<!-- END filter_areas_to -->" size="5">
&nbsp;&nbsp;
<!-- vehicle type -->
<!-- BEGIN filter_vehicletype -->{_filter_vehicletype_}<!-- END filter_vehicletype -->
<!-- distance -->
<!-- BEGIN filter_distance -->{_filter_distance_}<!-- END filter_distance -->
</td>
</tr>
<!-- search filters --> <!-- ATTENTION <tr><td colspan="4"> -->
<!-- BEGIN filters_out -->{_filters_out_}<!-- END filters_out -->
<!-- search filters --> <!-- ATTENTION <tr><td colspan="4"> -->
<!-- BEGIN filter_search -->{_filter_search_}<!-- END filter_search -->
<!-- scaling menu lists (frames) --> <!-- ATTENTION <tr><td colspan="4"> -->
<!-- BEGIN set_list_scaling -->{_set_list_scaling_}<!-- END set_list_scaling -->
<!-- mandator filters --> <!-- ATTENTION <tr><td colspan="4"> -->
<!-- BEGIN filter_mandators -->{_filter_mandators_}<!-- END filter_mandators -->
</table>
<!-- TABLE OF JOBS -->
<table width="100%" align="left" cellspacing="0" cellpadding="0" vspace="0" hspace="0">
<tr>
<td>
&nbsp;
</td>
</tr>
<!-- BEGIN tableHeader -->
{_tableHeader_}
<!-- END tableHeader -->
<!-- BEGIN jobentry -->
{_jobentry_}
<!-- END jobentry -->
<tr>
<td>
&nbsp;
</td>
<tr>
</table>
<input type="hidden" name="jb_id_storno" value="">
<input type="hidden" name="jb_storno_costs" value="2">
<input type="hidden" name="jb_storno_rhythm" value="1">
<input type="hidden" name="f_cr_sid" value="">
<input type="hidden" name="f_jb_id" value="2">
<input type="hidden" name="f_act" value="">
</form>
</body>
</html>

View File

@@ -0,0 +1,420 @@
<?php
/*=======================================================================
*
* jb_list_defineoutput.inc.php
*
* Autor: Marc Vollmann
*
=======================================================================*/
include_once ("../include/image.inc.php");
// Initialisation
$sumOfSummationField = 0;
if (!isset($summationField)) : $summationField = ""; endif;
if (!isset($newline)) : $newline = ""; endif;
if (!isset($emptylines)) : $emptylines = ""; endif;
if (!isset($noColoredCells)) : $noColoredCells = ""; endif;
if (!isset($noTableHeader)) : $noTableHeader = ""; endif;
if (!isset($jobEditPath)) : $jobEditPath = "jobs"; endif;
if (!isset($jobEditParameter)) : $jobEditParameter = ""; endif;
// Header of the list
$tableHeader = "";
if ($noTableHeader == "") :
$tableHeader = "<tr>";
for ($i = 0; $i < $fieldsLength; $i++) :
if (trim($titlesArray[$i]) == "") : $titlesArray[$i] = "&nbsp;"; endif;
// $tableHeader .= "<td align=\"center\">" . $titlesArray[$i] . "</td>";
$tableHeader .= "<td align=\"center\"><a href=\"javascript:document.forms[0].jb_sort.value=" . $i . "; finishPage();\">" . $titlesArray[$i] . "</a></td>";
// Check for newline ("linefeed")
if ($newline != ""):
$nlValue = substr($newline, $i, 1);
if ($nlValue == "1") :
$tableHeader .= "</tr><tr>";
endif;
endif;
endfor;
$tableHeader .= "</tr>";
endif;
$tpl->setCurrentBlock("tableHeader");
$tpl->setVariable("_tableHeader_", $tableHeader);
$tpl->parseCurrentBlock("tableHeader");
// Get date (today plus offset)
$offsetDate = getDateTime("date_plus_offset",array(0,MASK_DATE_PLUSOFFSETDAYS,0),"Y-m-d");
$offsetDateOut = getDateTime("date_plus_offset",array(0,MASK_DATE_PLUSOFFSETDAYS,0),"d.m.Y");
// Create filter for vehicles
$vehicleFilter = spliti(",",MASK_JOBLIST_VEHICLE_FILTER);
$vehicleFilterLen = count($vehicleFilter);
// Entries of the list
$rowCounter = 0;
$showFutureJobsFlag = TRUE;
$showPermanentJobsFlag = TRUE;
if (isset($filter_job_future) && $filter_job_future == "") :
$showFutureJobsFlag = FALSE;
endif;
if (isset($filter_job_permanent) && $filter_job_permanent == "") :
$showPermanentJobsFlag = FALSE;
endif;
while ($row = $result->fetch_assoc()):
$jobentry = "";
$jbPermanent = "0";
if ($row[jb_permanent] != "") : $jbPermanent = $row[jb_permanent]; endif;
$jbLonghaul = "0";
if ($row[jb_longhaul] != "") : $jbLonghaul = $row[jb_longhaul]; endif;
// Filter for displaying jobs. Do not show:
// - "sub-jobs" (jb_id_parent is not empty)
// - permanent jobs if not requested
// if (($jbPermanent == "0" || ($jbPermanent > 0 && $showPermanentJobsFlag)) &&
// ($userTypeName == "hq" || ($userTypeName == "cs" && ($row[jb_id_parent] == "" || $row[jb_id_parent] == "0" || $row[jb_id_parent] == "-1")) ) ) :
// Rules to display subjobs:
// - CS never see subjobs, - HQ only see subjobs if jb_status == "2" and jb_totalprice > 0 (no credit notes) because of reference to main job
if ( ($jbPermanent == "0" || ($jbPermanent > 0 && $showPermanentJobsFlag)) &&
( ($userTypeName == "hq" &&
( ($row[jb_id_parent] == "" || $row[jb_id_parent] == "0" || $row[jb_id_parent] == "-1") ||
($row[jb_status] == "2" && $row[jb_totalprice] >= "0" && $row[jb_id_parent] > "0") ) ) ||
($userTypeName == "cs" && ($row[jb_id_parent] == "" || $row[jb_id_parent] == "0" || $row[jb_id_parent] == "-1") ) ) ):
$rowCounter++;
// Split output per date (ONLY if sorted by ORDERTIME)
if ($showFutureJobsFlag && $row[jb_ordertime] >= $offsetDate) :
if ($fieldsArray[$jb_sort] == "jb_ordertime" && ($row[jb_status] == "0" || $row[jb_status] == "8" || $row[jb_status] == "9")) :
$jobentry .= "<tr><td class=\"f8np1\" colspan=\"" . $fieldsLength . "\">";
$jobentry .= "<br><br>Aufträge ab dem " . $offsetDateOut;
$jobentry .= "</td></tr>";
$showFutureJobsFlag = FALSE;
endif;
endif;
// Do not generate an output for empty table rows
$outIsNotEmpty = FALSE;
$jobentry .= "<tr>";
for ($i = 0; $i < $fieldsLength; $i++) :
if ($rowCounter % 2 == 0 && $i % 2 == 0) : $cellColor = "#BBBBFF"; endif;
if ($rowCounter % 2 == 0 && $i % 2 == 1) : $cellColor = "#CCCCFF"; endif;
if ($rowCounter % 2 == 1 && $i % 2 == 0) : $cellColor = "#DDDDDD"; endif;
if ($rowCounter % 2 == 1 && $i % 2 == 1) : $cellColor = "#EEEEEE"; endif;
// Change colour if job is not associated with a courier (not placed into the global market)
if ($row[jb_status] == 9 || $row[jb_status] == 8) :
if ($rowCounter % 2 == 0 && $i % 2 == 0) : $cellColor = "#FFBBBB"; endif;
if ($rowCounter % 2 == 0 && $i % 2 == 1) : $cellColor = "#FFCCCC"; endif;
if ($rowCounter % 2 == 1 && $i % 2 == 0) : $cellColor = "#DDDDDD"; endif;
if ($rowCounter % 2 == 1 && $i % 2 == 1) : $cellColor = "#EEEEEE"; endif;
endif;
// Job is for all couriers
if ($row[jb_status] == 0 && $row[jb_type] == 1) :
if ($rowCounter % 2 == 0 && $i % 2 == 0) : $cellColor = "#BBFFBB"; endif;
if ($rowCounter % 2 == 0 && $i % 2 == 1) : $cellColor = "#CCFFCC"; endif;
if ($rowCounter % 2 == 1 && $i % 2 == 0) : $cellColor = "#BBFFBB"; endif;
if ($rowCounter % 2 == 1 && $i % 2 == 1) : $cellColor = "#CCFFCC"; endif;
endif;
// Job is incomplete and has to be updated before invoicing
if ($row[jb_incomplete] == 1 && $row[jb_status] == 2) :
if ($rowCounter % 2 == 0 && $i % 2 == 0) : $cellColor = "#FFBBBB"; endif;
if ($rowCounter % 2 == 0 && $i % 2 == 1) : $cellColor = "#FFCCCC"; endif;
if ($rowCounter % 2 == 1 && $i % 2 == 0) : $cellColor = "#FFBBBB"; endif;
if ($rowCounter % 2 == 1 && $i % 2 == 1) : $cellColor = "#FFCCCC"; endif;
endif;
$tmpVarName = $fieldsArray[$i];
${$tmpVarName} = $row[$tmpVarName];
// *** Special treatment of fields ***
// Job is permanent
if ($tmpVarName == "jb_id" && $jbPermanent > 0 && ($row[jb_status] == "0" || $row[jb_status] == "1" || $row[jb_status] == "8" || $row[jb_status] == "9")) :
$cellColor = "#01C025"; // #01C025 #66FFCC
endif;
// Job is generated by customer
if ($userTypeName == "hq") :
if ($tmpVarName == "business_volume" && $row[jb_csc_id] > 0 && ($row[jb_status] == "0" || $row[jb_status] == "1" || $row[jb_status] == "8" || $row[jb_status] == "9")) :
$cellColor = "#FFFF00"; // Yellow
endif;
endif;
// Ordertime
if ($tmpVarName == "jb_ordertime") :
$tmp = ${$tmpVarName};
if ($row[jb_reserv] == 1) :
// mktime(hour,minute,second,month,day,year)
$latestTakeTime = LATEST_TAKETIME_IN_MINUTES;
if (is_numeric($row[srvpt_traveltime]) && $row[srvpt_traveltime] > 0) :
$latestTakeTime = $row[srvpt_traveltime];
endif;
$compareTime = date("Y-m-d H:i:s", mktime(substr($tmp,11,2),substr($tmp,14,2)-($latestTakeTime),substr($tmp,17,2),substr($tmp,5,2),substr($tmp,8,2),substr($tmp,2,2)));
else :
$compareTime = date("Y-m-d H:i:s", mktime(substr($tmp,11,2),substr($tmp,14,2)+5,substr($tmp,17,2),substr($tmp,5,2),substr($tmp,8,2),substr($tmp,2,2)));
endif;
if ((date("Y-m-d H:i:s") > $compareTime) && ($row[jb_status] == "0" || $row[jb_status] == "8" || $row[jb_status] == "9") && $row[jb_offer] != "1") :
if ($rowCounter % 2 == 0 && $i % 2 == 0) : $cellColor = "#FF1133"; endif;
if ($rowCounter % 2 == 0 && $i % 2 == 1) : $cellColor = "#FF3333"; endif;
if ($rowCounter % 2 == 1 && $i % 2 == 0) : $cellColor = "#FF4444"; endif;
if ($rowCounter % 2 == 1 && $i % 2 == 1) : $cellColor = "#FF5555"; endif;
endif;
endif;
// Latest taketime
if ($tmpVarName == "jb_latesttaketime") :
if ($row[jb_waittime] != "") :
${$tmpVarName} = $row[jb_waittime];
else :
$tmp = ${$tmpVarName};
if ($row[jb_reserv] == 1) :
// mktime(hour,minute,second,month,day,year)
$latestTakeTime = LATEST_TAKETIME_IN_MINUTES;
if (is_numeric($row[srvpt_traveltime]) && $row[srvpt_traveltime] > 0) :
$latestTakeTime = $row[srvpt_traveltime];
endif;
${$tmpVarName} = date("Y-m-d H:i:s", mktime(substr($tmp,11,2),substr($tmp,14,2)-($latestTakeTime),substr($tmp,17,2),substr($tmp,5,2),substr($tmp,8,2),substr($tmp,2,2)));
else :
${$tmpVarName} = date("Y-m-d H:i:s", mktime(substr($tmp,11,2),substr($tmp,14,2)+5,substr($tmp,17,2),substr($tmp,5,2),substr($tmp,8,2),substr($tmp,2,2)));
endif;
endif;
if ((date("Y-m-d H:i:s") > ${$tmpVarName}) && ($row[jb_status] == "0" || $row[jb_status] == "8" || $row[jb_status] == "9") && $row[jb_offer] != "1") :
if ($rowCounter % 2 == 0 && $i % 2 == 0) : $cellColor = "#FF1133"; endif;
if ($rowCounter % 2 == 0 && $i % 2 == 1) : $cellColor = "#FF3333"; endif;
if ($rowCounter % 2 == 1 && $i % 2 == 0) : $cellColor = "#FF4444"; endif;
if ($rowCounter % 2 == 1 && $i % 2 == 1) : $cellColor = "#FF5555"; endif;
endif;
endif;
// All zipcodes of the tour
if ($tmpVarName == "jb_tourzipcodes") :
if ($row[jb_tourzipcodes] != "" && !(strpos($row[jb_tourzipcodes], "|") === false)) :
$jbZipcodes = substr($row[jb_tourzipcodes], 0, strpos($row[jb_tourzipcodes], "|"));
$jbZipcodes = trim($jbZipcodes);
if (substr($jbZipcodes, -1) == ";") : // Remove last character if ";" again
$jbZipcodes = substr($jbZipcodes, 0, -1);
endif;
$jbZipcodes = str_replace (";", ", ", $jbZipcodes);
${$tmpVarName} = $jbZipcodes;
else :
${$tmpVarName} = $row[ad_zipcode];
if ($row[ad2_zipcode] != "") : ${$tmpVarName} .= ", " . $row[ad2_zipcode]; endif;
endif;
endif;
// All cities of the tour
if ($tmpVarName == "jb_tourcities") :
if ($row[jb_tourcities] != "" && !(strpos($row[jb_tourcities], "|") === false)) :
$jbCities = substr($row[jb_tourcities], strpos($row[jb_tourcities], "|") + 1);
$jbCities = trim($jbCities);
if (substr($jbCities, -1) == ";") : // Remove last character if ";" again
$jbCities = substr($jbCities, 0, -1);
endif;
$jbCities = str_replace (";", ", ", $jbCities);
${$tmpVarName} = $jbCities;
else :
${$tmpVarName} = $row[ad_city];
if ($row[ad2_city] != "") : ${$tmpVarName} .= ", " . $row[ad2_city]; endif;
endif;
endif;
// Optional summation of one or more fields
if ($summationField != "" && ($tmpVarName == $summationField) && is_numeric(${$tmpVarName})) :
// Check for row is NOT an subjob
if (!($row[jb_id_parent] > "0")) :
$sumOfSummationField += ${$tmpVarName};
endif;
endif;
// Convert output from "float" to "float_rounded_2"
if ($tmpVarName == "jb_cr_price" && is_numeric($row[jb_cr_price])) :
$outputFormatField[$tmpVarName] = "float_rounded_2";
endif;
$out = formatOutput(${$tmpVarName},$outputFormatField[$tmpVarName]);
if ($tmpVarName == "jb_tourname") :
$out = substr($out,0,MASK_JOBLIST_LENGTH_TOURNAME);
endif;
if ($tmpVarName == "jb_id" || $tmpVarName == "jb_tourname") :
// Check job for being a subjob
$tmpJbId = $row[jb_id];
if ($row[jb_id_parent] > "0") : $tmpJbId = $row[jb_id_parent]; endif;
$out = "<a href=\"javascript:popupWindow('../" . $targetPath . "/jb_detail.php?job_id=" .
ec($tmpJbId) . "&dbhistory=" . $dbhistory . $jobEditParameter . "','Auftrag','');\">" . $out . "</a>";
endif;
if ($tmpVarName == "jb_storno") :
if (($row[jb_export_time] == "" || $row[jb_export_time] == "0000-00-00 00:00:00") &&
($row[jb_id_parent] == "" || $row[jb_id_parent] == "0" || $row[jb_id_parent] == "-1")) :
if (${$tmpVarName} == "" || ${$tmpVarName} == "0") :
// if ($row[jb_status] == 0 || $row[jb_status] == 9) :
$out = "<a href=\"javascript:makeStorno(" . $row[jb_id] . "," . $jbPermanent . ",'" . $row[cr_id] . "');\">" . "Storno" . "</a>";
// else :
// $out = "";
// endif;
else :
if ($rowCounter % 2 == 0 && $i % 2 == 0) : $cellColor = "#FF2222"; endif;
if ($rowCounter % 2 == 0 && $i % 2 == 1) : $cellColor = "#FF3333"; endif;
if ($rowCounter % 2 == 1 && $i % 2 == 0) : $cellColor = "#FF4444"; endif;
if ($rowCounter % 2 == 1 && $i % 2 == 1) : $cellColor = "#FF5555"; endif;
if (${$tmpVarName} == "1") :
$out = "St.m.K.";
elseif (${$tmpVarName} == "2") :
$out = "St.o.K.";
endif;
endif;
else :
$out = "";
endif;
endif;
// Only jobs generated by customers or jobs generated by headquarters can be modified
if (($userTypeName == "hq" || ($row[jb_csc_id] > 0 && MASK_JB_CS_EDITJOB == "1")) && $tmpVarName == "jb_edit") : // $userTypeName == "hq" &&
if ($row[jb_export_time] == "" || $row[jb_export_time] == "0000-00-00 00:00:00") :
// Check job for being a subjob
$tmpJbId = $row[jb_id];
if ($row[jb_id_parent] > "0") : $tmpJbId = $row[jb_id_parent]; endif;
$out = "<a href=\"../" . $jobEditPath . "/job_edit.php?jb_id=" . ec($tmpJbId) . $jobEditParameter . "\" target=\"_blank\">" . $row[jb_id] . "</a>";
// if ($row[jb_id_parent] == "-1") :
// $out = "*&nbsp;" . $out . "&nbsp;*";
// endif;
if ($row[jb_id_parent] > "0") :
$out = "*&nbsp;" . $out . "&nbsp;*";
endif;
else :
$out = "";
if ($row[jb_id_parent] == "-1") :
$out = "*&nbsp;HA&nbsp;*";
endif;
if ($row[jb_id_parent] > "0") :
$out = "*&nbsp;UA&nbsp;*";
endif;
endif;
endif;
if ($userTypeName == "hq" && $tmpVarName == "cr_sid") :
// Check for subjob, if it is then no output ...
if ($row[jb_id_parent] == "" || $row[jb_id_parent] == "0" || $row[jb_id_parent] == "-1") :
if (($row[jb_export_time] == "" || $row[jb_export_time] == "0000-00-00 00:00:00") &&
($jbLonghaul == "0" || ($jbLonghaul == "1" || $jbLonghaul == "3") && authCheckEmployeeRights($emp_id, "10")) ) :
if ($row[cr_sid] == "") :
$out = "<a href=\"javascript:mk_cr_id_list('". $row[jb_id] . "','" . $row[ad_zipcode] . "','" . $f_hq_id_string . "');\">" . "???" . "</a>";
else :
$out = "<a href=\"javascript:mk_cr_id_list('". $row[jb_id] . "','" . $row[ad_zipcode] . "','" . $f_hq_id_string . "');\">" . $row[cr_sid] . "</a>";
// Show red brackets if at least one stop of the tour (the first one) is done (ONLY taken jobs!)
if ($row[jb_status] == 1) :
if ($row[tr_status] == "1") :
$out = "<span class=\"f8np1_red\">(</span>" . $out . "<span class=\"f8np1_red\">)</span>";
endif;
endif;
if ($row[jb_status] == 2) :
$out = $row[cr_sid];
endif;
// Show alert if time between the legs of the tour
if (MASK_JOBLIST_ALERT_LEG_TIME_SECONDS != "" && is_numeric(MASK_JOBLIST_ALERT_LEG_TIME_SECONDS)) :
$maxDeltaLegTime = MASK_JOBLIST_ALERT_LEG_TIME_SECONDS;
$deltaTime1 = ($row[time2] - $row[time1]);
$deltaTime2 = ($row[time3] - $row[time2]);
$deltaTime3 = ($row[time4] - $row[time3]);
$deltaTime4 = ($row[time5] - $row[time4]);
$deltaTime5 = ($row[time6] - $row[time5]);
if ( (($deltaTime1 < $maxDeltaLegTime) && $deltaTime1 > 0) || (($deltaTime2 < $maxDeltaLegTime) && $deltaTime2 > 0) ||
(($deltaTime3 < $maxDeltaLegTime) && $deltaTime3 > 0) || (($deltaTime4 < $maxDeltaLegTime) && $deltaTime4 > 0) ||
(($deltaTime5 < $maxDeltaLegTime) && $deltaTime5 > 0) ) :
$out .= "<span class=\"f8np1_red\">!</span>";
endif;
endif;
endif;
else :
if (($jbLonghaul == "1" || $jbLonghaul == "3") && !authCheckEmployeeRights($emp_id, "10")) :
$out = "FT"; // Longhaul job not to be mediated by employees without mandatory right ("FT" = "Ferntour")
else :
$out = $row[cr_sid];
endif;
endif;
// Check job is an offer
if ($row[jb_offer] == "1") :
$out = "Angebot";
endif;
else :
$out = $row[cr_sid];
endif;
endif;
if ($tmpVarName == "vht_value" && $row[jb_cr_filter] != "") :
for ($j = 0; $j < $vehicleFilterLen; $j++) :
if (!(strpos($row[jb_cr_filter], $vehicleFilter[$j]) === FALSE)) :
$out .= " " . $vehicleFilter[$j];
endif;
endfor;
endif;
// Set the colour of the credit notes
if ($userTypeName == "hq" && MASK_JOBLIST_CREDITNOTE_COLOUR == "1") :
if (($tmpVarName == "business_volume" && is_numeric($row[business_volume]) && $row[business_volume] < 0) ||
($tmpVarName == "jb_cr_price" && is_numeric($row[jb_cr_price]) && $row[jb_cr_price] < 0)) :
$out = "<span class=\"f8np1_red\">" . $out . "</span>";
endif;
endif;
// Customer-sign
if ($tmpVarName == "tour_1_sign" || $tmpVarName == "tour_2_sign" || $tmpVarName == "tour_3_sign" ||
$tmpVarName == "tour_4_sign" || $tmpVarName == "tour_5_sign" || $tmpVarName == "tour_6_sign") :
if ($row[tr_sign] != "") :
$rawCoord = splitRawCoordinates ($row[$tmpVarName]);
$maxCoord = checkMaxCoordinates($rawCoord);
$out = "<img src=\"../admin/jb_detail_sign2.php?tr_sign=" . $row[$tmpVarName] . "\" border=\"0\" height=\"" . $maxCoord[1] . "\" width=\"" . $maxCoord[0] . "\">";
endif;
endif;
if (trim($out) != ""):
$outIsNotEmpty = TRUE;
endif;
$jobentry .= "<td " . ($noColoredCells == "" ? "bgcolor=\"" . $cellColor . "\"" : "") . " align=\"" . setAlign($alignsArray[$i]) . "\" valign=\"" . setAlign($valignsArray[$i]) . "\">&nbsp;" . ($cellTextPreArray[$i] != "" ? $cellTextPreArray[$i] : "") . $out . "&nbsp;</td>";
// Check for newline ("linefeed")
if ($newline != ""):
$nlValue = substr($newline, $i, 1);
if ($nlValue == "1") :
$jobentry .= "</tr><tr>";
endif;
endif;
endfor;
$jobentry .= "</tr>";
// Check for newline ("linefeed")
if (is_numeric($emptylines) && $emptylines >= "1"):
for ($k = 1; $k <= $rowArrayLen; $k++) :
$jobentry .= "<tr><td>&nbsp;<br>&nbsp;</td></tr>";
endfor;
endif;
// Do not generate an output for emty table rows
if ($outIsNotEmpty == FALSE) :
$jobentry = "";
endif;
$tpl->setCurrentBlock("jobentry");
$tpl->setVariable("_jobentry_", $jobentry);
$tpl->parseCurrentBlock("jobentry");
endif; // Filter for displaying jobs
endwhile;
?>

View File

@@ -0,0 +1,43 @@
<?php
/*=======================================================================
*
* jb_list_fs.php (*** BWV ***)
*
* Autor: Marc Vollmann
*
=======================================================================*/
include_once ("../include/global.inc.php");
include_once ("../include/auth.inc.php");
// Check HTTP-Parameters
getSecHttpVars("1",array("maskNumOfWins", "useRemoteDB"));
if ($maskNumOfWins == "" || $maskNumOfWins == "0" || !is_numeric($maskNumOfWins)) : $maskNumOfWins = "3"; endif; // Number of frames = number of lists
$jobListParameter = "";
$frameNameExt = "";
if ($useRemoteDB != "") :
$jobListParameter = "&useRemoteDB=" . ec($useRemoteDB);
$frameNameExt = "1";
endif;
?>
<html>
<head>
<title>BWV FERNTOUREN</title>
</head>
<frameset rows="*,*,*,*" id="jb_list_fs<?php echo $frameNameExt ?>">
<frame src="jb_list.php?defaultListStatus=<?php echo ec("9") ?>&maskNumOfWin=<?php echo ec("1") ?>&maskNumOfWins=<?php echo $maskNumOfWins ?><?php echo $jobListParameter ?>" name="content1<?php echo $frameNameExt ?>" scrolling="yes" marginwidth="0" marginheight="0">
<frame src="jb_list.php?defaultListStatus=<?php echo ec("0") ?>&maskNumOfWin=<?php echo ec("2") ?>&maskNumOfWins=<?php echo $maskNumOfWins ?><?php echo $jobListParameter ?>" name="content2<?php echo $frameNameExt ?>" scrolling="yes" marginwidth="0" marginheight="0">
<frame src="jb_list.php?defaultListStatus=<?php echo ec("1") ?>&maskNumOfWin=<?php echo ec("3") ?>&maskNumOfWins=<?php echo $maskNumOfWins ?><?php echo $jobListParameter ?>" name="content3<?php echo $frameNameExt ?>" scrolling="yes" marginwidth="0" marginheight="0">
<frame src="jb_list.php?defaultListStatus=<?php echo ec("2") ?>&maskNumOfWin=<?php echo ec("4") ?>&maskNumOfWins=<?php echo $maskNumOfWins ?><?php echo $jobListParameter ?>" name="content4<?php echo $frameNameExt ?>" scrolling="yes" marginwidth="0" marginheight="0">
</frameset>
</html>

View File

@@ -0,0 +1,65 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="de">
<head>
<title>AUFTRAGSLISTE</title>
<link rel="stylesheet" type="text/css" href="../css/phoenix.css">
<!-- BEGIN js_date -->
{_js_date_}
<!-- END js_date -->
<noscript>
<center>
<b><br>JavaScript ist nicht verf&uuml;gbar. Bitte aktivieren Sie JavaScript<br><br>
in Ihrem Browser, damit diese Seite ordnungsgem&auml;&szlig; funktioniert!</b><br><br>
</center>
</noscript>
</head>
<body>
<form name="jb_list" action="../admin/jb_list.php" method="post" target="<!-- BEGIN currentFrameName -->{_currentFrameName_}<!-- END currentFrameName -->">
<input type="hidden" name="customerId" value="<!-- BEGIN customerId -->{_customerId_}<!-- END customerId -->">
<input type="hidden" name="cscIdRoot" value="<!-- BEGIN cscIdRoot -->{_cscIdRoot_}<!-- END cscIdRoot -->">
<input type="hidden" name="cscIdActual" value="<!-- BEGIN cscIdActual -->{_cscIdActual_}<!-- END cscIdActual -->">
<input type="hidden" name="empIdMaster" value="<!-- BEGIN empIdMaster -->{_empIdMaster_}<!-- END empIdMaster -->">
<input type="hidden" name="maskNumOfWin" value="<!-- BEGIN maskNumOfWin -->{_maskNumOfWin_}<!-- END maskNumOfWin -->">
<input type="hidden" name="jb_costcenter" value="1">
<input type="hidden" name="jb_status" value="">
<input type="hidden" name="jb_sort" value="<!-- BEGIN jb_sort -->{_jb_sort_}<!-- END jb_sort -->">
<input type="hidden" name="f_filter_active" value="1">
<input type="hidden" name="f_filter_browse_start" value="<!-- BEGIN filter_browse_start -->{_filter_browse_start_}<!-- END filter_browse_start -->">
<!-- TABLE OF JOBS -->
<table align="left" cellspacing="0" cellpadding="0" vspace="0" hspace="0">
<tr>
<td>
&nbsp;
</td>
</tr>
<!-- BEGIN tableHeader -->
{_tableHeader_}
<!-- END tableHeader -->
<!-- BEGIN jobentry -->
{_jobentry_}
<!-- END jobentry -->
<tr>
<td>
&nbsp;
</td>
<tr>
</table>
<input type="hidden" name="jb_id_storno" value="">
<input type="hidden" name="jb_storno_costs" value="2">
<input type="hidden" name="jb_storno_rhythm" value="1">
<input type="hidden" name="f_cr_sid" value="">
<input type="hidden" name="f_jb_id" value="2">
<input type="hidden" name="f_act" value="">
</form>
</body>
</html>

View File

@@ -0,0 +1,424 @@
<?php
/*=======================================================================
*
* jb_longhaul.php
*
* Autor: Marc Vollmann
*
=======================================================================*/
include_once ("../include/global.inc.php");
include_once ("../include/auth.inc.php");
include_once ("../include/html.inc.php");
include_once ("../include/image.inc.php");
include_once ("../include/bwv.inc.php");
getSecHttpVars("1",array("f_act", "mapSizeMode", "federalStateMode", "transparency", "distance", "singleZipcode", "specialJob",
"displayDirectionArrows", "displayJobIDs", "displayCrSIDs", "displayZipcodes",
"displayCouriers", "f_hq_id", "statusMessage", "useRemoteDB"));
// Check for authentication access and granted rights
$usrAccessArray["hq"] = "1";
authCheckForAccess($hq_id, $usr_id, $emp_id, "1", $customerId, $cscIdRoot, $cscIdActual);
authCheckEmployeeRights($emp_id, "10", "1");
// ******************************************************
// Very special treatment for access to remote database
$remoteDBisActive = false;
if (BWV2_checkEmpRemoteDBAccess($useRemoteDB, $emp_id)) :
$remoteDBisActive = BWV2_setRemoteDBAccessParameter();
endif;
$constLonghaulActive = "";
if ($remoteDBisActive) :
if ($f_hq_id == "") : $f_hq_id = array(); endif;
if (count($f_hq_id) == 0) : array_push($f_hq_id, getMinOfField("headquarters", "hq_id", "")); endif;
$constLonghaulActive = getParameterValue("0", "LONGHAUL_ACTIVE_REMOTE_DB", "0");
endif;
// ******************************************************
if ($mapSizeMode != "1" && $mapSizeMode != "2" && $mapSizeMode != "3") : $mapSizeMode = "2"; endif;
if ($federalStateMode == "" || count($federalStateMode) == 0) :
$federalStateMode = "0";
$federalStateMode_box = "";
else:
$federalStateMode = "1";
$federalStateMode_box = "checked";
endif;
if ($transparency == "") : $transparency = "0"; endif;
if ($distance == "") : $distance = "80"; endif;
if ($displayDirectionArrows == "" || count($displayDirectionArrows) == 0) :
$displayDirectionArrows = "0";
$displayDirectionArrows_box = "";
else:
$displayDirectionArrows = "1";
$displayDirectionArrows_box = "checked";
endif;
if ($displayJobIDs == "" || count($displayJobIDs) == 0) :
$displayJobIDs = "0";
$displayJobIDs_box = "";
else:
$displayJobIDs = "1";
$displayJobIDs_box = "checked";
endif;
if ($displayCrSIDs == "" || count($displayCrSIDs) == 0) :
$displayCrSIDs = "0";
$displayCrSIDs_box = "";
else:
$displayCrSIDs = "1";
$displayCrSIDs_box = "checked";
endif;
if ($displayZipcodes == "" || count($displayZipcodes) == 0) :
$displayZipcodes = "0";
$displayZipcodes_box = "";
else:
$displayZipcodes = "1";
$displayZipcodes_box = "checked";
endif;
if ($displayCouriers == "" || count($displayCouriers) == 0) :
$displayCouriers = "0";
$displayCouriers_box = "";
else:
$displayCouriers = "1";
$displayCouriers_box = "checked";
endif;
// Get status of activation of longhaul mediation
if ($constLonghaulActive == "") :
$constLonghaulActive = getParameterValue("0", "LONGHAUL_ACTIVE", "0");
endif;
// Mandator filter
if ($f_hq_id == "") : $f_hq_id = array(); endif;
if (count($f_hq_id) == 0) : array_push($f_hq_id, $hq_id); endif;
// Special conversion for map script (array => string)
$f_hq_id_string = implode(",", $f_hq_id);
// Current number of headquarters of the mandator
$numOfHq = getCountOfTable("mandatorheadquarters", "md_id = '" . $md_id . "'");
// $singleZipcode = trim($singleZipcode);
$singleZipcode = pad(trim($singleZipcode), 5, "0"); // Use "pad()" because e.g. "01067" is interpreted as "1067" !!!
$zipGeoCoord = getGeoCoordinatesFromZipcode($singleZipcode);
$zipLong = $zipGeoCoord[0];
$zipLat = $zipGeoCoord[1];
if ($zipLong == "" || $zipLat == "") : $singleZipcode = ""; endif;
// Return job to headquarters
if ($f_act == "returnJobToHeadquarters") :
if ($specialJob != "") :
$res = updateStmt("job", "jb_id", $specialJob, array("jb_longhaul", "2"), "jb_longhaul = '1'");
if ($db->affected_rows == 0) :
$statusMessage = "Der Auftrag kann nicht zurückgegeben werden, da er manuell den Status einer Ferntour zugewiesen bekommen hat!";
endif;
$specialJob = ""; // Init to avoid other potential operations according this value
endif;
endif;
$currentTime = getDateTime("0");
$outListOfLongHaulJobs = "";
// Generate a list of long haul jobs to be mediated
$outListOfLongHaulJobs .= "<b>Zu vermittelnde Ferntouren:</b><br><br>";
$jbArray = getLongHaulJobData("9", $distance);
$jbArrayLen = count($jbArray);
for ($i = 0; $i < $jbArrayLen; $i++) {
$jbId = $jbArray[$i][0]; // Get ID of the tour
$crSid = $jbArray[$i][1]; // Get SID of the courier
$jbTotalprice = $jbArray[$i][2]; // Get total price
$jbZipcodes = $jbArray[$i][3]; // Get zipcodes (and cities) of the tour
$jbZipcodes = trim(substr($jbZipcodes, 0, strpos($jbZipcodes, "|"))); // Remove cities
if (substr($jbZipcodes, -1) == ";") : // Remove last character if ";" again
$jbZipcodes = substr($jbZipcodes, 0, -1);
endif;
$jbZipcodes = str_replace (";", ",", $jbZipcodes);
$jbZipcodesArray = spliti(",", $jbZipcodes);
$jbZipcodesArrayLen = count($jbZipcodesArray);
$vhtJobID = $jbArray[$i][6];
$vhtJobName = $jbArray[$i][7];
// $vhtPayload = $jbArray[$i][8];
// $vhtMeasures = $jbArray[$i][9];
$jbLonghaul = $jbArray[$i][10];
// Long haul jobs
if ($remoteDBisActive) :
// $outListOfLongHaulJobs .= $jbId . "&nbsp;&nbsp;"; // Do not display because ONLY view mode !!!
$outListOfLongHaulJobs .= "<a href=\"javascript:popupWindow('../longhaul/jb_detail.php?job_id=" . ec($jbId) . "&dbhistory=job&useRemoteDB=" . ec($useRemoteDB) . "','Auftrag','');\">" . $jbId . "</a>&nbsp;&nbsp;";
else :
$outListOfLongHaulJobs .= "<a href=\"javascript:popupWindow('../longhaul/jb_detail.php?job_id=" . ec($jbId) . "&dbhistory=job&useRemoteDB=" . ec($useRemoteDB) . "','Auftrag','');\">" . $jbId . "</a>&nbsp;&nbsp;";
endif;
$outListOfLongHaulJobs .= "<a href=\"javascript:showSpecialJob('" . ec($jbId) . "');\">A</a>&nbsp;&nbsp;";
// $outListOfLongHaulJobs .= "[" . $crSid . ", " . $vhtName . "]&nbsp;&nbsp;[" . $jbTotalprice . "]&nbsp;&nbsp;";
// $outListOfLongHaulJobs .= "(" . $jbZipcodes . ")<br><br>";
$outListOfLongHaulJobs .= "<span class=\"f8np1_red\">[" . $vhtJobName . "]</span>&nbsp;&nbsp;";
$outListOfLongHaulJobs .= "(";
for ($j = 0; $j < $jbZipcodesArrayLen; $j++) {
$outListOfLongHaulJobs .= "<a href=\"javascript:showSpecialZipcode('" . ec($jbZipcodesArray[$j]) . "');\">" . $jbZipcodesArray[$j] . "</a>";
if ($j < ($jbZipcodesArrayLen - 1)) : $outListOfLongHaulJobs .= ",&nbsp;"; endif;
}
$outListOfLongHaulJobs .= ")&nbsp;&nbsp;&nbsp;";
if ($constLonghaulActive == "1") :
if ($jbLonghaul == "1") :
$outListOfLongHaulJobs .= "<a href=\"javascript:returnJobToHeadquarters('" . ec($jbId) . "', '" . $jbId . "');\">Rückgabe</a>&nbsp;&nbsp;&nbsp;";
else :
$outListOfLongHaulJobs .= "Man. FT &nbsp;";
endif;
else :
$outListOfLongHaulJobs .= "Keine Verm. &nbsp;";
endif;
$outListOfLongHaulJobs .= "<br><br>";
}
$outListOfLongHaulJobs .= "<br>";
// Generate a list of long haul jobs taken by couriers
$outListOfLongHaulJobs .= "<b>Angenommene Ferntouren:</b><br><br>";
$jbArray = getLongHaulJobData("1", $distance);
$jbArrayLen = count($jbArray);
for ($i = 0; $i < $jbArrayLen; $i++) {
$jbId = $jbArray[$i][0]; // Get ID of the tour
$crSid = $jbArray[$i][1]; // Get SID of the courier
$jbTotalprice = $jbArray[$i][2]; // Get total price
$jbZipcodes = $jbArray[$i][3]; // Get zipcodes (and cities) of the tour
$jbZipcodes = trim(substr($jbZipcodes, 0, strpos($jbZipcodes, "|"))); // Remove cities
if (substr($jbZipcodes, -1) == ";") : // Remove last character if ";" again
$jbZipcodes = substr($jbZipcodes, 0, -1);
endif;
$jbZipcodes = str_replace (";", ",", $jbZipcodes);
$jbZipcodesArray = spliti(",", $jbZipcodes);
$jbZipcodesArrayLen = count($jbZipcodesArray);
$vhtName = $jbArray[$i][4]; // Get (current) vehicle of the courier on the roadtrip
$vhtPayload = $jbArray[$i][8];
$vhtMeasures = $jbArray[$i][9];
// Long haul jobs
if ($remoteDBisActive) :
// $outListOfLongHaulJobs .= $jbId . "&nbsp;&nbsp;"; // Do not display because ONLY view mode !!!
$outListOfLongHaulJobs .= "<a href=\"javascript:popupWindow('../longhaul/jb_detail.php?job_id=" . ec($jbId) . "&dbhistory=job&useRemoteDB=" . ec($useRemoteDB) . "','Auftrag','');\">" . $jbId . "</a>&nbsp;&nbsp;";
else :
$outListOfLongHaulJobs .= "<a href=\"javascript:popupWindow('../longhaul/jb_detail.php?job_id=" . ec($jbId) . "&dbhistory=job&useRemoteDB=" . ec($useRemoteDB) . "','Auftrag','');\">" . $jbId . "</a>&nbsp;&nbsp;";
endif;
$outListOfLongHaulJobs .= "<a href=\"javascript:showSpecialJob('" . ec($jbId) . "');\">A</a>&nbsp;&nbsp;";
$outListOfLongHaulJobs .= "[<a href=\"../locating/locating.php?f_cr_sid=" . $crSid . "&useRemoteDB=" . ec($useRemoteDB) . "\" target=\"_blank\">" . $crSid . "</a>, " . $vhtName . ", " . $vhtMeasures . ", (" . $vhtPayload . ")]&nbsp;&nbsp;";
// $outListOfLongHaulJobs .= "(" . $jbZipcodes . ")<br><br>";
$outListOfLongHaulJobs .= "(";
for ($j = 0; $j < $jbZipcodesArrayLen; $j++) {
$outListOfLongHaulJobs .= "<a href=\"javascript:showSpecialZipcode('" . ec($jbZipcodesArray[$j]) . "');\">" . $jbZipcodesArray[$j] . "</a>";
if ($j < ($jbZipcodesArrayLen - 1)) : $outListOfLongHaulJobs .= ",&nbsp;"; endif;
}
$outListOfLongHaulJobs .= ") &nbsp;";
$outListOfLongHaulJobs .= "<br><br>";
}
$outListOfLongHaulJobs .= "<br>";
// Generate a list of done long haul jobs with couriers on the way home
$outListOfLongHaulJobs .= "<b>Rücktouren:</b><br><br>";
$jbArray = getLongHaulJobData("2", $distance);
$jbArrayLen = count($jbArray);
for ($i = 0; $i < $jbArrayLen; $i++) {
$jbId = $jbArray[$i][0]; // Get ID of the tour
$crSid = $jbArray[$i][1]; // Get SID of the courier
$jbTotalprice = $jbArray[$i][2]; // Get total price
$jbZipcodes = $jbArray[$i][3]; // Get zipcodes (and cities) of the tour
$jbZipcodes = trim(substr($jbZipcodes, 0, strpos($jbZipcodes, "|"))); // Remove cities
if (substr($jbZipcodes, -1) == ";") : // Remove last character if ";" again
$jbZipcodes = substr($jbZipcodes, 0, -1);
endif;
$jbZipcodes = str_replace (";", ",", $jbZipcodes);
$jbZipcodesArray = spliti(",", $jbZipcodes);
$jbZipcodesArrayLen = count($jbZipcodesArray);
$vhtName = $jbArray[$i][4]; // Get (current) vehicle of the courier on the roadtrip
$vhtPayload = $jbArray[$i][8];
$vhtMeasures = $jbArray[$i][9];
// Long haul jobs
if ($remoteDBisActive) :
// $outListOfLongHaulJobs .= $jbId . "&nbsp;&nbsp;"; // Do not display because ONLY view mode !!!
$outListOfLongHaulJobs .= "<a href=\"javascript:popupWindow('../longhaul/jb_detail.php?job_id=" . ec($jbId) . "&dbhistory=job&useRemoteDB=" . ec($useRemoteDB) . "','Auftrag','');\">" . $jbId . "</a>&nbsp;&nbsp;";
else :
$outListOfLongHaulJobs .= "<a href=\"javascript:popupWindow('../longhaul/jb_detail.php?job_id=" . ec($jbId) . "&dbhistory=job&useRemoteDB=" . ec($useRemoteDB) . "','Auftrag','');\">" . $jbId . "</a>&nbsp;&nbsp;";
endif;
$outListOfLongHaulJobs .= "<a href=\"javascript:showSpecialJob('" . ec($jbId) . "');\">A</a>&nbsp;&nbsp;";
$outListOfLongHaulJobs .= "[<a href=\"../locating/locating.php?f_cr_sid=" . $crSid . "&useRemoteDB=" . ec($useRemoteDB) . "\" target=\"_blank\">" . $crSid . "</a>, " . $vhtName . ", " . $vhtMeasures . ", (" . $vhtPayload . ")]&nbsp;&nbsp;";
// $outListOfLongHaulJobs .= "(" . $jbZipcodes . ")<br><br>";
$outListOfLongHaulJobs .= "(";
for ($j = 0; $j < $jbZipcodesArrayLen; $j++) {
$outListOfLongHaulJobs .= "<a href=\"javascript:showSpecialZipcode('" . ec($jbZipcodesArray[$j]) . "');\">" . $jbZipcodesArray[$j] . "</a>";
if ($j < ($jbZipcodesArrayLen - 1)) : $outListOfLongHaulJobs .= ",&nbsp;"; endif;
}
$outListOfLongHaulJobs .= ") &nbsp;";
$outListOfLongHaulJobs .= "<br><br>";
}
?>
<html lang="de">
<head>
<meta http-equiv="expires" content="Sat, 01 Dec 2003 00:00:00 GMT">
<title>BUNDESWEITE VERMITTLUNG</title>
<link rel="stylesheet" type="text/css" href="../css/phoenix.css">
<script type="text/javascript">
<!--
var statusMessage = '<?php echo $statusMessage ?>';
function displayStatusMessage() {
if (statusMessage != "") {
alert(statusMessage);
}
}
function showSpecialJob(jobId) {
this.document.forms[0].specialJob.value = jobId;
this.document.forms[0].submit();
}
function returnJobToHeadquarters(jobIdEncrypted, jobId) {
if (confirm('Möchten Sie den Auftrag ' + jobId + ' an die Niederlassung zurückgeben?')) {
this.document.forms[0].specialJob.value = jobIdEncrypted;
this.document.forms[0].f_act.value = 'returnJobToHeadquarters';
this.document.forms[0].submit();
}
}
function showSpecialZipcode(zipcode) {
this.document.forms[0].singleZipcode.value = zipcode;
this.document.forms[0].submit();
}
function clearSingleZipcode() {
document.forms[0].singleZipcode.value='';
};
function hqCheckAll(numOfHq) {
for (i = 0; i < numOfHq; i++) {
document.getElementsByName('f_hq_id[]')[i].checked = true;
}
}
function hqUncheckAll(numOfHq) {
for (i = 0; i < numOfHq; i++) {
document.getElementsByName('f_hq_id[]')[i].checked = false;
}
}
// Opens a new (popup-)window with specified parameters
function popupWindow(url,title,config,noFrame) {
// popup = window.open(url,title,config);
var widthPopupWin = screen.width;
var heightPopupWin = screen.height;
if (!noFrame) {
widthPopupWin -= 80;
heightPopupWin -= 180;
}
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2);
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2);
var popup;
popup = window.open(url,title,
"dependent=yes,width=" + widthPopupWin + ",height=" +
heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin +
",scrollbars=yes,resizable=yes");
}
-->
</script>
</head>
<body onLoad="displayStatusMessage()">
<table border="0">
<tr>
<td valign="top" align="center">
<img src="../longhaul/jb_longhaul_map.php?mapSizeMode=<?php echo ec($mapSizeMode) ?>&federalStateMode=<?php echo ec($federalStateMode) ?>&transparency=<?php echo ec($transparency) ?>&distance=<?php echo ec($distance) ?>&singleZipcode=<?php echo ec($singleZipcode) ?>&specialJob=<?php echo ec($specialJob) ?>&displayDirectionArrows=<?php echo ec($displayDirectionArrows) ?>&displayJobIDs=<?php echo ec($displayJobIDs) ?>&displayCrSIDs=<?php echo ec($displayCrSIDs) ?>&displayZipcodes=<?php echo ec($displayZipcodes) ?>&f_hq_id_string=<?php echo $f_hq_id_string ?>&displayCouriers=<?php echo $displayCouriers ?>&useRemoteDB=<?php echo ec($useRemoteDB) ?>" border="0">
</td>
<td width="10">
</td>
<td valign="top" align="center">
<form action="../longhaul/jb_longhaul.php" method="post">
<input type="hidden" name="f_act" value="">
<input type="hidden" name="specialJob" value="">
<input type="hidden" name="useRemoteDB" value="<?php echo ec($useRemoteDB) ?>">
<table border="0">
<tr>
<td valign="top" align="left">
<table border="0">
<tr>
<td valign="top" align="left" width="50%">
Kartengröße: <select name="mapSizeMode"><?php echo addOptionsFromRange("1", "3", $mapSizeMode, "", "", " ") ?></select>
<br><br>
Transparenz: <select name="transparency"><?php echo addOptionsFromArray(array("0","10","20","30","40","50","60","70","80","90","100"), $transparency, "") ?></select> [%]
<br><br>
Mindestdistanz: <select name="distance"><?php echo addOptionsFromArray(array("50","60","70","80","90","100","150","200","300","400","500"), $distance, "") ?></select> [KM]
<br><br>
Anzeige Bundesländer: <input type="checkbox" name="federalStateMode[]" value="1" <?php echo $federalStateMode_box ?>>
</td>
<td valign="top" align="left">
Anzeige Fahrtrichtung: <input type="checkbox" name="displayDirectionArrows[]" value="1" <?php echo $displayDirectionArrows_box ?>>
<br><br>
Anzeige Auftragsnummern: <input type="checkbox" name="displayJobIDs[]" value="1" <?php echo $displayJobIDs_box ?>>
<br><br>
Anzeige Fahrzeugdaten: <input type="checkbox" name="displayCrSIDs[]" value="1" <?php echo $displayCrSIDs_box ?>>
<br><br>
Anzeige Postleitzahlen: <input type="checkbox" name="displayZipcodes[]" value="1" <?php echo $displayZipcodes_box ?>>
<br><br>
Anzeige Kuriere: <input type="checkbox" name="displayCouriers[]" value="1" <?php echo $displayCouriers_box ?>>
</td>
</tr>
</table>
<br><br><br><br>
Lokalisiere PLZ: <input type="text" name="singleZipcode" value="<?php echo $singleZipcode ?>" size="5">
<a href="javascript:clearSingleZipcode();"><img src="../images/waste.png" border="0" height="15" width="12"></a>
<br><br>
<br><br><br><br>
<input type="submit" value="Aktualisieren">&nbsp;&nbsp;
(Letzte Aktualisierung: <?php echo substr($currentTime, -8) ?> Uhr)
<br><br>
<input type="button" value="Listenansicht" onClick="popupWindow('../longhaul/jb_list_fs.php?maskNumOfWins=4&useRemoteDB=<?php echo ec($useRemoteDB) ?>','Ferntouren','',true);">&nbsp;&nbsp;
<br><br>
<br><br><br><br>
Niederlassungen:<br><br>
<?php echo addCheckboxesFromTable("f_hq_id","headquarters","hq_id","hq_mnemonic","hq_mnemonic","",$f_hq_id, "&nbsp;&nbsp;&nbsp;"); ?>
<input type="button" name="f_hq_check_all" value="Alle" onClick="hqCheckAll(<?php echo $numOfHq; ?>);">
<input type="button" name="f_hq_uncheck_all" value="Keine" onClick="hqUncheckAll(<?php echo $numOfHq; ?>);">
<br><br>
<br><br><br><br>
<?php echo $outListOfLongHaulJobs ?>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,362 @@
<?php
/*=======================================================================
*
* jb_longhaul_map.php
*
* Autor: Marc Vollmann
*
=======================================================================*/
include_once ("../include/global.inc.php");
include_once ("../include/auth.inc.php");
include_once ("../include/image.inc.php");
include_once ("../include/bwv.inc.php");
getSecHttpVars("1",array("mapSizeMode", "federalStateMode", "transparency", "distance", "singleZipcode", "specialJob",
"displayDirectionArrows", "displayJobIDs", "displayCrSIDs", "displayZipcodes",
"displayCouriers", "f_hq_id_string", "useRemoteDB"));
// Check for authentication access and granted rights
$usrAccessArray["hq"] = "1";
authCheckForAccess($hq_id, $usr_id, $emp_id, "1", $customerId, $cscIdRoot, $cscIdActual);
authCheckEmployeeRights($emp_id, "10", "1");
// ******************************************************
// Very special treatment for access to remote database
$remoteDBisActive = false;
if (BWV2_checkEmpRemoteDBAccess($useRemoteDB, $emp_id)) :
$remoteDBisActive = BWV2_setRemoteDBAccessParameter();
endif;
// ******************************************************
if ($mapSizeMode != "1" && $mapSizeMode != "2" && $mapSizeMode != "3") : $mapSizeMode = "2"; endif;
if ($federalStateMode != "1") : $federalStateMode = "0"; endif;
if ($transparency == "") : $transparency = "0"; endif;
if ($distance == "") : $distance = "80"; endif;
if ($displayDirectionArrows != "1") : $displayDirectionArrows = "0"; endif;
if ($displayJobIDs != "1") : $displayJobIDs = "0"; endif;
if ($displayCrSIDs != "1") : $displayCrSIDs = "0"; endif;
if ($displayZipcodes != "1") : $displayZipcodes = "0"; endif;
if ($displayCouriers != "1") : $displayCouriers = "0"; endif;
// Special conversion for map script (array => string)
$f_hq_id = spliti(",", $f_hq_id_string);
// Mandator filter
if ($f_hq_id == "") : $f_hq_id = array(); endif;
if (count($f_hq_id) == 0) : array_push($f_hq_id, $hq_id); endif;
$singleZipcode = pad(trim($singleZipcode), 5, "0"); // Use "pad()" because e.g. "01067" is interpreted as "1067" !!!
$zipGeoCoord = getGeoCoordinatesFromZipcode($singleZipcode);
$zipLong = $zipGeoCoord[0];
$zipLat = $zipGeoCoord[1];
if ($zipLong == "" || $zipLat == "") : $singleZipcode = ""; endif;
// Check map file
if (($mapSizeMode == "1" || $mapSizeMode == "2" || $mapSizeMode == "3") && ($federalStateMode == "0" || $federalStateMode == "1")) :
$mapFileName = "germany_" . $mapSizeMode . $federalStateMode . ".jpg";
else :
$mapFileName = "germany_21.jpg"; // Resolution 673 x 900 with federal states [Default]
$mapSizeMode = "2";
$federalStateMode = "1";
endif;
$textFontPath = "../include/arial.ttf";
header ("Content-type: image/jpg");
// Create image from file
$im = createMapImageFromFile($mapFileName);
// Set modifications according to transparency mode
if ($transparency != "0") :
$im = getTransparency($im, $transparency);
endif;
if ($im) :
// Define colors
$lineColBlack = imagecolorallocate ($im, 0, 0, 0);
$lineColRed = imagecolorallocate ($im, 255, 0, 0);
$lineColGreen = imagecolorallocate ($im, 0, 255, 0);
$lineColBlue = imagecolorallocate ($im, 0, 0, 255);
// ****************************************
// Display a found zipcode
$point = getMapImagePoint($mapSizeMode, $zipLong, $zipLat);
if ($point[0] != "0" && $point[1] != "0") :
imageellipse($im, $point[0], $point[1], 29, 29, $lineColRed);
imageellipse($im, $point[0], $point[1], 30, 30, $lineColRed);
imageellipse($im, $point[0], $point[1], 31, 31, $lineColRed);
imageellipse($im, $point[0], $point[1], 32, 32, $lineColRed);
// imageline ($im, $point[0], $point[1] - 50, $point[0], $point[1] + 50, $lineColRed);
// imageline ($im, $point[0] - 50, $point[1], $point[0] + 50, $point[1], $lineColRed);
endif;
// ****************************************
for ($d = 0; $d <= 2; $d++) {
if ($d == "0") :
// Display longhaul jobs (jb_status = "9")
$jbArray = getLongHaulJobData("9", $distance, $specialJob);
$lineCol = $lineColRed;
endif;
if ($d == "1") :
// Display longhaul jobs taken by couriers (jb_status = "1")
$jbArray = getLongHaulJobData("1", $distance, $specialJob);
$lineCol = $lineColBlue;
endif;
if ($d == "2") :
// Display done longhaul with couriers on the way home
$jbArray = getLongHaulJobData("2", $distance, $specialJob);
$lineCol = $lineColGreen;
endif;
$jbArrayLen = count($jbArray);
for ($i = 0; $i < $jbArrayLen; $i++) {
$jbId = $jbArray[$i][0]; // Get ID of the tour
$CrSid = $jbArray[$i][1]; // Get SID of the courier
$jbZipcodes = $jbArray[$i][3]; // Get zipcodes of the tour
$jbZipcodes = trim(substr($jbZipcodes, 0, strpos($jbZipcodes, "|"))); // Remove cities
if (substr($jbZipcodes, -1) == ";") : // Remove last character if ";" again
$jbZipcodes = substr($jbZipcodes, 0, -1);
endif;
$jbZipcodes = str_replace (";", "-,-", $jbZipcodes);
$jbZipcodesArray = spliti("-,-",$jbZipcodes);
$jbZipcodesArrayLen = count($jbZipcodesArray);
$jbZipcodes = str_replace ("-,-", ",", $jbZipcodes);
$vhtName = $jbArray[$i][4]; // Get vehicle name
$vhtID = $jbArray[$i][5]; // Get vehicle ID
$crGpsLong = $jbArray[$i][11]; // Last GPS longitude of the courier
$crGpsLat = $jbArray[$i][12]; // Last GPS latitude of the courier
$crGpsTime = $jbArray[$i][13]; // Last timestamp of courier locating
$pointArray = array();
$drawPolygonFlag = true;
for ($j = 0; $j < $jbZipcodesArrayLen; $j++) :
$currZipcode = trim($jbZipcodesArray[$j]);
if ($currZipcode != "." && is_numeric($currZipcode)) :
// Get point of the current zipcode
$point = getMapCoordinatesFromZipcode($currZipcode, $mapSizeMode);
if ($point[0] != "0" && $point[1] != "0") :
$pointArray = array_merge($pointArray, $point);
endif;
else :
$drawPolygonFlag = false;
break; // Abort because at least one zipcode is not valid
endif;
endfor;
// Draw polygon of the tour
if ($drawPolygonFlag) :
if (count($pointArray) > 4) : // function "imagepolygon" aborts if not at least 3 pairs of coordinates do exist !!!
imagepolygon ($im, $pointArray, $jbZipcodesArrayLen, $lineCol);
else :
imageline ($im, $pointArray[0], $pointArray[1], $pointArray[2], $pointArray[3], $lineCol);
imageline ($im, $pointArray[0] + 1, $pointArray[1] + 1, $pointArray[2] + 1, $pointArray[3] + 1, $lineCol);
endif;
// Display tour start and tour end with ellipses
$pointArrayStart = array_slice($pointArray, 0, 2);
$pointArrayEnd = array_slice($pointArray, -2, 2);
imagefilledellipse($im, $pointArrayStart[0], $pointArrayStart[1], 10, 10, $lineCol);
imagefilledellipse($im, $pointArrayEnd[0], $pointArrayEnd[1], 10, 10, $lineCol);
if ($displayJobIDs == "1" || $displayCrSIDs == "1" || $displayZipcodes == "1" ||
$displayCouriers == "1" || $displayDirectionArrows == "1") :
$textToBeDisplayed = "";
if ($displayJobIDs == "1") : $textToBeDisplayed .= $jbId; endif;
if ($textToBeDisplayed != "") : $textToBeDisplayed .= " "; endif;
if ($displayCrSIDs == "1") : $textToBeDisplayed .= "[" . $CrSid . ", " . $vhtName . "]"; endif;
if ($textToBeDisplayed != "") : $textToBeDisplayed .= " "; endif;
if ($displayZipcodes == "1") : $textToBeDisplayed .= "(" . $jbZipcodes . ")"; endif;
// if ($textToBeDisplayed != "") : $textToBeDisplayed .= " "; endif;
// Display job data
// Central point of the first line of the tour
$pointMiddleX = (($pointArray[2] + $pointArray[0]) / 2); // Middle X-coord. of the first stations
$pointMiddleY = (($pointArray[3] + $pointArray[1]) / 2); // Middle Y-coord. of the first stations
// Top-left-corner of the textbox associated to the tour
$pointTextX = $pointMiddleX + 20;
$pointTextY = $pointMiddleY + 20;
// Gradient of the first line of the tour (=> take care for the y-axis because of orientation [(top, left) = (0, 0)] !!!)
// $gradient = ($pointArray[3] - $pointArray[1]) / ($pointArray[2] - $pointArray[0]);
// Arrow points of the first line of the tour
if ($displayDirectionArrows == "1") :
$pointArrowX = (($pointArray[2] + $pointMiddleX) / 2); // Arrow X-coord. of the first stations
$pointArrowY = (($pointArray[3] + $pointMiddleY) / 2); // Arrow Y-coord. of the first stations
$rScalar = 0.04;
$sScalar = sqrt( ($pointArray[2] - $pointArray[0]) * ($pointArray[2] - $pointArray[0]) + ($pointArray[3] - $pointArray[1]) * ($pointArray[3] - $pointArray[1]) );
$sScalar = 1;
// $rScalar = $sScalar;
$pointArrowX2 = $pointArrowX + $rScalar * ($pointArray[2] - $pointArray[0]); // Arrow X2-coord.
$pointArrowY2 = $pointArrowY + $rScalar * ($pointArray[3] - $pointArray[1]); // Arrow Y2-coord.
$pointArrowXR = $pointArrowX + $rScalar * ($pointArray[1] - $pointArray[3]); // Arrow right X2-coord.
$pointArrowYR = $pointArrowY + $rScalar * ($pointArray[2] - $pointArray[0]); // Arrow right Y2-coord.
$pointArrowXL = $pointArrowX - $rScalar * ($pointArray[1] - $pointArray[3]); // Arrow left X2-coord.
$pointArrowYL = $pointArrowY - $rScalar * ($pointArray[2] - $pointArray[0]); // Arrow left Y2-coord.
$arrowPointArray = array($pointArrowXL, $pointArrowYL, $pointArrowXR, $pointArrowYR, $pointArrowX2, $pointArrowY2);
imagefilledpolygon ($im, $arrowPointArray, 3, $lineCol);
endif;
// Set circle in the middle of the line of the first both stations for connection with textbox or vehicle icon
imagefilledellipse($im, $pointMiddleX, $pointMiddleY, 5, 5, $lineColBlack);
if ($displayJobIDs == "1" || $displayCrSIDs == "1" || $displayZipcodes == "1") :
$boxPointsArray = imagettftext ($im, 10, 0, $pointTextX, $pointTextY, $lineColBlack, $textFontPath, $textToBeDisplayed);
// Draws a box around the text
$boxBorder = "2";
setTextBox ($im, $boxPointsArray, $boxBorder, $lineColBlack);
imageline ($im, $pointMiddleX, $pointMiddleY, $boxPointsArray[6] - $boxBorder, $boxPointsArray[7] - $boxBorder, $lineColBlack);
endif;
// Display courier with vehicle icon
$vhtFileName = "";
if ($vhtID == "2") : $vhtFileName = "pkw_mc_1.jpg" ; endif;
if ($vhtID == "3") : $vhtFileName = "kombi_mc_1.jpg" ; endif;
if ($vhtID == "4") : $vhtFileName = "kasten_mc_1.jpg" ; endif;
if ($vhtID == "5") : $vhtFileName = "bus_mc_1.jpg" ; endif;
if ($vhtID == "6") : $vhtFileName = "grbus_mc_1.jpg" ; endif;
if ($vhtID == "7") : $vhtFileName = "lkw_mc_1.jpg" ; endif;
if ($vhtID > "7") : $vhtFileName = "lkw_mc_1.jpg" ; endif;
if ($displayCouriers == "1" && $vhtFileName != "") :
$imVht = createMapImageFromFile($vhtFileName);
$imVhtSizeX = imagesx($imVht);
$imVhtSizeY = imagesy($imVht);
// Set transparency of the vehicle icon
$currSeconds = mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y"));
$crGpsTimeSeconds = mktime(substr($crGpsTime,11,2), substr($crGpsTime,14,2), substr($crGpsTime,17,2), substr($crGpsTime,5,2), substr($crGpsTime,8,2), substr($crGpsTime,0,4));
$diffMinutes = (($currSeconds - $crGpsTimeSeconds) / 60);
$transparencyScaleVehicleIcon = min((floor($diffMinutes / 15) * 10) - 10, 80);
// $boxPointsArray = imagettftext ($im, 10, 0, 300, 500, $lineColBlack, $textFontPath, $transparencyScaleVehicleIcon);
// setTextBox ($im, $boxPointsArray, "2", $lineColBlack);
if ($transparencyScaleVehicleIcon > 0) :
$imVht = getTransparency($imVht, $transparencyScaleVehicleIcon);
endif;
// Get coordinates where the vehicle image has to be set
$pointVhtImgX = $pointMiddleX - 20;
$pointVhtImgY = $pointMiddleY - 20;
$currPointVht = getMapImagePoint($mapSizeMode, $crGpsLong, $crGpsLat);
if ($currPointVht[0] > 0 && $currPointVht[1] > 0) :
$pointVhtImgX = $currPointVht[0] - 20;
$pointVhtImgY = $currPointVht[1] - 20;
endif;
// int Imagecopy ( int dst_im, int src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h);
imagecopy ($im, $imVht, $pointVhtImgX, $pointVhtImgY, 0, 0, $imVhtSizeX, $imVhtSizeY);
// Connect text box with the middle of the first stations
// imagefilledellipse($im, $pointMiddleX, $pointMiddleY, 5, 5, $lineColBlack);
imageline ($im, $pointMiddleX, $pointMiddleY, $pointVhtImgX + ($imVhtSizeX / 2), $pointVhtImgY + ($imVhtSizeY / 2), $lineColBlack);
endif;
endif;
endif;
}
}
// ****************************************
endif;
/*
// -----------------------------------------------------------------------------------------
// Frankfurt am Main 8.60462075288717 50.1263940837884 60489
$geoCoordX = "8.60462075288717";
$geoCoordY = "50.1263940837884";
$point = getMapImagePoint($mapSizeMode, $geoCoordX, $geoCoordY);
setCrosshairs ($im, $point, "30");
// -----------------------------------------------------------------------------------------
// Kiel 10.1167469407959 54.3626350523619 24106
$geoCoordX = "10.1167469407959";
$geoCoordY = "54.3626350523619";
$point = getMapImagePoint($mapSizeMode, $geoCoordX, $geoCoordY);
setCrosshairs ($im, $point, "30");
// -----------------------------------------------------------------------------------------
// München 11.5721994266954 48.1378593490146 80331
$geoCoordX = "11.5721994266954";
$geoCoordY = "48.1378593490146";
$point = getMapImagePoint($mapSizeMode, $geoCoordX, $geoCoordY);
setCrosshairs ($im, $point, "30");
// -----------------------------------------------------------------------------------------
// Essen 7.00774636216092 51.5141464430345 45329
$geoCoordX = "7.00774636216092";
$geoCoordY = "51.5141464430345";
$mapPointX = $mapPointConstX + (($geoCoordX - $geoCoordConstX) * $mapPointConstDeltaX);
$mapPointY = $mapPointConstY + (($geoCoordConstY - $geoCoordY) * $mapPointConstDeltaY);
$point = getMapImagePoint($mapSizeMode, $geoCoordX, $geoCoordY);
setCrosshairs ($im, $point, "30");
// -----------------------------------------------------------------------------------------
// Dresden 13.6911443969423 51.0805574259239 01139
$geoCoordX = "13.6911443969423";
$geoCoordY = "51.0805574259239";
$mapPointX = $mapPointConstX + (($geoCoordX - $geoCoordConstX) * $mapPointConstDeltaX);
$mapPointY = $mapPointConstY + (($geoCoordConstY - $geoCoordY) * $mapPointConstDeltaY);
$point = getMapImagePoint($mapSizeMode, $geoCoordX, $geoCoordY);
setCrosshairs ($im, $point, "30");
// -----------------------------------------------------------------------------------------
// Nürnberg 11.0665446831496 49.4793815205307 90425
$geoCoordX = "11.0665446831496";
$geoCoordY = "49.4793815205307";
$point = getMapImagePoint($mapSizeMode, $geoCoordX, $geoCoordY);
setCrosshairs ($im, $point, "30");
// -----------------------------------------------------------------------------------------
// Hamburg 10.0011036114924 53.5541579534295 20095
$geoCoordX = "10.0011036114924";
$geoCoordY = "53.5541579534295";
$point = getMapImagePoint($mapSizeMode, $geoCoordX, $geoCoordY);
// imagettftext ($im, 8, 0, 500, 500, $lineColBlack, $textFontPath, $point[0] . " " . $point[1]);
setCrosshairs ($im, $point, "30");
// -----------------------------------------------------------------------------------------
// Magdeburg 11.6407479374166 52.1217786614182 39104
$geoCoordX = "11.6407479374166";
$geoCoordY = "52.1217786614182";
$point = getMapImagePoint($mapSizeMode, $geoCoordX, $geoCoordY);
setCrosshairs ($im, $point, "30");
*/
// Output DEBUG
// imagettftext ($im, 10, 0, 10, 10, $lineColBlack, $textFontPath, $debug);
imagepng ($im);
?>