1. Import
This commit is contained in:
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* check_jb_permanent.auto.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
// Execution-Time for script
|
||||
set_time_limit(0);
|
||||
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
|
||||
|
||||
include_once("../include/dbglobal.inc.php");
|
||||
include_once("../include/caglobal.inc.php");
|
||||
|
||||
// Sicherstellen, dass auch wirklich nur ein Prozess läuft...
|
||||
if ($argc > 0):
|
||||
$cnt = 0;
|
||||
exec("ps -fA", $output);
|
||||
for ($i = 0; $i < count($output); $i++):
|
||||
$pos = strpos ($output[$i], $argv[0]);
|
||||
if (!($pos === false))
|
||||
$cnt++;
|
||||
endfor;
|
||||
if ($cnt > 1):
|
||||
echo "[" . date("Y-m-d H:i:s") . "] " . "$PHP_SELF: [" . $argv[0] . "] läuft schon...\n";
|
||||
exit();
|
||||
endif;
|
||||
endif;
|
||||
|
||||
getDb2Connection(); // Try to connect request server because of performance
|
||||
|
||||
// Endless loop
|
||||
while (TRUE):
|
||||
|
||||
//********************************************************************************
|
||||
// Dinge, die zu einer bestimmten Uhrzeit passieren sollen
|
||||
// Diese sind in eine Schleife eingebaut, die für mindestens x Minuten Verzögerung sorgt
|
||||
|
||||
for ($i = 0; $i < 2; $i++):
|
||||
|
||||
// if (date("H:i") == "23:45"):
|
||||
// writeLog_("../log/check_jb_permanent_invtext_", "exiting...");
|
||||
// exit();
|
||||
// endif;
|
||||
|
||||
$sleep_time = 59 - date("s");
|
||||
sleep($sleep_time);
|
||||
while (date("s") != "00");
|
||||
endfor;
|
||||
|
||||
/*
|
||||
835489 //STE900608
|
||||
203463 //STHH927621
|
||||
//823978 //STF909226
|
||||
//819825 //STDD908923
|
||||
//833194 //STB975597
|
||||
835016 //STS910215
|
||||
832514 //STHB922142
|
||||
819783 //STH910930
|
||||
823862 //STE900608
|
||||
838538, 839047, 836563, 839052, 839053, 839044, 839045, 838877, 839055, 839046, 839056, 836922, 839048, 839049, 836571, 838816
|
||||
|
||||
t:m:
|
||||
cs_id cs_eid emp_id usr_id
|
||||
833194 STB975597 834135 841591
|
||||
819825 STDD908923 819943 825800
|
||||
823862 STE900608 824266 830604
|
||||
823978 STF909226 824386 830734
|
||||
819783 STH910930 819901 825754
|
||||
832514 STHB922142 833410 840785
|
||||
203463 STHH927621 203464 208443
|
||||
823922 STL908468 824329 830671
|
||||
839904 STM900029 841607 850094
|
||||
847829 STM900333 851375 861224
|
||||
|
||||
|
||||
Daikin:
|
||||
841784, 841782, 841783, 841785, 841786, 841787, 842129, 842128, 842195, 844750
|
||||
|
||||
ICS Group
|
||||
854125, 854116, 854129, 854166, 854113, 854120, 854115, 854117, 854114, 854118
|
||||
|
||||
*/
|
||||
// ALL !!!!!!!!!!
|
||||
// foreach (array(835489, 203463, 835016, 832514, 819783, 823862, 836193, 836374, 836358, 836366, 836367, 836368, 836803, 838449, 838538, 839047, 836563, 839052, 839053, 839044, 839045, 838877, 839055, 839046, 839056, 836922, 839048, 839049, 836571, 838816, 839596, 839603, 833194, 819825, 823978, 823922, 839904, 839996, 841784, 841782, 841783, 841785, 841786, 841787, 842129, 842128, 842195, 844750, 847829, 854125, 854116, 854129, 854166, 854113, 854120, 854115, 854117, 854114, 854118) as $cs_id_tmp) {
|
||||
|
||||
// Daikin and ICS only
|
||||
foreach (array(841784, 841782, 841783, 841785, 841786, 841787, 842129, 842128, 842195, 844750, 854125, 854116, 854129, 854166, 854113, 854120, 854115, 854117, 854114, 854118) as $cs_id_tmp) {
|
||||
$system_result = "";
|
||||
$cmd = "php ../tools/auto_response.php acapella7890 $cs_id_tmp >> ../log/auto_response.stdout+err 2>&1";
|
||||
$ausgabe = system($cmd, $system_result);
|
||||
writeLog_("../log/check_jb_permanent_invtext_", "Calling auto_response.php $cs_id_tmp: ausgabe='$ausgabe'");
|
||||
}
|
||||
|
||||
// 21.07.2025: make all log-files belong to www-data
|
||||
foreach(array("/srv/htdocs/stadtbote/log/","/srv/htdocs/stadtbote/service/LN_374893028394/") as $dir_name) {
|
||||
if ($handle = opendir($dir_name)) {
|
||||
while (false !== ($entry = readdir($handle))) {
|
||||
//echo $entry . ", " . (fileowner($dir_name . $entry) == 0) . ", " . in_array(pathinfo($dir_name . $entry, PATHINFO_EXTENSION), array("log", "stdout+err", "err", "txt")) . "\n";
|
||||
//print_r(posix_getpwuid(fileowner($filename)));
|
||||
if (is_file($dir_name . $entry) && in_array(pathinfo($dir_name . $entry, PATHINFO_EXTENSION), array("log", "stdout+err", "err", "txt")) && fileowner($dir_name . $entry) == 0) {
|
||||
if (!exec("chown www-data:www-data " . $dir_name . $entry))
|
||||
echo "executing command [" . "chown www-data:www-data " . $dir_name . $entry . "] returned true\n";
|
||||
else
|
||||
echo "executing command [" . "chown www-data:www-data " . $dir_name . $entry . "] returned false\n";
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
//********************************************************************************
|
||||
|
||||
endwhile; // Endless loop
|
||||
|
||||
?>?
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -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.php">
|
||||
|
||||
<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,58 @@
|
||||
<?php
|
||||
// /var/www/html/jobs/delete-file-upload.php
|
||||
error_reporting(0);
|
||||
header('Content-Type: application/json');
|
||||
try {
|
||||
include_once("../include/glob_defs.inc.php");
|
||||
|
||||
// Direkte MySQLi-Verbindung
|
||||
$conn = new mysqli($dbhostOnly, $dblogin, $dbpassword, $dbname, $dbport);
|
||||
|
||||
if ($conn->connect_error) {
|
||||
echo json_encode(['success' => false, 'error' => 'DB-Verbindung fehlgeschlagen']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$conn->query('SET NAMES latin1');
|
||||
|
||||
$json = file_get_contents('php://input');
|
||||
$data = json_decode($json, true);
|
||||
|
||||
if (!$data) {
|
||||
echo json_encode(['success' => false, 'error' => 'Keine Daten']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$objType = ($data['upload_type'] != 0) ? 'tr' : 'jb';
|
||||
$referenceId = intval($data['reference_id'] ?? 0);
|
||||
$filename = $conn->real_escape_string($data['filename'] ?? '');
|
||||
$viewUrl = $conn->real_escape_string($data['view_url'] ?? '');
|
||||
$counter = intval($data['counter'] ?? 0);
|
||||
$remark = $conn->real_escape_string($data['remark'] ?? '');
|
||||
$remark = str_replace('|', ' ', $remark);
|
||||
$context = $conn->real_escape_string($remark . '|' . $viewUrl . '|' . $counter);
|
||||
|
||||
$sql = "DELETE FROM genericdatacontainer
|
||||
WHERE gdc_obj_type = '$objType'
|
||||
AND gdc_obj_id = $referenceId
|
||||
AND gdc_gen_fieldname = 'file_upload'
|
||||
AND gdc_content = '$filename'
|
||||
AND gdc_context = '$context'";
|
||||
|
||||
$conn->query($sql);
|
||||
|
||||
$affectedRows = $conn->affected_rows;
|
||||
|
||||
$conn->close();
|
||||
|
||||
if ($affectedRows > 0) {
|
||||
echo json_encode(['success' => true, 'deleted' => $affectedRows . " " . $sql]);
|
||||
} else {
|
||||
echo json_encode(['success' => false, 'error' => 'Eintrag nicht gefunden '. $sql]);
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['success' => false, 'error' => $e->getMessage()]);
|
||||
} catch (Error $e) {
|
||||
echo json_encode(['success' => false, 'error' => $e->getMessage()]);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* get_address.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
//require_once("../PEAR/HTML/Template/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, $von_ad_country) = getFieldsValueFromId(
|
||||
"address", "ad_id", $von_ad_id, array("ad_city", "ad_zipcode", "ad_street", "ad_country"));
|
||||
// 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_AD_COUNTRY => $von_ad_country, 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, $nach_ad_country) = getFieldsValueFromId(
|
||||
"address", "ad_id", $nach_ad_id, array("ad_city", "ad_zipcode", "ad_street", "ad_country"));
|
||||
$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_AD_COUNTRY => $nach_ad_country, JL_TR_REMARK => $nach_remark));
|
||||
endif;
|
||||
|
||||
$javascript .= javascriptOpenerRefreshAndClose();
|
||||
|
||||
// Inhalt des temporären Fensters erzeugen und ausgeben
|
||||
//$tpl = new HTML_Template_IT();
|
||||
//$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,57 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* get_couriers.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
//require_once("../PEAR/HTML/Template/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);
|
||||
if ($userType == 1):
|
||||
$cr_id_order_list2 = str_replace("var cr_id_order_list2", "opener.cr_id_order_list2", $cr_id_order_list2);
|
||||
else:
|
||||
$cr_id_order_list2 = "opener.cr_id_order_list2=[\"&npsp;\"];\n";
|
||||
endif;
|
||||
$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);
|
||||
$companyIds_js = str_replace("var companyIds", "opener.companyIds", $companyIds_js);
|
||||
$cr_id_order_list_blocked_js = str_replace("var cr_id_order_list_blocked", "opener.cr_id_order_list_blocked", $cr_id_order_list_blocked_js);
|
||||
//die($cr_id_order_list);
|
||||
$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" .
|
||||
"opener.MASK_COURIER_BLOCK_BLOCKED =\"" . MASK_COURIER_BLOCK_BLOCKED . "\";\n" .
|
||||
"opener.jb_longhaul =\"" . $jb_longhaul . "\";\n" .
|
||||
$cr_id_order_list .
|
||||
$cr_id_order_list2 .
|
||||
$vht_id_str_js .
|
||||
$companyIds_js .
|
||||
$cr_id_order_list_blocked_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 HTML_Template_IT();
|
||||
//$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.php">
|
||||
<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,828 @@
|
||||
<?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); // Mail von I.K. am 06.01. -> Merkwürdige Fehlermeldung in check_jb_permanent_multi_202201.log: $phpVersion scheint nicht definiert?
|
||||
if ($phpVersion < "8.0"):
|
||||
if ($phpVersion >= "7.0"):
|
||||
require_once("../PEAR/HTML/Template/IT.php");
|
||||
else:
|
||||
require_once("HTML/IT.php");
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// Decision to use the archive or normal tables
|
||||
list ($dbhistory) = getHttpVars(array("dbhistory"));
|
||||
getDBNames($dbhistory);
|
||||
if (!isset($dbh_jb) || $dbh_jb == "")
|
||||
$dbh_jb = "job";
|
||||
if (!isset($dbh_tr) || $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($hq_id, $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_id_copy_permanent,
|
||||
$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_id_parent, $jb_export_time, $jb_freetext_2, $jb_dispoinfo, $jb_warningtime, $jb_offer, $jb_origin, $jb_orderer, $jb_commission_no, $jb_createtime) = // $jb_status wird bei der nachträglichen Änderung einer Tour benötigt
|
||||
getFieldsValueFromId($_job_table, "jb_id", $jb_id,
|
||||
array("hq_id", "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_id_copy_permanent",
|
||||
"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_id_parent", "jb_export_time", "jb_freetext_2", "jb_dispoinfo", "jb_warningtime", "jb_offer", "jb_origin", "jb_orderer", "jb_commission_no", "jb_createtime"));
|
||||
if (isset($no_dates) && $no_dates == "true")
|
||||
$jb_orderer = "";
|
||||
if (isset($_get_tr_commission_no) && $_get_tr_commission_no != true)
|
||||
$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'");
|
||||
// 23.01.2024: Wenn Dauerauftragsfortsetzung, dann manuelle TSZ-Sätze ignorieren (d.h. nur laden, wenn keine Dauerauftragsfortsetzung)
|
||||
if (!(isset($check_jb_permanent_flag) && $check_jb_permanent_flag == true && getParameterValue("0", "MASK_CHECK_MARKUP_PERMANENT", $hq_id) == "1")):
|
||||
$jb_cr_markup = $db->getOne("SELECT jbprc_price FROM jobprice WHERE jb_id = " . $jb_id . " AND mt_sort = 9");
|
||||
$jb_markup = $db->getOne("SELECT jbprc_price FROM jobprice WHERE jb_id = " . $jb_id . " AND mt_sort = 8");
|
||||
endif;
|
||||
}
|
||||
$jb_km = $db->getOne("SELECT jbprc_price FROM jobprice WHERE jb_id = " . $jb_id . " AND mt_sort = 11 AND (TRIM(jbprc_remark) = 'm' OR TRIM(jbprc_remark) = 'M')");
|
||||
$jb_price_km = $db->getOne("SELECT jbprc_price FROM jobprice WHERE jb_id = " . $jb_id . " AND mt_sort = 15");
|
||||
$jb_toll = $db->getOne("SELECT gdc_content FROM genericdatacontainer WHERE gdc_obj_type = 'jb' AND gdc_obj_id = " . $jb_id . " AND gdc_gen_fieldname = 'jb_toll'");
|
||||
$jb_origin_other = $db->getOne("SELECT gdc_content FROM genericdatacontainer WHERE gdc_obj_type = 'jb' AND gdc_obj_id = " . $jb_id . " AND gdc_gen_fieldname = 'jb_origin_other'");
|
||||
$jb_bwv = $db->getOne("SELECT gdc_content FROM genericdatacontainer WHERE gdc_obj_type = 'jb' AND gdc_obj_id = " . $jb_id . " AND gdc_gen_fieldname = 'jb_bwv'");
|
||||
$jb_id_insurance = $db->getOne("SELECT gdc_content FROM genericdatacontainer WHERE gdc_obj_type = 'jb' AND gdc_obj_id = " . $jb_id . " AND gdc_gen_fieldname = 'jb_id_insurance'");
|
||||
$jb_value_of_goods = "";
|
||||
$jb_insurance_rate = "0";
|
||||
$special_case = 0;
|
||||
if ($jb_id_insurance != "") {
|
||||
$jb_id_insurance_gdc_context = explode("|", $db->getOne("SELECT gdc_context FROM genericdatacontainer WHERE gdc_obj_type = 'jb' AND gdc_obj_id = " . $jb_id . " AND gdc_gen_fieldname = 'jb_id_insurance'"));
|
||||
$jb_value_of_goods = $jb_id_insurance_gdc_context[0];
|
||||
$jb_insurance_rate = $jb_id_insurance_gdc_context[1];
|
||||
$special_case = $jb_id_insurance_gdc_context[2];
|
||||
}
|
||||
$special_case_ori = $special_case;
|
||||
$job_is_exported = (trim($jb_export_time) != "" ? true : false);
|
||||
$self_service_discount = $db->getOne("SELECT jbprc_price FROM jobprice WHERE jb_id = " . $jb_id . " AND mt_sort = 13");
|
||||
$jb_hiddenFreetext_1 = $db->getOne("SELECT gdc_content FROM genericdatacontainer WHERE gdc_obj_type = 'jb' AND gdc_obj_id = " . $jb_id . " AND gdc_gen_fieldname = 'jb_hiddenFreetext_1'");
|
||||
$jb_cashpayer_mail = $db->getOne("SELECT gdc_content FROM genericdatacontainer WHERE gdc_obj_type = 'jb' AND gdc_obj_id = " . $jb_id . " AND gdc_gen_fieldname = 'jb_cashpayer_mail'");
|
||||
$jb_offer_mail = $db->getOne("SELECT gdc_content FROM genericdatacontainer WHERE gdc_obj_type = 'jb' AND gdc_obj_id = " . $jb_id . " AND gdc_gen_fieldname = 'jb_offer_mail'");
|
||||
$jb_cashpayer_mail_status = $db->getOne("SELECT gdc_context FROM genericdatacontainer WHERE gdc_obj_type = 'jb' AND gdc_obj_id = " . $jb_id . " AND gdc_gen_fieldname = 'jb_cashpayer_mail'");
|
||||
$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;
|
||||
|
||||
// Wenn Dauerauftrag dann den ersten Vorgänger finden, der nicht temporär geändert worden ist und als Vorlage für einen Fortsetzungsauftrag
|
||||
// gilt, sollte dieser Auftrag temporär geändert werden
|
||||
// Dies aber natürlich nur dann, wenn der Auftrag in die Maske geladen wird und nicht dann, wenn gerade ein Dauerauftrag neu eingestellt wird
|
||||
$jb_id_permanent_pre2 = "";
|
||||
if (!(isset($check_jb_permanent_flag) && $check_jb_permanent_flag == true)):
|
||||
if ($jb_permanent != "0" && $jb_id_copy_permanent == "" && getParameterValue("0", "MASK_ASK_PERMANENT", $hq_id) == "1") {
|
||||
$jb_id_permanent_pre2 = $db->getOne("SELECT jb_id FROM job WHERE jb_id_copy_permanent = " . $jb_id);
|
||||
if ($jb_id_permanent_pre2 != "") { // es gibt einen Vorgänger; hier schauen, ob der nicht temporär geändert worden war und einen anderen Vorgänger hatte
|
||||
$gdc_content = $db->getOne("SELECT gdc_content FROM genericdatacontainer WHERE gdc_obj_type = 'jb' AND gdc_obj_id = " . $jb_id_permanent_pre2 . " AND gdc_gen_fieldname = 'jb_id_permanent_pre'");
|
||||
if ($gdc_content != "")
|
||||
$jb_id_permanent_pre2 = $gdc_content;
|
||||
}
|
||||
}
|
||||
endif;
|
||||
|
||||
$today = getdate();
|
||||
// Prüfen, ob Datensatz gesperrt bzw. neue Sperre setzen
|
||||
if (!(isset($_copy_jobs_flag) && $_copy_jobs_flag == true) && !(isset($check_jb_permanent_flag) && $check_jb_permanent_flag == true)):
|
||||
$job_is_locked = false;
|
||||
$job_is_locked_mode = 0;
|
||||
$job_is_locked_text = "";
|
||||
$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((int) $jb_locktime_arr[3], (int) $jb_locktime_arr[4] + (int) MASK_LOCKTIME_TIMEOUT, (int) $jb_locktime_arr[5], (int) $jb_locktime_arr[1], (int) $jb_locktime_arr[2], $jb_locktime_arr[0]));
|
||||
if ($locktime <= $locktime_expired):
|
||||
// Timeout noch nicht abgelaufen: Datensatz ist gesperrt
|
||||
$job_is_locked = true;
|
||||
$job_is_locked_text = "";
|
||||
$tmpUserNames = getFieldsValueFromId("user", "usr_id", $jb_lockuser, array("usr_firstname","usr_name"));
|
||||
$job_is_locked_text = $tmpUserNames[0] . " " . $tmpUserNames[1];
|
||||
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;
|
||||
|
||||
if (!$job_is_locked && $csc_id_payer != CSC_ID_PAYER_CASH && isset($jb_copy) && $jb_copy == "true"):
|
||||
$tmpCsIdPayer = getFieldValueFromId("costcenter", "csc_id", $csc_id_payer, "cs_id");
|
||||
$tmpCmpIdPayer = getFieldValueFromId("customer", "cs_id", $tmpCsIdPayer, "cmp_id");
|
||||
$tmpCmpPayerFields = getFieldsValueFromId("company", "cmp_id", $tmpCmpIdPayer, array("cmp_authenticated","cmp_visible"));
|
||||
if ($tmpCmpPayerFields[0] == "0" || $tmpCmpPayerFields[1] == "0") :
|
||||
$job_is_locked = true;
|
||||
if ($tmpCmpPayerFields[0] == "0") : $job_is_locked_mode = 1; endif;
|
||||
if ($tmpCmpPayerFields[1] == "0") : $job_is_locked_mode = 2; endif;
|
||||
if ($tmpCmpPayerFields[0] == "0" && $tmpCmpPayerFields[1] == "0") : $job_is_locked_mode = 3; endif;
|
||||
endif;
|
||||
$fileHandle = @fopen("../log/get_saved_tour_" . $today['year'] . sprintf("%02d", $today['mon']) . ".log", 'a');
|
||||
@fwrite($fileHandle, "[" . date("Y-m-d H:i:s") . "] \$jb_id = " . $jb_id . ", \$csc_id_payer = " . $csc_id_payer . ", \$usr_id = " . $usr_id . ", \$tmpCmpIdPayer = " . $tmpCmpIdPayer . ", \$tmpCmpPayerFields = " . json_encode($tmpCmpPayerFields) . ", \$job_is_locked = " . $job_is_locked . ", \$job_is_locked_mode = " . $job_is_locked_mode . "\n");
|
||||
@fclose($fileHandle);
|
||||
|
||||
endif;
|
||||
endif;
|
||||
|
||||
if ($jb_weight == "") $jb_weight = "0";
|
||||
if ($jb_crvh_length == "") $jb_crvh_length = "0";
|
||||
if ($jb_crvh_width == "") $jb_crvh_width = "0";
|
||||
if ($jb_crvh_height == "") $jb_crvh_height = "0";
|
||||
if ($jb_crvh_position == "") $jb_crvh_position = "0";
|
||||
//if ($jb_payment == 0) $jb_payment = "";
|
||||
if ($jb_fixprice == 0) $jb_fixprice = "";
|
||||
//if ($jb_markup == 0) $jb_markup = "";
|
||||
if ($jb_serviceprice == 0) $jb_serviceprice = "";
|
||||
if ($jb_cr_price == 0) $jb_cr_price = "";
|
||||
if ($jb_fixprice != 0 && $jb_fixprice != "")
|
||||
$jb_fixprice = str_replace(".", ",", sprintf("%01.2f", $jb_fixprice));
|
||||
if (isset($jb_markup) && $jb_markup != 0 && $jb_markup != "")
|
||||
$jb_markup = str_replace(".", ",", sprintf("%01.2f", $jb_markup));
|
||||
if ($jb_toll != "")
|
||||
$jb_toll = str_replace(".", ",", sprintf("%01.2f", $jb_toll));
|
||||
if ($jb_serviceprice != 0 && $jb_serviceprice != "")
|
||||
$jb_serviceprice = str_replace(".", ",", sprintf("%01.2f", $jb_serviceprice));
|
||||
if ($jb_cr_price != 0 && $jb_cr_price != "")
|
||||
$jb_cr_price = str_replace(".", ",", sprintf("%01.2f", $jb_cr_price));
|
||||
if (MASK_CR_PRICE_MODE == "1") {
|
||||
if ($jb_cr_serviceprice != "")
|
||||
$jb_cr_serviceprice = str_replace(".", ",", sprintf("%01.2f", $jb_cr_serviceprice));
|
||||
if (isset($jb_cr_markup) && $jb_cr_markup != "") {
|
||||
$jb_cr_markup = str_replace(".", ",", sprintf("%01.2f", $jb_cr_markup));
|
||||
// } else {
|
||||
// $jb_cr_markup = $jb_markup;
|
||||
}
|
||||
}
|
||||
if ($jb_km != "")
|
||||
$jb_km = str_replace(".", ",", sprintf("%01.3f", $jb_km));
|
||||
while (substr($jb_km, -1) == "0")
|
||||
$jb_km = substr($jb_km, 0, -1);
|
||||
if (substr($jb_km, -1) == ",")
|
||||
$jb_km = substr($jb_km, 0, -1);
|
||||
|
||||
if (isset($csc_id_order))
|
||||
if ($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 = "";
|
||||
|
||||
$was_afterwards = job_was_afterwards($jb_id);
|
||||
if ((!isset($no_dates) || $no_dates != "true") && ($jb_reserv == 1 || $jb_permanent != 0 || $was_afterwards)):
|
||||
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 = "";
|
||||
$jb_id_permanent_pre2 = ""; // temporäre Änderungen in Tour-Konserven ergeben beim Aufruf der Konserve keinen Sinn mehr (siehe Mail aus Dresden am 16.02.2023)
|
||||
endif;
|
||||
if ($jb_warningtime != "0000-00-00 00:00:00" && $jb_warningtime != ""):
|
||||
list($jb_warnjahr, $jb_warnmonat, $jb_warntag, $jb_warnstunde, $jb_warnminute) = getValsFromDate($jb_warningtime);
|
||||
else:
|
||||
$jb_warnjahr = $jb_warnmonat = $jb_warntag = $jb_warnstunde = $jb_warnminute = "";
|
||||
endif;
|
||||
|
||||
// Unteraufträge holen
|
||||
list ($tmp_add_jb_ids, $tmp_add_sids, $tmp_add_prices) = getJobChildren($jb_id, $dbh_jb, (isset($no_dates) ? $no_dates : false));
|
||||
$delete_suborder = false;
|
||||
if ($tmp_add_jb_ids != "" AND $db->getOne("SELECT job.jb_id" .
|
||||
" FROM costcenter, customer, job" .
|
||||
" WHERE jb_id = " . $jb_id .
|
||||
" AND job.csc_id_payer = costcenter.csc_id AND costcenter.cs_id = customer.cs_id AND cs_eid IN (" . getParameterValue("0", "JB_CR_PRICE_MINIMUM", "0") . ")" .
|
||||
" AND csc_name = '- Ad hoc Pkw bis XL-Bus'" .
|
||||
" AND jb_finishtime > '2020-08-10' AND jb_status = 2" .
|
||||
" AND jb_storno IS NULL" .
|
||||
" AND jb_export_time IS NULL") == $jb_id)
|
||||
$delete_suborder = true;
|
||||
|
||||
// Sondervereinbarungen holen
|
||||
list ($tmp_add_srvs, $tmp_add_srvts, $tmp_add_mult, $tmp_add_mult_price) = explode(chr(0xB2), $jb_freetext_2); //chr(0xB2) = "²"; "²" führt zu Problemen, wenn da eine ungewollte Konvertierung zwischenkommt
|
||||
|
||||
// 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 = ($phpVersion >= "8.0" ? $res->fetch_assoc() : $res->fetchRow())):
|
||||
$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 = ($phpVersion >= "8.0" ? $res->fetch_assoc() : $res->fetchRow())):
|
||||
// $tr_mediationarea_names .= ($tr_mediationarea_names != "" ? "," : "") . $row['tr_mediationarea_name'];
|
||||
// endwhile;
|
||||
// $res->free();
|
||||
$minimum_price_name = $db->getOne("SELECT trs_srvt_name FROM tourservice WHERE trs_srv_name = 'Fixpreis' AND trs_srvt_name LIKE '[M] Mindestpreis%' AND jb_id = " . $jb_id);
|
||||
// $km_price_params = "|" . $km_price_params . "||zone|" . $tr_mediationarea_names . "|" . ($minimum_price_name != "" ? $minimum_price_name : "");
|
||||
$km_price_params = $jb_price_km . "|" . $km_price_params . "||zone||" . ($minimum_price_name != "" ? $minimum_price_name : "");
|
||||
$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 (isset($emp_id) && 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'");
|
||||
$jb_sales_tax_rate = "voll";
|
||||
if ($jb_sales_tax_rate_sign == "0")
|
||||
$jb_sales_tax_rate = "ohne";
|
||||
|
||||
$mandatory_filters = trim(getParameterValue("0", "MASK_MANDATORY_FILTERS", $hq_id));
|
||||
//echo $jb_cr_filter . "|" . $mandatory_filters . "<br>\n";
|
||||
if ($mandatory_filters != ''):
|
||||
$mandatory_filtersArr = explode(",", $mandatory_filters);
|
||||
for ($i = 0; $i < count($mandatory_filtersArr); $i++):
|
||||
if ($jb_cr_filter == $mandatory_filtersArr[$i])
|
||||
$jb_cr_filter = "";
|
||||
$jb_cr_filter = str_replace("," . $mandatory_filtersArr[$i] . ",", ",", $jb_cr_filter);
|
||||
$jb_cr_filter = str_replace($mandatory_filtersArr[$i] . ",", "", $jb_cr_filter);
|
||||
$jb_cr_filter = str_replace("," . $mandatory_filtersArr[$i], "", $jb_cr_filter);
|
||||
endfor;
|
||||
endif;
|
||||
//echo $jb_cr_filter . "<br>\n"; die();
|
||||
|
||||
$javascript = "opener.parent.job_options.bwv_alert = false;\n" . setJavascriptOpenerFormVals("job_options", "tourOptions",
|
||||
array("cr_id_order" => (isset($cr_sid_none) && $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_markup" => (isset($jb_markup) ? $jb_markup : ""), "jb_cr_markup" => (isset($jb_cr_markup) ? $jb_cr_markup : ""), "jb_toll" => $jb_toll,
|
||||
"jb_id_insurance" => $jb_id_insurance, "jb_serviceprice" => $jb_serviceprice, "jb_cr_price" => $jb_cr_price,
|
||||
"jb_tourname_hidden" => my_str_check(getFieldValueFromId($_job_table, "jb_id", $jb_id, "jb_tourname")),
|
||||
"jb_freetext_1" => my_str_check($jb_freetext_1), "jb_hiddenFreetext_1" => my_str_check($jb_hiddenFreetext_1), "jb_cr_filter" => $jb_cr_filter,
|
||||
"jb_dispoinfo" => my_str_check($jb_dispoinfo),
|
||||
"jb_warnjahr" => $jb_warnjahr, "jb_warnmonat" => $jb_warnmonat, "jb_warntag" => $jb_warntag, "jb_warnstunde" => $jb_warnstunde,
|
||||
"jb_warnminute" => $jb_warnminute,
|
||||
"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,
|
||||
"dont_change_tx" => "true",
|
||||
"jb_id_parent" => $jb_id_parent, "jb_type" => $jb_type,
|
||||
"tmp_add_jb_ids" => $tmp_add_jb_ids, "tmp_add_sids" => $tmp_add_sids, "tmp_add_prices" => $tmp_add_prices,
|
||||
"tmp_add_srvs" => my_str_check($tmp_add_srvs), "tmp_add_srvts" => my_str_check($tmp_add_srvts), "tmp_add_mult" => $tmp_add_mult, "tmp_add_mult_price" => $tmp_add_mult_price,
|
||||
"km_price_params" => $km_price_params, "jb_id_permanent_pre" => $jb_id_permanent_pre2, "jb_km" => $jb_km, "self_service_discount" => $self_service_discount
|
||||
)
|
||||
);
|
||||
|
||||
if (MASK_CR_PRICE_MODE == "1") {
|
||||
$javascript .= setJavascriptOpenerFormVals("job_options", "tourOptions", array("jb_cr_serviceprice" => $jb_cr_serviceprice));
|
||||
}
|
||||
|
||||
$javascript .=
|
||||
"opener.checkJb_permanent(0);\n" .
|
||||
"opener.setDateTimeFields(\"job_options\", \"tourOptions\", \"$tag\", \"$monat\", \"$jahr\", \"$stunde\", \"$minute\", \"tag\", \"monat\", \"jahr\", \"stunde\", \"minute\", \"jb_permanent\");\n" .
|
||||
"opener.setDateTimeFields(\"job_options\", \"tourOptions\", \"$endetag\", \"$endemonat\", \"$endejahr\", \"\", \"\", \"endetag\", \"endemonat\", \"endejahr\", \"\", \"\", \"\");\n" .
|
||||
// "opener.setDateTimeFields(\"job_options\", \"tourOptions\", \"$warntag\", \"$warnmonat\", \"$warnjahr\", \"\", \"\", \"warntag\", \"warnmonat\", \"warnjahr\", \"\", \"\", \"\");\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 (\"" . my_str_check($jb_hiddenFreetext_1) . "\" == \"\") {\n" .
|
||||
" opener.parent.job_tour.document.tourForm.jb_hiddenFreetextButton.value = \"Text nur Rg\";\n" .
|
||||
" } else {\n" .
|
||||
" opener.parent.job_tour.document.tourForm.jb_hiddenFreetextButton.value = \"Text nur Rg*\"}\n;" .
|
||||
" if (\"" . my_str_check($jb_dispoinfo) . "\" == \"\" && (\"" . $jb_warningtime. "\" == \"0000-00-00 00:00:00\" || \"" . $jb_warningtime . "\" == \"\")) {\n" .
|
||||
" opener.parent.job_tour.document.tourForm.jb_dispoInfoButton.value = \"Dispo Info\";\n" .
|
||||
" } else {\n" .
|
||||
" opener.parent.job_tour.document.tourForm.jb_dispoInfoButton.value = \"Dispo Info*\"};\n" .
|
||||
" if (typeof(opener.parent.job_tour.document.tourForm.jb_cashpayer_mail) != 'undefined') {\n" .
|
||||
" opener.parent.job_tour.document.tourForm.jb_cashpayer_mail.value = \"" . $jb_cashpayer_mail . "\";}\n" .
|
||||
" if (typeof(opener.parent.job_tour.document.tourForm.jb_offer_mail) != 'undefined') {\n" .
|
||||
" opener.parent.job_tour.document.tourForm.jb_offer_mail.value = \"" . $jb_offer_mail . "\";}\n" .
|
||||
" if (typeof(opener.parent.job_tour.document.tourForm.jb_orderer) != 'undefined') {\n" .
|
||||
" opener.parent.job_tour.document.tourForm.jb_orderer.value = \"" . $jb_orderer . "\";}\n" .
|
||||
" opener.parent.job_options.jb_orderer_mandatory = " . ((isset($no_dates) && $no_dates == "true") || strtotime($jb_createtime) > strtotime("2025-09-16 18:39:00") ? "true" : "false") . ";\n" .
|
||||
//"alert(\"$jb_cashpayer_mail\");\n";
|
||||
$javascript .= setJavascriptOpenerFormVals("job_options", "tourOptions",
|
||||
array(
|
||||
"jb_orderer_hidden" => $jb_orderer
|
||||
)
|
||||
);
|
||||
|
||||
if ($jb_cashpayer_mail_status == "MAIL_SENT" || $jb_cashpayer_mail_status == "MAIL_NOT_SENT")
|
||||
$javascript .=
|
||||
" opener.parent.job_tour.document.tourForm.jb_cashpayer_mail.disabled = true;\n";
|
||||
else
|
||||
$javascript .= setJavascriptOpenerFormVals("job_options", "tourOptions",
|
||||
array(
|
||||
"jb_cashpayer_mail_hidden" => $jb_cashpayer_mail
|
||||
)
|
||||
);
|
||||
if ($jb_cashpayer_mail_status == "MAIL_NOT_SENT")
|
||||
$javascript .=
|
||||
" opener.parent.job_tour.document.tourForm.jb_cashpayer_mail.style.backgroundColor = '#FF2222';\n";
|
||||
|
||||
$javascript .= setJavascriptOpenerFormVals("job_options", "tourOptions",
|
||||
array(
|
||||
"jb_offer_mail_hidden" => $jb_offer_mail
|
||||
)
|
||||
);
|
||||
|
||||
if (MASK_WAITTIME_ENABLED == "1"):
|
||||
$javascript .= setJavascriptOpenerFormVals("job_options", "tourOptions",
|
||||
array(
|
||||
"jb_waittime_hour" => $jb_waittime_hour, "jb_waittime_minute" => $jb_waittime_minute
|
||||
)
|
||||
);
|
||||
endif;
|
||||
|
||||
if ($jb_origin != 0) {
|
||||
$jb_origin_pos = array(1 => 0, 2 => 2, 3 => 4, 4 => 6, 5 => 1, 6 => 7, 7 => 3, 8 => 5);
|
||||
|
||||
$javascript .=
|
||||
" opener.parent.job_tour.document.tourForm.jb_origin[". ($jb_origin_pos[$jb_origin]) ."].checked = true;\n";
|
||||
if ($jb_origin == 3 || $jb_origin == 4 || $jb_origin == 5 || $jb_origin == 7 || $jb_origin == 8) {
|
||||
$javascript .=
|
||||
" opener.parent.job_tour.document.tourForm.jb_origin[" . $jb_origin_pos[1] . "].disabled = true;\n" .
|
||||
" opener.parent.job_tour.document.tourForm.jb_origin[" . $jb_origin_pos[2] . "].disabled = true;\n" .
|
||||
" opener.parent.job_tour.document.tourForm.jb_origin[" . $jb_origin_pos[6] . "].disabled = true;\n";
|
||||
}
|
||||
if ($jb_origin_other != "")
|
||||
$javascript .=
|
||||
" opener.parent.job_tour.document.tourForm.jb_origin_other.value = '" . $jb_origin_other . "';\n";
|
||||
$javascript .=
|
||||
"opener.checkOrigin();\n";
|
||||
}
|
||||
if ($jb_bwv == "1") {
|
||||
$javascript .=
|
||||
" opener.parent.job_options.document.tourOptions.jb_bwv.checked = true;\n";
|
||||
}
|
||||
|
||||
// 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 (opener.parent.job_options.document.tourOptions.jb_globaljob.disabled == true)\n" .
|
||||
" opener.parent.job_options.document.tourOptions.jb_globaljob.checked = false;\n" .
|
||||
"opener.checkJb_permanent2();\n" .
|
||||
"opener.initJobList();\n" .
|
||||
"opener.checkCr_id_order();\n" .
|
||||
"opener.checkFixprice(2);\n" .
|
||||
(isset($no_dates) && $no_dates == "true" ? "opener.checkJb_sales_tax_rate_sign(0);\n" : "");
|
||||
|
||||
$i = 1;
|
||||
$payer_found = false;
|
||||
$jobList = "";
|
||||
$cur_tr_statuses = "";
|
||||
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 und Daueraufträgen soll die erste Ko.-Nr. als $jb_commission_no übernommen werden wenn vorhanden und letztere leer
|
||||
if (((isset($no_dates) && $no_dates == "true") || $_get_tr_commission_no == true) && $jb_commission_no == "" && my_str_check($tr_commission_no) != "" && $i == 1)
|
||||
$jb_commission_no = my_str_check($tr_commission_no);
|
||||
$tr_photo = $db->getOne("SELECT gdc_content FROM genericdatacontainer WHERE gdc_obj_type = 'tr' AND gdc_obj_id = " . $tr_id . " AND gdc_gen_fieldname = 'tr_photo' AND NOT (gdc_context LIKE '%|forced')");
|
||||
$arr_tour = $db->getOne("SELECT gdc_content FROM genericdatacontainer WHERE gdc_obj_type = 'tr' AND gdc_gen_fieldname = 'arr_tour' AND gdc_obj_id = " . $tr_id);
|
||||
// $cur_tr_statuses .= ",[" . $tr_id . "," . $tr_status . "]\n";
|
||||
$cur_tr_statuses .= ",[" . $tr_id . "," . (trim($arr_tour) != "" ? 1 : 0) . "]\n";
|
||||
$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 && $jb_payment == 2)) ? "true" : "false";
|
||||
if (MASK_CR_PRICE_MODE == "1" && $is_payer == "true" && $csc_id_payer == CSC_ID_PAYER_CASH)
|
||||
$is_payer = !(strpos($tr_remark, "*** Bitte im Auftrag STADTBOTE Bar ") === FALSE) ? "true" : "false";
|
||||
// if ($is_payer == "true"): die(strpos($tr_remark, "*** Bitte im Auftrag STADTBOTE Bar ") . ", tr_sort=" . $i . ", \$csc_id_payer=" . $csc_id_payer . ", \$csc_id=" . $csc_id . ", \$csc_id_payer_cash=" . $csc_id_payer_cash . ", CSC_ID_PAYER_CASH=" . CSC_ID_PAYER_CASH); endif;
|
||||
//$javascript .=
|
||||
//"alert($i + \",\" + '$is_payer' + \",\" + $csc_id + \",\" + $csc_id_payer + \",\" + $csc_id_payer_cash);";
|
||||
if (!(strpos($tr_remark, "~~~\\n") === false)):
|
||||
$fileHandle = @fopen("../log/get_saved_tour_" . $today['year'] . sprintf("%02d", $today['mon']) . ".log", 'a');
|
||||
@fwrite($fileHandle, "[" . date("Y-m-d H:i:s") . "] [\$tr_remark = " . $tr_remark . "] . \n");
|
||||
$filters_text = strstr($tr_remark, "~~~\\n");
|
||||
@fwrite($fileHandle, "[" . date("Y-m-d H:i:s") . "] [\$filters_text = " . $filters_text . "] . \n");
|
||||
$filters_text = substr($filters_text, 0, strpos($filters_text, "~~~\\n", 5) + strlen("~~~\\n"));
|
||||
@fwrite($fileHandle, "[" . date("Y-m-d H:i:s") . "] [\$filters_text = " . $filters_text . "] . \n");
|
||||
if ($filters_text == "~~~\\n") {
|
||||
$filters_text = strstr($tr_remark, "~~~\\n");
|
||||
@fwrite($fileHandle, "[" . date("Y-m-d H:i:s") . "] [\$filters_text = " . $filters_text . "] . \n");
|
||||
$filters_text = substr($filters_text, 0, strpos($filters_text, "~~~", 3) + strlen("~~~"));
|
||||
@fwrite($fileHandle, "[" . date("Y-m-d H:i:s") . "] [\$filters_text = " . $filters_text . "] . \n");
|
||||
}
|
||||
$tr_remark = str_replace($filters_text, "", $tr_remark);
|
||||
@fwrite($fileHandle, "[" . date("Y-m-d H:i:s") . "] [\$tr_remark = " . $tr_remark . "] . \n");
|
||||
@fclose($fileHandle);
|
||||
endif;
|
||||
$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"),
|
||||
JL_TR_PHOTO => ($tr_photo != "" ? "true" : "false")));
|
||||
if (!isset($no_dates) || $no_dates != "true"):
|
||||
$javascript .= setJavascriptOpenerJobList($i - 1, array(JL_TR_ID => $tr_id));
|
||||
endif;
|
||||
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_PHOTO, ($tr_photo != "" ? "true" : "false"));
|
||||
//echo "tr_commission_no: " . "'$_tr_commission_no'" . "<br>";
|
||||
if ($_get_tr_commission_no == true):
|
||||
setJobList($i, JL_TR_COMMISSION_NO, my_str_check($tr_commission_no));
|
||||
else:
|
||||
setJobList($i, JL_TR_COMMISSION_NO, "");
|
||||
endif;
|
||||
setJobList($i, JL_TR_TRACKING, my_str_check($tr_tracking));
|
||||
setJobList($i, JL_HIDE_TR_REMARK, "true");
|
||||
setJobList($i, JL_TR_WARE_FROM, ($tr_ware_from_to == 2 || $tr_ware_from_to == 3 ? "true" : "false"));
|
||||
setJobList($i, JL_TR_WARE_TO, ($tr_ware_from_to == 1 || $tr_ware_from_to == 3 ? "true" : "false"));
|
||||
setJobList($i, JL_CSC_ID_PAYER, $is_payer);
|
||||
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);
|
||||
if (isset($check_jb_permanent_flag) && $check_jb_permanent_flag == true):
|
||||
$fileHandle = @fopen("../log/get_saved_tour_" . $today['year'] . sprintf("%02d", $today['mon']) . ".log", 'a');
|
||||
@fwrite($fileHandle, "JL_CSC_ID=" . JL_CSC_ID . "\n");
|
||||
@fwrite($fileHandle, "JL_TR_COMP=" . JL_TR_COMP . "\n");
|
||||
@fwrite($fileHandle, "JL_TR_PERSON=" . JL_TR_PERSON . "\n");
|
||||
@fwrite($fileHandle, "JL_AD_STREET=" . JL_AD_STREET . "\n");
|
||||
@fwrite($fileHandle, "JL_TR_HSNO=" . JL_TR_HSNO . "\n");
|
||||
@fwrite($fileHandle, "JL_AD_COUNTRY=" . JL_AD_COUNTRY . "\n");
|
||||
@fwrite($fileHandle, "JL_AD_ZIPCODE=" . JL_AD_ZIPCODE . "\n");
|
||||
@fwrite($fileHandle, "JL_AD_CITY=" . JL_AD_CITY . "\n");
|
||||
@fwrite($fileHandle, "JL_TR_REMARK=" . JL_TR_REMARK . "\n");
|
||||
@fwrite($fileHandle, "JL_TR_PHOTO=" . JL_TR_PHOTO . "\n");
|
||||
@fwrite($fileHandle, "JL_TR_COMMISSION_NO=" . JL_TR_COMMISSION_NO . "\n");
|
||||
@fwrite($fileHandle, "JL_HIDE_TR_REMARK=" . JL_HIDE_TR_REMARK . "\n");
|
||||
@fwrite($fileHandle, "JL_TR_WARE_FROM=" . JL_TR_WARE_FROM . "\n");
|
||||
@fwrite($fileHandle, "JL_TR_WARE_TO=" . JL_TR_WARE_TO . "\n");
|
||||
@fwrite($fileHandle, "JL_CSC_ID_PAYER=" . JL_CSC_ID_PAYER . "\n");
|
||||
@fwrite($fileHandle, "JL_TR_MEDIATIONAREA_ID=" . JL_TR_MEDIATIONAREA_ID . "\n");
|
||||
@fwrite($fileHandle, "JL_TR_ID=" . JL_TR_ID . "\n");
|
||||
@fwrite($fileHandle, "[" . date("Y-m-d H:i:s") . "] \$jb_id = " . $jb_id . ", \$jobList = " . $jobList . "\n");
|
||||
@fclose($fileHandle);
|
||||
endif;
|
||||
$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 .=
|
||||
"opener.parent.job_tour.document.tourForm.jb_costsplit.checked = true;\n" .
|
||||
"opener.checkCostsplit();\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 .=
|
||||
"opener.setCsc_id_payer('$csc_id_payer', '$comp_payer');\n";
|
||||
$javascript .= javascriptAdd_cs_eid($csc_id_payer, "opener.");
|
||||
endif;
|
||||
endif;
|
||||
|
||||
$javascript .=
|
||||
"opener.jobList_ori = opener.parent.job_options.document.tourOptions.jobList.value;\n" .
|
||||
"opener.jb_fixprice_ori = opener.parent.job_options.document.tourOptions.jb_fixprice.value;\n" .
|
||||
"opener.jb_serviceprice_ori = opener.parent.job_options.document.tourOptions.jb_serviceprice.value;\n" .
|
||||
"opener.jb_markup_ori = opener.parent.job_options.document.tourOptions.jb_markup.value;\n" .
|
||||
"opener.jb_ordertime_ori = '$jahr-$monat-$tag $stunde:$minute';\n" .
|
||||
"opener.curCsc_id_payer_ori = " . $csc_id_payer . ";\n" .
|
||||
"opener.cur_tr_statuses = [" . substr($cur_tr_statuses, 1) . "];\n";
|
||||
// Statusmail bei Auftragsänderung?
|
||||
$mail_recipients = "";
|
||||
// if (!(isset($_copy_jobs_flag) && $_copy_jobs_flag == true) && $no_dates != "true" && $jb_status == 2 && !($db->getOne("SELECT jb_storno FROM job WHERE jb_id = " . $jb_id) > 0)):
|
||||
// if (!(isset($_copy_jobs_flag) && $_copy_jobs_flag == true) && $no_dates != "true" && ($jb_status == 2 || $jb_status == 1) && !($db->getOne("SELECT jb_storno FROM job WHERE jb_id = " . $jb_id) > 0)):
|
||||
if (!(isset($_copy_jobs_flag) && $_copy_jobs_flag == true) && $no_dates != "true" && !($db->getOne("SELECT jb_storno FROM job WHERE jb_id = " . $jb_id) > 0)):
|
||||
// $cs_id = getFieldValueFromId("costcenter", "csc_id", ($csc_id_payer == CSC_ID_PAYER_CASH ? $csc_id_payer_cash : $csc_id_payer), "cs_id");
|
||||
// $cs_jbstatusmail_fields = getFieldValueFromId("customer", "cs_id", $cs_id, "cs_jbstatusmail_fields");
|
||||
//
|
||||
// $empIdActCC24State = false;
|
||||
// $empHqList = getParameterValue("0", "HEADQUARTERS_MULTIPLE_ACCESS_EMPLOYEES", "0") . "|300001";
|
||||
// if ($empHqList != "") {
|
||||
// $empIdActCC24State = isInParameterString($emp_id, $empHqList);
|
||||
// }
|
||||
//
|
||||
// if ((substr($cs_jbstatusmail_fields, 3, 1) == "1" && (getParameterValue("0", "MASK_IGNORE_JBSTATUSMAIL2CSC", $hq_id) == "0" || $empIdActCC24State)) ||
|
||||
// (getParameterValue("0", "MASK_IGNORE_JBSTATUSMAIL2CSC", $hq_id) != "0" && (getParameterValue($emp_id, "MODE_LATER_JOB") != "0" || $vht_id >= 7 /* Immer Status-Mails bei LKWs */ || getParameterValue("0", "MASK_IGNORE_JBSTATUSMAIL2CSC", $hq_id) == "2"))):
|
||||
// $sqlquery = "SELECT usr.usr_email, cs.cs_jbstatusmail, cscad.cscad_email"
|
||||
// . " FROM costcenter AS csc, customer AS cs, costcenteraddress AS cscad, employee AS emp, user AS usr"
|
||||
// . " WHERE csc.csc_id = " . ($csc_id_payer == CSC_ID_PAYER_CASH ? $csc_id_payer_cash : $csc_id_payer) . " AND"
|
||||
// . " csc.cs_id = cs.cs_id AND"
|
||||
// . " cs.cs_admin = emp.emp_id AND"
|
||||
// . " emp.usr_id = usr.usr_id AND"
|
||||
// . " csc.csc_id = cscad.csc_id AND"
|
||||
// . " cscad.adt_id = '2'";
|
||||
// //echo $sqlquery . "<br>\n";
|
||||
// $fileHandle = @fopen("../log/get_saved_tour_" . $today['year'] . sprintf("%02d", $today['mon']) . ".log", 'a');
|
||||
// @fwrite($fileHandle, "[" . date("Y-m-d H:i:s") . "] \$jb_id = $jb_id [" . $sqlquery . "] . \n");
|
||||
// @fclose($fileHandle);
|
||||
// $result = $db->query($sqlquery);
|
||||
// if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
// while ($row = ($phpVersion >= "8.0" ? $result->fetch_assoc() : $result->fetchRow())):
|
||||
// $ask_for_statusmail =
|
||||
// (getParameterValue("0", "MASK_IGNORE_JBSTATUSMAIL2CSC", $hq_id) == "0" || $empIdActCC24State) ||
|
||||
// ((getParameterValue("0", "MASK_IGNORE_JBSTATUSMAIL2CSC", $hq_id) != "0" && (getParameterValue($emp_id, "MODE_LATER_JOB") == "1" || $vht_id >= 7 || getParameterValue("0", "MASK_IGNORE_JBSTATUSMAIL2CSC", $hq_id) == "2"))
|
||||
// && ($row["cs_jbstatusmail"] == "1" || (substr($cs_jbstatusmail_fields, 3, 1) == "1"))
|
||||
// );
|
||||
// if (trim($row["usr_email"]) != "" && $ask_for_statusmail)
|
||||
// $mail_recipients = trim($row["usr_email"]);
|
||||
// if (trim($row["cscad_email"]) != "" && $ask_for_statusmail)
|
||||
// $mail_recipients = trim($row["cscad_email"]);
|
||||
// endwhile;
|
||||
// $result->free();
|
||||
// // $javascript .= "opener.ask_mailrecipients = '" . $mail_recipients . "';\n";
|
||||
// $javascript .= setJavascriptOpenerFormVals("job_options", "tourOptions", array("ask_mailrecipients" => $mail_recipients));
|
||||
|
||||
// Ist in ajaxReqJobs ausgelagert worden, deshalb hier eine "1"
|
||||
$javascript .= setJavascriptOpenerFormVals("job_options", "tourOptions", array("ask_mailrecipients" => "1"));
|
||||
|
||||
// //die($mail_recipients);
|
||||
// $fileHandle = @fopen("../log/get_saved_tour_" . $today['year'] . sprintf("%02d", $today['mon']) . ".log", 'a');
|
||||
// @fwrite($fileHandle, "[" . date("Y-m-d H:i:s") . "] [" . $mail_recipients . "] \n");
|
||||
// @fclose($fileHandle);
|
||||
// endif;
|
||||
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++)
|
||||
{
|
||||
if (isset($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" .
|
||||
" 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 .=
|
||||
"opener.parent.job_tour.document.tourForm.jb_cash.checked = true;\n" .
|
||||
"opener.checkCash();\n";
|
||||
else
|
||||
$javascript .=
|
||||
"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";
|
||||
$javascript .= $javascript_zone;
|
||||
$jb_discount = 0;
|
||||
$jb_discount_rate = 0;
|
||||
if (($jb_fixprice != "0" && $jb_fixprice != "") || ($jb_serviceprice != "0" && $jb_serviceprice != "")):
|
||||
$granted_discount = $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");
|
||||
if ($granted_discount != 0 && $granted_discount != ""):
|
||||
// $javascript .=
|
||||
// "opener.parent.job_options.document.tourOptions.jb_discount.disabled = false;\n" .
|
||||
// "opener.parent.job_options.document.tourOptions.jb_discount.checked = true;\n";
|
||||
$jb_discount = 1;
|
||||
$jb_discount_rate = $granted_discount;
|
||||
else:
|
||||
$javascript .=
|
||||
"opener.parent.job_options.discount_default = false;\n";
|
||||
// für check_jb_permanent
|
||||
endif;
|
||||
else:
|
||||
// Hansetrans legt oft Touren an, die erst nachträglich bearbeitet werden. Diese haben bei der Anlage erst mal einen
|
||||
// Festpreis "0", so dass der der Default-Discount beim Nachbearbeiten verschwindet. Daher wird sich gemerkt, ob der
|
||||
// ursprüngliche Auftrag einen Nullpreis hatte, so dass in diesem Fall der Auftrag wieder wie ein neuer behandelt wird und
|
||||
// der Default-Discount zur Anwendung kommt
|
||||
$javascript .=
|
||||
"opener.parent.job_options.fixprice_was_0 = true;\n";
|
||||
endif;
|
||||
|
||||
$javascript .=
|
||||
"opener.parent.job_options.delete_suborder = " . ($delete_suborder ? "true" : "false") . ";\n" .
|
||||
"opener.parent.job_options.is_exported = " . ($job_is_exported ? "true" : "false") . ";\n" .
|
||||
"opener.parent.job_options.was_afterwards = " . ($was_afterwards ? "true" : "false") . ";\n" .
|
||||
"opener.checkCalculator();\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" .
|
||||
"opener.parent.job_options.document.tourOptions.jb_permanent.disabled = false;\n" .
|
||||
$waittimefiels .
|
||||
// "opener.parent.job_options.document.tourOptions.jb_globaljob.checked = false;\n" .
|
||||
// "opener.parent.job_options.document.tourOptions.jb_globaljob.disabled = false;\n" .
|
||||
// "opener.parent.job_options.document.tourOptions.jb_status_manual.disabled = false;\n" .
|
||||
((isset($consider_manual_disp) && $consider_manual_disp == 1 && MASK_MANUAL_DISPOSITION == "1")
|
||||
? "opener.parent.job_options.document.tourOptions.jb_status_manual.checked = true;\n"
|
||||
: "opener.parent.job_options.document.tourOptions.jb_status_manual.checked = false;\n") .
|
||||
"opener.checkAfterwards();\n" .
|
||||
($jb_incomplete == 1
|
||||
? "opener.parent.job_options.document.tourOptions.jb_incomplete.checked = true;\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" .
|
||||
($jb_offer == 1
|
||||
? "opener.parent.job_options.document.tourOptions.jb_offer.disabled = false;\n" .
|
||||
"opener.parent.job_options.document.tourOptions.jb_offer.checked = true;\n" .
|
||||
"opener.checkOffer();\n"
|
||||
: "opener.parent.job_options.document.tourOptions.jb_offer.disabled = " . ((trim(getFieldValueFromId($_job_table, "jb_id", $jb_id, "jb_tourname")) != "") ? "false" : "true") . ";\n" .
|
||||
"opener.parent.job_options.document.tourOptions.jb_offer.checked = false;\n"
|
||||
) .
|
||||
"opener.parent.job_options.document.tourOptions.jb_jam_waittime.value = '" . $jb_jam_waittime . "';\n" .
|
||||
"opener.parent.job_options.document.tourOptions.jb_value_of_goods.value = '" . $jb_value_of_goods . "';\n" .
|
||||
"opener.document.getElementsByName('jb_insurance_rate')[0].selectedIndex = '" . $jb_insurance_rate . "';\n" .
|
||||
"opener.parent.job_options.document.tourOptions.special_case_ori.value = '" . $special_case_ori . "';\n" .
|
||||
// "opener.parent.job_options.document.tourOptions.jb_id_insurance.value = 'in Auftrag Nr. " . $jb_id_insurance . " (Warenwert " . $jb_value_of_goods . " EUR)';\n" .
|
||||
// ($jb_id_insurance != "" ? "opener.\$('#div_insurance_done').show(); opener.parent.job_options.document.tourOptions.jb_insurance.checked = true;"
|
||||
// . " opener.parent.job_options.document.tourOptions.jb_insurance.disabled = true;\n" : "opener.\$('#div_insurance_done').hide();\n") .
|
||||
($jb_id_insurance != "" ? "opener.parent.job_options.document.tourOptions.jb_insurance.checked = true; "
|
||||
. ($special_case == 1 ? "opener.parent.job_options.document.tourOptions.special_case.checked = true; " : "")
|
||||
. "opener.\$('#div_insurance').show();\n" : "") .
|
||||
"opener.resetSignificantPriceValues();\n" .
|
||||
// "opener.writeJob();\n" .
|
||||
"var curTourNo = 0;\n" .
|
||||
(isset($job_is_locked) && $job_is_locked ? "opener.parent.job_options.setTimeout('job_is_locked(" . $job_is_locked_mode . ", \\'" . $job_is_locked_text . "\\')', 100);\n" : "") .
|
||||
(isset($jb_copy) && $jb_copy == "true" ? "opener.parent.job_options.setTimeout('duplicateJob(true)', 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);
|
||||
// $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 (und 'jb_dispoinfo' für Stornos) clean sein!
|
||||
$jb_freetext_1 = my_str_check($jb_freetext_1);
|
||||
$jb_hiddenFreetext_1 = my_str_check($jb_hiddenFreetext_1);
|
||||
$jb_dispoinfo = my_str_check($jb_dispoinfo);
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* getTournames.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
//require_once("../PEAR/HTML/Template/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"));
|
||||
|
||||
getDb2Connection(); // Try to connect request server because of performance
|
||||
|
||||
// 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 (defined('CSC_ID_PAYER_CASH') && $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:
|
||||
// "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";
|
||||
$sqlStmt = "(SELECT jb_id, jb_tourname FROM job WHERE csc_id_payer = '$csc_id' AND LENGTH(jb_tourname) > 0)" .
|
||||
" UNION (SELECT jb_id, jb_tourname FROM job WHERE (csc_id_payer_cash = '$csc_id' AND csc_id_payer_cash != '0') AND LENGTH(jb_tourname) > 0) ORDER BY jb_tourname";
|
||||
endif;
|
||||
$result = $db2->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 + '\t';\n";
|
||||
$javascript .= "opener.savedTour_options = opener.savedTour_options + '" .
|
||||
str_replace('\'', '\\\'', $row['jb_tourname']) . "\t" . $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" .
|
||||
"opener.setTimeout('force_rerender()', 100);\n" .
|
||||
"self.close();\n";
|
||||
//echo $javascript;
|
||||
// Inhalt des temporären Fensters erzeugen und ausgeben
|
||||
$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.php">
|
||||
|
||||
</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>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,545 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* jb_exp_csv.php
|
||||
*
|
||||
* Autor: Marc Vollmann
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
|
||||
include_once ("../include/mcglobal.inc.php");
|
||||
include_once ("../include/auth.inc.php");
|
||||
include_once ("../include/image.inc.php");
|
||||
include_once ("../include/caglobal.inc.php");
|
||||
|
||||
|
||||
// Check HTTP-Parameters
|
||||
getSecHttpVars("1",array("f_act", "customerId", "cscIdRoot", "cscIdActual",
|
||||
"day_from", "month_from", "year_from", "day_to", "month_to", "year_to",
|
||||
"g_cs_id", "g_csc_id", "g_csc_name", "initCsSearch", "f_filter", "f_vht_filter",
|
||||
"f_inv_no", "f_inv_datetime_day", "f_inv_datetime_month", "f_inv_datetime_year",
|
||||
"filenameCSV", "statusMessage", "deactivateMenu"));
|
||||
|
||||
$pageTitel = "CSV-AUSGABE";
|
||||
include_once ("../admin/menu.php");
|
||||
include_once ("../include/html.inc.php");
|
||||
|
||||
// Execution-Time for script
|
||||
// set_time_limit(30000);
|
||||
|
||||
$phpVer56Plus = false;
|
||||
if (substr(phpversion(), 0, 3) >= "5.6") :
|
||||
$phpVer56Plus = true;
|
||||
endif;
|
||||
|
||||
// Get global export path
|
||||
$globalExportPath = getParameterValue("0", "EXPORT_PATH", "0");
|
||||
if ($globalExportPath == "") : $globalExportPath = getParameterValue("0", "EXPORT_PATH", "0"); endif;
|
||||
if ($globalExportPath == "") : $globalExportPath = "../export/download/"; endif;
|
||||
|
||||
$path = getAbsoluteSystemPath();
|
||||
|
||||
// Check range of date. All fields have to be set
|
||||
if ($day_from == "" || $month_from == "" || $year_from == "" ||
|
||||
$day_to == "" || $month_to == "" || $year_to == "") :
|
||||
|
||||
// Initialize date-ranges to the current date
|
||||
$fromDateRange = getDateTime("1") . "000000";
|
||||
$toDateRange = getDateTime("1") . "235959";
|
||||
|
||||
$day_from = getDateTime("day");
|
||||
$month_from = getDateTime("month");
|
||||
$year_from = getDateTime("year");
|
||||
$day_to = getDateTime("day");
|
||||
$month_to = getDateTime("month");
|
||||
$year_to = getDateTime("year");
|
||||
else :
|
||||
$fromDateRange = $year_from . pad($month_from,2) . pad($day_from,2) . "000000";
|
||||
$toDateRange = $year_to . pad($month_to,2) . pad($day_to,2) . "235959";
|
||||
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) ) ) : gotoReferer("1"); endif;
|
||||
|
||||
// Get the rights of the employee logged in and check the accessibility
|
||||
authCheckEmployeeRights($emp_id, "7", "1");
|
||||
|
||||
getDBNames("0"); // Only use current tables (no history tables)
|
||||
|
||||
// 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");
|
||||
|
||||
$f_inv_no = trim($f_inv_no);
|
||||
$f_inv_datetime = "";
|
||||
if ($f_inv_datetime_month >= "1" && $f_inv_datetime_month <= "12" && $f_inv_datetime_day >= "1" && $f_inv_datetime_day <= "31") :
|
||||
$f_inv_datetime = $f_inv_datetime_year . "-" . $f_inv_datetime_month . "-" . $f_inv_datetime_day . " 12:00:00";
|
||||
endif;
|
||||
|
||||
|
||||
if ($f_filter == "") : $f_filter = "0"; endif; // Filter (order clause by CSV generation)
|
||||
if ($f_vht_filter == "") : $f_vht_filter = array(); endif; // filter for vehicle of the courier for exporting ALL or ONLY the specified vehicle types
|
||||
|
||||
|
||||
// Store invoice data to jobs
|
||||
/*
|
||||
if ($f_act == "storeJobs") :
|
||||
if ($g_cs_id != "") :
|
||||
if ($f_jobs_len > 0) :
|
||||
if ($f_inv_no != "" && $f_inv_datetime != "") :
|
||||
|
||||
// Transaction control starts here
|
||||
// TA("B");
|
||||
|
||||
// Iterate all jobs
|
||||
for ($i = 0; $i < $f_jobs_len; $i++) :
|
||||
|
||||
$jbId = $f_jobs[$i];
|
||||
|
||||
// Insert job into table "invoice" if does not exist else update
|
||||
if (!(existsEntry("invoice",array("jb_id",$jbId)))) :
|
||||
insertStmt("invoice", array("jb_id", $jbId, "inv_no", $f_inv_no, "inv_datetime", $f_inv_datetime));
|
||||
else :
|
||||
updateStmt("invoice", "jb_id", $jbId, array("inv_no", $f_inv_no, "inv_datetime", $f_inv_datetime));
|
||||
endif;
|
||||
endfor;
|
||||
|
||||
// TA("C");
|
||||
// TA("E");
|
||||
|
||||
$f_act = "loadJobsOfCustomer";
|
||||
else :
|
||||
$statusMessage = "Sie müssen eine Rechnungsnummer und ein Rechnungsdatum vergeben!";
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = "Es wurden noch keine Aufträge identifiziert!";
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = "Sie haben noch keinen Kunden ausgewählt!";
|
||||
endif;
|
||||
endif;
|
||||
*/
|
||||
|
||||
// Generate CSV document
|
||||
if ($f_act == "generateCSV") :
|
||||
if ($g_cs_id != "") :
|
||||
|
||||
$passwd = "acapella7890";
|
||||
$logFile = $path . "/log/sys_auto_export.log";
|
||||
$emptyArgument = "\"\"";
|
||||
$fileNameSuffix = substr(getDateTime("6"), 0, 12); // Format: "YmdHi"
|
||||
|
||||
// Get data for calling customer export functionality
|
||||
$g_cs_admin = getFieldValueFromId("customer", "cs_id", $g_cs_id, "cs_admin");
|
||||
$g_hq_id = getFieldValueFromId("customer", "cs_id", $g_cs_id, "hq_id");
|
||||
$g_hq_mnemonic = getFieldValueFromId("headquarters", "hq_id", $g_hq_id, "hq_mnemonic");
|
||||
$g_usr_id = getFieldValueFromId("employee", "emp_id", $g_cs_admin, "usr_id");
|
||||
|
||||
// Noch parametrisieren !!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
$f_act = "special_export_4";
|
||||
|
||||
// Arguments for calling customer export
|
||||
// $hq_id $usr_id $dummy_01 $f_act $f_exp_category $f_delimiter $f_parname $f_parname_export $f_fileName $day_to $month_to $year_to $f_cs_eid_filter $day_from $month_from $year_from $f_jbp_filter $specialJbPayment $jbpc_id
|
||||
|
||||
// Bsp: STHB.t:m: $g_hq_id = "1"; $g_hq_mnemonic = "HB"; $g_cs_id = "832514"; $g_usr_id = "840785";
|
||||
|
||||
$exportPars = array();
|
||||
$exportPars[] = array($g_hq_id,$g_usr_id,"_",$f_act,$emptyArgument,$emptyArgument,$emptyArgument,$emptyArgument,$g_cs_eid . "_" . $fileNameSuffix . ".csv",$day_to,$month_to,$year_to,$emptyArgument,$day_from,$month_from,$year_from,$g_cs_id);
|
||||
|
||||
$exportParsKeys = array_keys($exportPars);
|
||||
$exportParsKeysLen = count($exportParsKeys);
|
||||
if ($exportParsKeysLen != "" && is_numeric($exportParsKeysLen)) :
|
||||
|
||||
// Exports
|
||||
for ($i = 0; $i < $exportParsKeysLen; $i++) :
|
||||
|
||||
list($hq_id,$usr_id,$dummy_01,$f_act,$f_exp_category,$f_delimiter,$f_parname,$f_parname_export,$f_fileName,
|
||||
$day_to,$month_to,$year_to,$f_cs_eid_filter,$day_from,$month_from,$year_from,$customerId,$f_jbp_filter,$specialJbPayment,$jbpc_id) = $exportPars[$exportParsKeys[$i]];
|
||||
|
||||
$cmd = "php " . $path . "/export/export.php " . $passwd . " " . $hq_id . " " . $usr_id . " " . $dummy_01 . " " . $f_act . " " . $f_exp_category . " " . "\"" . $f_delimiter. "\"" . " "
|
||||
. "\"" . $f_parname . "\"" . " " . "\"" . $f_parname_export . "\"" . " " . "\"" . $f_fileName . "\"" . " " . $day_to . " " . $month_to . " " . $year_to . " "
|
||||
. $f_cs_eid_filter . " " . $day_from . " " . $month_from . " " . $year_from . " " . $customerId . " " . $f_jbp_filter . " " . $specialJbPayment . " " . $jbpc_id; // . " &";
|
||||
// echo $cmd . "\n\n\n"; die();
|
||||
$cmdOutput = null;
|
||||
exec($cmd, $cmdOutput);
|
||||
// list($errNo, $errDesc) = $cmdOutput;
|
||||
|
||||
$currentTime = getDateTime("0");
|
||||
writeToFile($logFile, "OP=AUTO_EXPORT|DATETIME=" . $currentTime . "|CUST=" . $exportParsKeys[$i]);
|
||||
|
||||
$f_act = "loadJobsOfCustomer";
|
||||
|
||||
// sleep(5); // Avoid too many tasks
|
||||
endfor;
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = "Sie haben noch keinen Kunden ausgewählt!";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
|
||||
// Show all specified jobs of the customer
|
||||
$invoiceNumberArray = array(); // Distinct array of all invoice numbers of the selelected date interval
|
||||
if ($f_act == "loadJobsOfCustomer") :
|
||||
if ($g_cs_id != "") :
|
||||
|
||||
// Filter export according specified vehicle types (if NO type is specified then this filter is not be used)
|
||||
$whereClauseFilterVehicleType = "";
|
||||
$f_vht_filter_len = count($f_vht_filter);
|
||||
if ($f_vht_filter_len > 0) :
|
||||
for ($i = 0; $i < $f_vht_filter_len; $i++) :
|
||||
if ($whereClauseFilterVehicleType != "") :
|
||||
$whereClauseFilterVehicleType .= " OR ";
|
||||
endif;
|
||||
$whereClauseFilterVehicleType .= " jb.vht_id = '" . $f_vht_filter[$i] . "'";
|
||||
endfor;
|
||||
if ($whereClauseFilterVehicleType != "") :
|
||||
$whereClauseFilterVehicleType = " AND (" . $whereClauseFilterVehicleType . ") ";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
$sqlquery = "SELECT jb.jb_id, jb.jb_totalprice AS price, jb.jb_export_time, jb.jb_ordertime, jb.jb_finishtime, jb.jb_freetext_1,"
|
||||
. " jb.cr_sid, tr.tr_commission_no, csc.csc_name"
|
||||
. " FROM job AS jb, tour AS tr, costcenter AS csc"
|
||||
. " WHERE jb.jb_status = '2' AND"
|
||||
. " (NOT isnull(jb.jb_export_time)) AND"
|
||||
. " jb.jb_ordertime >= '$fromDateRange' AND"
|
||||
. " jb.jb_ordertime <= '$toDateRange' AND"
|
||||
. " jb.jb_id = tr.jb_id AND"
|
||||
. " tr.tr_sort = '1' AND"
|
||||
. " jb.csc_id_payer = csc.csc_id AND"
|
||||
. " csc.cs_id = '" . $g_cs_id . "' "
|
||||
. $whereClauseFilterVehicleType
|
||||
. " ORDER BY jb.jb_id";
|
||||
|
||||
$result = $db->query($sqlquery);
|
||||
// echo $sqlquery . "<br>";
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
|
||||
$out = "";
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$numOfRows++;
|
||||
|
||||
$sumOfJobPrices += $row["price"];
|
||||
|
||||
$out .= "<tr class=\"f10np1\">";
|
||||
|
||||
$out .= "<td style=\"padding: 3px;\">". $row["jb_id"] . "</td> ";
|
||||
|
||||
$tmpDateTime = formatOutput($row["jb_ordertime"],"datetime","3");
|
||||
$out .= "<td style=\"padding: 3px\"> ". substr($tmpDateTime,0,8) . " - " . substr($tmpDateTime,11,5) . "</td>";
|
||||
|
||||
$tmpDateTime = formatOutput($row["jb_finishtime"],"datetime","3");
|
||||
$out .= "<td style=\"padding: 3px\"> ". substr($tmpDateTime,0,8) . " - " . substr($tmpDateTime,11,5) . "</td>";
|
||||
$out .= "<td style=\"padding: 3px\" align=\"right\"> ". formatOutput($row["price"],"float_rounded_2") . " </td> ";
|
||||
$out .= "<td style=\"padding: 3px\"> ". $row["cr_sid"] . "</td> ";
|
||||
// $out .= "<td> ". $row["jb_freetext_1"] . "<br>[Kst.: " . $row["csc_name"] . "]</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();
|
||||
else :
|
||||
$statusMessage = "Sie haben noch keinen Kunden ausgewählt!";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
|
||||
// *** Output ***
|
||||
$storedExportFiles = "";
|
||||
if ($g_cs_id != "" && is_numeric($g_cs_id)) :
|
||||
|
||||
// Read all of the local exported filenames for the current customer
|
||||
|
||||
$sqlquery = "SELECT expf_id, expf_name, expf_cryptname, expf_storetime, expf_ftpupload"
|
||||
. " FROM exportfiles"
|
||||
. " WHERE cs_id = '" . $g_cs_id . "'"
|
||||
. " ORDER BY expf_storetime DESC";
|
||||
|
||||
$result = $db->query($sqlquery);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
|
||||
$expfIdArray = array();
|
||||
$expfCryptNameArray = array();
|
||||
|
||||
$customerId = $g_cs_id;
|
||||
$cscIdRoot = getFieldValueFromId("customer", "cs_id", $customerId, "csc_id");
|
||||
$cscIdActual = $cscIdRoot;
|
||||
|
||||
// Restrictions to display links for FTP upload
|
||||
/*
|
||||
$parFTPuploadDisabled = getParameterValue("0", "EXPORT_MASK_FTP_UPLOAD_DISABLED", $hq_id);
|
||||
if ($parFTPuploadDisabled == "") : $parFTPuploadDisabled = getParameterValue("0", "EXPORT_MASK_FTP_UPLOAD_DISABLED", "0"); endif;
|
||||
*/
|
||||
|
||||
$storedExportFiles .= "<table>";
|
||||
// Define table header
|
||||
$storedExportFiles .= "<tr>";
|
||||
$storedExportFiles .= "<td>Datum / Uhrzeit</td><td>WEB-Download</td>";
|
||||
$storedExportFiles .= "</tr>";
|
||||
// Define table body from result set
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$expfIdArray[] = $row["expf_id"];
|
||||
$expfCryptNameArray[] = $row["expf_cryptname"];
|
||||
$storedExportFiles .= "<tr>";
|
||||
$storedExportFiles .= "<td>" . formatOutput($row["expf_storetime"],"timestamp") . " </td>";
|
||||
|
||||
$storedExportFiles .= "<td><a href=\"../export/exportdata.php?customerId=" . ec($customerId) . "&cscIdRoot=" . ec($cscIdRoot) .
|
||||
"&cscIdActual=" . ec($cscIdActual) . "&f_fileName=" . $row["expf_name"] . "\" target=\"_blank\">" .
|
||||
$row["expf_name"] . "</a> </td>";
|
||||
// Enable FTP upload option only for headquarter
|
||||
/*
|
||||
if ($userTypeName == "hq" && $parFTPuploadDisabled != "1") :
|
||||
if ($row["expf_ftpupload"] != "1") :
|
||||
$storedExportFiles .= "<td><a href=\"exportdata_ftp.php?f_fileName=" . $row["expf_name"] . "&customerId=" . ec($customerId) .
|
||||
"&cscIdRoot=" . ec($cscIdRoot) . "&cscIdActual=" . ec($cscIdActual) . "\" target=\"_blank\">" .
|
||||
$row["expf_name"] . "</a></td>";
|
||||
else :
|
||||
$storedExportFiles .= "<td>" . $row["expf_name"] . "</td>";
|
||||
endif;
|
||||
endif;
|
||||
*/
|
||||
$storedExportFiles .= "</tr>";
|
||||
endwhile;
|
||||
$storedExportFiles .= "</table>";
|
||||
$result->free();
|
||||
|
||||
// Init, because script works in headquarters mode only
|
||||
$customerId = "";
|
||||
$cscIdRoot = "";
|
||||
$cscIdActual = "";
|
||||
|
||||
// Automatical deletion of more than 10 files
|
||||
$maxEntries = getParameterValue("0", "EXPORT_FILES_ON_SERVER_CUSTOMER", "0");
|
||||
if ($maxEntries == "" || !is_numeric($maxEntries)) : $maxEntries = "10"; endif;
|
||||
$expfIdArrayLen = count($expfIdArray);
|
||||
if ($expfIdArrayLen >= $maxEntries) :
|
||||
|
||||
for ($j = $maxEntries - 1; $j < $expfIdArrayLen; $j++) :
|
||||
|
||||
unlink($globalExportPath . $expfCryptNameArray[$j]); // delete file
|
||||
deleteStmt("exportfiles","expf_id = " . $expfIdArray[$j]); // delete corresponding db-entry
|
||||
endfor;
|
||||
endif;
|
||||
endif;
|
||||
|
||||
|
||||
$currentFrameName = ""; // Empty string for "main frame"
|
||||
|
||||
// Date-ranges
|
||||
$filter_dateranges .= "<td><span class=\"f12bp1_blue\">Auftragsdatum: </span>";
|
||||
$filter_dateranges .= "Von:\n";
|
||||
$filter_dateranges .= "<select name=\"day_from\" class=\"f8np1\" onchange=\"fillDateFields(0, '" . $currentFrameName . "', 'jb_exp_csv', 'day_from', 'day_from', 'month_from', 'year_from', '', '', '')\"></select>\n";
|
||||
$filter_dateranges .= "<select name=\"month_from\" class=\"f8np1\" onchange=\"fillDateFields(0, '" . $currentFrameName . "', 'jb_exp_csv', 'month_from', 'day_from', 'month_from', 'year_from', '', '', '')\"></select>\n";
|
||||
$filter_dateranges .= "<select name=\"year_from\" class=\"f8np1\" onchange=\"fillDateFields(0, '" . $currentFrameName . "', 'jb_exp_csv', 'year_from', 'day_from', 'month_from', 'year_from', '', '', '')\"></select>\n";
|
||||
$filter_dateranges .= "</td><td> bis:\n";
|
||||
$filter_dateranges .= "<select name=\"day_to\" class=\"f8np1\" onchange=\"fillDateFields(0, '" . $currentFrameName . "', 'jb_exp_csv', 'day_to', 'day_to', 'month_to', 'year_to', '', '', '')\"></select>\n";
|
||||
$filter_dateranges .= "<select name=\"month_to\" class=\"f8np1\" onchange=\"fillDateFields(0, '" . $currentFrameName . "', 'jb_exp_csv', 'month_to', 'day_to', 'month_to', 'year_to', '', '', '')\"></select>\n";
|
||||
$filter_dateranges .= "<select name=\"year_to\" class=\"f8np1\" onchange=\"fillDateFields(0, '" . $currentFrameName . "', 'jb_exp_csv', 'year_to', 'day_to', 'month_to', 'year_to', '', '', '')\"></select>\n";
|
||||
$filter_dateranges .= "</td>";
|
||||
|
||||
// Javascript-function as template only for
|
||||
$js_date = "<script type=\"text/javascript\">\n";
|
||||
$js_date .= "<!--\n";
|
||||
$js_date .= "function initForm() {\n";
|
||||
$js_date .= " fillDateFields(1,\"" . $currentFrameName . "\",\"jb_exp_csv\",\"\",\"day_from\",\"month_from\",\"year_from\",\"\",\"\",\"\");\n";
|
||||
$js_date .= " setDateTimeFields(\"" . $currentFrameName . "\",\"jb_exp_csv\",".$day_from.",".$month_from.",".$year_from.", \"\", \"\", \"day_from\", \"month_from\", \"year_from\", \"\", \"\", \"\");\n";
|
||||
$js_date .= " fillDateFields(1,\"" . $currentFrameName . "\",\"jb_exp_csv\", \"\", \"day_to\", \"month_to\", \"year_to\", \"\", \"\", \"\");\n";
|
||||
$js_date .= " setDateTimeFields(\"" . $currentFrameName . "\",\"jb_exp_csv\",".$day_to.",".$month_to.",".$year_to.", \"\", \"\", \"day_to\", \"month_to\", \"year_to\", \"\", \"\", \"\");\n";
|
||||
$js_date .= "}\n";
|
||||
$js_date .= "-->\n";
|
||||
$js_date .= "</script>\n";
|
||||
?>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>CSV-AUSGABE</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../css/phoenix.css">
|
||||
<style type="text/css">
|
||||
<?php include_once ("../css/navigation.css.php"); ?>
|
||||
</style>
|
||||
|
||||
<?php include_once ("../include/js_framework.inc.php"); ?>
|
||||
|
||||
<script src="../include/searchLists.js" type="text/javascript"></script>
|
||||
<script src="../include/checkFormTags.js" type="text/javascript"></script>
|
||||
<script src="../include/lib_global.js" type="text/javascript"></script>
|
||||
|
||||
<?php echo $js_date ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
// NAVIGATION
|
||||
<?php echo $jsMenuOut; ?>
|
||||
|
||||
function searchCs() {
|
||||
searchCsCscGeneric('111000000000111');
|
||||
};
|
||||
|
||||
function finishPage(mode) {
|
||||
if (mode == 'generateCSV') {
|
||||
if (document.forms[0].g_cs_id.value != '') {
|
||||
if (confirm('Möchten Sie die CSV-Datei über den angegebenen Zeitraum generieren?')) {
|
||||
document.forms[0].f_act.value = mode;
|
||||
document.forms[0].action.disabled = true;
|
||||
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_exp_csv.php?currentNavigationItem=CSV_ausgabe";
|
||||
}
|
||||
}
|
||||
if (mode == 'clearPageAndCustomerSearch') {
|
||||
if (document.forms[0].g_cs_id.value != '') {
|
||||
if (confirm('Möchten Sie einen neuen Kunden wählen? Die Seiteninformationen gehen verloren!')) {
|
||||
document.location.href = "jb_exp_csv.php?initCsSearch=1";
|
||||
}
|
||||
} else {
|
||||
searchCs();
|
||||
};
|
||||
}
|
||||
if (mode == 'loadJobsOfCustomer') {
|
||||
// if (confirm('Aufträge für den gewählten Kunden anzeigen?')) {
|
||||
document.forms[0].f_act.value = mode;
|
||||
document.forms[0].submit();
|
||||
// }
|
||||
}
|
||||
};
|
||||
|
||||
function checkDate(checkObj,mode) {
|
||||
var resetValue = checkDateFields(checkObj,mode);
|
||||
if (resetValue) {
|
||||
checkObj.value = '';
|
||||
checkObj.focus();
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
function jbCheckAll(numOfRows) {
|
||||
for (i = 0; i < numOfRows; i++) {
|
||||
document.getElementsByName('f_jobs[]')[i].checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
function jbUncheckAll(numOfRows) {
|
||||
for (i = 0; i < numOfRows; i++) {
|
||||
document.getElementsByName('f_jobs[]')[i].checked = false;
|
||||
}
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body onLoad="<?php echo $phpCurrentNavigationOnLoad ?>initForm();displayStatusMessage(); <?php if ($initCsSearch == "1") : echo "searchCs();" ; endif; ?>">
|
||||
|
||||
<?php echo $phpMenuOut ?>
|
||||
<?php echo $phpReducedMenuOut ?>
|
||||
<?php echo $phpPageTitelOut ?>
|
||||
|
||||
<div class="maincontent" name="maincontent" id="maincontent">
|
||||
|
||||
<form name="jb_exp_csv" action="jb_exp_csv.php" method="post">
|
||||
|
||||
<input type="hidden" name="f_act" value="">
|
||||
<input type="hidden" name="g_cs_id" value="<?php echo $g_cs_id ?>">
|
||||
<input type="hidden" name="g_csc_id" value="<?php echo $g_csc_id ?>">
|
||||
<input type="hidden" name="filenameCSV" value="">
|
||||
<?php echo $phpCurrentNavigationInputHidden ?>
|
||||
<input type="hidden" name="deactivateMenu" value="<?php echo ec($deactivateMenu) ?>">
|
||||
|
||||
<?php echo htmlDivLineSpacer("5px"); ?>
|
||||
|
||||
<!- Date-ranges -->
|
||||
<div class="f12bp1_blue">
|
||||
<table cellspacing="0" cellpadding="0" vspace="0" hspace="0">
|
||||
<tr>
|
||||
<?php echo $filter_dateranges ?>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("40px", "", "left"); ?>
|
||||
|
||||
<div class="f12bp1_blue">
|
||||
<div style="float:left">
|
||||
Aufträge 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" value="!!!" onClick="showPageStatus();"> -->
|
||||
</div>
|
||||
<?php echo defineButtonType10("Kunde suchen", "action_search", "finishPage('clearPageAndCustomerSearch');", "120", "left", "5"); ?>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("30px", "", "left"); ?>
|
||||
|
||||
<!-- Search, reset and store -->
|
||||
<div>
|
||||
<?php echo defineButtonType10("Aufträge anzeigen", "action_load", "finishPage('loadJobsOfCustomer');", "200", "left", "10"); ?>
|
||||
<?php echo defineButtonType10("CSV erzeugen", "action_create", "finishPage('generateCSV');", "220", "left", "10"); ?>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("30px", "", "left"); ?>
|
||||
|
||||
<!-- Input fields for new jobs-->
|
||||
<div>
|
||||
<table class="f8np1" border="1" cellpadding="0">
|
||||
<tr>
|
||||
<td> Auftrag </td> <td> Auftragszeit </td> <td> Erledigungszeit </td> <td> Betrag </td> <td> Fahrzeug </td>
|
||||
</tr>
|
||||
|
||||
<!-- Stored jobs -->
|
||||
<?php echo $out ?>
|
||||
|
||||
<?php if ($sumOfJobPrices != 0) : ?>
|
||||
<tr>
|
||||
<td> </td> <td> </td> <td> </td>
|
||||
<td class="f8np1_red"> <?php echo number_format(round($sumOfJobPrices,2), 2, ",", ".") ?> </td> <td> </td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("30px", "", "left"); ?>
|
||||
|
||||
<!-- Filenames of the selected interval to generate CSV documents -->
|
||||
<div>
|
||||
<table class="f8np1" border="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo $storedExportFiles ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("30px", "", "left"); ?>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,402 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* jb_exp_csv_meta.php
|
||||
*
|
||||
* Autor: Marc Vollmann
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
|
||||
include_once ("../include/mcglobal.inc.php");
|
||||
include_once ("../include/auth.inc.php");
|
||||
include_once ("../include/image.inc.php");
|
||||
include_once ("../include/caglobal.inc.php");
|
||||
|
||||
|
||||
// Check HTTP-Parameters
|
||||
getSecHttpVars("1",array("f_act", "customerId", "cscIdRoot", "cscIdActual",
|
||||
"day_from", "month_from", "year_from", "day_to", "month_to", "year_to",
|
||||
"g_cs_id", "g_csc_id", "g_csc_name", "initCsSearch", "f_filter", "f_vht_filter",
|
||||
"f_inv_no", "f_inv_datetime_day", "f_inv_datetime_month", "f_inv_datetime_year",
|
||||
"filenameCSV", "statusMessage", "deactivateMenu"));
|
||||
|
||||
|
||||
$pageTitel = "CSV-AUSGABE";
|
||||
$deactivateMenuStatic = "1";
|
||||
include_once ("../admin/menu.php");
|
||||
include_once ("../include/html.inc.php");
|
||||
|
||||
// Execution-Time for script
|
||||
// set_time_limit(30000);
|
||||
|
||||
$phpVer56Plus = false;
|
||||
if (substr(phpversion(), 0, 3) >= "5.6") :
|
||||
$phpVer56Plus = true;
|
||||
endif;
|
||||
|
||||
// Get global export path
|
||||
$globalExportPath = getParameterValue("0", "EXPORT_PATH", "0");
|
||||
if ($globalExportPath == "") : $globalExportPath = getParameterValue("0", "EXPORT_PATH", "0"); endif;
|
||||
if ($globalExportPath == "") : $globalExportPath = "../export/download/"; endif;
|
||||
|
||||
$path = getAbsoluteSystemPath();
|
||||
|
||||
// Check range of date. All fields have to be set
|
||||
if ($day_from == "" || $month_from == "" || $year_from == "" ||
|
||||
$day_to == "" || $month_to == "" || $year_to == "") :
|
||||
|
||||
// Initialize date-ranges to the current date
|
||||
$fromDateRange = getDateTime("1") . "000000";
|
||||
$toDateRange = getDateTime("1") . "235959";
|
||||
|
||||
$day_from = getDateTime("day");
|
||||
$month_from = getDateTime("month");
|
||||
$year_from = getDateTime("year");
|
||||
$day_to = getDateTime("day");
|
||||
$month_to = getDateTime("month");
|
||||
$year_to = getDateTime("year");
|
||||
else :
|
||||
$fromDateRange = $year_from . pad($month_from,2) . pad($day_from,2) . "000000";
|
||||
$toDateRange = $year_to . pad($month_to,2) . pad($day_to,2) . "235959";
|
||||
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) ) ) : gotoReferer("1"); endif;
|
||||
|
||||
// Get the rights of the employee logged in and check the accessibility
|
||||
authCheckEmployeeRights($emp_id, "7", "1");
|
||||
|
||||
getDBNames("0"); // Only use current tables (no history tables)
|
||||
|
||||
// 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");
|
||||
|
||||
$f_inv_no = trim($f_inv_no);
|
||||
$f_inv_datetime = "";
|
||||
if ($f_inv_datetime_month >= "1" && $f_inv_datetime_month <= "12" && $f_inv_datetime_day >= "1" && $f_inv_datetime_day <= "31") :
|
||||
$f_inv_datetime = $f_inv_datetime_year . "-" . $f_inv_datetime_month . "-" . $f_inv_datetime_day . " 12:00:00";
|
||||
endif;
|
||||
|
||||
|
||||
if ($f_filter == "") : $f_filter = "0"; endif; // Filter (order clause by CSV generation)
|
||||
if ($f_vht_filter == "") : $f_vht_filter = array(); endif; // filter for vehicle of the courier for exporting ALL or ONLY the specified vehicle types
|
||||
|
||||
|
||||
// Generate CSV document
|
||||
if ($f_act == "generateCSV") :
|
||||
if ($g_cs_id != "") :
|
||||
|
||||
$passwd = "acapella7890";
|
||||
$logFile = $path . "/log/sys_auto_export.log";
|
||||
$emptyArgument = "\"\"";
|
||||
$fileNameSuffix = substr(getDateTime("6"), 0, 12); // Format: "YmdHi"
|
||||
|
||||
// Get data for calling customer export functionality
|
||||
$g_cs_admin = getFieldValueFromId("customer", "cs_id", $g_cs_id, "cs_admin");
|
||||
$g_hq_id = getFieldValueFromId("customer", "cs_id", $g_cs_id, "hq_id");
|
||||
$g_hq_mnemonic = getFieldValueFromId("headquarters", "hq_id", $g_hq_id, "hq_mnemonic");
|
||||
$g_usr_id = getFieldValueFromId("employee", "emp_id", $g_cs_admin, "usr_id");
|
||||
|
||||
// t:m special function (!!!!)
|
||||
$f_act = "special_export_5";
|
||||
|
||||
// Arguments for calling customer export
|
||||
// $hq_id $usr_id $dummy_01 $f_act $f_exp_category $f_delimiter $f_parname $f_parname_export $f_fileName $day_to $month_to $year_to $f_cs_eid_filter $day_from $month_from $year_from $f_jbp_filter $specialJbPayment $jbpc_id
|
||||
|
||||
// Bsp: STHB.t:m: $g_hq_id = "1"; $g_hq_mnemonic = "HB"; $g_cs_id = "832514"; $g_usr_id = "840785";
|
||||
|
||||
$exportPars = array();
|
||||
$exportPars[] = array($g_hq_id,$g_usr_id,"_",$f_act,$emptyArgument,$emptyArgument,$emptyArgument,$emptyArgument,$g_cs_eid . "_" . $fileNameSuffix . ".csv",$day_to,$month_to,$year_to,$emptyArgument,$day_from,$month_from,$year_from,$g_cs_id);
|
||||
|
||||
$exportParsKeys = array_keys($exportPars);
|
||||
$exportParsKeysLen = count($exportParsKeys);
|
||||
if ($exportParsKeysLen != "" && is_numeric($exportParsKeysLen)) :
|
||||
|
||||
// Exports
|
||||
for ($i = 0; $i < $exportParsKeysLen; $i++) :
|
||||
|
||||
list($hq_id,$usr_id,$dummy_01,$f_act,$f_exp_category,$f_delimiter,$f_parname,$f_parname_export,$f_fileName,
|
||||
$day_to,$month_to,$year_to,$f_cs_eid_filter,$day_from,$month_from,$year_from,$customerId,$f_jbp_filter,$specialJbPayment,$jbpc_id) = $exportPars[$exportParsKeys[$i]];
|
||||
|
||||
$cmd = "php " . $path . "/export/export.php " . $passwd . " " . $hq_id . " " . $usr_id . " " . $dummy_01 . " " . $f_act . " " . $f_exp_category . " " . "\"" . $f_delimiter. "\"" . " "
|
||||
. "\"" . $f_parname . "\"" . " " . "\"" . $f_parname_export . "\"" . " " . "\"" . $f_fileName . "\"" . " " . $day_to . " " . $month_to . " " . $year_to . " "
|
||||
. $f_cs_eid_filter . " " . $day_from . " " . $month_from . " " . $year_from . " " . $customerId . " " . $f_jbp_filter . " " . $specialJbPayment . " " . $jbpc_id; // . " &";
|
||||
// echo $cmd . "\n\n\n"; die();
|
||||
$cmdOutput = null;
|
||||
exec($cmd, $cmdOutput);
|
||||
// list($errNo, $errDesc) = $cmdOutput;
|
||||
|
||||
$currentTime = getDateTime("0");
|
||||
writeToFile($logFile, "OP=AUTO_EXPORT|DATETIME=" . $currentTime . "|CUST=" . $exportParsKeys[$i]);
|
||||
|
||||
$f_act = "loadJobsOfCustomer";
|
||||
|
||||
// sleep(5); // Avoid too many tasks
|
||||
endfor;
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = "Sie haben noch keinen Kunden ausgewählt!";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
|
||||
// *** Output ***
|
||||
$storedExportFiles = "";
|
||||
if ($g_cs_id != "" && is_numeric($g_cs_id) && $g_cs_id > "0") :
|
||||
|
||||
// Read all of the local exported filenames for the current customer
|
||||
|
||||
$sqlquery = "SELECT expf_id, expf_name, expf_cryptname, expf_storetime, expf_ftpupload"
|
||||
. " FROM exportfiles"
|
||||
. " WHERE cs_id = '" . $g_cs_id . "'"
|
||||
. " ORDER BY expf_storetime DESC";
|
||||
|
||||
$result = $db->query($sqlquery);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
|
||||
$expfIdArray = array();
|
||||
$expfCryptNameArray = array();
|
||||
|
||||
$customerId = $g_cs_id;
|
||||
$cscIdRoot = getFieldValueFromId("customer", "cs_id", $customerId, "csc_id");
|
||||
$cscIdActual = $cscIdRoot;
|
||||
|
||||
// Restrictions to display links for FTP upload
|
||||
/*
|
||||
$parFTPuploadDisabled = getParameterValue("0", "EXPORT_MASK_FTP_UPLOAD_DISABLED", $hq_id);
|
||||
if ($parFTPuploadDisabled == "") : $parFTPuploadDisabled = getParameterValue("0", "EXPORT_MASK_FTP_UPLOAD_DISABLED", "0"); endif;
|
||||
*/
|
||||
|
||||
$storedExportFiles .= "<table>";
|
||||
// Define table header
|
||||
$storedExportFiles .= "<tr>";
|
||||
$storedExportFiles .= "<td>Datum / Uhrzeit</td><td>WEB-Download</td>";
|
||||
$storedExportFiles .= "</tr>";
|
||||
// Define table body from result set
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$expfIdArray[] = $row["expf_id"];
|
||||
$expfCryptNameArray[] = $row["expf_cryptname"];
|
||||
$storedExportFiles .= "<tr>";
|
||||
$storedExportFiles .= "<td>" . formatOutput($row["expf_storetime"],"timestamp") . " </td>";
|
||||
|
||||
$storedExportFiles .= "<td><a href=\"../export/exportdata.php?customerId=" . ec($customerId) . "&cscIdRoot=" . ec($cscIdRoot) .
|
||||
"&cscIdActual=" . ec($cscIdActual) . "&f_fileName=" . $row["expf_name"] . "\" target=\"_blank\">" .
|
||||
$row["expf_name"] . "</a> </td>";
|
||||
// Enable FTP upload option only for headquarter
|
||||
/*
|
||||
if ($userTypeName == "hq" && $parFTPuploadDisabled != "1") :
|
||||
if ($row["expf_ftpupload"] != "1") :
|
||||
$storedExportFiles .= "<td><a href=\"exportdata_ftp.php?f_fileName=" . $row["expf_name"] . "&customerId=" . ec($customerId) .
|
||||
"&cscIdRoot=" . ec($cscIdRoot) . "&cscIdActual=" . ec($cscIdActual) . "\" target=\"_blank\">" .
|
||||
$row["expf_name"] . "</a></td>";
|
||||
else :
|
||||
$storedExportFiles .= "<td>" . $row["expf_name"] . "</td>";
|
||||
endif;
|
||||
endif;
|
||||
*/
|
||||
$storedExportFiles .= "</tr>";
|
||||
endwhile;
|
||||
$storedExportFiles .= "</table>";
|
||||
$result->free();
|
||||
|
||||
// Init, because script works in headquarters mode only
|
||||
$customerId = "";
|
||||
$cscIdRoot = "";
|
||||
$cscIdActual = "";
|
||||
|
||||
// Automatical deletion of more than 10 files
|
||||
$maxEntries = getParameterValue("0", "EXPORT_FILES_ON_SERVER_CUSTOMER", "0");
|
||||
if ($maxEntries == "" || !is_numeric($maxEntries)) : $maxEntries = "10"; endif;
|
||||
$expfIdArrayLen = count($expfIdArray);
|
||||
if ($expfIdArrayLen >= $maxEntries) :
|
||||
|
||||
for ($j = $maxEntries - 1; $j < $expfIdArrayLen; $j++) :
|
||||
|
||||
unlink($globalExportPath . $expfCryptNameArray[$j]); // delete file
|
||||
deleteStmt("exportfiles","expf_id = " . $expfIdArray[$j]); // delete corresponding db-entry
|
||||
endfor;
|
||||
endif;
|
||||
endif;
|
||||
|
||||
|
||||
$currentFrameName = ""; // Empty string for "main frame"
|
||||
|
||||
// Date-ranges
|
||||
$filter_dateranges .= "<td><span class=\"f12bp1_blue\">Auftragsdatum: </span>";
|
||||
$filter_dateranges .= "Von:\n";
|
||||
$filter_dateranges .= "<select name=\"day_from\" class=\"f8np1\" onchange=\"fillDateFields(0, '" . $currentFrameName . "', 'jb_exp_csv', 'day_from', 'day_from', 'month_from', 'year_from', '', '', '')\"></select>\n";
|
||||
$filter_dateranges .= "<select name=\"month_from\" class=\"f8np1\" onchange=\"fillDateFields(0, '" . $currentFrameName . "', 'jb_exp_csv', 'month_from', 'day_from', 'month_from', 'year_from', '', '', '')\"></select>\n";
|
||||
$filter_dateranges .= "<select name=\"year_from\" class=\"f8np1\" onchange=\"fillDateFields(0, '" . $currentFrameName . "', 'jb_exp_csv', 'year_from', 'day_from', 'month_from', 'year_from', '', '', '')\"></select>\n";
|
||||
$filter_dateranges .= "</td><td> bis:\n";
|
||||
$filter_dateranges .= "<select name=\"day_to\" class=\"f8np1\" onchange=\"fillDateFields(0, '" . $currentFrameName . "', 'jb_exp_csv', 'day_to', 'day_to', 'month_to', 'year_to', '', '', '')\"></select>\n";
|
||||
$filter_dateranges .= "<select name=\"month_to\" class=\"f8np1\" onchange=\"fillDateFields(0, '" . $currentFrameName . "', 'jb_exp_csv', 'month_to', 'day_to', 'month_to', 'year_to', '', '', '')\"></select>\n";
|
||||
$filter_dateranges .= "<select name=\"year_to\" class=\"f8np1\" onchange=\"fillDateFields(0, '" . $currentFrameName . "', 'jb_exp_csv', 'year_to', 'day_to', 'month_to', 'year_to', '', '', '')\"></select>\n";
|
||||
$filter_dateranges .= "</td>";
|
||||
|
||||
// Javascript-function as template only for
|
||||
$js_date = "<script type=\"text/javascript\">\n";
|
||||
$js_date .= "<!--\n";
|
||||
$js_date .= "function initForm() {\n";
|
||||
$js_date .= " fillDateFields(1,\"" . $currentFrameName . "\",\"jb_exp_csv\",\"\",\"day_from\",\"month_from\",\"year_from\",\"\",\"\",\"\");\n";
|
||||
$js_date .= " setDateTimeFields(\"" . $currentFrameName . "\",\"jb_exp_csv\",".$day_from.",".$month_from.",".$year_from.", \"\", \"\", \"day_from\", \"month_from\", \"year_from\", \"\", \"\", \"\");\n";
|
||||
$js_date .= " fillDateFields(1,\"" . $currentFrameName . "\",\"jb_exp_csv\", \"\", \"day_to\", \"month_to\", \"year_to\", \"\", \"\", \"\");\n";
|
||||
$js_date .= " setDateTimeFields(\"" . $currentFrameName . "\",\"jb_exp_csv\",".$day_to.",".$month_to.",".$year_to.", \"\", \"\", \"day_to\", \"month_to\", \"year_to\", \"\", \"\", \"\");\n";
|
||||
$js_date .= "}\n";
|
||||
$js_date .= "-->\n";
|
||||
$js_date .= "</script>\n";
|
||||
?>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>CSV-AUSGABE</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../css/phoenix.css">
|
||||
<style type="text/css">
|
||||
<?php include_once ("../css/navigation.css.php"); ?>
|
||||
</style>
|
||||
|
||||
<?php include_once ("../include/js_framework.inc.php"); ?>
|
||||
|
||||
<script src="../include/searchLists.js" type="text/javascript"></script>
|
||||
<script src="../include/checkFormTags.js" type="text/javascript"></script>
|
||||
<script src="../include/lib_global.js" type="text/javascript"></script>
|
||||
|
||||
<?php echo $js_date ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
// NAVIGATION
|
||||
<?php echo $jsMenuOut; ?>
|
||||
|
||||
function searchCs() {
|
||||
searchCsCscGeneric('111000000000111');
|
||||
};
|
||||
|
||||
function finishPage(mode) {
|
||||
if (mode == 'generateCSV') {
|
||||
if (document.forms[0].g_cs_id.value != '') {
|
||||
if (confirm('Möchten Sie die CSV-Datei über den angegebenen Zeitraum generieren?')) {
|
||||
document.forms[0].f_act.value = mode;
|
||||
document.forms[0].action.disabled = true;
|
||||
document.forms[0].submit();
|
||||
}
|
||||
} else {
|
||||
alert('Sie müssen zuvor bitte einen Kunden wählen!');
|
||||
}
|
||||
}
|
||||
if (mode == 'clearPageAndCustomerSearch') {
|
||||
if (document.forms[0].g_cs_id.value != '') {
|
||||
if (confirm('Möchten Sie einen neuen Kunden wählen? Die Seiteninformationen gehen verloren!')) {
|
||||
document.location.href = "jb_exp_csv_meta.php?initCsSearch=1";
|
||||
}
|
||||
} else {
|
||||
searchCs();
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
function checkDate(checkObj,mode) {
|
||||
var resetValue = checkDateFields(checkObj,mode);
|
||||
if (resetValue) {
|
||||
checkObj.value = '';
|
||||
checkObj.focus();
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
function jbCheckAll(numOfRows) {
|
||||
for (i = 0; i < numOfRows; i++) {
|
||||
document.getElementsByName('f_jobs[]')[i].checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
function jbUncheckAll(numOfRows) {
|
||||
for (i = 0; i < numOfRows; i++) {
|
||||
document.getElementsByName('f_jobs[]')[i].checked = false;
|
||||
}
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body onLoad="<?php echo $phpCurrentNavigationOnLoad ?>initForm();displayStatusMessage(); <?php if ($initCsSearch == "1") : echo "searchCs();" ; endif; ?>">
|
||||
|
||||
<?php echo $phpMenuOut ?>
|
||||
<?php echo $phpReducedMenuOut ?>
|
||||
<?php echo $phpPageTitelOut ?>
|
||||
|
||||
<div class="maincontent" name="maincontent" id="maincontent">
|
||||
|
||||
<form name="jb_exp_csv" action="jb_exp_csv_meta.php" method="post">
|
||||
|
||||
<input type="hidden" name="f_act" value="">
|
||||
<input type="hidden" name="g_cs_id" value="<?php echo $g_cs_id ?>">
|
||||
<input type="hidden" name="g_csc_id" value="<?php echo $g_csc_id ?>">
|
||||
<input type="hidden" name="filenameCSV" value="">
|
||||
<?php echo $phpCurrentNavigationInputHidden ?>
|
||||
<input type="hidden" name="deactivateMenu" value="<?php echo ec($deactivateMenu) ?>">
|
||||
|
||||
<?php echo htmlDivLineSpacer("5px"); ?>
|
||||
|
||||
<!- Date-ranges -->
|
||||
<div class="f12bp1_blue">
|
||||
<table cellspacing="0" cellpadding="0" vspace="0" hspace="0">
|
||||
<tr>
|
||||
<?php echo $filter_dateranges ?>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("40px", "", "left"); ?>
|
||||
|
||||
<div class="f12bp1_blue">
|
||||
<div style="float:left">
|
||||
Kunde:
|
||||
<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" value="!!!" onClick="showPageStatus();"> -->
|
||||
</div>
|
||||
<?php echo defineButtonType10("Suchen", "action_search", "finishPage('clearPageAndCustomerSearch');", "120", "left", "5"); ?>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("30px", "", "left"); ?>
|
||||
|
||||
<!-- Search, reset and store -->
|
||||
<div>
|
||||
<?php echo defineButtonType10("CSV erzeugen", "action_create", "finishPage('generateCSV');", "220", "left", "10"); ?>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("30px", "", "left"); ?>
|
||||
|
||||
<!-- Filenames of the selected interval to generate CSV documents -->
|
||||
<div>
|
||||
<table class="f8np1" border="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo $storedExportFiles ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("30px", "", "left"); ?>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,828 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* jb_inv_assoc.php
|
||||
*
|
||||
* Autor: Marc Vollmann
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
|
||||
include_once ("../include/mcglobal.inc.php");
|
||||
include_once ("../include/auth.inc.php");
|
||||
include_once ("../include/image.inc.php");
|
||||
include_once ("../include/caglobal.inc.php");
|
||||
|
||||
|
||||
// Check HTTP-Parameters
|
||||
getSecHttpVars("1",array("f_act", "customerId", "cscIdRoot", "cscIdActual",
|
||||
"day_from", "month_from", "year_from", "day_to", "month_to", "year_to",
|
||||
"g_cs_id", "g_csc_id", "g_csc_name", "initCsSearch", "f_filter", "f_vht_filter",
|
||||
"f_inv_no", "f_inv_datetime_day", "f_inv_datetime_month", "f_inv_datetime_year",
|
||||
"f_jobs", "invId4PDF", "statusMessage", "deactivateMenu"));
|
||||
|
||||
$pageTitel = "PDF-AUSGABE";
|
||||
include_once ("../admin/menu.php");
|
||||
include_once ("../include/html.inc.php");
|
||||
|
||||
// Execution-Time for script
|
||||
// set_time_limit(30000);
|
||||
|
||||
$phpVer56Plus = false;
|
||||
if (substr(phpversion(), 0, 3) >= "5.6") :
|
||||
$phpVer56Plus = true;
|
||||
endif;
|
||||
|
||||
$utf8euro = mb_convert_encoding("?", 'UTF-8');
|
||||
$utf8sz = mb_convert_encoding("ß", 'UTF-8');
|
||||
|
||||
// Include functions
|
||||
include_once ("../include/inc_pdf.inc.php");
|
||||
|
||||
|
||||
function callJbDetail() {
|
||||
global $db, $outputFormatField, $automailer, $f_act, $job_id, $currentHqId;
|
||||
global $dbh_jb, $dbh_tr, $dbh_trs, $dbh_log;
|
||||
include ("../admin/jb_detail_.php");
|
||||
return array($sqlqueryJob, $sqlqueryTour, $sqlqueryCourier, $sqlqueryCosts);
|
||||
}
|
||||
|
||||
|
||||
// Check range of date. All fields have to be set
|
||||
if ($day_from == "" || $month_from == "" || $year_from == "" ||
|
||||
$day_to == "" || $month_to == "" || $year_to == "") :
|
||||
|
||||
// Initialize date-ranges to the current date
|
||||
$fromDateRange = getDateTime("1") . "000000";
|
||||
$toDateRange = getDateTime("1") . "235959";
|
||||
|
||||
$day_from = getDateTime("day");
|
||||
$month_from = getDateTime("month");
|
||||
$year_from = getDateTime("year");
|
||||
$day_to = getDateTime("day");
|
||||
$month_to = getDateTime("month");
|
||||
$year_to = getDateTime("year");
|
||||
else :
|
||||
$fromDateRange = $year_from . pad($month_from,2) . pad($day_from,2) . "000000";
|
||||
$toDateRange = $year_to . pad($month_to,2) . pad($day_to,2) . "235959";
|
||||
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) ) ) : gotoReferer("1"); endif;
|
||||
|
||||
// Get the rights of the employee logged in and check the accessibility
|
||||
authCheckEmployeeRights($emp_id, "7", "1");
|
||||
|
||||
getDBNames("0"); // Only use current tables (no history tables)
|
||||
|
||||
// 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");
|
||||
|
||||
mcTrim($f_inv_no);
|
||||
$f_inv_datetime = "";
|
||||
if ($f_inv_datetime_month >= "1" && $f_inv_datetime_month <= "12" && $f_inv_datetime_day >= "1" && $f_inv_datetime_day <= "31") :
|
||||
$f_inv_datetime = $f_inv_datetime_year . "-" . $f_inv_datetime_month . "-" . $f_inv_datetime_day . " 12:00:00";
|
||||
endif;
|
||||
$f_jobs_len = is_countable($f_jobs) ? count($f_jobs) : 0;
|
||||
$sumOfJobPrices = 0;
|
||||
$numOfRows = 0;
|
||||
|
||||
if ($f_filter == "") : $f_filter = "0"; endif; // Filter (order clause by PDF generation)
|
||||
if ($f_vht_filter == "") : $f_vht_filter = array(); endif; // filter for vehicle of the courier for exporting ALL or ONLY the specified vehicle types
|
||||
|
||||
|
||||
// Store invoice data to jobs
|
||||
if ($f_act == "storeJobs") :
|
||||
if ($g_cs_id != "") :
|
||||
if ($f_jobs_len > 0) :
|
||||
if ($f_inv_no != "" && $f_inv_datetime != "") :
|
||||
|
||||
// Transaction control starts here
|
||||
// TA("B");
|
||||
|
||||
// Iterate all jobs
|
||||
for ($i = 0; $i < $f_jobs_len; $i++) :
|
||||
|
||||
$jbId = $f_jobs[$i];
|
||||
|
||||
// Insert job into table "invoice" if does not exist else update
|
||||
if (!(existsEntry("invoice",array("jb_id",$jbId)))) :
|
||||
insertStmt("invoice", array("jb_id", $jbId, "inv_no", $f_inv_no, "inv_datetime", $f_inv_datetime));
|
||||
else :
|
||||
updateStmt("invoice", "jb_id", $jbId, array("inv_no", $f_inv_no, "inv_datetime", $f_inv_datetime));
|
||||
endif;
|
||||
endfor;
|
||||
|
||||
// TA("C");
|
||||
// TA("E");
|
||||
|
||||
$f_act = "loadJobsOfCustomer";
|
||||
else :
|
||||
$statusMessage = "Sie müssen eine Rechnungsnummer und ein Rechnungsdatum vergeben!";
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = "Es wurden noch keine Aufträge identifiziert!";
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = "Sie haben noch keinen Kunden ausgewählt!";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// Generate PDF document
|
||||
if ($f_act == "generatePDF") :
|
||||
if ($invId4PDF != "") :
|
||||
|
||||
// Decision to use the job archive or normal tables
|
||||
$dbhistory = checkHistoryLevel($dbhistory, "jb", $jbId);
|
||||
$dbhistory = getDBNames($dbhistory);
|
||||
|
||||
// Set filters
|
||||
$orderByClause = "jb.csc_id_payer, jb.jb_id"; // Internal ID of the costcenter of the payer
|
||||
if ($f_filter == "0") : $orderByClause = "csc.csc_name, jb.jb_id"; endif; // Name of the costcenter of the payer
|
||||
if ($f_filter == "1") : $orderByClause = "jb.jb_id"; endif; // Job number
|
||||
|
||||
$jobArray = array();
|
||||
$sqlquery = "SELECT jb.jb_id, usr.usr_email, jb.cr_sid, jb.hq_id"
|
||||
. " FROM invoice AS inv, job AS jb, costcenter AS csc, customer AS cs, employee AS emp, user AS usr"
|
||||
. " WHERE inv.inv_no = '" . $invId4PDF . "' AND"
|
||||
. " inv.jb_id = jb.jb_id AND"
|
||||
. " jb.csc_id_payer = csc.csc_id AND"
|
||||
. " csc.cs_id = cs.cs_id AND"
|
||||
. " cs.cs_admin = emp.emp_id AND"
|
||||
. " emp.usr_id = usr.usr_id "
|
||||
. " ORDER BY " . $orderByClause;
|
||||
$result = $db->query($sqlquery);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$jobArray[] = array($row["jb_id"], $row["hq_id"]);
|
||||
endwhile;
|
||||
$result->free();
|
||||
|
||||
$automailer = "1"; // Takes care for NO web output in jb_details
|
||||
$f_act = ""; // Takes care for NO operation in jb_details
|
||||
|
||||
$lenJobArray = count($jobArray);
|
||||
if ($lenJobArray > 0) :
|
||||
|
||||
// Declare PDF File
|
||||
getPDFObject(getLicenceKey());
|
||||
|
||||
// PDF_open_file($pdf);
|
||||
// open new PDF file; insert a file name to create the PDF on disk
|
||||
if ($pdf->begin_document("", "") == 0) {
|
||||
die("Error: " . $pdf->get_errmsg());
|
||||
}
|
||||
|
||||
setPDFInfo("Auftragsdetails");
|
||||
setPDFParameter();
|
||||
$font = $pdf->load_font("Arial", "winansi", "");
|
||||
// $font = $pdf->load_font("Courier New", "winansi", "");
|
||||
|
||||
// Iterate all jobs of the selected invoice
|
||||
for ($i = 0; $i < $lenJobArray; $i++) :
|
||||
|
||||
// pdfNewPage();
|
||||
|
||||
// Current job and mail address
|
||||
$job_id = $jobArray[$i][0];
|
||||
$currentHqId = $jobArray[$i][1];
|
||||
|
||||
// Get number of entries in tour to scale the width of the PDF-page
|
||||
$pdfPageWidth = 1000;
|
||||
$pdfPageHeight = 500;
|
||||
$numOfTourEntries = getCountOfTable("tour", "jb_id = '" . $job_id . "'");
|
||||
$numOfTourEntries -= 5;
|
||||
if ($numOfTourEntries > 0) :
|
||||
$pdfPageWidth += ($numOfTourEntries * 200);
|
||||
endif;
|
||||
|
||||
$pdf->begin_page_ext(0,0, "width=" . $pdfPageWidth . " height=" . $pdfPageHeight);
|
||||
$pdf->setfont($font, 12);
|
||||
$pdf->show_xy("Rechnung: " . $invId4PDF, 15, 480);
|
||||
$pdf->show_xy("Auftrag: " . $job_id, 15, 465);
|
||||
$pdf->setfont($font, 8);
|
||||
|
||||
// PDF_begin_page_ext($pdf, $pdfPageWidth, 500, "");
|
||||
// PDF_setfont($pdf, $font, 12);
|
||||
// PDF_show_xy($pdf, "Rechnung: " . $invId4PDF, 15, 480);
|
||||
// PDF_show_xy($pdf, "Auftrag : " . $job_id, 15, 465);
|
||||
// PDF_setfont($pdf, $font, 8);
|
||||
|
||||
if ($job_id != "" && $currentHqId != "") :
|
||||
ob_start();
|
||||
$sqlStatementArray = callJbDetail();
|
||||
ob_end_clean(); // Erases output buffer
|
||||
endif;
|
||||
|
||||
// Job data
|
||||
$result = $db->query($sqlStatementArray[0]);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage() . ": " . $sqlStatementArray[0]);
|
||||
$titles = "Fahrzeug,Auftragszeit,Annahme,Erledigung";
|
||||
$fields = "vht_value,jb_ordertime,jb_taketime,jb_finishtime";
|
||||
$titlesArray = spliti(",",$titles);
|
||||
$fieldsArray = spliti(",",$fields);
|
||||
$fieldsLength = count($fieldsArray);
|
||||
$pdfTextOffsetRow = 0; // Offset for rows
|
||||
while ($row = $result->fetch_assoc()):
|
||||
for ($j = 0; $j < $fieldsLength; $j++) :
|
||||
if (trim($titlesArray[$j]) == "") : $titlesArray[$j] = " "; endif;
|
||||
$tmpVarName = $fieldsArray[$j];
|
||||
$row[$tmpVarName] = str_replace("<br>", " ", $row[$tmpVarName]);
|
||||
$row[$tmpVarName] = str_replace(" ", " ", $row[$tmpVarName]);
|
||||
|
||||
$pdf->show_xy($titlesArray[$j] . ": ", 15, (430 - $pdfTextOffsetRow));
|
||||
$pdf->show_xy(formatOutput($row[$tmpVarName],$outputFormatField[$tmpVarName]), 100, (430 - $pdfTextOffsetRow));
|
||||
// PDF_show_xy($pdf, $titlesArray[$j] . ": ", 15, (430 - $pdfTextOffsetRow));
|
||||
// PDF_show_xy($pdf, formatOutput($row[$tmpVarName],$outputFormatField[$tmpVarName]), 100, (430 - $pdfTextOffsetRow));
|
||||
|
||||
|
||||
$job_cr_sid = $row["cr_sid"];
|
||||
|
||||
$pdfTextOffsetRow = $pdfTextOffsetRow + 10;
|
||||
endfor;
|
||||
endwhile;
|
||||
$result->free();
|
||||
|
||||
// Tour data
|
||||
$result = $db->query($sqlStatementArray[1]);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage() . ": " . $sqlStatementArray[1]);
|
||||
$titles = "Firma,Zusatz,Person,Straße + Hausnr.,PLZ + Ort,EID,Kostenstelle,Tel.,Kommissionsnr.,Erledigungszeit,Klartext,Unterschrift";
|
||||
$fields = "tr_comp,tr_comp2,tr_person,ad_street_hsno,ad_zipcode_city,cs_eid,csc_name,tr_phone,tr_commission_no,tr_finishtime,tr_signname,tr_sign";
|
||||
$titlesArray = spliti(",",$titles);
|
||||
$fieldsArray = spliti(",",$fields);
|
||||
$fieldsLength = count($fieldsArray);
|
||||
$tourentry = "";
|
||||
$rowCounter = 0;
|
||||
$pdfTextOffsetCol = 0; // Offset for cols
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$rowCounter++;
|
||||
$pdfTextOffsetRow = 0; // Offset for rows
|
||||
|
||||
for ($j = 0; $j < $fieldsLength; $j++) :
|
||||
|
||||
if (trim($titlesArray[$j]) == "") : $titlesArray[$j] = " "; endif;
|
||||
|
||||
if ($rowCounter == 1) :
|
||||
if (!mb_check_encoding($titlesArray[$j], 'UTF-8')) {
|
||||
$titlesArray[$j] = mb_convert_encoding($titlesArray[$j], 'UTF-8');
|
||||
}
|
||||
$pdf->show_xy($titlesArray[$j] . ": ", (15 + $pdfTextOffsetCol), (270 - $pdfTextOffsetRow));
|
||||
// PDF_show_xy($pdf, $titlesArray[$j] . ": ", (15 + $pdfTextOffsetCol), (270 - $pdfTextOffsetRow));
|
||||
elseif ($j == 0) :
|
||||
$tourentry .= "<img arr>";
|
||||
else :
|
||||
$tourentry .= "";
|
||||
endif;
|
||||
$tmpVarName = $fieldsArray[$j];
|
||||
${$tmpVarName} = $row[$tmpVarName];
|
||||
$outField = formatOutput(${$tmpVarName},$outputFormatField[$tmpVarName]);
|
||||
|
||||
// Customer-sign
|
||||
if ($tmpVarName == "tr_sign") :
|
||||
if ($row["tr_sign"] != "") :
|
||||
$rawCoord = splitRawCoordinates ($row["tr_sign"]);
|
||||
$maxCoord = checkMaxCoordinates($rawCoord);
|
||||
|
||||
$tmpSignPath = "../temp/signs/";
|
||||
if (SIGNS_PATH != "") : $tmpSignPath = SIGNS_PATH; endif;
|
||||
$imgFilename = $tmpSignPath . $job_id . "_" . $row["tr_sort"] . ".png";
|
||||
$im = createSignImage($rawCoord);
|
||||
$boolImg = true;
|
||||
if (!file_exists($imgFilename)) :
|
||||
$boolImg = imagepng($im, $imgFilename);
|
||||
endif;
|
||||
|
||||
// $image1 = PDF_load_image($pdf, "png", $path . substr($imgFilename, 2), "");
|
||||
if ($boolImg) :
|
||||
// $image1 = PDF_load_image($pdf, "png", $path . substr($imgFilename, 2), "");
|
||||
$image1 = $pdf->load_image("png", $imgFilename, "");
|
||||
if ($image1 != -1) :
|
||||
// PDF_fit_image($pdf, $image1, (100 + $pdfTextOffsetCol), 70, "boxsize {100 50} fitmethod meet" );
|
||||
$pdf->fit_image($image1, (100 + $pdfTextOffsetCol), 70, "boxsize {100 50} fitmethod meet" );
|
||||
endif;
|
||||
endif;
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// Finishtime of the stop
|
||||
if ($tmpVarName == "tr_finishtime") :
|
||||
if (substr($tr_finishtime,0,4) == "1970") :
|
||||
$outField = "";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// Do not show customer data if external costcenter
|
||||
if ($tmpVarName == "usr_phone" || $tmpVarName == "usr_email" || $tmpVarName == "cs_eid") :
|
||||
if (!(strpos(strtoupper($row["csc_path"]), "//EXTERN//") === FALSE)) :
|
||||
$outField = "";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
if ($tmpVarName != "tr_sign") : // all but the sign !!!
|
||||
if ($outField == " ") : $outField = ""; endif;
|
||||
if (!mb_check_encoding($outField, 'UTF-8')) {
|
||||
$outField = mb_convert_encoding($outField, 'UTF-8');
|
||||
}
|
||||
$pdf->show_xy($outField, (100 + $pdfTextOffsetCol), (270 - $pdfTextOffsetRow));
|
||||
// PDF_show_xy($pdf, $outField, (100 + $pdfTextOffsetCol), (270 - $pdfTextOffsetRow));
|
||||
$pdfTextOffsetRow = $pdfTextOffsetRow + 10;
|
||||
endif;
|
||||
endfor;
|
||||
$pdfTextOffsetCol = $pdfTextOffsetCol + 120;
|
||||
endwhile;
|
||||
$result->free();
|
||||
|
||||
// Courier data
|
||||
$result = $db->query($sqlStatementArray[2]);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage() . ": " . $sqlStatementArray[2]);
|
||||
$titles = "Name,Vorname,SID";
|
||||
$fields = "usr_name,usr_firstname,cr_sid";
|
||||
$titlesArray = spliti(",",$titles);
|
||||
$fieldsArray = spliti(",",$fields);
|
||||
$fieldsLength = count($fieldsArray);
|
||||
$pdfTextOffsetRow = 0; // Offset for rows
|
||||
while ($row = $result->fetch_assoc()):
|
||||
for ($j = 0; $j < $fieldsLength; $j++) :
|
||||
if (trim($titlesArray[$j]) == "") : $titlesArray[$j] = " "; endif;
|
||||
$tmpVarName = $fieldsArray[$j];
|
||||
|
||||
// Take cr_sid from job because (1:n)-relation "courier:vehicle"
|
||||
if ($tmpVarName == "cr_sid") :
|
||||
$row[$tmpVarName] = $job_cr_sid;
|
||||
endif;
|
||||
|
||||
$row[$tmpVarName] = str_replace("<br>", " ", $row[$tmpVarName]);
|
||||
$row[$tmpVarName] = str_replace(" ", " ", $row[$tmpVarName]);
|
||||
|
||||
$tmpOut = $titlesArray[$j] . ": ";
|
||||
if (!mb_check_encoding($tmpOut, 'UTF-8')) {
|
||||
$tmpOut = mb_convert_encoding($tmpOut, 'UTF-8');
|
||||
}
|
||||
$pdf->show_xy($tmpOut, 250, (430 - $pdfTextOffsetRow));
|
||||
|
||||
$tmpOut = formatOutput($row[$tmpVarName],$outputFormatField[$tmpVarName]);
|
||||
if (!mb_check_encoding($tmpOut, 'UTF-8')) {
|
||||
$tmpOut = mb_convert_encoding($tmpOut, 'UTF-8');
|
||||
}
|
||||
$pdf->show_xy($tmpOut, 300, (430 - $pdfTextOffsetRow));
|
||||
|
||||
// PDF_show_xy($pdf, $titlesArray[$j] . ": ", 250, (430 - $pdfTextOffsetRow));
|
||||
// PDF_show_xy($pdf, formatOutput($row[$tmpVarName],$outputFormatField[$tmpVarName]), 300, (430 - $pdfTextOffsetRow));
|
||||
|
||||
$pdfTextOffsetRow = $pdfTextOffsetRow + 10;
|
||||
endfor;
|
||||
endwhile;
|
||||
$result->free();
|
||||
|
||||
// Job costs
|
||||
$result = $db->query($sqlStatementArray[3]);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage() . ": " . $sqlStatementArray[3]);
|
||||
$titles = "Kostenstelle,EID,Kunde,Leistung,Betrag";
|
||||
$fields = "csc_name,cs_eid,cmp_comp,trs_srv_name,business_volume";
|
||||
$titlesArray = spliti(",",$titles);
|
||||
$fieldsArray = spliti(",",$fields);
|
||||
$fieldsLength = count($fieldsArray);
|
||||
$sumOfBusinessVolume = 0;
|
||||
$rowCounter = 0;
|
||||
$pdfTextOffsetRow = 0; // Offset for rows
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$rowCounter++;
|
||||
$pdfTextOffsetCol = 0; // Offset for cols
|
||||
|
||||
for ($j = 0; $j < $fieldsLength; $j++) :
|
||||
if (trim($titlesArray[$j]) == "") : $titlesArray[$j] = " "; endif;
|
||||
$tmpVarName = $fieldsArray[$j];
|
||||
$row[$tmpVarName] = str_replace("<br>", " ", $row[$tmpVarName]);
|
||||
$row[$tmpVarName] = str_replace(" ", " ", $row[$tmpVarName]);
|
||||
$row[$tmpVarName] = substr($row[$tmpVarName],0,30);
|
||||
|
||||
// Summation field
|
||||
if ($tmpVarName == "business_volume") :
|
||||
$sumOfBusinessVolume += $row[$tmpVarName];
|
||||
endif;
|
||||
|
||||
if ($rowCounter == 1) :
|
||||
$tmpOut = $titlesArray[$j] . ": ";
|
||||
if (!mb_check_encoding($tmpOut, 'UTF-8')) {
|
||||
$tmpOut = mb_convert_encoding($tmpOut, 'UTF-8');
|
||||
}
|
||||
$pdf->show_xy($tmpOut, (15 + $pdfTextOffsetCol), 370);
|
||||
// PDF_show_xy($pdf, $titlesArray[$j] . ": ", (15 + $pdfTextOffsetCol), 370);
|
||||
endif;
|
||||
|
||||
$outField = formatOutput($row[$tmpVarName],$outputFormatField[$tmpVarName]);
|
||||
|
||||
// Format business volume
|
||||
if ($tmpVarName == "business_volume") :
|
||||
$outField = pad($outField,8," ");
|
||||
endif;
|
||||
|
||||
if (!mb_check_encoding($outField, 'UTF-8')) {
|
||||
$outField = mb_convert_encoding($outField, 'UTF-8');
|
||||
}
|
||||
$pdf->show_xy($outField, (15 + $pdfTextOffsetCol), (360 - $pdfTextOffsetRow));
|
||||
// PDF_show_xy($pdf, $outField, (15 + $pdfTextOffsetCol), (360 - $pdfTextOffsetRow));
|
||||
|
||||
$pdfTextOffsetCol = $pdfTextOffsetCol + 150;
|
||||
endfor;
|
||||
|
||||
$pdfTextOffsetRow = $pdfTextOffsetRow + 10;
|
||||
endwhile;
|
||||
$result->free();
|
||||
if ($rowCounter > 0) :
|
||||
$pdfTextOffsetCol = $pdfTextOffsetCol - 150;
|
||||
$sumOfBusinessVolume = number_format(round($sumOfBusinessVolume,2), 2, ",", ".");
|
||||
$sumOfBusinessVolume = pad($sumOfBusinessVolume,8," ");
|
||||
$pdf->show_xy($sumOfBusinessVolume . " GESAMT", (15 + $pdfTextOffsetCol), (360 - $pdfTextOffsetRow));
|
||||
// PDF_show_xy($pdf, $sumOfBusinessVolume . " GESAMT", (15 + $pdfTextOffsetCol), (360 - $pdfTextOffsetRow));
|
||||
endif;
|
||||
|
||||
$pdf->end_page_ext("");
|
||||
// PDF_end_page_ext($pdf, "");
|
||||
endfor;
|
||||
|
||||
$pdf->end_document("");
|
||||
// PDF_end_document($pdf, "");
|
||||
$output = $pdf->get_buffer();
|
||||
// $output = PDF_get_buffer($pdf);
|
||||
header("Content-type: application/pdf"); //set filetype to pdf.
|
||||
header("Content-Length: ".strlen($output)); //content length
|
||||
header("Content-Disposition: attachment; filename=" . $invId4PDF . ".pdf"); // you can use inline or attachment.
|
||||
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
||||
header('Pragma: public');
|
||||
echo $output; // actual print area!
|
||||
// PDF_delete($pdf);
|
||||
die();
|
||||
else :
|
||||
$statusMessage = "Es wurde keine PDF-Datei generiert!";
|
||||
endif;
|
||||
else :
|
||||
$statusMessage = "Es liegt eine Inkonsistenz bzgl. der Rechnungsnummer vor!";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
|
||||
// Show all specified jobs of the customer
|
||||
$invoiceNumberArray = array(); // Distinct array of all invoice numbers of the selelected date interval
|
||||
if ($f_act == "loadJobsOfCustomer") :
|
||||
if ($g_cs_id != "") :
|
||||
|
||||
// Filter export according specified vehicle types (if NO type is specified then this filter is not be used)
|
||||
$whereClauseFilterVehicleType = "";
|
||||
$f_vht_filter_len = count($f_vht_filter);
|
||||
if ($f_vht_filter_len > 0) :
|
||||
for ($i = 0; $i < $f_vht_filter_len; $i++) :
|
||||
if ($whereClauseFilterVehicleType != "") :
|
||||
$whereClauseFilterVehicleType .= " OR ";
|
||||
endif;
|
||||
$whereClauseFilterVehicleType .= " jb.vht_id = '" . $f_vht_filter[$i] . "'";
|
||||
endfor;
|
||||
if ($whereClauseFilterVehicleType != "") :
|
||||
$whereClauseFilterVehicleType = " AND (" . $whereClauseFilterVehicleType . ") ";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
$sqlquery = "SELECT jb.jb_id, jb.jb_totalprice AS price, jb.jb_export_time, jb.jb_ordertime, jb.jb_finishtime, jb.jb_freetext_1,"
|
||||
. " jb.cr_sid, tr.tr_commission_no, csc.csc_name, inv.inv_no, inv.inv_datetime "
|
||||
. " FROM job AS jb LEFT JOIN invoice AS inv ON inv.jb_id = jb.jb_id, tour AS tr, costcenter AS csc"
|
||||
. " WHERE jb.jb_status = '2' AND"
|
||||
. " (NOT isnull(jb.jb_export_time)) AND"
|
||||
. " jb.jb_ordertime >= '$fromDateRange' AND"
|
||||
. " jb.jb_ordertime <= '$toDateRange' AND"
|
||||
. " jb.jb_id = tr.jb_id AND"
|
||||
. " tr.tr_sort = '1' AND"
|
||||
. " jb.csc_id_payer = csc.csc_id AND"
|
||||
. " csc.cs_id = '" . $g_cs_id . "' "
|
||||
. $whereClauseFilterVehicleType
|
||||
. " ORDER BY jb.jb_id";
|
||||
|
||||
$result = $db->query($sqlquery);
|
||||
// echo $sqlquery . "<br>";
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
|
||||
$out = "";
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$numOfRows++;
|
||||
|
||||
$sumOfJobPrices += $row["price"];
|
||||
|
||||
$out .= "<tr class=\"f10np1\">";
|
||||
|
||||
$invNo = $row["inv_no"];
|
||||
if ($invNo == "") :
|
||||
$invNo = " ";
|
||||
else :
|
||||
$j = array_search($invNo, $invoiceNumberArray);
|
||||
if ($j === FALSE) : $invoiceNumberArray[] = $invNo; endif;
|
||||
endif;
|
||||
$out .= "<td align=\"center\"> ". $invNo . "</td> ";
|
||||
|
||||
$tmpDateTime = formatOutput($row["inv_datetime"],"datetime","3");
|
||||
$out .= "<td align=\"center\"> ". substr($tmpDateTime,0,8) . " - " . substr($tmpDateTime,11,5) . "</td>";
|
||||
|
||||
$out .= "<td align=\"center\"><input type=\"checkbox\" name=\"f_jobs[]\" value=\"". $row["jb_id"] . "\" > </td> ";
|
||||
$out .= "<td align=\"center\"> ". $row["jb_id"] . "</td> ";
|
||||
|
||||
$tmpDateTime = formatOutput($row["jb_ordertime"],"datetime","3");
|
||||
$out .= "<td align=\"center\"> ". substr($tmpDateTime,0,8) . " - " . substr($tmpDateTime,11,5) . "</td>";
|
||||
|
||||
$tmpDateTime = formatOutput($row["jb_finishtime"],"datetime","3");
|
||||
$out .= "<td align=\"center\"> ". substr($tmpDateTime,0,8) . " - " . substr($tmpDateTime,11,5) . "</td>";
|
||||
$out .= "<td align=\"right\"> ". formatOutput($row["price"],"float_rounded_2") . " </td> ";
|
||||
$out .= "<td align=\"center\"> ". $row["cr_sid"] . "</td> ";
|
||||
// $out .= "<td> ". $row["jb_freetext_1"] . "<br>[Kst.: " . $row["csc_name"] . "]</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();
|
||||
else :
|
||||
$statusMessage = "Sie haben noch keinen Kunden ausgewählt!";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
|
||||
// *** Output ***
|
||||
|
||||
// Preparation of the generation of the PDF-documents
|
||||
$outInvoiceNumbersForPDF = "";
|
||||
$invoiceNumberArrayLen = count($invoiceNumberArray);
|
||||
for ($i = 0; $i < $invoiceNumberArrayLen; $i++) {
|
||||
$outInvoiceNumbersForPDF .= "<a href=\"javascript:generateInvoicePDF('" . ec($invoiceNumberArray[$i]) . "');\" target\"_blank\">" . $invoiceNumberArray[$i] . "</a>";
|
||||
if ((($i + 1) % 5) == 0) :
|
||||
$outInvoiceNumbersForPDF .= "<br><br>";
|
||||
else :
|
||||
$outInvoiceNumbersForPDF .= " ";
|
||||
endif;
|
||||
}
|
||||
|
||||
$currentFrameName = ""; // Empty string for "main frame"
|
||||
|
||||
// Date-ranges
|
||||
$filter_dateranges .= "<td><span class=\"f12bp1_blue\">Auftragsdatum: </span>";
|
||||
$filter_dateranges .= "Von:\n";
|
||||
$filter_dateranges .= "<select name=\"day_from\" class=\"f8np1\" onchange=\"fillDateFields(0, '" . $currentFrameName . "', 'jb_inv_assoc', 'day_from', 'day_from', 'month_from', 'year_from', '', '', '')\"></select>\n";
|
||||
$filter_dateranges .= "<select name=\"month_from\" class=\"f8np1\" onchange=\"fillDateFields(0, '" . $currentFrameName . "', 'jb_inv_assoc', 'month_from', 'day_from', 'month_from', 'year_from', '', '', '')\"></select>\n";
|
||||
$filter_dateranges .= "<select name=\"year_from\" class=\"f8np1\" onchange=\"fillDateFields(0, '" . $currentFrameName . "', 'jb_inv_assoc', 'year_from', 'day_from', 'month_from', 'year_from', '', '', '')\"></select>\n";
|
||||
$filter_dateranges .= "</td><td> bis:\n";
|
||||
$filter_dateranges .= "<select name=\"day_to\" class=\"f8np1\" onchange=\"fillDateFields(0, '" . $currentFrameName . "', 'jb_inv_assoc', 'day_to', 'day_to', 'month_to', 'year_to', '', '', '')\"></select>\n";
|
||||
$filter_dateranges .= "<select name=\"month_to\" class=\"f8np1\" onchange=\"fillDateFields(0, '" . $currentFrameName . "', 'jb_inv_assoc', 'month_to', 'day_to', 'month_to', 'year_to', '', '', '')\"></select>\n";
|
||||
$filter_dateranges .= "<select name=\"year_to\" class=\"f8np1\" onchange=\"fillDateFields(0, '" . $currentFrameName . "', 'jb_inv_assoc', 'year_to', 'day_to', 'month_to', 'year_to', '', '', '')\"></select>\n";
|
||||
$filter_dateranges .= "</td>";
|
||||
|
||||
// Javascript-function as template only for
|
||||
$js_date = "<script type=\"text/javascript\">\n";
|
||||
$js_date .= "<!--\n";
|
||||
$js_date .= "function initForm() {\n";
|
||||
$js_date .= " fillDateFields(1,\"" . $currentFrameName . "\",\"jb_inv_assoc\",\"\",\"day_from\",\"month_from\",\"year_from\",\"\",\"\",\"\");\n";
|
||||
$js_date .= " setDateTimeFields(\"" . $currentFrameName . "\",\"jb_inv_assoc\",".$day_from.",".$month_from.",".$year_from.", \"\", \"\", \"day_from\", \"month_from\", \"year_from\", \"\", \"\", \"\");\n";
|
||||
$js_date .= " fillDateFields(1,\"" . $currentFrameName . "\",\"jb_inv_assoc\", \"\", \"day_to\", \"month_to\", \"year_to\", \"\", \"\", \"\");\n";
|
||||
$js_date .= " setDateTimeFields(\"" . $currentFrameName . "\",\"jb_inv_assoc\",".$day_to.",".$month_to.",".$year_to.", \"\", \"\", \"day_to\", \"month_to\", \"year_to\", \"\", \"\", \"\");\n";
|
||||
$js_date .= "}\n";
|
||||
$js_date .= "-->\n";
|
||||
$js_date .= "</script>\n";
|
||||
?>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>PDF-AUSGABE</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../css/phoenix.css">
|
||||
<style type="text/css">
|
||||
<?php include_once ("../css/navigation.css.php"); ?>
|
||||
</style>
|
||||
|
||||
<?php include_once ("../include/js_framework.inc.php"); ?>
|
||||
|
||||
<script src="../include/searchLists.js" type="text/javascript"></script>
|
||||
<script src="../include/checkFormTags.js" type="text/javascript"></script>
|
||||
<script src="../include/lib_global.js" type="text/javascript"></script>
|
||||
|
||||
<?php echo $js_date ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
// NAVIGATION
|
||||
<?php echo $jsMenuOut; ?>
|
||||
|
||||
function searchCs() {
|
||||
searchCsCscGeneric('111000000000111');
|
||||
};
|
||||
|
||||
function finishPage(mode) {
|
||||
if (mode == 'storeJobs') {
|
||||
if (document.forms[0].g_cs_id.value != '') {
|
||||
if (document.forms[0].f_inv_no.value != '' && document.forms[0].f_inv_datetime_day.value != '' &&
|
||||
document.forms[0].f_inv_datetime_month.value != '' && document.forms[0].f_inv_datetime_year.value != '') {
|
||||
if (confirm('Möchten Sie die Rechnungsnummer und das Rechnungsdatum den markierten Aufträgen zuordnen?')) {
|
||||
document.forms[0].f_act.value = mode;
|
||||
document.forms[0].action.disabled = true;
|
||||
document.forms[0].submit();
|
||||
}
|
||||
} else {
|
||||
alert('Tragen Sie bitte eine Rechnungsnummer und ein Rechnungsdatum ein!');
|
||||
}
|
||||
} 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_inv_assoc.php?currentNavigationItem=pdf_ausgabe";
|
||||
}
|
||||
}
|
||||
if (mode == 'clearPageAndCustomerSearch') {
|
||||
if (document.forms[0].g_cs_id.value != '') {
|
||||
if (confirm('Möchten Sie einen neuen Kunden wählen? Die Seiteninformationen gehen verloren!')) {
|
||||
document.location.href = "jb_inv_assoc.php?initCsSearch=1";
|
||||
}
|
||||
} else {
|
||||
searchCs();
|
||||
};
|
||||
}
|
||||
if (mode == 'loadJobsOfCustomer') {
|
||||
// if (confirm('Aufträge für den gewählten Kunden anzeigen?')) {
|
||||
document.forms[0].f_act.value = mode;
|
||||
document.forms[0].submit();
|
||||
// }
|
||||
}
|
||||
};
|
||||
|
||||
function checkDate(checkObj,mode) {
|
||||
var resetValue = checkDateFields(checkObj,mode);
|
||||
if (resetValue) {
|
||||
checkObj.value = '';
|
||||
checkObj.focus();
|
||||
}
|
||||
}
|
||||
|
||||
function generateInvoicePDF(invNo) {
|
||||
document.forms[0].invId4PDF.value = invNo;
|
||||
document.forms[0].f_act.value = 'generatePDF';
|
||||
document.forms[0].submit();
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
function jbCheckAll(numOfRows) {
|
||||
for (i = 0; i < numOfRows; i++) {
|
||||
document.getElementsByName('f_jobs[]')[i].checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
function jbUncheckAll(numOfRows) {
|
||||
for (i = 0; i < numOfRows; i++) {
|
||||
document.getElementsByName('f_jobs[]')[i].checked = false;
|
||||
}
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body onLoad="<?php echo $phpCurrentNavigationOnLoad ?>initForm();displayStatusMessage(); <?php if ($initCsSearch == "1") : echo "searchCs();" ; endif; ?>">
|
||||
|
||||
<?php echo $phpMenuOut ?>
|
||||
<?php echo $phpReducedMenuOut ?>
|
||||
<?php echo $phpPageTitelOut ?>
|
||||
|
||||
<div class="maincontent" name="maincontent" id="maincontent">
|
||||
|
||||
<form name="jb_inv_assoc" action="jb_inv_assoc.php" method="post">
|
||||
|
||||
<input type="hidden" name="f_act" value="">
|
||||
<input type="hidden" name="g_cs_id" value="<?php echo $g_cs_id ?>">
|
||||
<input type="hidden" name="g_csc_id" value="<?php echo $g_csc_id ?>">
|
||||
<input type="hidden" name="invId4PDF" value="">
|
||||
<?php echo $phpCurrentNavigationInputHidden ?>
|
||||
<input type="hidden" name="deactivateMenu" value="<?php echo ec($deactivateMenu) ?>">
|
||||
|
||||
<?php echo htmlDivLineSpacer("5px"); ?>
|
||||
|
||||
<!- Date-ranges -->
|
||||
<div class="f12bp1_blue">
|
||||
<table cellspacing="0" cellpadding="0" vspace="0" hspace="0">
|
||||
<tr>
|
||||
<?php echo $filter_dateranges ?>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("40px", "", "left"); ?>
|
||||
|
||||
<div class="f12bp1_blue">
|
||||
<div style="float:left">
|
||||
Aufträge 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" value="!!!" onClick="showPageStatus();"> -->
|
||||
</div>
|
||||
<?php echo defineButtonType10("Kunde suchen", "action_search", "finishPage('clearPageAndCustomerSearch');", "120", "left", "5"); ?>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("30px", "", "left"); ?>
|
||||
|
||||
<!- Vehicle filters -->
|
||||
<div>
|
||||
Fahrzeug-Filter:
|
||||
<?php echo addCheckboxesFromTable("f_vht_filter","metatype","mt_sort","mt_value","mt_sort","mt_type = 'vehicletype' AND mt_sort > '0' AND mt_sort < '8'","", " "); ?>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("30px", "", "left"); ?>
|
||||
|
||||
<!-- Search, reset and store -->
|
||||
<div>
|
||||
<?php echo defineButtonType10("Seite komplett zurücksetzen", "action_reset", "finishPage('clearPage');", "220", "left", "10"); ?>
|
||||
<?php echo defineButtonType10("Rechnungsangaben zuordnen", "action_reset", "finishPage('storeJobs');", "220", "left", "10"); ?>
|
||||
<?php echo defineButtonType10("Aufträge anzeigen", "action_load", "finishPage('loadJobsOfCustomer');", "200", "left", "10"); ?>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("30px", "", "left"); ?>
|
||||
|
||||
<div>
|
||||
Rechnungsnummer: <input type="text" name="f_inv_no" value="">
|
||||
|
||||
Rechnungsdatum: <input type="text" name="f_inv_datetime_day" value="" size="2" maxlength="2" onBlur="checkDate(this,'day')">
|
||||
<input type="text" name="f_inv_datetime_month" value="" size="2" maxlength="2" onBlur="checkDate(this,'month')">
|
||||
<input type="text" name="f_inv_datetime_year" value="" size="4" maxlength="4" onBlur="checkDate(this,'year')">
|
||||
(TT-MM-JJJJ)
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("30px", "", "left"); ?>
|
||||
|
||||
<div>
|
||||
<div style="float:left">
|
||||
Aufträge markieren:
|
||||
</div>
|
||||
<?php echo defineButtonType10("Alle", "action_check", "jbCheckAll(" . $numOfRows . ");", "60", "left", "3"); ?>
|
||||
<?php echo defineButtonType10("Keine", "action_uncheck", "jbUncheckAll(" . $numOfRows . ");", "60", "left", "3"); ?>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("30px", "", "left"); ?>
|
||||
|
||||
<!-- Input fields for new jobs-->
|
||||
<div>
|
||||
<table class="f8np1" border="1" cellpadding="0">
|
||||
<tr>
|
||||
<td> Re.-Nr. </td> <td> Re.-Dat. </td> <td> Zuordnen </td> <td> Auftrag </td>
|
||||
<td> Auftragszeit </td> <td> Erledigungszeit </td>
|
||||
<td> Betrag </td> <td> Fahrzeug </td>
|
||||
</tr>
|
||||
|
||||
<!-- Stored jobs -->
|
||||
<?php echo $out ?>
|
||||
|
||||
<?php if ($sumOfJobPrices != 0) : ?>
|
||||
<tr>
|
||||
<td> </td> <td> </td> <td> </td> <td> </td>
|
||||
<td> </td> <td> </td>
|
||||
<td class="f8np1_red"> <?php echo number_format(round($sumOfJobPrices,2), 2, ",", ".") ?> </td> <td> </td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("30px", "", "left"); ?>
|
||||
|
||||
<!-- Invoice numbers of the selected interval to generate PDF documents -->
|
||||
<div>
|
||||
PDF-Dokument generieren für Rechnungsnummer:<br><br>
|
||||
<table class="f8np1" border="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
Sortierung der Aufträge nach Kostenstelle
|
||||
<input type="radio" name="f_filter" value="0" <?php if ($f_filter == "0") : echo "checked"; endif; ?>>
|
||||
oder nach Auftragsnummer
|
||||
<input type="radio" name="f_filter" value="1" <?php if ($f_filter == "1") : echo "checked"; endif; ?>>
|
||||
<br><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo $outInvoiceNumbersForPDF ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php echo htmlDivLineSpacer("30px", "", "left"); ?>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</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.php">
|
||||
|
||||
<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,424 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* jb_special.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
include_once("../include/global.inc.php");
|
||||
include_once("../include/auth.inc.php");
|
||||
include_once("../include/caglobal.inc.php");
|
||||
include_once("../include/inc_check_publicholiday.inc.php");
|
||||
//if ($phpVersion >= "7.0"):
|
||||
// require_once("../PEAR/HTML/Template/IT.php");
|
||||
//else:
|
||||
// require_once("HTML/IT.php");
|
||||
//endif;
|
||||
if ($usr_type != 1 && $usr_type != 0):
|
||||
reportDie ("$PHP_SELF: Ungültiger 'usr_type': '$usr_type'", false);
|
||||
endif;
|
||||
|
||||
//if ($phpVersion >= "7.0"):
|
||||
// $tpl = new HTML_Template_IT();
|
||||
//else:
|
||||
// $tpl = new IntegratedTemplate();
|
||||
//endif;
|
||||
$output = file_get_contents("jb_special.tpl.htm");
|
||||
$output = str_replace("{_css_file_}", "../css/phoenix.css.php", $output);
|
||||
//$tpl->loadTemplatefile("jb_special.tpl.htm", true, true);
|
||||
//$tpl->setCurrentBlock("css_file");
|
||||
//$tpl->setVariable("_css_file_", "../css/phoenix.css.php");
|
||||
////$tpl->setVariable("_css_file_", "../css/phoenix-print.css");
|
||||
//$tpl->parseCurrentBlock("css_file");
|
||||
|
||||
list ($cs_id, $csc_id, $action, $sort, $deljobs) = getHttpVars(array("cs_id", "csc_id", "action", "sort", "deljobs"));
|
||||
getSecHttpVars("1", array("cs_id", "csc_id"));
|
||||
|
||||
if ($deljobs != "") {
|
||||
$sqlquery = "SELECT jb_id, jb_tourname FROM job WHERE jb_id IN (" . $deljobs . ")";
|
||||
$res = $db->query($sqlquery);
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlquery': " . $res->getMessage());
|
||||
$jb_tournames = array();
|
||||
while ($row = $res->fetch_assoc()):
|
||||
$jb_tournames[$row["jb_id"]] = $row["jb_tourname"];
|
||||
endwhile;
|
||||
$res->free();
|
||||
|
||||
$sqlquery = "UPDATE job SET jb_tourname = '' WHERE jb_id IN (" . $deljobs . ")";
|
||||
writeLog_("../log/job_options_", $sqlquery . " " . json_encode($jb_tournames));
|
||||
$res = $db->query($sqlquery);
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlquery': " . $res->getMessage());
|
||||
header("Location: ../jobs/jb_special.php?csc_id=" . ec($csc_id) . "&cs_id=" . ec($cs_id) . "&action=" . $action . "&sort=" . $sort);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($csc_id == ""):
|
||||
if ($cs_id != "" && $cs_id != "0"):
|
||||
// BARZAHLER $CS_ID ABFANGEN!!!
|
||||
if ($db->getOne("SELECT cs_id FROM costcenter WHERE csc_id = " . CSC_ID_PAYER_CASH) == $cs_id):
|
||||
$csc_id_list_sql = CSC_ID_PAYER_CASH;
|
||||
else:
|
||||
$sqlquery = "SELECT csc_id FROM costcenter WHERE cs_id = " . $cs_id . " AND csc_visible = 1";
|
||||
$res = $db->query($sqlquery);
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlquery': " . $res->getMessage());
|
||||
$csc_id_list_sql = "";
|
||||
while ($row = $res->fetch_assoc()):
|
||||
if ($csc_id_list_sql != "")
|
||||
$csc_id_list_sql .= ",";
|
||||
$csc_id_list_sql .= $row["csc_id"];
|
||||
endwhile;
|
||||
$res->free();
|
||||
endif;
|
||||
else:
|
||||
// reportDie ("$PHP_SELF: Parameter 'cs_id' fehlt", false);
|
||||
endif;
|
||||
else:
|
||||
$csc_id_list_sql = $csc_id;
|
||||
endif;
|
||||
$hq_id = $HTTP_SESSION_VARS['hq_id'];
|
||||
|
||||
$sqlStmt =
|
||||
"SELECT jb.jb_id, jb.jb_ordertime, jb.jb_tourname, jb.jb_totalprice, jb.jb_permanent, jb.jb_permanent2, jb.jp_permenddat, csc_name, " .
|
||||
"tr.tr_comp, ad.ad_zipcode, ad2.ad_zipcode AS ad2_zipcode, CONCAT(ad.ad_street,' ',tr.tr_hsno) AS streethsno, " .
|
||||
"vht.mt_sort AS vht_sort, vht.mt_value AS vht_value " .
|
||||
"FROM tour AS tr, address AS ad, metatype AS vht, costcenter AS csc, job AS jb LEFT JOIN tour AS tr2 ON tr2.jb_id = jb.jb_id AND tr2.tr_sort = '2' LEFT JOIN address AS ad2 ON ad2.ad_id = tr2.ad_id " .
|
||||
"WHERE jb.vht_id = vht.mt_sort AND vht.mt_type = 'vehicletype' AND jb.jb_id = tr.jb_id AND tr.tr_sort = 1 AND tr.ad_id = ad.ad_id";
|
||||
// gespeicherte Tournamen der übergebenen Kostenstelle holen
|
||||
// wenn Kostenstelle Barzahler, dann nur Touren, in denen kein Zahler (in csc_id_payer_cash) eingetragen ist!
|
||||
|
||||
if ($action == "")
|
||||
$action = 1;
|
||||
switch ($action) {
|
||||
case 2:
|
||||
case 3:
|
||||
// Wenn alle Daueraufträge der Zentrale (wenn $csc_id/$cs_id leer), dann Datum aus DB nehmen (auf diese Weise können alte Dumps analysiert werden)
|
||||
$today = getdate();
|
||||
if ($csc_id_list_sql != ""):
|
||||
$today_date = $today['year'] . "-" . sprintf("%02d", $today['mon']) . "-" . sprintf("%02d", $today['mday']);
|
||||
else:
|
||||
list($tmpJahr, $tmpMonat, $tmpTag, $dummy1, $dummy2) = getValsFromDate($db->getOne("SELECT MAX(ka_lastexecutiontime) FROM keepalive"));
|
||||
$today_date = $tmpJahr . "-" . $tmpMonat . "-" . $tmpTag;
|
||||
endif;
|
||||
// Daueraufträge holen
|
||||
$sqlStmt .=
|
||||
" AND (jb.jb_ordertime >= '$today_date" . " 00:00:00')" .
|
||||
" AND ((jb.jb_storno != 3 AND jb.jb_storno != 4) OR jb.jb_storno IS NULL) " .
|
||||
" AND jb.jb_status != 2 AND (jb.jb_permanent IN (4, 5, 6, 7, 8, 9) OR (jb.jb_permanent IN (1, 2, 3) AND jb.jb_permanent2 != '0000000'))" .
|
||||
" AND (jb.jb_id_copy_permanent IS NULL OR jb.jb_id_copy_permanent = 0) " .
|
||||
" AND (jb.jp_permenddat >= '$today_date" . " 00:00:00' OR jb.jp_permenddat IS NULL OR jb.jp_permenddat = '00.00.0000 00:00:00')";
|
||||
$actionStr = "Daueraufträge";
|
||||
$actionStrAlt2 = "Gespeicherte Touren";
|
||||
$actionAlt2 = "1";
|
||||
$actionStrAlt1 = ($action == 2 ? "ein" : "aus");
|
||||
$actionAlt1 = ($action == 2 ? 3 : 2);
|
||||
// Dauerauftragsrhythmus-Typen holen
|
||||
$sqlquery = "SELECT mt_sort, mt_value FROM metatype WHERE mt_type = 'permanent' ORDER BY mt_sort";
|
||||
$res = $db->query($sqlquery);
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlquery': " . $res->getMessage());
|
||||
$permanent_types = array();
|
||||
while ($row = $res->fetch_assoc()):
|
||||
$permanent_types[$row['mt_sort']] = $row['mt_value'];
|
||||
endwhile;
|
||||
$res->free();
|
||||
// alle Vorgänger-Daueraufträge (bis Anfang des letzten Jahres) für die Darstellung der Historie holen
|
||||
$sqlquery = "SELECT jb_id, jb_id_copy_permanent, jb_ordertime FROM job WHERE NOT (jb_id_copy_permanent IS NULL) AND jb_ordertime > " .
|
||||
($today['year'] - 1) . "-01-01 AND (csc_id_payer IN (" . $csc_id_list_sql . ") OR csc_id_payer_cash IN (" . $csc_id_list_sql . ")) ORDER BY jb_id ASC";
|
||||
$res = $db2->query($sqlquery);
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlquery': " . $res->getMessage());
|
||||
$permanent_jobs = array();
|
||||
while ($row = $res->fetch_assoc()):
|
||||
$permanent_jobs[$row['jb_id_copy_permanent']] = array($row['jb_id'], $row['jb_ordertime']);
|
||||
endwhile;
|
||||
$res->free();
|
||||
break;
|
||||
default:
|
||||
// Konserven holen
|
||||
$sqlStmt .=
|
||||
" AND LENGTH(jb.jb_tourname) > 0";
|
||||
$actionStr = "Gespeicherte Touren";
|
||||
$actionStrAlt2 = "Daueraufträge";
|
||||
$actionAlt2 = "2";
|
||||
$actionStrAlt1 = "undefined";
|
||||
$actionAlt1 = "undefined";
|
||||
}
|
||||
|
||||
switch ($sort) {
|
||||
case 1:
|
||||
$sqlSortField = "jb_id";
|
||||
break;
|
||||
case 2:
|
||||
$sqlSortField = "jb_totalprice";
|
||||
break;
|
||||
case 3:
|
||||
$sqlSortField = "csc_name";
|
||||
break;
|
||||
case 4:
|
||||
$sqlSortField = "jb_tourname";
|
||||
break;
|
||||
case 5:
|
||||
$sqlSortField = "tr_comp";
|
||||
break;
|
||||
case 6:
|
||||
$sqlSortField = "streethsno";
|
||||
break;
|
||||
case 7:
|
||||
$sqlSortField = "ad_zipcode";
|
||||
break;
|
||||
case 8:
|
||||
$sqlSortField = "ad2_zipcode";
|
||||
break;
|
||||
case 9:
|
||||
$sqlSortField = "vht_value";
|
||||
break;
|
||||
case 10:
|
||||
$sqlSortField = "jb_ordertime";
|
||||
break;
|
||||
default:
|
||||
$sqlSortField = "jb_tourname";
|
||||
}
|
||||
|
||||
//if ($csc_id_list_sql == CSC_ID_PAYER_CASH):
|
||||
// $sqlStmt .=
|
||||
// " AND (jb.csc_id_payer = '$csc_id_list_sql' AND jb.csc_id_payer_cash != 0)";
|
||||
if ($csc_id_list_sql != ""):
|
||||
$sqlStmt = "(" .
|
||||
$sqlStmt . " AND (csc.csc_id = jb.csc_id_payer)" . " AND jb.csc_id_payer IN ($csc_id_list_sql)" .
|
||||
") UNION (" .
|
||||
$sqlStmt . " AND (csc.csc_id = jb.csc_id_payer_cash)" . " AND (jb.csc_id_payer_cash IN ($csc_id_list_sql) AND jb.csc_id_payer_cash != '0')" .
|
||||
")";
|
||||
endif;
|
||||
$sqlStmt .=
|
||||
" ORDER BY $sqlSortField";
|
||||
|
||||
if ($csc_id != ""):
|
||||
// wenn Root-Kostenstelle, dann Name aus company nehmen
|
||||
if (trim($db->getOne("SELECT csc_pre_id FROM costcenter WHERE csc_id = '" . $csc_id . "'")) == ""):
|
||||
$csc_name = $db->getOne(
|
||||
"SELECT company.cmp_comp FROM company, customer, costcenter" .
|
||||
" WHERE customer.cs_id = costcenter.cs_id AND company.cmp_id = customer.cmp_id " .
|
||||
" AND costcenter.csc_id = '" . $csc_id . "'");
|
||||
else:
|
||||
// wenn Unterkostenstelle, dann Kostenstellennamen
|
||||
$csc_name = $db->getOne("SELECT csc_name FROM costcenter WHERE csc_id = '" . $csc_id . "'");
|
||||
endif;
|
||||
elseif ($cs_id != ""):
|
||||
$csc_name = $db->getOne(
|
||||
"SELECT company.cmp_comp FROM company, customer" .
|
||||
" WHERE customer.cs_id = $cs_id AND company.cmp_id = customer.cmp_id");
|
||||
else:
|
||||
$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;
|
||||
|
||||
$tableHeader_output =
|
||||
"<td align=\"left\" colspan=\"2\"> </td>" .
|
||||
"<td align=\"center\" colspan=\"7\">" .
|
||||
"<span class=\"verysmall\"> <br> <br></span>" .
|
||||
"<b>$csc_name: $actionStr" . "</b>" .
|
||||
($actionStrAlt1 == "undefined" ? "" :
|
||||
" " .
|
||||
"<input type=\"button\" name=\"actionButton1\" class=\"f8np1\" size=\"1\" value=\"Historie ${actionStrAlt1}\" title=\"Historie ${actionStrAlt1}blenden (alt+h)\" accesskey=\"h\" onClick=\"finishPage(1)\">"
|
||||
) .
|
||||
"<br><br></td>" .
|
||||
"<td align=\"right\" colspan=\"2\">" .
|
||||
"<input type=\"button\" name=\"actionButton2\" class=\"f8np1\" size=\"2\" value=\"$actionStrAlt2\" title=\"$actionStrAlt2 anzeigen (alt+a)\" accesskey=\"a\" onClick=\"finishPage(2)\">" .
|
||||
"</td>";
|
||||
//$tpl->setCurrentBlock("tableHeader");
|
||||
//$tpl->setVariable("_tableHeader_",
|
||||
// "<td align=\"left\" colspan=\"2\"> </td>" .
|
||||
// "<td align=\"center\" colspan=\"7\">" .
|
||||
// "<span class=\"verysmall\"> <br> <br></span>" .
|
||||
// "<b>$csc_name: $actionStr" . "</b>" .
|
||||
// ($actionStrAlt1 == "undefined" ? "" :
|
||||
// " " .
|
||||
// "<input type=\"button\" name=\"actionButton1\" class=\"f8np1\" size=\"1\" value=\"Historie ${actionStrAlt1}\" title=\"Historie ${actionStrAlt1}blenden (alt+h)\" accesskey=\"h\" onClick=\"finishPage(1)\">"
|
||||
// ) .
|
||||
// "<br><br></td>" .
|
||||
// "<td align=\"right\" colspan=\"2\">" .
|
||||
// "<input type=\"button\" name=\"actionButton2\" class=\"f8np1\" size=\"2\" value=\"$actionStrAlt2\" title=\"$actionStrAlt2 anzeigen (alt+a)\" accesskey=\"a\" onClick=\"finishPage(2)\">" .
|
||||
// "</td>"
|
||||
//);
|
||||
//$tpl->parseCurrentBlock("tableHeader");
|
||||
|
||||
$sortLinkStart = "<a href=\"../jobs/jb_special.php?csc_id=" . ec($csc_id) . "&cs_id=" . ec($cs_id) . "&action=$action&sort=";
|
||||
$sortLinkMid = "\">";
|
||||
$sortLinkEnd = "</a>";
|
||||
$tableHeader_output .= "</tr><tr><td align=\"left\">Lfd. Nr." .
|
||||
"</td><td align=\"left\">" . $sortLinkStart . "1" . $sortLinkMid . "Auftr.-Nr." . $sortLinkEnd .
|
||||
"</td><td align=\"left\">" . $sortLinkStart . "2" . $sortLinkMid . "Preis" . $sortLinkEnd .
|
||||
"</td><td align=\"left\">" . $sortLinkStart . "3" . $sortLinkMid . "Kostenstelle" . $sortLinkEnd .
|
||||
"</td><td align=\"left\">" . $sortLinkStart . "4" . $sortLinkMid . "Tourenname" . $sortLinkEnd .
|
||||
"</td><td align=\"left\">" . $sortLinkStart . "5" . $sortLinkMid . "Firma" . $sortLinkEnd .
|
||||
"</td><td align=\"left\">" . $sortLinkStart . "6" . $sortLinkMid . "Startadresse" . $sortLinkEnd .
|
||||
"</td><td align=\"left\">" . $sortLinkStart . "7" . $sortLinkMid . "S.PLZ" . $sortLinkEnd .
|
||||
"</td><td align=\"left\">" . $sortLinkStart . "8" . $sortLinkMid . "Z.PLZ" . $sortLinkEnd .
|
||||
"</td><td align=\"left\">" . $sortLinkStart . "9" . $sortLinkMid . "Fahrz." . $sortLinkEnd .
|
||||
"</td><td align=\"left\">" . $sortLinkStart . "10" . $sortLinkMid . "Auftragszeit" . $sortLinkEnd .
|
||||
"<td align=\"left\">Bearb." . ($action == 1 ? " / <input type=\"button\" name=\"actionButton3\" class=\"f8np1\" size=\"2\" value=\"Löschen\" title=\"Löschen\" onClick=\"del_jobs()\">" : "") .
|
||||
"</td>";
|
||||
$output = str_replace("{_tableHeader_}", $tableHeader_output, $output);
|
||||
//$tpl->setCurrentBlock("tableHeader");
|
||||
//$tpl->setVariable("_tableHeader_",
|
||||
// "<td align=\"left\">Lfd. Nr." .
|
||||
// "</td><td align=\"left\">" . $sortLinkStart . "1" . $sortLinkMid . "Auftr.-Nr." . $sortLinkEnd .
|
||||
// "</td><td align=\"left\">" . $sortLinkStart . "2" . $sortLinkMid . "Preis" . $sortLinkEnd .
|
||||
// "</td><td align=\"left\">" . $sortLinkStart . "3" . $sortLinkMid . "Kostenstelle" . $sortLinkEnd .
|
||||
// "</td><td align=\"left\">" . $sortLinkStart . "4" . $sortLinkMid . "Tourenname" . $sortLinkEnd .
|
||||
// "</td><td align=\"left\">" . $sortLinkStart . "5" . $sortLinkMid . "Firma" . $sortLinkEnd .
|
||||
// "</td><td align=\"left\">" . $sortLinkStart . "6" . $sortLinkMid . "Startadresse" . $sortLinkEnd .
|
||||
// "</td><td align=\"left\">" . $sortLinkStart . "7" . $sortLinkMid . "S.PLZ" . $sortLinkEnd .
|
||||
// "</td><td align=\"left\">" . $sortLinkStart . "8" . $sortLinkMid . "Z.PLZ" . $sortLinkEnd .
|
||||
// "</td><td align=\"left\">" . $sortLinkStart . "9" . $sortLinkMid . "Fahrz." . $sortLinkEnd .
|
||||
// "</td><td align=\"left\">" . $sortLinkStart . "10" . $sortLinkMid . "Auftragszeit" . $sortLinkEnd .
|
||||
// "<td align=\"left\">Bearb." . ($action == 1 ? " / <input type=\"button\" name=\"actionButton3\" class=\"f8np1\" size=\"2\" value=\"Löschen\" title=\"Löschen\" onClick=\"del_jobs()\">" : "") .
|
||||
// "</td>"
|
||||
//);
|
||||
//$tpl->parseCurrentBlock("tableHeader");
|
||||
|
||||
// Jetzt die Daueraufträge bzw. Konserven holen
|
||||
// echo "[$sqlStmt]";
|
||||
$result = $db2->query($sqlStmt);
|
||||
if (DB::isError($result))
|
||||
reportDie ("$PHP_SELF: <br>$sqlStmt<br>" . $result->getMessage());
|
||||
|
||||
$ph = getPublicHolidays(getDateTime("year"), "1", "0");
|
||||
$js_dates_list = "var specialDates=[\n";
|
||||
$i = 1;
|
||||
$jobentry_output = "";
|
||||
while ($row = $result->fetch_assoc()):
|
||||
// $tpl->setCurrentBlock("jobentry");
|
||||
if ($i % 2 == 0) : $cellColor = "DDDDDD"; $cellColor2 = "EEEEEE"; endif;
|
||||
if ($i % 2 == 1) : $cellColor = "BBBBFF"; $cellColor2 = "CCCCFF"; endif;
|
||||
|
||||
$firstLineFiller = "";
|
||||
if ($action == 3)
|
||||
$firstLineFiller = " <br>";
|
||||
$jb_idLink = $firstLineFiller .
|
||||
"<a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=" . $row['jb_id'] . "','Auftrag','');\">" . $row['jb_id'] . "</a>";
|
||||
$jb_tournameLink = "";
|
||||
if (trim($row['jb_tourname']) != "")
|
||||
$jb_tournameLink =
|
||||
"<a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=" . $row['jb_id'] . "','Auftrag','');\">" . $row['jb_tourname'] . "</a>";
|
||||
$jb_ordertimeLink = my_datum_zeit_format_datetime($row['jb_ordertime'], " ");
|
||||
if ($action == 2 || $action == 3) {
|
||||
$jb_permanent2_str = "";
|
||||
if ($row['jb_permanent'] == 1 || $row['jb_permanent'] == 2 || $row['jb_permanent'] == 3) {
|
||||
if (substr($row['jb_permanent2'], 0, 1) == "1") $jb_permanent2_str .= ", Mo";
|
||||
if (substr($row['jb_permanent2'], 1, 1) == "1") $jb_permanent2_str .= ", Di";
|
||||
if (substr($row['jb_permanent2'], 2, 1) == "1") $jb_permanent2_str .= ", Mi";
|
||||
if (substr($row['jb_permanent2'], 3, 1) == "1") $jb_permanent2_str .= ", Do";
|
||||
if (substr($row['jb_permanent2'], 4, 1) == "1") $jb_permanent2_str .= ", Fr";
|
||||
if (substr($row['jb_permanent2'], 5, 1) == "1") $jb_permanent2_str .= ", Sa";
|
||||
if (substr($row['jb_permanent2'], 6, 1) == "1") $jb_permanent2_str .= ", So";
|
||||
if ($jb_permanent2_str != "") $jb_permanent2_str = ": " . substr($jb_permanent2_str, 2);
|
||||
}
|
||||
// Daueraufträge: Link zu einem Extra-Fenster mit den Ausführungsdaten
|
||||
$jb_ordertimeLink =
|
||||
"[" . $permanent_types[$row['jb_permanent']] . $jb_permanent2_str . "]<br>" .
|
||||
"<a href=\"javascript:mkYearCalendarWin(" . $today['year'] . "," . ($i - 1) . ");\">" .
|
||||
my_datum_zeit_format_datetime($row['jb_ordertime'], " ") . "</a><br>";
|
||||
// Zu dem aktuellen Dauerauftrag alle ordertimes der Vorgängeraufträge holen
|
||||
if ($j > 1)
|
||||
$js_dates_list .= ",\n";
|
||||
$js_dates_list .= "[";
|
||||
$j = 0;
|
||||
$jb_id_prev = $row["jb_id"];
|
||||
do {
|
||||
list($jahr, $monat, $tag, $stunde, $minute) = getValsFromDate($permanent_jobs[$jb_id_prev][1]); // jb_ordertime des Vorgängers
|
||||
if ($j > 0)
|
||||
$js_dates_list .= ",\n";
|
||||
$js_dates_list .= "\"" . $jahr . sprintf("%02d", $monat) . sprintf("%02d", $tag) . "\"";
|
||||
if ($action == 3) {
|
||||
$jb_idLink .=
|
||||
"<br><a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=" . $permanent_jobs[$jb_id_prev][0] . "','Auftrag','');\">" . $permanent_jobs[$jb_id_prev][0] . "</a>";
|
||||
$jb_ordertimeLink .= my_datum_zeit_format_datetime($permanent_jobs[$jb_id_prev][1], " ") . "<br>";
|
||||
}
|
||||
$jb_id_prev = $permanent_jobs[$jb_id_prev][0]; // jb_id des Vorgängers
|
||||
$j++;
|
||||
} while(array_key_exists($jb_id_prev, $permanent_jobs)); // solange bis der Vorgänger selbst keinen weiteren Vorgänger hat
|
||||
if (trim($row['jp_permenddat']) != "")
|
||||
$jb_ordertimeLink .= "<i>Enddatum: " . my_datum_zeit_format_datetime($row['jp_permenddat'], " ") . "</i><br>";
|
||||
// Zu dem aktuellen Dauerauftrag alle Ausführungsdaten berechnen, damit sie im Extra-Fenster angezeigt werden können
|
||||
list($jahr, $monat, $tag, $stunde, $minute) = getValsFromDate($row['jb_ordertime']);
|
||||
$tempDate = array($jahr, sprintf("%d", $monat), sprintf("%d", $tag));
|
||||
while($tempDate[0] <= $jahr + 1) {
|
||||
if ($j > 0)
|
||||
$js_dates_list .= ",\n";
|
||||
$js_dates_list .= "\"" . $tempDate[0] . sprintf("%02d", $tempDate[1]) . sprintf("%02d", $tempDate[2]) . "\"";
|
||||
$tempDate = getNextOrderDate($tempDate[0], $tempDate[1], $tempDate[2], $row['jb_permanent'], $row['jb_permanent2'], false);
|
||||
list($endejahr, $endemonat, $endetag, $dummy1, $dummy2) = getValsFromDate($row['jp_permenddat']);
|
||||
if (!(mktime(0, 0, 0, $tempDate[1], $tempDate[2], $tempDate[0])
|
||||
< mktime(0, 0, 0, $endemonat, $endetag, $endejahr) || trim($row['jp_permenddat']) == ""))
|
||||
break;
|
||||
$j++;
|
||||
}
|
||||
$js_dates_list .= "]\n";
|
||||
}
|
||||
if ($action == 1)
|
||||
$delBox = " <input type=\"checkbox\" name=\"del_" . $jb_id . "\" value=\"1\" onclick=\"toggle_del('" . $row['jb_id'] . "')\">";
|
||||
$jobentry_output .= ($jobentry_output == "" ? "" : "</tr><tr>") .
|
||||
"<td class=\"$cellColor\" align=\"center\" valign=\"top\">" . $i .
|
||||
"</td><td class=\"$cellColor2\" align=\"center\" valign=\"top\">" . $jb_idLink .
|
||||
"</td><td class=\"$cellColor\" align=\"right\" valign=\"top\">" . str_replace(".", ",", sprintf("%01.2f", $row['jb_totalprice'])) .
|
||||
"</td><td class=\"$cellColor2\" align=\"left\" valign=\"top\">" . $row['csc_name'] .
|
||||
"</td><td class=\"$cellColor\" align=\"left\" valign=\"top\">" . $jb_tournameLink .
|
||||
"</td><td class=\"$cellColor2\" align=\"left\" valign=\"top\">" . $row['tr_comp'] .
|
||||
"</td><td class=\"$cellColor\" align=\"left\" valign=\"top\">" . $row['streethsno'] .
|
||||
"</td><td class=\"$cellColor2\" align=\"left\" valign=\"top\">" . $row['ad_zipcode'] .
|
||||
"</td><td class=\"$cellColor\" align=\"left\" valign=\"top\">" . $row['ad2_zipcode'] .
|
||||
"</td><td class=\"$cellColor2\" align=\"left\" valign=\"top\">" . $row['vht_value'] .
|
||||
"</td><td class=\"$cellColor\" align=\"left\" valign=\"top\">" . $jb_ordertimeLink .
|
||||
"</td><td class=\"$cellColor2\" align=\"left\" valign=\"top\">" . $firstLineFiller .
|
||||
"<a href=\"../jobs/job_edit.php?jb_id=" . ec($row['jb_id']) . "\" target=_blank>" . $row['jb_id'] . "</a>" . $delBox .
|
||||
"</td>";
|
||||
// $tpl->setVariable("_jobentry_",
|
||||
// "<td class=\"$cellColor\" align=\"center\" valign=\"top\">" . $i .
|
||||
// "</td><td class=\"$cellColor2\" align=\"center\" valign=\"top\">" . $jb_idLink .
|
||||
// "</td><td class=\"$cellColor\" align=\"right\" valign=\"top\">" . str_replace(".", ",", sprintf("%01.2f", $row['jb_totalprice'])) .
|
||||
// "</td><td class=\"$cellColor2\" align=\"left\" valign=\"top\">" . $row['csc_name'] .
|
||||
// "</td><td class=\"$cellColor\" align=\"left\" valign=\"top\">" . $jb_tournameLink .
|
||||
// "</td><td class=\"$cellColor2\" align=\"left\" valign=\"top\">" . $row['tr_comp'] .
|
||||
// "</td><td class=\"$cellColor\" align=\"left\" valign=\"top\">" . $row['streethsno'] .
|
||||
// "</td><td class=\"$cellColor2\" align=\"left\" valign=\"top\">" . $row['ad_zipcode'] .
|
||||
// "</td><td class=\"$cellColor\" align=\"left\" valign=\"top\">" . $row['ad2_zipcode'] .
|
||||
// "</td><td class=\"$cellColor2\" align=\"left\" valign=\"top\">" . $row['vht_value'] .
|
||||
// "</td><td class=\"$cellColor\" align=\"left\" valign=\"top\">" . $jb_ordertimeLink .
|
||||
// "</td><td class=\"$cellColor2\" align=\"left\" valign=\"top\">" . $firstLineFiller .
|
||||
// "<a href=\"../jobs/job_edit.php?jb_id=" . ec($row['jb_id']) . "\" target=_blank>" . $row['jb_id'] . "</a>" . $delBox .
|
||||
// "</td>"
|
||||
// );
|
||||
$i++;
|
||||
// $tpl->parseCurrentBlock("jobentry");
|
||||
endwhile;
|
||||
$result->free();
|
||||
$js_dates_list .= "];\n";
|
||||
$javascript = $js_dates_list .
|
||||
"\n" .
|
||||
"function finishPage(no)\n" .
|
||||
"{\n" .
|
||||
($actionStrAlt1 == "undefined" ? "" :
|
||||
" document.getElementsByName(\"actionButton1\")[0].disabled = true;\n"
|
||||
) .
|
||||
" document.getElementsByName(\"actionButton2\")[0].disabled = true;\n" .
|
||||
" if (no == 1)\n" .
|
||||
" self.location.href=\"../jobs/jb_special.php?csc_id=" . ec($csc_id) . "&cs_id=" . ec($cs_id) . "&action=$actionAlt1&sort=$sort\";\n" .
|
||||
" if (no == 2)\n" .
|
||||
" self.location.href=\"../jobs/jb_special.php?csc_id=" . ec($csc_id) . "&cs_id=" . ec($cs_id). "&action=$actionAlt2&sort=$sort\";\n" .
|
||||
"}\n" .
|
||||
"\n" .
|
||||
"var curloc = \"../jobs/jb_special.php?csc_id=" . ec($csc_id) . "&cs_id=" . ec($cs_id) . "&action=" . $action . "&sort=" . $sort ."\"\n;" .
|
||||
"\n";
|
||||
|
||||
$output = str_replace("{_jobentry_}", $jobentry_output, $output);
|
||||
$output = str_replace("{_javascript_}", $javascript, $output);
|
||||
echo $output;
|
||||
//$tpl->setCurrentBlock("javascript");
|
||||
//$tpl->setVariable("_javascript_", $javascript);
|
||||
//$tpl->parseCurrentBlock("javascript");
|
||||
|
||||
//$tpl->show();
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,112 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>votian: Auftragsübersicht</title>
|
||||
<!-- BEGIN css_file -->
|
||||
<link rel="stylesheet" type="text/css" href="{_css_file_}">
|
||||
<!-- END css_file -->
|
||||
<style>
|
||||
a:visited {
|
||||
color: fuchsia;
|
||||
}
|
||||
</style>
|
||||
<script src="../include/lib_global.js" type="text/javascript"></script>
|
||||
<script src="../jobs/job_options.js" type="text/javascript"></script>
|
||||
<script src="../include/lib_calendar.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
||||
<!-- BEGIN javascript -->
|
||||
{_javascript_}
|
||||
<!-- END javascript -->
|
||||
|
||||
function mkYearCalendarWin(startYear, specialDatesIndex)
|
||||
{
|
||||
yearCalendarWin(startYear, specialDatesIndex);
|
||||
}
|
||||
|
||||
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");
|
||||
|
||||
}
|
||||
|
||||
var delJobs = "";
|
||||
|
||||
function toggle_del(jb_id) {
|
||||
|
||||
var pos = (delJobs).indexOf(jb_id);
|
||||
if (pos >= 0)
|
||||
delJobs = delJobs.substr(0, pos) + delJobs.substr(pos + jb_id.length + 1);
|
||||
else
|
||||
delJobs += jb_id + ",";
|
||||
}
|
||||
|
||||
function del_jobs() {
|
||||
if (delJobs == "") {
|
||||
alert("Keine Aufträge zum Löschen markiert.");
|
||||
return;
|
||||
}
|
||||
if (!confirm("Tournamen der markierten Aufträge wirklich löschen?")) {
|
||||
return;
|
||||
}
|
||||
//alert(curloc + "&deljobs=" + delJobs.substr(0, delJobs.length - 1));
|
||||
window.location.href = curloc + "&deljobs=" + delJobs.substr(0, delJobs.length - 1);
|
||||
}
|
||||
|
||||
-->
|
||||
</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>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
.verysmall
|
||||
{ font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 2pt; font-weight: normal; padding: 0px}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table border="0" width="100%" cellspacing="0" cellpadding="0" vspace="0" hspace="0">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td align="center">
|
||||
<table border="0" width="100%" align="left" cellspacing="0" cellpadding="4" vspace="0" hspace="0">
|
||||
|
||||
<!-- BEGIN tableHeader -->
|
||||
<tr>
|
||||
{_tableHeader_}
|
||||
</tr>
|
||||
<!-- END tableHeader -->
|
||||
|
||||
<!-- BEGIN jobentry -->
|
||||
<tr>
|
||||
{_jobentry_}
|
||||
</tr>
|
||||
<!-- END jobentry -->
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* job_accesskeys.inc.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
if (isset($HTTP_SESSION_VARS) && $HTTP_SESSION_VARS['hq_id'] != 3)
|
||||
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,130 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* job_courier.inc.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
$phpVersion = substr(phpversion(), 0, 3);
|
||||
|
||||
// Sortierfunktion für Arrays aus ranking.inc.php für usort-Sortierung
|
||||
function cmp_usort ($a, $b) {
|
||||
//global $jb_longhaul;
|
||||
|
||||
// if (isset($a[12]) && isset($b[12]) && $jb_longhaul == 1) {
|
||||
// return ($a[12] < $b[12]) ? -1 : 1;
|
||||
// } else {
|
||||
// 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, $phpVersion;
|
||||
|
||||
$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, REPLACE(REPLACE(CONCAT(crvh.crvh_filter, ',', cr.cr_filter), ',,,', ',,'), ',,', ',') AS all_filter, cr.cr_occupied"
|
||||
. " FROM courier AS cr, couriervehicle AS crvh, metatype AS mt, company AS cmp"
|
||||
. " WHERE " . $sqlInClause
|
||||
. " cr.cr_sid != '' AND"
|
||||
. " cr.cmp_id = cmp.cmp_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 = ($phpVersion >= "8.0" ? $res->fetch_assoc() : $res->fetchRow())):
|
||||
$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["all_filter"],
|
||||
$row["cr_occupied"],
|
||||
);
|
||||
endwhile;
|
||||
$res->free();
|
||||
endif;
|
||||
return $cr_id_order_list_temp;
|
||||
}
|
||||
|
||||
//function get_longhaul_courier_data($cr_id_order_list_temp, $ad_zipcode, $ad_city, $ad_street, $tr_hsno) {
|
||||
// global $db;
|
||||
//
|
||||
// writeLog_("../log/job_courier_", "get_longhaul_courier_data: count(\$cr_id_order_list_temp) = " . count($cr_id_order_list_temp) . ", " . var_export($cr_id_order_list_temp, true));
|
||||
// if ($cr_id_order_list_temp == "" || count($cr_id_order_list_temp) == 0):
|
||||
// $cr_id_order_list_temp = Array();
|
||||
// else:
|
||||
// for($i = 0; $i < count($cr_id_order_list_temp); $i++) {
|
||||
// list($cr_gps_long, $cr_gps_lat) =
|
||||
// getFieldsValueFromId("courier", "cr_id", $cr_id_order_list_temp[$i][0], array("cr_gps_long", "cr_gps_lat"));
|
||||
// // $ad_country ist noch nicht sauber!
|
||||
// $dest_coords = get_coords("", $ad_zipcode, $ad_city, $ad_street, $tr_hsno);
|
||||
// $starting_sec = get_distance_google(array($cr_gps_lat, $cr_gps_long), $dest_coords, $force_date = '0000-00-00 00:00:00', "km", true);
|
||||
// $starting_min = round($starting_sec / 60);
|
||||
// $starting_m = get_distance_google(array($cr_gps_lat, $cr_gps_long), $dest_coords, $force_date = '0000-00-00 00:00:00', "km");
|
||||
//// $starting_km = round($starting_m / 1000);
|
||||
// if (!isset($cr_id_order_list_temp[$i][8]))
|
||||
// $cr_id_order_list_temp[$i][8] = 0;
|
||||
// $cr_id_order_list_temp[$i][9] = $cr_gps_lat;
|
||||
// $cr_id_order_list_temp[$i][10] = $cr_gps_long;
|
||||
//// $cr_id_order_list_temp[$i][11] = $dest_coords[0];
|
||||
//// $cr_id_order_list_temp[$i][12] = $dest_coords[1];
|
||||
// $cr_id_order_list_temp[$i][11] = $starting_min;
|
||||
// $cr_id_order_list_temp[$i][12] = $starting_m;
|
||||
// }
|
||||
// endif;
|
||||
// writeLog_("../log/job_courier_", "get_longhaul_courier_data finished");
|
||||
// return $cr_id_order_list_temp;
|
||||
//}
|
||||
|
||||
?>
|
||||
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
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,82 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* job_edit.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
include_once("../include/global.inc.php");
|
||||
include_once("../include/caglobal.inc.php");
|
||||
include_once ("../include/auth.inc.php");
|
||||
|
||||
// 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"));
|
||||
list ($disp) = getHttpVars(array("disp"));
|
||||
|
||||
$hq_id_job = "";
|
||||
if ($jb_id != ""):
|
||||
$what_is_this = "Auftragsänderung (Nr. $jb_id)";
|
||||
$csc_id = getFieldValueFromId("job", "jb_id", "$jb_id", "csc_id");
|
||||
$hq_id_job = getFieldValueFromId("job", "jb_id", "$jb_id", "hq_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;
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>AUFTRAGSERFASSUNG</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta name="description" content="Auftragserfassung"> <meta name="keywords" content="Auftragserfassung">
|
||||
<script type="text/javascript">
|
||||
self.moveTo(0, 0);
|
||||
self.resizeTo(screen.width, screen.height);
|
||||
|
||||
// For identification of the window
|
||||
this.iname="job_edit";
|
||||
top.opener.top.job_edit = this;
|
||||
|
||||
var Start = new Date();
|
||||
var Startzeit = Start.getTime();
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<frameset rows="35,*,250,95" border=0>
|
||||
<frame src="job_header.php?csc_id_orderer=<?php echo ec($csc_id_orderer);?>&what_is_this=<?php echo $what_is_this;?>&hq_id_job=<?php echo $hq_id_job;?>" name="job_header" scrolling="no" marginwidth=0 marginheight=0>
|
||||
<frame src="job_tour.php?csc_id_orderer=<?php echo ec($csc_id_orderer);?>&hq_id_job=<?php echo $hq_id_job;?>" name="job_tour" scrolling="no" marginwidth=0 marginheight=0>
|
||||
<frame src="job_options.php?csc_id_orderer=<?php echo ec($csc_id_orderer);?>&jb_id=<?php echo ec($jb_id);?>&jb_copy=<?php echo $jb_copy;?>&csc_id_start=<?php echo $csc_id_start;?>&disp=<?php echo $disp;?>&dbhistory=<?php echo $dbhistory;?>&hq_id_job=<?php echo $hq_id_job;?>" name="job_options" scrolling="no" marginwidth=0 marginheight=0>
|
||||
<frame src="job_tour_list.php" name="job_tour_list" scrolling="no" marginwidth=0 marginheight=0>
|
||||
<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,199 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* job_header.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
include_once("../include/caglobal.inc.php");
|
||||
include_once("../include/global.inc.php");
|
||||
list ($hq_id_job) = getHttpVars(array("hq_id_job"));
|
||||
include_once ("../include/auth.inc.php");
|
||||
include_once ("../admin/menu.php");
|
||||
|
||||
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'];
|
||||
if ($hq_id_job != "")
|
||||
$hq_id = $hq_id_job;
|
||||
$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;
|
||||
|
||||
$_cr_id_order_list_ = "";
|
||||
// $reload_couriers ist nur beim ersten Aufruf nicht gesetzt
|
||||
if ($reload_couriers == "1"):
|
||||
include_once("job_courier.inc.php");
|
||||
$_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";
|
||||
else:
|
||||
$_cr_id_order_list_ =
|
||||
"function updateCr_id_order_list(){\n" .
|
||||
"}\n";
|
||||
endif;
|
||||
|
||||
$_kundenname_ = "";
|
||||
$what_is_this_split = split(" ", $what_is_this);
|
||||
$phpCurrentNavigationOnLoad = "";
|
||||
|
||||
if (trim($what_is_this_split[0]) == "Auftragsänderung" || trim($what_is_this_split[0]) == "Auftragsänderung"):
|
||||
$_kundenname_ = "<span style=\"color:red\">" . $what_is_this . " $cmp_comp ($csc_name)" . "</span>";
|
||||
else:
|
||||
$_kundenname_ = $what_is_this . " $cmp_comp ($csc_name)";
|
||||
// dynamisches Ändern der Zentrale im Callcenter-Modus
|
||||
// Selection of the current usertype from session-variable
|
||||
$sqlquery = "SELECT usr_type FROM user"
|
||||
. " WHERE usr_id = " . $usr_id;
|
||||
$result = $db->query($sqlquery);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
$userType = "";
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$userType = $row["usr_type"];
|
||||
endwhile;
|
||||
$result->free();
|
||||
|
||||
$outHqSelection = "";
|
||||
if ($hq_id != "") :
|
||||
$empHqList = getParameterValue("0", "HEADQUARTERS_MULTIPLE_ACCESS_EMPLOYEES", "0");
|
||||
if ($userType == "1" && $empHqList != "") :
|
||||
$showMultipleHqSelection = isInParameterString($emp_id, $empHqList);
|
||||
if ($showMultipleHqSelection) :
|
||||
$tmpHqIdArray = getColVectorFromDB2ArrayByClause("headquarters", "hq_id", "", "", "hq_id", "");
|
||||
$tmpHqIdArrayLen = count($tmpHqIdArray);
|
||||
$outHqSelection .= "<div font-size:14pt; font-family:Helvetica,Arial; font-style:normal; font-weight:normal; vertical-align:middle;background-color:" . $constPageHeadlineBgCol . "; color:#FFFFFF\" name=\"currHqSelectionReduced\" id=\"currHqSelectionReduced\" onClick=\"myshow('currHqSelection'); myhide('currHqSelectionReduced');\">\n";
|
||||
// $outHqSelection .= " " . strtoupper(getFieldValueFromId("headquarters","hq_id",$hq_id,"hq_name")) . " : : " . strtoupper($what_is_this);
|
||||
$outHqSelection .= $_kundenname_;
|
||||
$outHqSelection .= "</div>\n";
|
||||
$outHqSelection .= "<div background-color:" . $constPageHeadlineBgCol . "; color:#FFFFFF\" name=\"currHqSelection\" id=\"currHqSelection\" onClick=\"myshow('currHqSelectionReduced'); myhide('currHqSelection');\">";
|
||||
for ($i = 0; $i < $tmpHqIdArrayLen; $i++) :
|
||||
// $outHqSelection .= " <a class=\"a_menu\" href=\"../admin/relogin.php?currReferer=" . urlencode(getCurrentScript($_SERVER['REQUEST_URI'])) . "&currHqSelection=" . ec($tmpHqIdArray[$i]) . "\">" . getFieldValueFromId("headquarters","hq_id",$tmpHqIdArray[$i],"hq_name") . "</a> ";
|
||||
// $outHqSelection .= " <a class=\"a_menu\" href=\"../admin/relogin.php?currReferer=" . urlencode(getCurrentScript($_SERVER['HTTP_REFERER'])) . "&currHqSelection=" . ec($tmpHqIdArray[$i]) . "\">" . getFieldValueFromId("headquarters","hq_id",$tmpHqIdArray[$i],"hq_name") . "</a> ";
|
||||
$outHqSelection .= " <a class=\"a_menu\" href=\"../admin/relogin.php?currReferer=" . urlencode("jobs/job_edit.php?currentNavigationItem=erfassung") . "&currHqSelection=" . ec($tmpHqIdArray[$i]) . "\" target=\"_parent\">" . getFieldValueFromId("headquarters","hq_id",$tmpHqIdArray[$i],"hq_name") . "</a> ";
|
||||
endfor;
|
||||
$outHqSelection .= "</div>";
|
||||
$phpCurrentNavigationOnLoad = "myhide('currHqSelection'); myshow('currHqSelectionReduced');";
|
||||
$_kundenname_ = $outHqSelection;
|
||||
endif;
|
||||
endif;
|
||||
endif;
|
||||
endif;
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>AUFTRAGSERFASSUNG</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/phoenix.css.php">
|
||||
<script src="../include/lib_global.js" type="text/javascript">
|
||||
</script>
|
||||
|
||||
<script src="../include/key_events_content.js" language="JavaScript1.2" type="text/javascript">
|
||||
</script>
|
||||
|
||||
<?php if ($phpCurrentNavigationOnLoad != "") include_once ("../include/js_framework.inc.php"); ?>
|
||||
|
||||
<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">
|
||||
<!--
|
||||
|
||||
var job_tour_isLoading = true;
|
||||
|
||||
<?php echo $_cr_id_order_list_;?>
|
||||
|
||||
var auto_refresh = "<?php echo MASK_AUTO_REFRESH;?>";
|
||||
|
||||
function startTimeout()
|
||||
{
|
||||
<?php echo $phpCurrentNavigationOnLoad;?>
|
||||
if (auto_refresh == "1") {
|
||||
updateCr_id_order_list();
|
||||
self.setTimeout("startReload()", 60000);
|
||||
}
|
||||
}
|
||||
|
||||
function startReload()
|
||||
{
|
||||
self.location.href="job_header.php?csc_id_orderer=<?php echo ec($csc_id_orderer);?>&what_is_this=<?php echo $what_is_this;?>&reload_couriers=1";
|
||||
}
|
||||
|
||||
-->
|
||||
</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">
|
||||
<?php echo $_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,362 @@
|
||||
var cfl=[["AB", "Abgeplant", "1", 0],
|
||||
["H2", "Hebebühne 1,2 TO", "1", 0],
|
||||
["I269", "Innenhöhe 2,6 m", "1", 0],
|
||||
["PL", "Plane", "1", 0],
|
||||
["AH 7", "Anhänger 7 TO", "1", 0],
|
||||
["H2", "Hilfskraft 2", "1", 0],
|
||||
["K2", "Führerschein Kl. II", "1", 0],
|
||||
["RH", "Rampenhoch", "1", 0],
|
||||
["AH11", "Anhänger 11 TO", "1", 0],
|
||||
["H3", "Hilfskraft 3", "1", 0],
|
||||
["KF", "Koffer", "1", 0],
|
||||
["RK", "Rockingerkupplung", "1", 0],
|
||||
["BS", "Seitlich beladbar für Längen", "1", 0],
|
||||
["H3", "Hebebühne 1,5 TO", "1", 0],
|
||||
["KH", "Kühler", "1", 0],
|
||||
["RV", "Raumverschluss", "1", 0],
|
||||
["D1", "D1 Durchfahrtshöhe 3,00", "1", 0],
|
||||
["H4", "Hilfskraft 4", "1", 0],
|
||||
["KK", "Kugelkopf-Kupplung", "1", 0],
|
||||
["RZ", "Rechnung in die Zentrale", "0", 0],
|
||||
["D2", "D2 3,40", "1", 0],
|
||||
["HB", "Hebebühne", "1", 0],
|
||||
["KR", "Kran-Fahrzeug", "1", 0],
|
||||
["S 12", "Steckdose 12V", "1", 0],
|
||||
["D3", "D3 3,50", "1", 0],
|
||||
["HH", "Hebeb. hintergeklappt", "1", 0],
|
||||
["L 6", "Lademeter 6 m", "1", 0],
|
||||
["S 24", "Steckdose 24V", "1", 0],
|
||||
["D4", "D4 3,60", "1", 0],
|
||||
["HK", "Hafenkundig", "1", 0],
|
||||
["L 7", "Lademeter 7 m", "1", 0],
|
||||
["SF", "Sauberes Fahrzeug", "1", 0],
|
||||
["D5", "D5 3,80", "1", 0],
|
||||
["HU", "Hebeb. untergeklappt", "1", 0],
|
||||
["L4", "Lademeter 4 m", "1", 0],
|
||||
["SI", "Sicherheitsschuhe", "1", 0],
|
||||
["DE", "Decken", "1", 0],
|
||||
["HV", "Hängeversand", "1", 0],
|
||||
["LA", "Luftanschluss", "1", 0],
|
||||
["SK", "Sackkarre", "1", 0],
|
||||
["DF", "Deutscher Fahrer", "1", 0],
|
||||
["HW", "Hubwagen", "1", 0],
|
||||
["LE", "Leere Ladefläche", "1", 0],
|
||||
["SP", "Staplerschein", "1", 0],
|
||||
["EB", "Echter Bus", "1", 0],
|
||||
["I220", "Innenhöhe 2,2 m", "1", 0],
|
||||
["LG", "Luftgefedert", "1", 0],
|
||||
["ST", "Schaltschranktauglich", "1", 0],
|
||||
["EV", "Edscha-Verdeck", "1", 0],
|
||||
["I230", "Innenhöhe 2,3 m", "1", 0],
|
||||
["LK", "Lieferschein Kunde", "0", 0],
|
||||
["TP", "Tauschpaletten", "1", 0],
|
||||
["EZ", "Einzelrechnung", "0", 0],
|
||||
["I235", "Innenhöhe 2,35 m", "1", 0],
|
||||
["LL", "Lichtleiste", "1", 0],
|
||||
["ÜB", "Überbreite", "1", 0],
|
||||
["GF", "Gefahrengutausrüstung", "1", 0],
|
||||
["I240", "Innenhöhe 2,4 m", "1", 0],
|
||||
["LZ", "Lieferschein Zentrale", "0", 0],
|
||||
["ZO", "Zollkenntnisse", "1", 0],
|
||||
["GU", "Gurte", "1", 0],
|
||||
["I245", "Innenhöhe 2,45 m", "1", 0],
|
||||
["MT", "Hunt", "1", 0],
|
||||
["ZV", "Zollverschluss", "1", 0],
|
||||
["H1", "Hebebühne 1,0 TO", "1", 0],
|
||||
["I250", "Innenhöhe 2,5 m", "1", 0],
|
||||
["NA", "Neutral anliefern", "0", 0],
|
||||
[" ", " ", "0", 0],
|
||||
["H1", "Hilfskraft 1", "1", 0],
|
||||
["I255", "Innenhöhe 2,55 m", "1", 0],
|
||||
["PA", "Personalausweis", "1", 0],
|
||||
[" ", " ", "0", 0]];
|
||||
var sales_tax_rate_sign_list = [["3", "0.00"],["2", "0.00"],["1", "0.00"],["4", "16.00"]];
|
||||
var ph=["20060101",
|
||||
"20060108",
|
||||
"20060115",
|
||||
"20060122",
|
||||
"20060129",
|
||||
"20060205",
|
||||
"20060212",
|
||||
"20060219",
|
||||
"20060226",
|
||||
"20060305",
|
||||
"20060312",
|
||||
"20060319",
|
||||
"20060326",
|
||||
"20060402",
|
||||
"20060409",
|
||||
"20060414",
|
||||
"20060416",
|
||||
"20060417",
|
||||
"20060423",
|
||||
"20060430",
|
||||
"20060501",
|
||||
"20060507",
|
||||
"20060514",
|
||||
"20060521",
|
||||
"20060525",
|
||||
"20060528",
|
||||
"20060604",
|
||||
"20060605",
|
||||
"20060611",
|
||||
"20060618",
|
||||
"20060625",
|
||||
"20060702",
|
||||
"20060709",
|
||||
"20060716",
|
||||
"20060723",
|
||||
"20060730",
|
||||
"20060806",
|
||||
"20060813",
|
||||
"20060820",
|
||||
"20060827",
|
||||
"20060903",
|
||||
"20060910",
|
||||
"20060917",
|
||||
"20060924",
|
||||
"20061001",
|
||||
"20061003",
|
||||
"20061008",
|
||||
"20061015",
|
||||
"20061022",
|
||||
"20061029",
|
||||
"20061105",
|
||||
"20061112",
|
||||
"20061119",
|
||||
"20061126",
|
||||
"20061203",
|
||||
"20061210",
|
||||
"20061217",
|
||||
"20061224",
|
||||
"20061225",
|
||||
"20061226",
|
||||
"20061231",
|
||||
"20070101",
|
||||
"20070107",
|
||||
"20070114",
|
||||
"20070121",
|
||||
"20070128",
|
||||
"20070204",
|
||||
"20070211",
|
||||
"20070218",
|
||||
"20070225",
|
||||
"20070304",
|
||||
"20070311",
|
||||
"20070318",
|
||||
"20070325",
|
||||
"20070401",
|
||||
"20070406",
|
||||
"20070408",
|
||||
"20070409",
|
||||
"20070415",
|
||||
"20070422",
|
||||
"20070429",
|
||||
"20070501",
|
||||
"20070506",
|
||||
"20070513",
|
||||
"20070517",
|
||||
"20070520",
|
||||
"20070527",
|
||||
"20070528",
|
||||
"20070603",
|
||||
"20070610",
|
||||
"20070617",
|
||||
"20070624",
|
||||
"20070701",
|
||||
"20070708",
|
||||
"20070715",
|
||||
"20070722",
|
||||
"20070729",
|
||||
"20070805",
|
||||
"20070812",
|
||||
"20070819",
|
||||
"20070826",
|
||||
"20070902",
|
||||
"20070909",
|
||||
"20070916",
|
||||
"20070923",
|
||||
"20070930",
|
||||
"20071003",
|
||||
"20071007",
|
||||
"20071014",
|
||||
"20071021",
|
||||
"20071028",
|
||||
"20071104",
|
||||
"20071111",
|
||||
"20071118",
|
||||
"20071125",
|
||||
"20071202",
|
||||
"20071209",
|
||||
"20071216",
|
||||
"20071223",
|
||||
"20071225",
|
||||
"20071226",
|
||||
"20071230"];
|
||||
var fz=[["20457", "20095", "1201", "Hamburg Centrum"],
|
||||
["20457", "20457", "1218", "Hamburg Freihafen"],
|
||||
["21039", "21039", "1228", "Hamburg Bergedorf"],
|
||||
["21039", "21038", "8301", "Börnsen"],
|
||||
["21465", "21465", "1295", "Reinbek"],
|
||||
["21465", "21466", "8303", "Wentorf"],
|
||||
["22113", "22113", "1369", "Hamburg Billbrook"],
|
||||
["22113", "22114", "8302", "Oststeinbek"],
|
||||
["22145", "22145", "1374", "Hamburg Rahlstedt"],
|
||||
["22145", "22146", "8305", "Stapelfeld"],
|
||||
["22145", "22144", "8304", "Braak"],
|
||||
["25436", "25437", "8306", "Tornesch"],
|
||||
["25436", "25436", "1738", "Uetersen"],
|
||||
["25436", "25438", "8307", "Moorrege"],
|
||||
["25474", "25474", "1742", "Bönningstedt"],
|
||||
["25474", "25475", "8309", "Ellerbek"],
|
||||
["25474", "25473", "8308", "Hasloh"],
|
||||
["28816", "28816", "2070", "Stuhr"],
|
||||
["28816", "28817", "8310", "Brinkum"],
|
||||
["28816", "28818", "8311", "Fahrenhorst"],
|
||||
["28816", "28819", "8312", "Groß Mackenstedt"],
|
||||
["28816", "28820", "8313", "Heiligenrode"],
|
||||
["28816", "28821", "8314", "Moordeich"],
|
||||
["28816", "28822", "8315", "Seckenhausen"],
|
||||
["28816", "28823", "8316", "Varrel"],
|
||||
["28844", "28844", "2072", "Weyhe"],
|
||||
["28844", "28845", "8317", "Dreye"],
|
||||
["28844", "28846", "8318", "Kirchweyhe"],
|
||||
["28844", "28847", "8319", "Leeste"],
|
||||
["28844", "28848", "8320", "Sudweyhe"],
|
||||
["30855", "30855", "2218", "Langenhagen"],
|
||||
["30855", "30856", "8321", "Langenhagen Kaltenweide"],
|
||||
["30855", "30857", "8322", "Langenhagen Engelbostel"],
|
||||
["30880", "30880", "2219", "Laatzen"],
|
||||
["30880", "30881", "8323", "Laatzen Rethen"],
|
||||
["30880", "30882", "8324", "Laatzen Gleidingen"],
|
||||
["30890", "30890", "2220", "Barsinghausen"],
|
||||
["30890", "30891", "8325", "Barsinghausen Bantorf"],
|
||||
["30900", "30900", "2221", "Wedemark Berkhof"],
|
||||
["30900", "30901", "8326", "Wedemark Bissendorf"],
|
||||
["30900", "30902", "8327", "Wedemark Brelingen"],
|
||||
["30900", "30903", "8328", "Wedemark Elze"],
|
||||
["30900", "30904", "8329", "Wedemark Gailhof"],
|
||||
["30900", "30905", "8330", "Wedemark Hellendorf"],
|
||||
["30900", "30906", "8331", "Wedemark Meitze"],
|
||||
["30900", "30907", "8332", "Wedemark Mellendorf"],
|
||||
["30900", "30908", "8333", "Wedemark Negenborn"],
|
||||
["30900", "30909", "8334", "Wedemark Scherenbostel"],
|
||||
["30900", "30910", "8335", "Wedemark Wennebostel"],
|
||||
["30916", "30916", "2222", "Altwarmbüchen"],
|
||||
["30916", "30918", "8336", "Isernhagen Kirchhorst"],
|
||||
["30916", "30919", "8337", "Isernhagen NB"],
|
||||
["30916", "30920", "8338", "Isernhagen HB/KB/FB"],
|
||||
["30926", "30926", "2223", "Letter"],
|
||||
["30926", "30927", "8339", "Seelze Dedensen"],
|
||||
["30926", "30928", "8340", "Seelze Lathwehren"],
|
||||
["30926", "30929", "8341", "Seelze Lohnde"],
|
||||
["30926", "30930", "8358", "Seelze"],
|
||||
["30952", "30952", "2225", "Empelde"],
|
||||
["30952", "30953", "8342", "Ronnenberg"],
|
||||
["30952", "30954", "8343", "Ronnenberg Weetzen"],
|
||||
["30966", "30966", "2226", "Hemmingen"],
|
||||
["30966", "30967", "8344", "Hemmingen Arnum"],
|
||||
["30989", "30989", "2229", "Gehrden"],
|
||||
["30989", "30990", "8345", "Gehrden Ditterke"],
|
||||
["31008", "31008", "2230", "Elze"],
|
||||
["31008", "31009", "8346", "Elze/Wülfingen"],
|
||||
["31174", "31174", "2262", "Schellerten"],
|
||||
["31174", "31175", "8347", "Schellerten/Bettmar"],
|
||||
["31174", "31176", "8348", "Schellerten/Dinklar"],
|
||||
["31180", "31180", "2264", "Giesen"],
|
||||
["31180", "31181", "8349", "Giesen/Ahrbergen"],
|
||||
["31275", "31275", "2278", "Lehrte"],
|
||||
["31275", "31276", "8350", "Lehrte/Ahlten"],
|
||||
["31303", "31303", "2279", "Burgdorf"],
|
||||
["31303", "31304", "8351", "Burgdorf/Ehlershausen"],
|
||||
["31319", "31319", "2281", "Sehnde"],
|
||||
["31319", "31320", "8359", "Sehnde Höver"],
|
||||
["31515", "31515", "2282", "Wunstorf"],
|
||||
["31515", "31516", "8352", "Wunstorf/Steinhude"],
|
||||
["31515", "31517", "8353", "Wunstorf/Großenheidorn"],
|
||||
["31515", "31518", "8354", "Wunstorf/Luthe"],
|
||||
["31535", "31535", "2283", "Neustadt"],
|
||||
["31535", "31536", "8355", "Neustadt/Basse"],
|
||||
["31832", "31832", "2343", "Springe"],
|
||||
["31832", "31833", "8356", "Springe/Bennigsen"],
|
||||
["31832", "31834", "8357", "Springe/Völksen"]];
|
||||
var cr_id_order_list=[" 22609,<span style=\"color:red\"> 23:04 (13.02.)</span> - <i><b><span style=\"color:#9999FF\">conan<\/span></b>, LKW 25 To.<i></i>",
|
||||
" b2100,<span style=\"color:red\"> 04:22 (03.03.)</span> - <i><b><span style=\"color:#9999FF\">HB001<\/span></b>, LKW 5 To.<i></i>",
|
||||
" 26131,<span style=\"color:red\"> 18:48 (03.03.)</span> - <i><b>HB002</b>, LKW 5 To.<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=12274','Auftrag','scrollbars=yes,width=800,height=500');\"><i>12274 (<span style=\"color:red\">27777</span>->49757) <span style=\"color:green\">(03.03., 15:02)</span></i></a>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b><span style=\"color:#9999FF\">HB003<\/span></b>, LKW 3 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB005</b>, LKW 3 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b><span style=\"color:#9999FF\">HB006<\/span></b>, LKW 5 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b><span style=\"color:#9999FF\">HB007<\/span></b>, Großer Bus<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB008</b>, LKW 5 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB009</b>, LKW 5 To.<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=12244','Auftrag','scrollbars=yes,width=800,height=500');\"><i>12244 (28217->27753) <span style=\"color:green\">(06.03., 08:00)</span></i></a>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB010</b>, LKW 3 To.<i></i>",
|
||||
" .,<span style=\"color:red\"> 17:21 (03.03.)</span> - <i><b>HB012</b>, LKW 3 To.<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=12242','Auftrag','scrollbars=yes,width=800,height=500');\"><i>12242 (28936->53501) <span style=\"color:green\">(06.03., 07:30)</span></i></a>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b><span style=\"color:#9999FF\">HB013<\/span></b>, LKW 3 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB014</b>, LKW 5 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB015</b>, LKW 8 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB016</b>, LKW 5 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB017</b>, LKW 5 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB018</b>, LKW 3 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB019</b>, LKW 1 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB020</b>, Bus<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB022</b>, LKW 5 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB023</b>, LKW 5 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB026</b>, LKW 5 To.<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=12231','Auftrag','scrollbars=yes,width=800,height=500');\"><i>12231 (28719->.) <span style=\"color:green\">(06.03., 07:00)</span></i></a>",
|
||||
" 28237,<span style=\"color:red\"> 17:33 (03.03.)</span> - <i><b><span style=\"color:#9999FF\">HB027<\/span></b>, LKW 3 To.<i></i>",
|
||||
" 76437, 07:47 (04.03.) - <i><b>HB028</b>, Großer Bus<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB029</b>, LKW 5 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB030</b>, LKW 3 To.<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=12248','Auftrag','scrollbars=yes,width=800,height=500');\"><i>12248 (27777->28307) <span style=\"color:green\">(06.03., 06:45)</span></i></a>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB031</b>, LKW 5 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB032</b>, LKW 3 To.<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=12269','Auftrag','scrollbars=yes,width=800,height=500');\"><i>12269 (27243->.) <span style=\"color:green\">(06.03., 06:00)</span></i></a>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB033</b>, LKW 3 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB034</b>, LKW 5 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB035</b>, LKW 3 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB036</b>, Bus<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB037</b>, LKW 5 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b><span style=\"color:#9999FF\">HB038<\/span></b>, Großer Bus<i></i>",
|
||||
" 28307,<span style=\"color:red\"> 17:05 (03.03.)</span> - <i><b>HB039</b>, Großer Bus<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB040</b>, LKW 5 To.<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=12012','Auftrag','scrollbars=yes,width=800,height=500');\"><i>12012 (28719->22113) <span style=\"color:green\">(06.03., 07:15)</span></i></a>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB041</b>, LKW 5 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB042</b>, LKW 3 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB045</b>, LKW 5 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b><span style=\"color:#9999FF\">HB046<\/span></b>, LKW 1 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB047</b>, Großer Bus<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=12270','Auftrag','scrollbars=yes,width=800,height=500');\"><i>12270 (26386->28365) <span style=\"color:green\">(06.03., 07:01)</span></i></a>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB050</b>, LKW 5 To.<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=11754','Auftrag','scrollbars=yes,width=800,height=500');\"><i>11754 (28309->28309) <span style=\"color:green\">(06.03., 07:00)</span></i></a>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB055</b>, LKW 5 To.<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=12261','Auftrag','scrollbars=yes,width=800,height=500');\"><i>12261 (28237->28832) <span style=\"color:green\">(06.03., 07:30)</span></i></a>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB056</b>, LKW 5 To.<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=11779','Auftrag','scrollbars=yes,width=800,height=500');\"><i>11779 (.->.) <span style=\"color:green\">(06.03., 04:00)</span></i></a>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b><span style=\"color:#9999FF\">HB057<\/span></b>, Bus<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB058</b>, LKW 1 To.<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=12155','Auftrag','scrollbars=yes,width=800,height=500');\"><i>12155 (28259->.) <span style=\"color:green\">(06.03., 07:30)</span></i></a>, <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=12254','Auftrag','scrollbars=yes,width=800,height=500');\"><i>12254 (.->28309) <span style=\"color:green\">(06.03., 08:00)</span></i></a>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b><span style=\"color:#9999FF\">HB059<\/span></b>, LKW 1 To.<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=12265','Auftrag','scrollbars=yes,width=800,height=500');\"><i>12265 (28197->27753) <span style=\"color:green\">(06.03., 07:00)</span></i></a>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB062</b>, LKW 1 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB066</b>, LKW 1 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB067</b>, LKW 3 To.<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=12259','Auftrag','scrollbars=yes,width=800,height=500');\"><i>12259 (27243->.) <span style=\"color:green\">(06.03., 06:00)</span></i></a>",
|
||||
" <span style=\"color:red\">00000</span>,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB070</b>, LKW 5 To.<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=12209','Auftrag','scrollbars=yes,width=800,height=500');\"><i>12209 (28309->28309)</i></a>, <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=12257','Auftrag','scrollbars=yes,width=800,height=500');\"><i>12257 (28307->.)</i></a>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB075</b>, LKW 3 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB080</b>, LKW 3 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB085</b>, LKW 3 To.<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=12284','Auftrag','scrollbars=yes,width=800,height=500');\"><i>12284 (28307->22885) <span style=\"color:green\">(06.03., 08:00)</span></i></a>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB086</b>, LKW 1 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB088</b>, Großer Bus<i></i><\/a>, <span style=\"color:red\">aktueller Auftrag:</span> <a href=\"javascript:popupWindow('../admin/jb_detail.php?job_id=12205','Auftrag','scrollbars=yes,width=800,height=500');\"><i>12205 (<span style=\"color:red\">27243</span>->.->.) <span style=\"color:green\">(03.03., 07:24)</span></i></a>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB093</b>, LKW 5 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b><span style=\"color:#9999FF\">HB094<\/span></b>, LKW 3 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b><span style=\"color:#9999FF\">HB095<\/span></b>, LKW 3 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b><span style=\"color:#9999FF\">HB097<\/span></b>, Bus<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB104</b>, LKW 3 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b>HB116</b>, LKW 3 To.<i></i>",
|
||||
" 28277,<span style=\"color:red\"> 11:22 (23.02.)</span> - <i><b>HB127</b>, LKW 3 To.<i></i>",
|
||||
" 28277,<span style=\"color:red\"> 11:22 (23.02.)</span> - <i><b>HB128</b>, LKW 5 To.<i></i>",
|
||||
" .,<span style=\"color:red\"> 15:57 (02.03.)</span> - <i><b>HB250</b>, LKW 5 To.<i></i>",
|
||||
" 28816,<span style=\"color:red\"> 16:01 (03.03.)</span> - <i><b>HB251</b>, LKW 5 To.<i></i>",
|
||||
" 28195,<span style=\"color:red\"> 14:57 (03.03.)</span> - <i><b>HB252</b>, LKW 3 To.<i></i>",
|
||||
" 27777,<span style=\"color:red\"> 15:10 (03.03.)</span> - <i><b>HB254</b>, LKW 3 To.<i></i>",
|
||||
" 28277,<span style=\"color:red\"> 20:12 (03.03.)</span> - <i><b><span style=\"color:#9999FF\">HB255<\/span></b>, LKW 3 To.<i></i>",
|
||||
" 28199,<span style=\"color:red\"> 11:18 (03.03.)</span> - <i><b>HB256</b>, LKW 3 To.<i></i>",
|
||||
" 28857,<span style=\"color:red\"> 15:33 (03.03.)</span> - <i><b>HB257</b>, LKW 3 To.<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b><span style=\"color:#9999FF\">HB550<\/span></b>, ---<i></i>",
|
||||
" xxxxx,<span style=\"color:red\"> 17:38 (02.03.)</span> - <i><b>HB666</b>, ---<i></i>",
|
||||
" xxxxx,<span style=\"color:red\"> 17:38 (02.03.)</span> - <i><b>HB701</b>, ---<i></i>",
|
||||
" xxxxx,<span style=\"color:red\"> 17:38 (02.03.)</span> - <i><b>HB702</b>, ---<i></i>",
|
||||
" 00000,<span style=\"color:red\"> 00:00 (00.00.)</span> - <i><b><span style=\"color:#9999FF\">HB777<\/span></b>, ---<i></i>",
|
||||
" xxxxx,<span style=\"color:red\"> 17:38 (02.03.)</span> - <i><b>HB888</b>, LKW 3 To.<i></i>"];
|
||||
var cr_id_order_list2=[];
|
||||
var vht_id_str=[];
|
||||
var vht_product_list = [["0", ""],["1", "K"],["2", "G"],["3", "M1"],["4", "M3"],["5", "M4"],["6", "M5"],["7", "M6"],["8", "L"]];
|
||||
@@ -0,0 +1,228 @@
|
||||
<?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");
|
||||
include_once("../include/services_func.inc.php");
|
||||
trace_execution_time_start();
|
||||
|
||||
// $hq_id muss bereits definiert sein!!!
|
||||
// $db2 auch!
|
||||
|
||||
$sqlquery = "SELECT tax.tx_id, tax.tx_value FROM tax";
|
||||
$res = $db2->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 = $db2->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";
|
||||
|
||||
// getPublicHolidays benutzt globale hq_id
|
||||
$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 = $db2->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";
|
||||
|
||||
$sqlquery = "SELECT mt_sort, mt_value FROM metatype WHERE mt_type = 'vht_product' ORDER BY mt_sort";
|
||||
$res = $db2->query($sqlquery);
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlquery': " . $res->getMessage());
|
||||
$vht_product_list = "var vht_product_list = [";
|
||||
$i = 0;
|
||||
while ($row = $res->fetch_assoc()):
|
||||
if ($i++ > 0)
|
||||
$vht_product_list .= ",";
|
||||
$vht_product_list .= "[\"" . $row["mt_sort"] . "\", \"" . $row["mt_value"] . "\"]";
|
||||
endwhile;
|
||||
$res->free();
|
||||
$vht_product_list .= "];\n";
|
||||
|
||||
// Matrix der Kunden mit speziellen Preisen
|
||||
// Da Mitarbeiter mit Mandantenrecht Zugriff auf alle Kunden aller Zentralen haben, müssen für jede Zentrale
|
||||
// demzufolge auch alle Daten aller Zentralen verfügbar sein...
|
||||
$csSrvLists = "";
|
||||
if (getParameterValue("0", "MASK_CALCULATOR_SRV_SRC", $hq_id) != "1"): // "1" bedeutet dynamisch, d.h. wenn der Kunde in der Maske als Zahler ausgewählt wird
|
||||
$csSrvLists = getCustomerServices($db2, 0, $hq_id);
|
||||
endif;
|
||||
|
||||
// // 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"):
|
||||
|
||||
// job_courier.inc.php benutzt globale hq_id
|
||||
writeLog_("../log/job_options.js.inc_", "vor job_courier.inc.php");
|
||||
include("job_courier.inc.php");
|
||||
writeLog_("../log/job_options.js.inc_", "nach 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_$hq_id.js", 'w');
|
||||
@fwrite($fileHandle, $courierfilter_list . $sales_tax_rate_sign_list . $js_ph_list . $js_fz_list . $cr_id_order_list . $vht_product_list . $csSrvLists);
|
||||
@fclose($fileHandle);
|
||||
|
||||
//$db_history_date = "var db_history_date[" . $hq_id . "] = '" . getParameterValue("0", "DB_HISTORY_DATE", $hq_id) . "';\n";
|
||||
//$js_script = file_get_contents("../include/lib_global.js");
|
||||
//$fileHandle = @fopen("../include/lib_global.js", 'w');
|
||||
//@fwrite($fileHandle, $db_history_date . $js_script);
|
||||
//@fclose($fileHandle);
|
||||
|
||||
writeLog_("../log/job_options.js.inc_", trace_execution_time_stop() . " '../jobs/job_options_$hq_id.js' updated");
|
||||
|
||||
if (!isset($newbies_last_execution) || $newbies_last_execution < time() - (3 * 60)):
|
||||
trace_execution_time_start();
|
||||
// Unwichtige, aber den Betrieb aufhaltende Parameterabfragen der Kurierliste auslagern
|
||||
|
||||
$vehicletypes = "\$vehicletypes = array(\n";
|
||||
$vehicletype_ids_src = "\$vehicletype_ids = array(\n";
|
||||
$sqlQuery = "SELECT mt_sort, mt_value FROM metatype WHERE mt_type = 'vehicletype'";
|
||||
$res = $db2->query($sqlQuery);
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlQuery': " . $res->getMessage());
|
||||
$i = 0;
|
||||
while ($row = $res->fetch_assoc()):
|
||||
if ($i++ > 0):
|
||||
$vehicletypes .= ",\n";
|
||||
$vehicletype_ids_src .= ",\n";
|
||||
endif;
|
||||
$vehicletypes .= " " . $row["mt_sort"] . " => '" . $row["mt_value"] . "'";
|
||||
$vehicletype_ids_src .= " '" . $row["mt_value"] . "' => " . $row["mt_sort"];
|
||||
endwhile;
|
||||
$res->free();
|
||||
$vehicletypes .= ");\n\n";
|
||||
$vehicletype_ids_src .= ");\n\n";
|
||||
|
||||
$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 = "\$newbie_cr_sids = array(\n";
|
||||
// alle Fahrer finden, die _keine_ newbies sind (d.h. die mind. einen erledigten Auftrag haben, der älter als einen Monat ist)
|
||||
$sqlQuery = "SELECT DISTINCT cr_id FROM job WHERE cr_id > 0 AND jb_status = 2 AND jb_ordertime < '$newbie_date_sql'";
|
||||
$res = $db2->query($sqlQuery);
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlQuery': " . $res->getMessage());
|
||||
$i = 0;
|
||||
while ($row = $res->fetch_assoc()):
|
||||
if ($row["cr_id"] != '' && $row["cr_id"] != 0):
|
||||
if ($i++ > 0)
|
||||
$newbie_cr_sids .= ",\n";
|
||||
$newbie_cr_sids .= " " . $row["cr_id"] . " => 1";
|
||||
endif;
|
||||
endwhile;
|
||||
$res->free();
|
||||
$newbie_cr_sids .= ");\n\n";
|
||||
|
||||
// Alle historischen cs_markup_prov-Sätze holen
|
||||
$cs_markup_prov_list = "\$cs_markup_prov_list = array(\n";
|
||||
// $sqlquery = "SELECT cs_id FROM customer WHERE cs_markup_prov > 0 UNION" .
|
||||
// " SELECT DISTINCT srvprch_obj_id FROM servicepricehistory WHERE srvprch_obj_type = 'cs' AND srvprch_fieldname = 'cs_markup_prov' AND srvprch_price > 0";
|
||||
$sqlquery = "SELECT DISTINCT srvprch_obj_id AS cs_id FROM servicepricehistory WHERE srvprch_obj_type = 'cs' AND srvprch_fieldname = 'cs_markup_prov' AND srvprch_price > 0";
|
||||
$res = $db2->query($sqlquery);
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlquery': " . $res->getMessage());
|
||||
$cs_ids = "";
|
||||
while ($row = $res->fetch_assoc()):
|
||||
if ($cs_ids != "")
|
||||
$cs_ids .= ",";
|
||||
$cs_ids .= $row["cs_id"];
|
||||
endwhile;
|
||||
$res->free();
|
||||
if ($cs_ids != ""):
|
||||
$i = 0;
|
||||
// $sqlquery = "SELECT cs_id, cs_markup_prov, cs_validfrom FROM ((" .
|
||||
// " SELECT cs_id, cs_markup_prov, '1970-01-01 00:00:00' AS cs_validfrom FROM customer WHERE cs_id IN (" . $cs_ids . ")) UNION (" .
|
||||
// " SELECT srvprch_obj_id, srvprch_price, srvprch_validfrom FROM servicepricehistory, customer" .
|
||||
// " WHERE srvprch_obj_type = 'cs' AND srvprch_fieldname = 'cs_markup_prov' AND servicepricehistory.srvprch_obj_id = customer.cs_id AND srvprch_obj_id IN (" . $cs_ids . "))) AS schlonz" .
|
||||
// " ORDER BY cs_id ASC, cs_validfrom DESC";
|
||||
$sqlquery =
|
||||
" SELECT srvprch_obj_id AS cs_id, srvprch_price AS cs_markup_prov, srvprch_validfrom AS cs_validfrom FROM servicepricehistory, customer" .
|
||||
" WHERE srvprch_obj_type = 'cs' AND srvprch_fieldname = 'cs_markup_prov' AND servicepricehistory.srvprch_obj_id = customer.cs_id AND srvprch_obj_id IN (" . $cs_ids . ")" .
|
||||
" ORDER BY cs_id ASC, cs_validfrom DESC";
|
||||
$res = $db2->query($sqlquery);
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlquery': " . $res->getMessage());
|
||||
while ($row = $res->fetch_assoc()):
|
||||
if ($i++ > 0)
|
||||
$cs_markup_prov_list .= ",\n";
|
||||
$cs_markup_prov_list .= " array(" . $row["cs_id"] . ", '" . $row["cs_validfrom"] . "', '" . $row["cs_markup_prov"] . "')";
|
||||
endwhile;
|
||||
$res->free();
|
||||
endif;
|
||||
$cs_markup_prov_list .= ");\n\n";
|
||||
|
||||
$fileHandle = @fopen("../jobs/job_courier.inc.newbies.php", 'w');
|
||||
@fwrite($fileHandle, "<?php\n" . $vehicletypes . $vehicletype_ids_src . $newbie_cr_sids . $cs_markup_prov_list . "?>\n");
|
||||
@fclose($fileHandle);
|
||||
writeLog_("../log/job_options.js.inc_", trace_execution_time_stop() . " '../jobs/job_courier.inc.newbies.php' updated");
|
||||
$newbies_last_execution = time();
|
||||
endif;
|
||||
?>
|
||||
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
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,981 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* job_tour.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
include_once("../include/global.inc.php");
|
||||
include_once("../include/caglobal.inc.php");
|
||||
list ($hq_id_job) = getHttpVars(array("hq_id_job"));
|
||||
include_once("../include/auth.inc.php");
|
||||
include_once("../jobs/job_accesskeys.inc.php");
|
||||
include_once ("../admin/menu.php");
|
||||
|
||||
//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'");
|
||||
|
||||
$_von_csc_id_options_ = $von_csc_id_options;
|
||||
$_nach_csc_id_options_ = $nach_csc_id_options;
|
||||
if (getParameterValue($emp_id, "MODE_LATER_JOB") == "1"):
|
||||
$EMP_MODE_LATERJOB_START = "";
|
||||
$EMP_MODE_LATERJOB_END = "";
|
||||
else:
|
||||
$EMP_MODE_LATERJOB_START = "<!--";
|
||||
$EMP_MODE_LATERJOB_END = "-->";
|
||||
endif;
|
||||
|
||||
if (MASK_CASH_PAYER_SELECT != "1"):
|
||||
$PAYER_TEXT = "Rechnungszahler";
|
||||
$COSTSPLIT_TEXT = "Kosten werden aufgeteilt";
|
||||
$COSTSPLIT_TITLE = "Kosten splitten";
|
||||
else:
|
||||
$PAYER_TEXT = "Bezahler";
|
||||
$COSTSPLIT_TEXT = "Rechnungszahlung";
|
||||
$COSTSPLIT_TITLE = "Rechnung an Bezahler";
|
||||
endif;
|
||||
|
||||
$JB_CASHPAYER_MAIL_DISABLED_START = "<!--";
|
||||
$JB_CASHPAYER_MAIL_DISABLED_END = "-->";
|
||||
$sqlquery = "SELECT cs.cs_jbstatusmail, cs.cs_jbstatusmail2, cs.cs_jbstatusmail3"
|
||||
. " FROM costcenter AS csc, customer AS cs"
|
||||
. " WHERE csc.csc_id = " . getParameterValue("0", "CSC_ID_PAYER_CASH", $hq_id) . " AND csc.cs_id = cs.cs_id";
|
||||
$res = $db->query($sqlquery);
|
||||
//$fileHandle = @fopen("../log/job_tour_" . $today['year'] . sprintf("%02d", $today['mon']) . ".log", 'a');
|
||||
//@fwrite($fileHandle, "[" . date("Y-m-d H:i:s") . "] \$sqlquery = " . $sqlquery . "\n");
|
||||
//@fclose($fileHandle);
|
||||
if (DB::isError($res)) reportDie ("$PHP_SELF: '$sqlquery': " . $res->getMessage());
|
||||
$cs_jbstatusmailstr = "";
|
||||
if ($row =($phpVersion >= "8.0" ? $res->fetch_assoc() : $res->fetchRow())):
|
||||
if ($row["cs_jbstatusmail3"] == "1")
|
||||
$cs_jbstatusmailstr .= "Erf.";
|
||||
if ($row["cs_jbstatusmail2"] == "1")
|
||||
$cs_jbstatusmailstr .= ($cs_jbstatusmailstr == "" ? "" : "/") . "Abh.";
|
||||
if ($row["cs_jbstatusmail"] == "1")
|
||||
$cs_jbstatusmailstr .= ($cs_jbstatusmailstr == "" ? "" : "/") . "Erl.";
|
||||
if ($cs_jbstatusmailstr != "") {
|
||||
$cs_jbstatusmailstr = "Mail (" . $cs_jbstatusmailstr . ")";
|
||||
$JB_CASHPAYER_MAIL_DISABLED_START = "";
|
||||
$JB_CASHPAYER_MAIL_DISABLED_END = "";
|
||||
}
|
||||
endif;
|
||||
$res->free();
|
||||
|
||||
$CUSTOMER_DISABLED_START = "";
|
||||
$CUSTOMER_DISABLED_END = "";
|
||||
|
||||
$PHOTO_DISABLED_START = "";
|
||||
$PHOTO_DISABLED_END = "";
|
||||
if (MASK_TR_PHOTO != "1"):
|
||||
$PHOTO_DISABLED_START = "<!--";
|
||||
$PHOTO_DISABLED_END = "-->";
|
||||
endif;
|
||||
|
||||
$MASK_CUSTOMER_PRICEQUERY_DISABLED_START = "";
|
||||
$MASK_CUSTOMER_PRICEQUERY_DISABLED_END = "";
|
||||
if (MASK_CUSTOMER_SHOW_PRICEQUERY != "1"):
|
||||
$MASK_CUSTOMER_PRICEQUERY_DISABLED_START = "<!--";
|
||||
$MASK_CUSTOMER_PRICEQUERY_DISABLED_END = "-->";
|
||||
endif;
|
||||
|
||||
$_TOURNOVALSIZE_ = (MASK_MAXTOUR > 10 ? 2 : 1);
|
||||
|
||||
// *** TABINDICES ***
|
||||
$_origin1_tabindex_ = "";
|
||||
$_origin2_tabindex_ = "";
|
||||
$_origin3_tabindex_ = "";
|
||||
$_origin4_tabindex_ = "";
|
||||
$_origin5_tabindex_ = "";
|
||||
$_origin6_tabindex_ = "";
|
||||
$_origin7_tabindex_ = "";
|
||||
$ti = 0;
|
||||
$_von_cs_comp_tabindex_ = ++$ti;
|
||||
$_von_tr_person_tabindex_ = ++$ti;
|
||||
$_von_ad_street_tabindex_ = ++$ti;
|
||||
$_von_tr_hsno_tabindex_ = ++$ti;
|
||||
$_von_ad_country_tabindex_ = "";
|
||||
$_von_ad_zipcode_tabindex_ = ++$ti;
|
||||
$_von_ad_city_tabindex_ = ++$ti;
|
||||
$_von_tr_remark_tabindex_ = ++$ti;
|
||||
$_nach_cs_comp_tabindex_ = ++$ti;
|
||||
$_nach_tr_person_tabindex_ = ++$ti;
|
||||
$_nach_ad_street_tabindex_ = ++$ti;
|
||||
$_nach_tr_hsno_tabindex_ = ++$ti;
|
||||
$_nach_ad_country_tabindex_ = "";
|
||||
$_nach_ad_zipcode_tabindex_ = ++$ti;
|
||||
$_nach_ad_city_tabindex_ = ++$ti;
|
||||
$_nach_tr_remark_tabindex_ = ++$ti;
|
||||
$_von_tr_commission_no_tabindex_ = ++$ti;
|
||||
$_von_tr_commission_no_accesskey_ = _VON_TR_COMMISSION_NO_ACCESSKEY_;
|
||||
$_nach_tr_commission_no_tabindex_ = ++$ti;
|
||||
$_nach_tr_commission_no_accesskey_ = _NACH_TR_COMMISSION_NO_ACCESSKEY_;
|
||||
$_jb_orderer_tabindex_ = ++$ti;
|
||||
$_jb_commission_no_tabindex_ = ++$ti;
|
||||
$_nach_tr_tracking_tabindex_ = ++$ti;
|
||||
$_von_tr_tracking_tabindex_ = ++$ti;
|
||||
$_tr_photo_von_tabindex_ = ++$ti;
|
||||
$_tr_ware_from_von_tabindex_ = ++$ti;
|
||||
$_tr_ware_to_von_tabindex_ = ++$ti;
|
||||
$_tr_ware_from_nach_tabindex_ = ++$ti;
|
||||
$_tr_ware_to_nach_tabindex_ = ++$ti;
|
||||
$_tr_photo_nach_tabindex_ = ++$ti;
|
||||
$_payer_from_tabindex_ = ++$ti;
|
||||
$_payer_to_tabindex_ = ++$ti;
|
||||
$_vonFirmaButton_tabindex_ = ++$ti;
|
||||
$_vonFirmaButton_accesskey_ = _VONFIRMABUTTON_ACCESSKEY_;
|
||||
$_vonAdressButton_tabindex_ = ++$ti;
|
||||
$_vonAdressButton_accesskey_ = _VONADRESSBUTTON_ACCESSKEY_;
|
||||
$_von_tr_mediationarea_id_Button_tabindex_ = "";
|
||||
$_von_tr_remark_Button_tabindex_ = ++$ti;
|
||||
$_von_tr_remark_Button_accesskey_ = _VON_TR_REMARK_BUTTON_ACCESSKEY_;
|
||||
$_hide_von_tr_remark_tabindex_ = ++$ti;
|
||||
$_nachFirmaButton_tabindex_ = ++$ti;
|
||||
$_nachFirmaButton_accesskey_ = _NACHFIRMABUTTON_ACCESSKEY_;
|
||||
$_nachAdressButton_tabindex_ = ++$ti;
|
||||
$_nachAdressButton_accesskey_ = _NACHADRESSBUTTON_ACCESSKEY_;
|
||||
$_nach_tr_mediationarea_id_Button_tabindex_ = "";
|
||||
$_hide_nach_tr_remark_tabindex_ = ++$ti;
|
||||
$_nach_tr_remark_Button_tabindex_ = ++$ti;
|
||||
$_nach_tr_remark_Button_accesskey_ = _NACH_TR_REMARK_BUTTON_ACCESSKEY_;
|
||||
$_Berichte_tabindex_ = "";
|
||||
$_Dokumente_tabindex_ = "";
|
||||
$_bezahlerFirmaButton_tabindex_ = ++$ti;
|
||||
$_bezahlerFirmaButton_accesskey_ = _BEZAHLERFIRMABUTTON_ACCESSKEY_;
|
||||
$_jb_cash_tabindex_ = ++$ti;
|
||||
$_jb_cash_accesskey_ = "";
|
||||
$_jb_costsplit_tabindex_ = ++$ti;
|
||||
$_jb_costsplit_accesskey_ = "";
|
||||
$_accept_all_addresses_tabindex_ = ++$ti;
|
||||
$_accept_all_addresses_accesskey_ = _ACCEPT_ALL_ADDRESSES_ACCESSKEY_;
|
||||
$_jb_cashpayer_mail_tabindex_ = ++$ti;
|
||||
$_jb_offer_mail_tabindex_ = ++$ti;
|
||||
$_prevButton_tabindex_ = ++$ti;
|
||||
$_prevButton_accesskey_ = _PREVBUTTON_ACCESSKEY_;
|
||||
$_waste1Button_tabindex_ = ++$ti;
|
||||
$_waste1Button_accesskey_ = _WASTE1BUTTON_ACCESSKEY_;
|
||||
$_switchButton_tabindex_ = ++$ti;
|
||||
$_switchButton_accesskey_ = _SWITCHBUTTON_ACCESSKEY_;
|
||||
$_waste2Button_tabindex_ = ++$ti;
|
||||
$_waste2Button_accesskey_ = _WASTE2BUTTON_ACCESSKEY_;
|
||||
$_nextButton_tabindex_ = ++$ti;
|
||||
$_nextButton_accesskey_ = _NEXTBUTTON_ACCESSKEY_;
|
||||
$_searchOldJobButton_tabindex_ = ++$ti;
|
||||
//$_searchOldJobButton_accesskey_ = _SEARCHOLDJOBBUTTON_ACCESSKEY_;
|
||||
$_duplicateJobButton_tabindex_ = ++$ti;
|
||||
$_getLastJobButton_tabindex_ = ++$ti;
|
||||
$_duplicateJobButton_accesskey_ = _DUPLICATEJOBBUTTON_ACCESSKEY_;
|
||||
$_jb_freetextButton_tabindex_ = ++$ti;
|
||||
$_jb_freetextButton_accesskey_ = _JB_FREETEXTBUTTON_ACCESSKEY_;
|
||||
$_jb_hiddenFreetextButton_tabindex_ = ++$ti;
|
||||
// *** ***
|
||||
|
||||
//include("..\jobs\shrink.inc.php");
|
||||
//$html_code = $tpl->get();
|
||||
//echo htmlShrink($html_code, true);
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>AUFTRAGSERFASSUNG - DATENEINGABE</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/phoenix.css.php">
|
||||
<?php include_once ("../include/js_framework.inc.php"); ?>
|
||||
<style>
|
||||
.cmp_remark
|
||||
{ border: 0; width: 40em; height: 20em; background: rgba(0, 0, 0, 0); font-size: 9pt }
|
||||
.cmp_remark_payer
|
||||
{ border: 0; width: 40em; height: 20em; background: rgba(0, 0, 0, 0); font-size: 9pt }
|
||||
.cmp_remark_small
|
||||
{ border: 0; width: 40em; height: 10em; background: rgba(0, 0, 0, 0); font-size: 9pt }
|
||||
.cmp_remark_payer_small
|
||||
{ border: 0; width: 40em; height: 10em; background: rgba(0, 0, 0, 0); font-size: 9pt }
|
||||
</style>
|
||||
<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">
|
||||
<!--
|
||||
var job_tour_isLoading=true;
|
||||
var cmp_remark_style="cmp_remark";
|
||||
var cmp_remark_payer_style="cmp_remark_payer";
|
||||
if (screen.height < 1080){
|
||||
cmp_remark_style="cmp_remark_small";
|
||||
cmp_remark_payer_style="cmp_remark_payer_small";
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
<script src="../include/maps.googleapis.com_maps_api_js_places.php" async defer></script>
|
||||
<script>
|
||||
let autocomplete1;
|
||||
let autocomplete2;
|
||||
function initAutocomplete1(i) {
|
||||
if (typeof google == 'undefined') {
|
||||
if (i < 10)
|
||||
self.setTimeout('initAutocomplete1(' + (i+1) + ')', 100);
|
||||
return;
|
||||
}
|
||||
autocomplete1 = new google.maps.places.Autocomplete(
|
||||
document.getElementById('von_autocomplete'),
|
||||
{
|
||||
types: ['address'],
|
||||
// componentRestrictions: {'country': ['DE']},
|
||||
fields: ["geometry", "address_components", "types"]
|
||||
});
|
||||
|
||||
// autocomplete.setFields('address_components');
|
||||
autocomplete1.addListener('place_changed', fillInAddress1);
|
||||
initAutocomplete2();
|
||||
}
|
||||
|
||||
function initAutocomplete2() {
|
||||
autocomplete2 = new google.maps.places.Autocomplete(
|
||||
document.getElementById('nach_autocomplete'),
|
||||
{
|
||||
types: ['address'],
|
||||
// componentRestrictions: {'country': ['DE']},
|
||||
fields: ["geometry", "address_components", "types"]
|
||||
});
|
||||
|
||||
// autocomplete.setFields('address_components');
|
||||
autocomplete2.addListener('place_changed', fillInAddress2);
|
||||
}
|
||||
|
||||
// JQuery.Request (GET)
|
||||
function ajaxRequestGetAsync(url, data) {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
data: data,
|
||||
async: true,
|
||||
cache: false,
|
||||
success: function(msg){eval(msg);}
|
||||
});
|
||||
}
|
||||
|
||||
function fillInAddress1() {
|
||||
fillInAddress(1);
|
||||
}
|
||||
|
||||
function fillInAddress2() {
|
||||
fillInAddress(2);
|
||||
}
|
||||
|
||||
function fillInAddress(side) {
|
||||
// Get the place details from the autocomplete object.
|
||||
let place;
|
||||
if (side == 1)
|
||||
place = autocomplete1.getPlace();
|
||||
if (side == 2)
|
||||
place = autocomplete2.getPlace();
|
||||
if (!place.geometry)
|
||||
return;
|
||||
|
||||
//console.log(place.types);
|
||||
let accuracy = 0;
|
||||
const sufficient_types = ["intersection", "street_address", "premise", "subpremise"];
|
||||
const sufficient_types_accuracy = [7, 8, 9, 9];
|
||||
|
||||
let type_index = -1;
|
||||
for (const type of place.types) {
|
||||
type_index = sufficient_types.indexOf(type);
|
||||
if (type_index > -1) {
|
||||
if (accuracy < sufficient_types_accuracy[type_index])
|
||||
accuracy = sufficient_types_accuracy[type_index];
|
||||
}
|
||||
}
|
||||
// let address1 = "";
|
||||
// let postcode = "";
|
||||
let route = "";
|
||||
let street_number = "";
|
||||
let country = "";
|
||||
let postal_code = ""
|
||||
let locality = "";
|
||||
let lat = 0;
|
||||
let lng = 0;
|
||||
|
||||
if (type_index > -1) {
|
||||
//console.log(place.geometry.location.lat());
|
||||
//console.log(place.geometry.location.lng());
|
||||
lat = place.geometry.location.lat();
|
||||
lng = place.geometry.location.lng();
|
||||
}
|
||||
|
||||
// Get each component of the address from the place details,
|
||||
// and then fill-in the corresponding field on the form.
|
||||
// place.address_components are google.maps.GeocoderAddressComponent objects
|
||||
// which are documented at http://goo.gle/3l5i5Mr
|
||||
for (const component of place.address_components) {
|
||||
let postal_code_dirty = false;
|
||||
// @ts-ignore remove once typings fixed
|
||||
//console.log(component);
|
||||
for (const componentType of component.types) {
|
||||
//console.log(componentType);
|
||||
switch (componentType) {
|
||||
case "route": {
|
||||
route = component.short_name;
|
||||
if (side == 1)
|
||||
document.getElementsByName('von_ad_street')[0].value = component.short_name;
|
||||
if (side == 2)
|
||||
document.getElementsByName('nach_ad_street')[0].value = component.short_name;
|
||||
break;
|
||||
}
|
||||
|
||||
case "street_number": {
|
||||
street_number = component.short_name;
|
||||
if (side == 1)
|
||||
document.getElementsByName('von_tr_hsno')[0].value = component.short_name;
|
||||
if (side == 2)
|
||||
document.getElementsByName('nach_tr_hsno')[0].value = component.short_name;
|
||||
break;
|
||||
}
|
||||
|
||||
case "country": {
|
||||
country = component.short_name;
|
||||
if (side == 1)
|
||||
document.getElementsByName('von_ad_country')[0].value = component.short_name;
|
||||
if (side == 2)
|
||||
document.getElementsByName('nach_ad_country')[0].value = component.short_name;
|
||||
break;
|
||||
}
|
||||
|
||||
case "postal_code": {
|
||||
if (!postal_code_dirty) {
|
||||
postal_code = component.short_name;
|
||||
if (side == 1)
|
||||
document.getElementsByName('von_ad_zipcode')[0].value = component.short_name;
|
||||
if (side == 2)
|
||||
document.getElementsByName('nach_ad_zipcode')[0].value = component.short_name;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Bei unvollständigen Eingaben (Straße ohne Hausnummer) wird manchmal nur die ersten beiden Ziffern der PLZ zurückgegeben, erkennbar an "postal_code_prefix"
|
||||
case "postal_code_prefix": {
|
||||
if (country == "DE") {
|
||||
postal_code_dirty = true;
|
||||
postal_code = "";
|
||||
if (side == 1)
|
||||
document.getElementsByName('von_ad_zipcode')[0].value = "";
|
||||
if (side == 2)
|
||||
document.getElementsByName('nach_ad_zipcode')[0].value = "";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case "locality": {
|
||||
locality = component.long_name;
|
||||
if (side == 1)
|
||||
document.getElementsByName('von_ad_city')[0].value = component.short_name;
|
||||
if (side == 2)
|
||||
document.getElementsByName('nach_ad_city')[0].value = component.short_name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// After filling the form with address components from the Autocomplete
|
||||
// prediction, set cursor focus on the second address line to encourage
|
||||
// entry of subpremise information such as apartment, unit, or floor number.
|
||||
parent.frames[2].saveFormFields();
|
||||
if (side == 1)
|
||||
document.getElementsByName('von_tr_remark')[0].focus();
|
||||
if (side == 2)
|
||||
document.getElementsByName('nach_tr_remark')[0].focus();
|
||||
|
||||
if (accuracy > 6) {
|
||||
ajaxRequestGetAsync('../include/ajaxReqKmPrice.php', "mode=coords&a=" + route + ";" + street_number + ";" + postal_code + ";" + locality + ";" + country + ";" + lat + ";" + lng + ";" + accuracy);
|
||||
}
|
||||
}
|
||||
self.setTimeout('initAutocomplete1(0)', 100);
|
||||
</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 width=100% align=center cellspacing=0 cellpadding=0 vspace=0 hspace=0>
|
||||
<form name="tourNoForm" action="dummy.htm">
|
||||
<tr>
|
||||
<td width=2%>
|
||||
|
||||
</td>
|
||||
<td width=7% align=center>
|
||||
<img name="start_gif" src="../images/start.gif" height=25 border=0 alt="Start">
|
||||
</td>
|
||||
<td width=7% align=right valign=bottom>
|
||||
|
||||
</td>
|
||||
<td width=29% align=right valign=bottom colspan=2>
|
||||
<input name="von_csc_name" type="text" value="" size="57" maxlength="57" class="hideSmall" readonly>
|
||||
</td>
|
||||
<td width=10% align=center valign=bottom>
|
||||
<div class=headline2a>
|
||||
Etappe <input name="tourNoVal" type="text" value="1"
|
||||
size="<?php echo $_TOURNOVALSIZE_;?>" maxlength="<?php echo $_TOURNOVALSIZE_;?>" class="hideBiga" readonly>
|
||||
</div>
|
||||
</td>
|
||||
<td width=29% align=left valign=bottom colspan=2>
|
||||
<input name="nach_csc_name" type="text" value="" size="57" maxlength="57" class="hideSmall" readonly>
|
||||
</td>
|
||||
<td width=7% align=right valign=bottom>
|
||||
|
||||
</td>
|
||||
<td width=7% align=center>
|
||||
<img name="goal_gif" src="../images/goal.gif" height=25 border=0 alt="Ziel">
|
||||
</td>
|
||||
<td width=2%>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
<tr>
|
||||
<form name="tourForm" action="dummy.htm">
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td colspan=4 align=right>
|
||||
<input type="button" name="vonFirmaButton" value="..."
|
||||
class="button_enabled"
|
||||
tabindex="<?php echo $_vonFirmaButton_tabindex_;?>" title="Suchen: von Firma (alt+<?php echo $_vonFirmaButton_accesskey_;?>)" accesskey="<?php echo $_vonFirmaButton_accesskey_;?>" onclick="parent.frames[2].searchCsCsc(0)">
|
||||
<input name="von_cs_comp" type="text" value="" size="21" maxlength="50" class="input"
|
||||
tabindex="<?php echo $_von_cs_comp_tabindex_;?>" onchange="parent.frames[2].saveFormFields()">
|
||||
<input name="von_tr_person" type="text" value="" size="20" maxlength="50" class="input"
|
||||
tabindex="<?php echo $_von_tr_person_tabindex_;?>" onchange="parent.frames[2].saveFormFields()">
|
||||
<select name="select_von_tr_person" class="input" style="width:20px;display:none" tabindex="" onchange="parent.frames[2].set_tr_person(0)">
|
||||
</select>
|
||||
<input type="hidden" name="von_csc_id" value="">
|
||||
</td>
|
||||
<td align=center>
|
||||
Firma, Person
|
||||
</td>
|
||||
<td colspan=2 align=left>
|
||||
<input name="nach_cs_comp" type="text" value="" size="21" maxlength="50" class="input"
|
||||
tabindex="<?php echo $_nach_cs_comp_tabindex_;?>" onchange="parent.frames[2].saveFormFields()">
|
||||
<input name="nach_tr_person" type="text" value="" size="20" maxlength="50" class="input"
|
||||
tabindex="<?php echo $_nach_tr_person_tabindex_;?>" onchange="parent.frames[2].saveFormFields()">
|
||||
<select name="select_nach_tr_person" class="input" style="width:20px;display:none" tabindex="" onchange="parent.frames[2].set_tr_person(1)">
|
||||
</select>
|
||||
<input type="button" name="nachFirmaButton" value="..."
|
||||
class="button_enabled"
|
||||
tabindex="<?php echo $_nachFirmaButton_tabindex_;?>" title="Suchen: nach Firma (alt+<?php echo $_nachFirmaButton_accesskey_;?>)" accesskey="<?php echo $_nachFirmaButton_accesskey_;?>" onclick="parent.frames[2].searchCsCsc(1)">
|
||||
<input type="hidden" name="nach_csc_id" value="">
|
||||
</td>
|
||||
<td rowspan=5 colspan=2 align=left valign=top>
|
||||
Auftragseingang per<br>
|
||||
<table border=0 align=left cellspacing=0 cellpadding=0 vspace=0 hspace=0>
|
||||
<tr>
|
||||
<td align=left width=50%>
|
||||
<!--
|
||||
| |<br>
|
||||
Auftragseingang per <br>
|
||||
-->
|
||||
<input type="radio" name="jb_origin" value="1" tabindex="<?php echo $_origin1_tabindex_;?>"
|
||||
onclick="parent.frames[2].checkOrigin()" title="Auftragseingang per Telefon"
|
||||
<?php if (isset($jb_origin) && $jb_origin == "1") echo " checked"; ?>>
|
||||
<b>Telefon</b><br>
|
||||
</td>
|
||||
<td align=left>
|
||||
<input type="radio" name="jb_origin" value="5" tabindex="<?php echo $_origin5_tabindex_;?>"
|
||||
onclick="parent.frames[2].checkOrigin()" title="Auftragseingang per Dauerauftrag"
|
||||
<?php if (isset($jb_origin) && $jb_origin == "5") echo " checked"; ?> disabled>
|
||||
<b>Dauerauftrag</b><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>
|
||||
<input type="radio" name="jb_origin" value="2" tabindex="<?php echo $_origin2_tabindex_;?>"
|
||||
onclick="parent.frames[2].checkOrigin()" title="Auftragseingang per Mail"
|
||||
<?php if (isset($jb_origin) && $jb_origin == "2") echo " checked"; ?>>
|
||||
<b>Mail</b><br>
|
||||
</td>
|
||||
<td align=left>
|
||||
<input type="radio" name="jb_origin" value="7" tabindex="<?php echo $_origin7_tabindex_;?>"
|
||||
onclick="parent.frames[2].checkOrigin()" title="Auftragseingang per Listenbuchung"
|
||||
<?php if (isset($jb_origin) && $jb_origin == "7") echo " checked"; ?>disabled>
|
||||
<b>Listenbuchung</b><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>
|
||||
<input type="radio" name="jb_origin" value="3" tabindex="<?php echo $_origin3_tabindex_;?>"
|
||||
onclick="parent.frames[2].checkOrigin()" title="Auftragseingang per Schnittstelle"
|
||||
<?php if (isset($jb_origin) && $jb_origin == "3") echo " checked"; ?> disabled>
|
||||
<b>Schnittstelle</b><br>
|
||||
</td>
|
||||
<td align=left>
|
||||
<input type="radio" name="jb_origin" value="8" tabindex="<?php echo $_origin8_tabindex_;?>"
|
||||
onclick="parent.frames[2].checkOrigin()" title="Auftragseingang per Höherversicherung"
|
||||
<?php if (isset($jb_origin) && $jb_origin == "8") echo " checked"; ?> disabled>
|
||||
<b>Höherversicherung</b><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>
|
||||
<input type="radio" name="jb_origin" value="4" tabindex="<?php echo $_origin4_tabindex_;?>"
|
||||
onclick="parent.frames[2].checkOrigin()" title="Auftragseingang per KAE"
|
||||
<?php if (isset($jb_origin) && $jb_origin == "4") echo " checked"; ?> disabled>
|
||||
<b>KAE</b><br>
|
||||
</td>
|
||||
<td align=left>
|
||||
<input type="radio" name="jb_origin" value="6" tabindex="<?php echo $_origin6_tabindex_;?>"
|
||||
onclick="parent.frames[2].checkOrigin()" title="Auftragseingang sonstiges"
|
||||
<?php if (isset($jb_origin) && $jb_origin == "6") echo " checked"; ?>>
|
||||
<b>Sonstiges</b><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left colspan=2>
|
||||
<div id="div_jb_origin_other" style="display:none">
|
||||
<input name="jb_origin_other" type="text" size="20" maxlength="40"
|
||||
class="inputRed" tabindex="<?php echo $_origin6_tabindex_;?>" onchange="parent.frames[2].checkOrigin()" value="<?php echo (isset($jb_origin_other) ? $jb_origin_other : "");?>">
|
||||
</div>
|
||||
<br>
|
||||
Besteller:
|
||||
<input name="jb_orderer" type="text" size="20" maxlength="50" class="input" tabindex="<?php echo $_jb_orderer_tabindex_;?>" onchange="parent.frames[2].check_jb_orderer()">
|
||||
<br>
|
||||
Rg.-Ko.-Nr.:
|
||||
<input name="jb_commission_no" type="text" size="20" maxlength="50" class="input" tabindex="<?php echo $_jb_commission_no_tabindex_;?>" title="Erscheint als Kommission auf der Rechnung" onchange="parent.frames[2].check_jb_commission_no()">
|
||||
<div id="div_jb_offer_mail" style="display: none; margin:0; padding:0; border: 0px solid green;">
|
||||
<br>
|
||||
Angebotsmail senden an:
|
||||
<input name="jb_offer_mail" type="text" size="27" class="input" tabindex="<?php echo $_jb_offer_mail_tabindex_;?>" onchange="parent.frames[2].saveEmailAddressOffer()">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td colspan=4 align=right>
|
||||
<input type="button" name="vonAdressButton" value="..."
|
||||
class="button_enabled"
|
||||
tabindex="<?php echo $_vonAdressButton_tabindex_;?>" title="Suchen: von Adresse (alt+<?php echo $_vonAdressButton_accesskey_;?>)" accesskey="<?php echo $_vonAdressButton_accesskey_;?>" onclick="parent.frames[2].searchAddress(0);">
|
||||
<input name="von_ad_street" id="von_autocomplete" type="text" value="" size="38" maxlength="50" class="input"
|
||||
tabindex="<?php echo $_von_ad_street_tabindex_;?>" onchange="parent.frames[2].saveFormFields()">
|
||||
<input name="von_tr_hsno" type="text" value="" size="3" maxlength="10" class="input"
|
||||
tabindex="<?php echo $_von_tr_hsno_tabindex_;?>" onchange="parent.frames[2].saveFormFields()">
|
||||
</td>
|
||||
<td align=center>
|
||||
Straße, Nr.
|
||||
</td>
|
||||
<td colspan=2 align=left>
|
||||
<input name="nach_ad_street" id="nach_autocomplete" type="text" value="" size="38" maxlength="50" class="input"
|
||||
tabindex="<?php echo $_nach_ad_street_tabindex_;?>" onchange="parent.frames[2].saveFormFields()">
|
||||
<input name="nach_tr_hsno" type="text" value="" size="3" maxlength="10" class="input"
|
||||
tabindex="<?php echo $_nach_tr_hsno_tabindex_;?>" onchange="parent.frames[2].saveFormFields()">
|
||||
<input type="button" name="nachAdressButton" value="..."
|
||||
class="button_enabled"
|
||||
tabindex="<?php echo $_nachAdressButton_tabindex_;?>" title="Suchen: nach Adresse (alt+<?php echo $_nachAdressButton_accesskey_;?>)" accesskey="<?php echo $_nachAdressButton_accesskey_;?>" onclick="parent.frames[2].searchAddress(1);">
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td colspan=4 align=right>
|
||||
<?php echo $CUSTOMER_DISABLED_START;?>
|
||||
<input type="button" name="von_tr_mediationarea_id_Button" value="Rg.-Plz"
|
||||
class="button_enabled"
|
||||
tabindex="<?php echo $_von_tr_mediationarea_id_Button_tabindex_;?>" title="Abrechnungs-PLZ eingeben" onclick="parent.frames[2].mk_tr_mediationarea_id(0)">
|
||||
<input type="hidden" name="von_tr_mediationarea_id">
|
||||
<?php echo $CUSTOMER_DISABLED_END;?>
|
||||
<select class="input" name="von_ad_country" tabindex="<?php echo $_von_ad_country_tabindex_;?>"
|
||||
onchange="parent.frames[2].saveFormFields()">
|
||||
<?php echo addOptionsFromTable("phoenix_special.country","cou_iso_2","cou_iso_2","cou_iso_2","cou_continent = '1'","DE"); ?>
|
||||
</select>
|
||||
<input name="von_ad_zipcode" type="text" value="" size="7" maxlength="10" class="input"
|
||||
tabindex="<?php echo $_von_ad_zipcode_tabindex_;?>" onchange="parent.frames[2].saveFormFields()">
|
||||
<input name="von_ad_city" type="text" value="" size="26" maxlength="50" class="input"
|
||||
tabindex="<?php echo $_von_ad_city_tabindex_;?>" onchange="parent.frames[2].saveFormFields()">
|
||||
</td>
|
||||
<td align=center>
|
||||
PLZ, Ort
|
||||
</td>
|
||||
<td colspan=2 align=left>
|
||||
<select class="input" name="nach_ad_country" tabindex="<?php echo $_nach_ad_country_tabindex_;?>"
|
||||
onchange="parent.frames[2].saveFormFields()">
|
||||
<?php echo addOptionsFromTable("phoenix_special.country","cou_iso_2","cou_iso_2","cou_iso_2","cou_continent = '1'","DE"); ?>
|
||||
</select>
|
||||
<input name="nach_ad_zipcode" type="text" value="" size="7" maxlength="10" class="input"
|
||||
tabindex="<?php echo $_nach_ad_zipcode_tabindex_;?>" onchange="parent.frames[2].saveFormFields()">
|
||||
<input name="nach_ad_city" type="text" value="" size="26" maxlength="50" class="input"
|
||||
tabindex="<?php echo $_nach_ad_city_tabindex_;?>" onchange="parent.frames[2].saveFormFields()">
|
||||
<?php echo $CUSTOMER_DISABLED_START;?>
|
||||
<input type="button" name="nach_tr_mediationarea_id_Button" value="Rg.-Plz"
|
||||
class="button_enabled"
|
||||
tabindex="<?php echo $_nach_tr_mediationarea_id_Button_tabindex_;?>" title="Abrechnungs-PLZ eingeben" onclick="parent.frames[2].mk_tr_mediationarea_id(1)">
|
||||
<input type="hidden" name="nach_tr_mediationarea_id">
|
||||
<?php echo $CUSTOMER_DISABLED_END;?>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=5 align=right>
|
||||
<input type="button" name="_von_tr_remark_Button" value="..."
|
||||
class="button_enabled"
|
||||
tabindex="<?php echo $_von_tr_remark_Button_tabindex_;?>" title="Bemerkung (alt+<?php echo $_von_tr_remark_Button_accesskey_;?>)" accesskey="<?php echo $_von_tr_remark_Button_accesskey_;?>" onclick="parent.frames[2].mk_tr_remark_Text(0)">
|
||||
<input type="checkbox" name="hide_von_tr_remark" value="1"
|
||||
tabindex="<?php echo $_hide_von_tr_remark_tabindex_;?>" onclick="parent.frames[2].saveFormFields()">
|
||||
<textarea name="von_tr_remark" class="input" tabindex="<?php echo $_von_tr_remark_tabindex_;?>" cols="43" rows="3"
|
||||
onchange="parent.frames[2].saveFormFields()"></textarea>
|
||||
</td>
|
||||
<td align=center>
|
||||
Bemerkung
|
||||
</td>
|
||||
<td colspan=2 align=left>
|
||||
<textarea name="nach_tr_remark" class="input" tabindex="<?php echo $_nach_tr_remark_tabindex_;?>"
|
||||
cols="43" rows="3" onchange="parent.frames[2].saveFormFields()"></textarea>
|
||||
<input type="checkbox" name="hide_nach_tr_remark" value="1"
|
||||
tabindex="<?php echo $_hide_nach_tr_remark_tabindex_;?>" onclick="parent.frames[2].saveFormFields()">
|
||||
<input type="button" name="_nach_tr_remark_Button" value="..."
|
||||
class="button_enabled"
|
||||
tabindex="<?php echo $_nach_tr_remark_Button_tabindex_;?>" title="Bemerkung (alt+<?php echo $_nach_tr_remark_Button_accesskey_;?>)" accesskey="<?php echo $_nach_tr_remark_Button_accesskey_;?>" onclick="parent.frames[2].mk_tr_remark_Text(1)">
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=5 align=right>
|
||||
<input name="von_tr_commission_no" type="text" size="30" maxlength="30" class="input" tabindex="<?php echo $_von_tr_commission_no_tabindex_;?>" title="Erscheint im Rechnungstext" onchange="parent.frames[2].saveFormFields()">
|
||||
</td>
|
||||
<td align=center>
|
||||
Ko.-Nr.
|
||||
</td>
|
||||
<td colspan=2 align=left>
|
||||
<input name="nach_tr_commission_no" type="text" size="30" maxlength="30" class="input" tabindex="<?php echo $_nach_tr_commission_no_tabindex_;?>" title="Erscheint im Rechnungstext" onchange="parent.frames[2].saveFormFields()">
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="tr_tracking_row" style="visibility:collapse">
|
||||
<td colspan=5 align=right id="tr_tracking_von" style="visibility:collapse">
|
||||
<input name="von_tr_tracking" type="text" size="43" maxlength="60" class="input" tabindex="<?php echo $_von_tr_tracking_tabindex_;?>" onchange="parent.frames[2].saveFormFields()">
|
||||
</td>
|
||||
<td align=center>
|
||||
Tracking-eMail
|
||||
</td>
|
||||
<td colspan=5 align=left id="tr_tracking_nach" style="visibility:collapse">
|
||||
<input name="nach_tr_tracking" type="text" size="43" maxlength="60" class="input" tabindex="<?php echo $_nach_tr_tracking_tabindex_;?>" onchange="parent.frames[2].saveFormFields()">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span class="verysmall"> </span>
|
||||
</td>
|
||||
<td align=center>
|
||||
<button name="prevButton" type="button" value="zurück" style="height: 20px;"
|
||||
class="button_disabled"
|
||||
tabindex="<?php echo $_prevButton_tabindex_;?>" onClick="parent.frames[2].prevTour()" title="zurück (alt+<?php echo $_prevButton_accesskey_;?>)" accesskey="<?php echo $_prevButton_accesskey_;?>" disabled>
|
||||
<img name="prev_gif" src="../images/prev_dis.gif" height="10" width="26" border="0">
|
||||
</button>
|
||||
</td>
|
||||
<td align=center>
|
||||
|
||||
<button name="waste1Button" type="button" value="löschen" style="height: 20px;"
|
||||
class="button_enabled"
|
||||
tabindex="<?php echo $_waste1Button_tabindex_;?>" onClick="parent.frames[2].delTour(0)" title="links löschen (alt+<?php echo $_waste1Button_accesskey_;?>)" accesskey="<?php echo $_waste1Button_accesskey_;?>">
|
||||
<img name="waste_left_gif" src="../images/waste.png" border=0 height=16 width=16>
|
||||
</button>
|
||||
|
||||
</td>
|
||||
<td align=right colspan=2>
|
||||
<?php echo $PHOTO_DISABLED_START;?>
|
||||
<input type="checkbox" name="tr_photo_von" value="1"
|
||||
tabindex="<?php echo $_tr_photo_von_tabindex_;?>" onclick="parent.frames[2].saveFormFields()"> <span id="span_photo_von">Pflichtfoto</span>
|
||||
<?php echo $PHOTO_DISABLED_END;?>
|
||||
<input type="checkbox" name="tr_ware_from_von" value="1"
|
||||
tabindex="<?php echo $_tr_ware_from_von_tabindex_;?>" onclick="parent.frames[2].saveFormFields()">An
|
||||
<input type="checkbox" name="tr_ware_to_von" value="1"
|
||||
tabindex="<?php echo $_tr_ware_to_von_tabindex_;?>" onclick="parent.frames[2].saveFormFields()">Ab
|
||||
</td>
|
||||
<td align=center>
|
||||
<span class="verysmall"><br></span>
|
||||
<button name="switchButton" type="button" value="vertauschen" style="height: 20px;"
|
||||
class="button_enabled"
|
||||
tabindex="<?php echo $_switchButton_tabindex_;?>" onClick="parent.frames[2].switchJobList()" title="vertauschen (alt+<?php echo $_switchButton_accesskey_;?>)" accesskey="<?php echo $_switchButton_accesskey_;?>">
|
||||
<img name="switch_gif" src="../images/switch.gif" height="10" width="26" border="0">
|
||||
</button>
|
||||
</td>
|
||||
<td align=left colspan=2>
|
||||
<input type="checkbox" name="tr_ware_from_nach" value="1"
|
||||
tabindex="<?php echo $_tr_ware_from_nach_tabindex_;?>" onclick="parent.frames[2].saveFormFields()">An
|
||||
<input type="checkbox" name="tr_ware_to_nach" value="1"
|
||||
tabindex="<?php echo $_tr_ware_to_nach_tabindex_;?>" onclick="parent.frames[2].saveFormFields()">Ab
|
||||
|
||||
<?php echo $PHOTO_DISABLED_START;?>
|
||||
<input type="checkbox" name="tr_photo_nach" value="1"
|
||||
tabindex="<?php echo $_tr_photo_nach_tabindex_;?>" onclick="parent.frames[2].saveFormFields()"> <span id="span_photo_nach">Pflichtfoto</span>
|
||||
<?php echo $PHOTO_DISABLED_END;?>
|
||||
</td>
|
||||
<td align=center>
|
||||
|
||||
<button name="waste2Button" type="button" value="löschen" style="height: 20px;"
|
||||
class="button_enabled"
|
||||
tabindex="<?php echo $_waste2Button_tabindex_;?>" onClick="parent.frames[2].delTour(1)" title="rechts löschen (alt+<?php echo $_waste2Button_accesskey_;?>)" accesskey="<?php echo $_waste2Button_accesskey_;?>">
|
||||
<img name="waste_right_gif" src="../images/waste.png" border=0 height=16 width=16>
|
||||
</button>
|
||||
|
||||
</td>
|
||||
<td align=center>
|
||||
<button name="nextButton" type="button" value="vor" style="height: 20px;"
|
||||
class="button_enabled"
|
||||
tabindex="<?php echo $_nextButton_tabindex_;?>" onClick="parent.frames[2].nextTour()" title="vor (alt+<?php echo $_nextButton_accesskey_;?>)" accesskey="<?php echo $_nextButton_accesskey_;?>">
|
||||
<img name="next_gif" src="../images/next.gif" height=10 width=26 border=0>
|
||||
</button>
|
||||
</td>
|
||||
<td>
|
||||
<span class="verysmall"> </span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td colspan=9>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height=10>
|
||||
|
||||
</td>
|
||||
<td align=left valign=top colspan=3>
|
||||
<table border=0 width=100% align=center cellspacing=0 cellpadding=0 vspace=0 hspace=0>
|
||||
<tr>
|
||||
<td height=40>
|
||||
<input type="checkbox" name="accept_all_addresses" value="1" tabindex="<?php echo $_accept_all_addresses_tabindex_;?>"
|
||||
onclick="parent.frames[2].checkAccept_all_addresses()" title="Adressen ungeprüft übernehmen (alt+<?php echo $_accept_all_addresses_accesskey_;?>)"
|
||||
accesskey="<?php echo $_accept_all_addresses_accesskey_;?>">
|
||||
Adressen ungeprüft übernehmen
|
||||
</td>
|
||||
<td align=right>
|
||||
<div id="div_jb_cashpayer_mail" style="display: none; margin:0; padding:0; border: 0px solid green;">
|
||||
<?php echo $JB_CASHPAYER_MAIL_DISABLED_START;?>
|
||||
<?php echo $cs_jbstatusmailstr;?> an:
|
||||
<input name="jb_cashpayer_mail" type="text" size="27" class="input" tabindex="<?php echo $_jb_cashpayer_mail_tabindex_;?>" onchange="parent.frames[2].saveEmailAddress()">
|
||||
<?php echo $JB_CASHPAYER_MAIL_DISABLED_END;?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2>
|
||||
<input type="button" name="searchOldJobButton" value="Suche Job(s)"
|
||||
class="button_enabled"
|
||||
tabindex="<?php echo $_searchOldJobButton_tabindex_;?>" title="Suchen: nach Jobs" onclick="parent.frames[2].searchJbList()">
|
||||
|
||||
<input type="button" name="duplicateJobButton" value="Kopieren"
|
||||
class="button_disabled"
|
||||
tabindex="<?php echo $_duplicateJobButton_tabindex_;?>" title="Auftrag kopieren (alt+<?php echo $_duplicateJobButton_accesskey_;?>)" accesskey="<?php echo $_duplicateJobButton_accesskey_;?>" onclick="parent.frames[2].duplicateJob()" disabled>
|
||||
<?php echo $EMP_MODE_LATERJOB_START;?>
|
||||
|
||||
<input type="button" name="getLastJobButton" value="Letzter Auftrag"
|
||||
class="button_enabled"
|
||||
tabindex="<?php echo $_duplicateJobButton_tabindex_;?>" title="Letzten Auftrag kopieren" onclick="parent.frames[2].getLastJob()">
|
||||
<?php echo $EMP_MODE_LATERJOB_END;?>
|
||||
<div id="div_optimize" style="float:right;display:none">
|
||||
<input type="button" name="OptimizeButton" value="Optimieren"
|
||||
class="button_enabled"
|
||||
title="Optimieren" accesskey="" onclick="javascript:parent.frames[2].openDistanceprice('optimize');">
|
||||
<input type="checkbox" name="dont_optimize_last" value="1" tabindex="" title="Endstation bleibt bei der Optimierung bestehen" checked
|
||||
accesskey="<?php echo $_accept_all_addresses_accesskey_;?>"> außer Endstation
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td colspan=3 valign=top>
|
||||
<table border=0 width=100% align=center cellspacing=0 cellpadding=0 vspace=0 hspace=0>
|
||||
<tr>
|
||||
<td align=right width=35%>
|
||||
<?php echo $CUSTOMER_DISABLED_START;?>
|
||||
<input type="radio" name="payer_from" value="von" class="input"
|
||||
tabindex="<?php echo $_payer_from_tabindex_;?>" onclick="parent.frames[2].checkPayer(0)">
|
||||
<?php echo $CUSTOMER_DISABLED_END;?>
|
||||
</td>
|
||||
<td align=center width=30%>
|
||||
<?php echo $CUSTOMER_DISABLED_START;?>
|
||||
<?php echo $PAYER_TEXT;?>
|
||||
<?php echo $CUSTOMER_DISABLED_END;?>
|
||||
</td>
|
||||
<td align=left width=35%>
|
||||
<?php echo $CUSTOMER_DISABLED_START;?>
|
||||
<input type="radio" name="payer_to" value="nach" class="input"
|
||||
tabindex="<?php echo $_payer_to_tabindex_;?>" onclick="parent.frames[2].checkPayer(1)">
|
||||
<?php echo $CUSTOMER_DISABLED_END;?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=3 align=center><br>
|
||||
<?php echo $CUSTOMER_DISABLED_START;?>
|
||||
<input type="radio" name="jb_cash" value="1"
|
||||
tabindex="<?php echo $_jb_cash_tabindex_;?>" title="Barzahlung (alt+<?php echo $_jb_cash_accesskey_;?>)" accesskey="<?php echo $_jb_cash_accesskey_;?>" onclick="parent.frames[2].checkCash(true)">
|
||||
Barzahlung
|
||||
<input type="radio" name="jb_costsplit" value="1"
|
||||
tabindex="<?php echo $_jb_costsplit_tabindex_;?>" title="<?php echo $COSTSPLIT_TITLE;?> (alt+<?php echo $_jb_costsplit_accesskey_;?>)" accesskey="<?php echo $_jb_costsplit_accesskey_;?>" onclick="parent.frames[2].checkCostsplit(true)">
|
||||
<?php echo $COSTSPLIT_TEXT;?>
|
||||
<?php echo $CUSTOMER_DISABLED_END;?>
|
||||
<input type="button" name="jb_freetextButton" value="Text"
|
||||
class="button_enabled"
|
||||
tabindex="<?php echo $_jb_freetextButton_tabindex_;?>" title="Rechnungstext (alt+<?php echo $_jb_freetextButton_accesskey_;?>)" accesskey="<?php echo $_jb_freetextButton_accesskey_;?>" onclick="parent.frames[2].mkRechnungsText('normal')">
|
||||
|
||||
<div id="div_jb_hiddenFreetextButton" style="display:none">
|
||||
<input type="button" name="jb_hiddenFreetextButton" value="Text nur Rg"
|
||||
class="button_enabled"
|
||||
tabindex="<?php echo $_jb_hiddenFreetextButton_tabindex_;?>" title="Rechnungstext nur für den Rechnungsempfänger" onclick="parent.frames[2].mkRechnungsText('hidden')">
|
||||
|
||||
</div>
|
||||
<?php echo $MASK_CUSTOMER_PRICEQUERY_DISABLED_START;?>
|
||||
<input type="button" name="jb_priceQueryButton" value="Preisanfrage"
|
||||
class="button_enabled"
|
||||
tabindex="" title="Rechnungstext (alt+)" accesskey="" onclick="parent.frames[2].mkPriceQuery()">
|
||||
|
||||
<?php echo $MASK_CUSTOMER_PRICEQUERY_DISABLED_END;?>
|
||||
<?php echo $CUSTOMER_DISABLED_START;?>
|
||||
<input type="button" name="jb_dispoInfoButton" value="Dispo Info"
|
||||
class="button_enabled"
|
||||
tabindex="" title="Dispo Info" accesskey="" onclick="parent.frames[2].mkDispoInfo()">
|
||||
|
||||
<?php echo $CUSTOMER_DISABLED_END;?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td align=left valign=top colspan=3>
|
||||
<table border = 1 align=center cellspacing=0 cellpadding=0 vspace=0 hspace=0>
|
||||
<tr><td valign=center>
|
||||
<table border=0 width=100% align=center cellspacing=0 cellpadding=0 vspace=0 hspace=0>
|
||||
<tr><td valign=center align=left>
|
||||
Standardpreis:
|
||||
</td><td valign=center align=right>
|
||||
<input name="currentPrice" type="text" value="" size="23" maxlength="23" class="hideRed" readonly>
|
||||
</td></tr>
|
||||
<?php echo (MASK_CR_PRICE_MODE == "1" ? "" : "<!--");?>
|
||||
<tr><td valign=center align=left>
|
||||
Standard-Frachtverg.:
|
||||
</td><td valign=center align=right>
|
||||
<input name="currentCrPrice" type="text" value="" size="23" maxlength="23" class="hideRed" readonly>
|
||||
</td></tr>
|
||||
<?php echo (MASK_CR_PRICE_MODE == "1" ? "" : "-->");?>
|
||||
<tr><td valign=top align=left>
|
||||
<i><a href="javascript:parent.frames[2].openDistanceprice();">Kilometerpreis:</a></i><br>
|
||||
</td><td valign=center align=left>
|
||||
<div id="div_distanceprice"></div>
|
||||
</td></tr>
|
||||
<tr id="tr_zoneprice" style="visibility:collapse"><td valign=top align=left>
|
||||
<i><a href="javascript:parent.frames[2].openDistanceprice('zone');">PZM-Preis:</a></i><br>
|
||||
</td><td valign=center align=left>
|
||||
<div id="div_zoneprice"></div>
|
||||
</td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>
|
||||
<table border=0 width=100% align=center cellspacing=0 cellpadding=0 vspace=0 hspace=0>
|
||||
<tr><td valign=center align=left>
|
||||
Rechnung an:<br>
|
||||
<div id="maskDisplayBerichteButton" name="maskDisplayBerichteButton" style="float:left">
|
||||
<input type="button" name="BerichteButton" value="[B]"
|
||||
class="button_enabled"
|
||||
tabindex="<?php echo $_Berichte_tabindex_;?>" title="Berichte" accesskey="" onclick="parent.frames[2].getReports()">
|
||||
</div>
|
||||
<div id="maskDisplayDokumenteButton" name="maskDisplayDokumenteButton" style="float:left">
|
||||
<input type="button" name="DokumenteButton" value="[D]"
|
||||
class="button_enabled"
|
||||
tabindex="<?php echo $_Dokumente_tabindex_;?>" title="Dokumente" accesskey="" onclick="parent.frames[2].getDocuments()">
|
||||
</div>
|
||||
<input name="nameOfPayer" type="text" value="" size="25" maxlength="25" class="hideRed" readonly>
|
||||
<?php echo $CUSTOMER_DISABLED_START;?>
|
||||
<input type="button" name="bezahlerFirmaButton" value="..."
|
||||
class="button_enabled"
|
||||
tabindex="<?php echo $_bezahlerFirmaButton_tabindex_;?>" title="Suchen: Drittzahler (alt+<?php echo $_bezahlerFirmaButton_accesskey_;?>)" accesskey="<?php echo $_bezahlerFirmaButton_accesskey_;?>" onclick="parent.frames[2].searchCsCsc(2)">
|
||||
<?php echo $CUSTOMER_DISABLED_END;?>
|
||||
</td></tr>
|
||||
<tr><td valign=bottom align=left>
|
||||
Rechnungs-Email:
|
||||
<img name="info_svg" src="../images/Info_i_yellow.svg" height=12 border=0 alt="info" title="Gemäß Wachstumschancengesetz vom 27.3.2024 (BGBl 2024 I Nr. 108) sind wir zum digitalen Rechnungsversand im B2B - Bereich verpflichtet.">
|
||||
<br>
|
||||
<input name="invmailOfPayer" type="text" value="" size="25" maxlength="200" class="hideRed" onchange="parent.frames[2].saveInvmail()" readonly>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td height=10>
|
||||
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td colspan=9>
|
||||
<table border=0 width=100% align=center cellspacing=0 cellpadding=0 vspace=0 hspace=0>
|
||||
<td align=center valign=top>
|
||||
<div id="von_cmp_remark_div" style="width: 50em; border-style:none;"> </div>
|
||||
</td>
|
||||
<td align=center valign=top>
|
||||
<div id="dritt_cmp_remark_div" style="width: 50em; border-style:none;"> </div>
|
||||
</td>
|
||||
<td align=center valign=top>
|
||||
<div id="nach_cmp_remark_div" style="width: 50em; border-style:none;"> </div>
|
||||
</td>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
<?php
|
||||
echo "document.getElementById('tr_zoneprice').style.visibility = 'visible';\n";
|
||||
?>
|
||||
job_tour_isLoading=false;
|
||||
-->
|
||||
</script>
|
||||
@@ -0,0 +1,44 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>Mi2ju: 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,43 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>AUFTRAGSERFASSUNG: TOURENDATEN</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/phoenix.css.php">
|
||||
</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>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* job_unlock.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
//require_once("../PEAR/HTML/Template/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 HTML_Template_IT();
|
||||
//$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,191 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Upload Manager - Simple Buttons</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
||||
background: #f5f5f5;
|
||||
padding: 50px;
|
||||
text-align: center;
|
||||
}
|
||||
.buttons {
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
gap: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.btn {
|
||||
padding: 15px 30px;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
border: none;
|
||||
border-radius: 12px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
justify-content: center;
|
||||
}
|
||||
.btn-upload {
|
||||
background: #4a90d9;
|
||||
color: white;
|
||||
}
|
||||
.btn-upload:hover {
|
||||
background: #357abd;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
.btn-manager {
|
||||
background: #6c5ce7;
|
||||
color: white;
|
||||
}
|
||||
.btn-manager:hover {
|
||||
background: #5a4bd1;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
.um-widget-modal {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 99999;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-family: inherit;
|
||||
}
|
||||
.um-widget-backdrop {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
.um-widget-content {
|
||||
position: relative;
|
||||
width: 90%;
|
||||
max-width: 700px;
|
||||
max-height: 90vh;
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
.um-widget-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
border-bottom: 1px solid #eee;
|
||||
background: #fafbfc;
|
||||
}
|
||||
.um-widget-title {
|
||||
margin: 0;
|
||||
font-size: 1.2rem;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
.um-widget-close {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #666;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.um-widget-close:hover {
|
||||
background: #eee;
|
||||
color: #333;
|
||||
}
|
||||
.um-widget-iframe {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
border: none;
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
body { padding: 20px; }
|
||||
.um-widget-iframe { height: 70vh; }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="buttons">
|
||||
<h1>📁 Upload Manager</h1>
|
||||
|
||||
<button class="btn btn-upload" onclick="openUploadModal()">
|
||||
📤 Dateien hochladen
|
||||
</button>
|
||||
|
||||
<button class="btn btn-manager" onclick="openManagerModal()">
|
||||
📋 Dateien verwalten
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const UPLOAD_SERVER = 'https://uplman.assecutor.net'; // Dein Server!
|
||||
|
||||
function openUploadModal() {
|
||||
openModal('index.php?type=job');
|
||||
}
|
||||
|
||||
function openManagerModal() {
|
||||
openModal('manager.php?type=job&allowDelete=true&allowDownload=true');
|
||||
}
|
||||
|
||||
function openModal(pageUrl) {
|
||||
// Altes Modal schließen
|
||||
const existing = document.querySelector('.um-widget-modal');
|
||||
if (existing) existing.remove();
|
||||
|
||||
// Neues Modal erstellen
|
||||
const modal = document.createElement('div');
|
||||
modal.className = 'um-widget-modal';
|
||||
modal.innerHTML = `
|
||||
<div class="um-widget-backdrop"></div>
|
||||
<div class="um-widget-content">
|
||||
<div class="um-widget-header">
|
||||
<h3 class="um-widget-title">${pageUrl.includes('index.php') ? 'Dateien hochladen' : 'Dateien verwalten'}</h3>
|
||||
<button class="um-widget-close" onclick="this.closest('.um-widget-modal').remove()">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<line x1="18" y1="6" x2="6" y2="18"></line>
|
||||
<line x1="6" y1="6" x2="18" y2="18"></line>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<iframe class="um-widget-iframe" src="${UPLOAD_SERVER}/${pageUrl}"></iframe>
|
||||
</div>
|
||||
`;
|
||||
|
||||
document.body.appendChild(modal);
|
||||
|
||||
// ESC zum Schließen
|
||||
const escHandler = (e) => {
|
||||
if (e.key === 'Escape') modal.remove();
|
||||
};
|
||||
document.addEventListener('keydown', escHandler);
|
||||
|
||||
// Cleanup bei Schließen
|
||||
modal.addEventListener('click', (e) => {
|
||||
if (e.target.classList.contains('um-widget-backdrop')) modal.remove();
|
||||
});
|
||||
modal.addEventListener('remove', () => {
|
||||
document.removeEventListener('keydown', escHandler);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,450 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* price_query.php
|
||||
*
|
||||
* Autor: Carsten Annacker
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
include_once("../include/auth.inc.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, $markup, $job_hq_id) =
|
||||
getHttpVars(array("zipcode1", "zipcode2", "zipcode3", "zipcode4", "zipcode5", "zipcode6", "vht_id", "jb_markup", "job_hq_id"));
|
||||
//if ($zipcode1 == "" || $zipcode2 == "" || $vht_id == "") reportDie ("$PHP_SELF: Parameter fehlt!", false);
|
||||
|
||||
if ($job_hq_id != "")
|
||||
$hq_id = $job_hq_id;
|
||||
|
||||
// Der Normalfall
|
||||
$cs_invmode_default = -1;
|
||||
// Besonderheit in Berlin: Zuerst Bereichs-Preise ermitteln ...
|
||||
if ($hq_id == 3):
|
||||
$cs_invmode_default = 2;
|
||||
endif;
|
||||
|
||||
// Treibstoffzuschlag
|
||||
$srvt_name = $db->getOne(
|
||||
"SELECT mt_value FROM metatype WHERE mt_sort = '$vht_id' AND mt_type = 'vehicletype'");
|
||||
$today = getdate();
|
||||
$jb_ordertime = $today['year'] . "-" . $today['mon'] . "-" . $today['mday'] . " "
|
||||
. $today['hours'] . ":" . $today['minutes'] . ":" . $today['seconds'];
|
||||
|
||||
$fuel_markup = str_replace(",", ".", $markup);
|
||||
if ($fuel_markup == ""):
|
||||
$fuel_markup = getFuelMarkup($srvt_name, 0, $hq_id, $jb_ordertime);
|
||||
endif;
|
||||
//echo "'$srvt_name, 0, $hq_id, $jb_ordertime'<b>";
|
||||
//echo "'$fuel_markup'";
|
||||
$grundpreis = 0;
|
||||
list($tmpGrundpreis, $plzpreis1) = getPrice($zipcode1, $zipcode2, $cs_invmode_default, $fuel_markup);
|
||||
if ($tmpGrundpreis > 0) $grundpreis = $tmpGrundpreis;
|
||||
list($tmpGrundpreis, $plzpreis2) = getPrice($zipcode2, $zipcode3, $cs_invmode_default, $fuel_markup);
|
||||
if ($tmpGrundpreis > 0) $grundpreis = $tmpGrundpreis;
|
||||
list($tmpGrundpreis, $plzpreis3) = getPrice($zipcode3, $zipcode4, $cs_invmode_default, $fuel_markup);
|
||||
if ($tmpGrundpreis > 0) $grundpreis = $tmpGrundpreis;
|
||||
list($tmpGrundpreis, $plzpreis4) = getPrice($zipcode4, $zipcode5, $cs_invmode_default, $fuel_markup);
|
||||
if ($tmpGrundpreis > 0) $grundpreis = $tmpGrundpreis;
|
||||
list($tmpGrundpreis, $plzpreis5) = getPrice($zipcode5, $zipcode6, $cs_invmode_default, $fuel_markup);
|
||||
if ($tmpGrundpreis > 0) $grundpreis = $tmpGrundpreis;
|
||||
|
||||
$fullprice = $grundpreis + $plzpreis1 + $plzpreis2 + $plzpreis3 + $plzpreis4 + $plzpreis5;
|
||||
|
||||
$valign = "center";
|
||||
|
||||
$area_names1 = "";
|
||||
$area_names2 = "";
|
||||
$area_names3 = "";
|
||||
$area_names4 = "";
|
||||
$area_names5 = "";
|
||||
|
||||
$area_price1 = "";
|
||||
$area_price2 = "";
|
||||
$area_price3 = "";
|
||||
$area_price4 = "";
|
||||
$area_price5 = "";
|
||||
|
||||
$area_fullprice = "";
|
||||
|
||||
// ... dann PLZ-Preise ermitteln!
|
||||
if ($hq_id == 3):
|
||||
$valign = "bottom";
|
||||
|
||||
$area_name1 = getAreaName($zipcode1);
|
||||
$area_name2 = getAreaName($zipcode2);
|
||||
$area_name3 = getAreaName($zipcode3);
|
||||
$area_name4 = getAreaName($zipcode4);
|
||||
$area_name5 = getAreaName($zipcode5);
|
||||
$area_name6 = getAreaName($zipcode6);
|
||||
|
||||
$area_names1 = "<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, $fuel_markup);
|
||||
list($tmpGrundpreis, $area_price2) = getPrice($zipcode2, $zipcode3, 1, $fuel_markup);
|
||||
list($tmpGrundpreis, $area_price3) = getPrice($zipcode3, $zipcode4, 1, $fuel_markup);
|
||||
list($tmpGrundpreis, $area_price4) = getPrice($zipcode4, $zipcode5, 1, $fuel_markup);
|
||||
list($tmpGrundpreis, $area_price5) = getPrice($zipcode5, $zipcode6, 1, $fuel_markup);
|
||||
|
||||
$area_fullprice = $grundpreis + $area_price1 + $area_price2 + $area_price3 + $area_price4 + $area_price5;
|
||||
endif;
|
||||
|
||||
$popupWinCode1 =str_replace("\"", "\\\"", str_replace("\n", "\\n",
|
||||
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n" .
|
||||
"<html lang=\"de\">\n" .
|
||||
"<head>\n" .
|
||||
"<title>votian: Eingabe der Abrechnungs-PLZ<\/title>\n" .
|
||||
"<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/phoenix.css.php\">\n" .
|
||||
"<script type=\"text/javascript\">\n" .
|
||||
"<!" . "--\n" .
|
||||
"\n" .
|
||||
"var caller = "));
|
||||
$popupWinCode2 =str_replace("\"", "\\\"", str_replace("\n", "\\n",
|
||||
";\n" .
|
||||
"\n" .
|
||||
"function doFocus(){\n" .
|
||||
"while (typeof(document.forms[0].tr_mediationarea_id) == 'undefined');\n" .
|
||||
// " document.forms[1].saveButton.focus();\n" .
|
||||
" document.forms[0].tr_mediationarea_id.focus();\n" .
|
||||
"}\n" .
|
||||
"\n" .
|
||||
"function doSave(){\n" .
|
||||
" switch (caller)\n" .
|
||||
" {\n" .
|
||||
" case 1:\n" .
|
||||
" opener.document.forms[0].zipcode1.value = document.forms[0].tr_mediationarea_id.value;\n" .
|
||||
" break;\n" .
|
||||
" case 2:\n" .
|
||||
" opener.document.forms[0].zipcode2.value = document.forms[0].tr_mediationarea_id.value;\n" .
|
||||
" break;\n" .
|
||||
" case 3:\n" .
|
||||
" opener.document.forms[0].zipcode3.value = document.forms[0].tr_mediationarea_id.value;\n" .
|
||||
" break;\n" .
|
||||
" case 4:\n" .
|
||||
" opener.document.forms[0].zipcode4.value = document.forms[0].tr_mediationarea_id.value;\n" .
|
||||
" break;\n" .
|
||||
" case 5:\n" .
|
||||
" opener.document.forms[0].zipcode5.value = document.forms[0].tr_mediationarea_id.value;\n" .
|
||||
" break;\n" .
|
||||
" case 6:\n" .
|
||||
" opener.document.forms[0].zipcode6.value = document.forms[0].tr_mediationarea_id.value;\n" .
|
||||
" break;\n" .
|
||||
" default:\n" .
|
||||
" break;\n" .
|
||||
" } \n" .
|
||||
" opener.updatePrice(0);\n" .
|
||||
" self.close();\n" .
|
||||
"}\n" .
|
||||
"\n" .
|
||||
"//--" . ">\n" .
|
||||
"<\/script>\n" .
|
||||
"<\/head>\n" .
|
||||
"<body onload=\"doFocus()\">\n" .
|
||||
" <table border=0 align=center height=100% cellspacing=0 cellpadding=0 vspace=0 hspace=0>\n" .
|
||||
" <tr>\n" .
|
||||
" <td align=center valign=top>\n" .
|
||||
"<form action=\"../jobs/price_query.php\" method=\"get\">\n" .
|
||||
"<select name=\"tr_mediationarea_id\" class=\"input\">\n"));
|
||||
$popupWinCode3 = str_replace("\"", "\\\"", str_replace("\n", "\\n",
|
||||
"\n</select>\n" .
|
||||
"</form>\n" .
|
||||
"<form action=\"../jobs/price_query.php\" method=\"get\">\n" .
|
||||
"<input type=\"button\" class=\"button_enabled\" name=\"cancelButton\" value=\"Abbrechen\" onClick=\"self.close()\" accesskey=\"a\"> \n" .
|
||||
"<input type=\"button\" class=\"button_enabled\" name=\"saveButton\" value=\"Übernehmen\" onClick=\"doSave()\" accesskey=\"s\"> \n" .
|
||||
"</form>\n" .
|
||||
" <\/td>\n" .
|
||||
" <\/tr>\n" .
|
||||
" <\/table>\n" .
|
||||
"<\/body>\n" .
|
||||
"<\/html>\n"));
|
||||
|
||||
echo
|
||||
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n" .
|
||||
"<html lang=\"de\">\n" .
|
||||
"<head>\n" .
|
||||
"<title>votian: Preisanfrage</title>\n" .
|
||||
"<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/phoenix.css.php\">\n" .
|
||||
"<script src=\"job_options_$hq_id.js\" type=\"text/javascript\"></script>" .
|
||||
"<script type=\"text/javascript\">\n" .
|
||||
"<!" . "--\n" .
|
||||
"var curZipcode = \"\";\n" .
|
||||
"var popupWinCode1 = \"" . $popupWinCode1 . "\";\n" .
|
||||
"var popupWinCode2 = \"" . $popupWinCode2 . "\";\n" .
|
||||
"var popupWinCode3 = \"" . $popupWinCode3 . "\";\n" .
|
||||
"var popupWinCode = \"\";\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(caller){\n" .
|
||||
" var doIt = true;\n" .
|
||||
"\n" .
|
||||
" if (caller > 0 && caller < 7) {\n" .
|
||||
" if (check_tr_mediationarea_id(caller))\n" .
|
||||
" doIt = false; \n" .
|
||||
" }\n" .
|
||||
" if (document.forms[0].zipcode1.value != '' && document.forms[0].zipcode2.value != '' && doIt)\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 + \"&jb_markup=\" + document.forms[0].markup.value;\n" .
|
||||
"}\n" .
|
||||
"function check_tr_mediationarea_id(caller)\n" .
|
||||
"{\n" .
|
||||
" var zipcode = \"\";\n" .
|
||||
"\n" .
|
||||
" switch (caller) {\n" .
|
||||
" case 1:\n" .
|
||||
" zipcode = document.forms[0].zipcode1.value;\n" .
|
||||
" break;\n" .
|
||||
" case 2:\n" .
|
||||
" zipcode = document.forms[0].zipcode2.value;\n" .
|
||||
" break;\n" .
|
||||
" case 3:\n" .
|
||||
" zipcode = document.forms[0].zipcode3.value;\n" .
|
||||
" break;\n" .
|
||||
" case 4:\n" .
|
||||
" zipcode = document.forms[0].zipcode4.value;\n" .
|
||||
" break;\n" .
|
||||
" case 5:\n" .
|
||||
" zipcode = document.forms[0].zipcode5.value;\n" .
|
||||
" break;\n" .
|
||||
" case 6:\n" .
|
||||
" zipcode = document.forms[0].zipcode6.value;\n" .
|
||||
" break;\n" .
|
||||
" default:\n" .
|
||||
" return;\n" .
|
||||
" }\n" .
|
||||
" for (i = 0; i < fz.length; i++)\n" .
|
||||
" {\n" .
|
||||
" if (fz[i][0] == zipcode)\n" .
|
||||
" {\n" .
|
||||
" mk_tr_mediationarea_id(caller, zipcode);\n" .
|
||||
" return true;\n" .
|
||||
" }\n" .
|
||||
" }\n" .
|
||||
" return false;\n" .
|
||||
"}\n" .
|
||||
"\n" .
|
||||
"function mk_tr_mediationarea_id(caller, zipcode) {\n" .
|
||||
" var widthPopupWin = 400;\n" .
|
||||
" var heightPopupWin = 75;\n" .
|
||||
" var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;\n" .
|
||||
" var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;\n" .
|
||||
" var popupWin;\n" .
|
||||
"\n" .
|
||||
" var tr_mediationarea_id_options = \"\"; /* \"<option value=\"\"> </option>\n\"; */\n" .
|
||||
" for (i = 0; i < fz.length; i++)\n" .
|
||||
" {\n" .
|
||||
" if (fz[i][0] == zipcode)\n" .
|
||||
" {\n" .
|
||||
" tr_mediationarea_id_options += \"<option \";\n" .
|
||||
// " if (zipcode == fz[i][1])\n" .
|
||||
// " tr_mediationarea_id_options += \"selected \";\n" .
|
||||
" tr_mediationarea_id_options += \" value=\\\"\" + fz[i][1] + \"\\\">\" + fz[i][1] + \" (\" + fz[i][3] + \")</option>\\n\";\n" .
|
||||
" }\n" .
|
||||
" }\n" .
|
||||
" popupWin=window.open(\"about:blank\", \"\",\n" .
|
||||
" \"dependent=yes,width=\" + widthPopupWin + \",height=\" + heightPopupWin +\n" .
|
||||
" \",left=\" + leftPopupWin + \",top=\" + topPopupWin);\n" .
|
||||
" popupWin.document.open();\n" .
|
||||
" popupWinCode = popupWinCode1 + caller + popupWinCode2 + tr_mediationarea_id_options + popupWinCode3;\n" .
|
||||
" popupWin.document.writeln(popupWinCode);\n" .
|
||||
" popupWin.document.close();\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(1)\" onFocus=\"curZipcode='price_query1'\">\n" .
|
||||
" NACH PLZ <input name=\"zipcode2\" type=\"text\" value=\"" . $zipcode2 . "\" size=\"5\" maxlength=\"5\" class=\"input\"\n" .
|
||||
" onchange=\"updatePrice(2)\" 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(3)\" 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(4)\" 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(5)\" 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(6)\" 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(7)\">\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" .
|
||||
" Treibstoffzuschlag: " .
|
||||
"<input name=\"markup\" type=\"text\" value=\"" . str_replace(".", ",", sprintf("%01.2f", $fuel_markup)) . "\" size=\"3\" maxlength=\"5\" class=\"input\"\n" .
|
||||
" onchange=\"updatePrice(0)\">%\n" .
|
||||
" <br><br></td><td align=right valign=$valign>\n" .
|
||||
"<br>" .
|
||||
|
||||
" </td></tr><tr><td align=right valign=center>\n" .
|
||||
"<b>Gesamtpreis: </b>" .
|
||||
" <br>" .
|
||||
($fuel_markup <> 0 ? "<i>(incl. " . str_replace(".", ",", sprintf("%01.2f", $fuel_markup)) . " % Treibstoffzuschlag)</i>" : "") .
|
||||
"<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\" class=\"button_enabled\" value=\"Schließen\" onClick=\"self.close()\" accesskey=\"s\"> \n" .
|
||||
"<input type=\"button\" class=\"button_enabled\" value=\"Rücksetzen\" onClick=\"doDelete()\" accesskey=\"r\"> \n" .
|
||||
"<input type=\"button\" class=\"button_enabled\" 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, $fuel_markup)
|
||||
{
|
||||
global $db, $hq_id, $vht_id, $jb_ordertime;
|
||||
|
||||
if (strlen($zipcode1) == 5 && strlen($zipcode2) == 5 && is_numeric($zipcode1) && is_numeric($zipcode2)):
|
||||
if ($cs_invmode > -1):
|
||||
$cs_id = $cs_invmode * -1;
|
||||
else:
|
||||
$cs_id = 0;
|
||||
endif;
|
||||
// $cs_id decides about invmode
|
||||
// if 0, then default invmode from hq_id is taken
|
||||
// for Berlin, $cs_id directly takes invmode in negative form (in order to distinguish from ordinary cs_id, that always are postive)
|
||||
// Grundpreis
|
||||
// Servicetype-Name (Fahrrad etc.)
|
||||
$srvt_name = $db->getOne(
|
||||
"SELECT mt_value FROM metatype WHERE mt_sort = '$vht_id' AND mt_type = 'vehicletype'");
|
||||
list ($grundpreis, $fd, $fpm, $customer_specific) =
|
||||
saveServiceCosts("Grundpreis", $srvt_name, $hq_id, $cs_id, 0 /* $jb_id */, 0, $jb_ordertime, 0 /* count */, 1 /* $costsplit_count */, 1 /* $getPriceOnly */, false /* $jb_cash */, "0" /* $csc_id_payer */, 0 /* $jb_storno */, false /* zipcode1 */, false /* zipcode2 */, false, $fuel_markup, $fuel_markup, $vht_id);
|
||||
//$fullPrice += $fp * ((100-$fd)/100);
|
||||
//$discount_sign = ($fd > 0 || $customer_specific || $discount_sign == "*" ? "*" : "");
|
||||
// PLZ-Preis
|
||||
list ($plzpreis, $fd, $fpm, $customer_specific) =
|
||||
saveServiceCosts($zipcode1, $zipcode2, $hq_id, $cs_id, 0 /* $jb_id */, 0, $jb_ordertime, 0 /* count */, 1 /* $costsplit_count */, 1 /* $getPriceOnly */, false /* $jb_cash */, "0" /* $csc_id_payer */, 0 /* $jb_storno */, false /* zipcode1 */, false /* zipcode2 */, true, $fuel_markup, $fuel_markup, $vht_id);
|
||||
//$fullPrice += $fp * ((100-$fd)/100);
|
||||
//$discount_sign = ($fd > 0 || $customer_specific || $discount_sign == "*" ? "*" : "");
|
||||
else:
|
||||
$zipcode1 = "";
|
||||
$zipcode2 = "";
|
||||
$grundpreis = 0;
|
||||
$plzpreis = 0;
|
||||
endif;
|
||||
|
||||
return array($grundpreis, $plzpreis);
|
||||
}
|
||||
|
||||
function formatPrice($thePrice)
|
||||
{
|
||||
if (strlen($thePrice) > 0):
|
||||
return str_replace(".", ",", sprintf("%01.2f", $thePrice)) . " EUR";
|
||||
else:
|
||||
return "";
|
||||
endif;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
// /var/www/html/jobs/save-file-upload.php
|
||||
error_reporting(0);
|
||||
header('Content-Type: application/json');
|
||||
try {
|
||||
include_once("../include/glob_defs.inc.php");
|
||||
|
||||
// Direkte MySQLi-Verbindung
|
||||
$conn = new mysqli($dbhostOnly, $dblogin, $dbpassword, $dbname, $dbport);
|
||||
|
||||
if ($conn->connect_error) {
|
||||
echo json_encode(['success' => false, 'error' => 'DB-Verbindung fehlgeschlagen']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$conn->query('SET NAMES latin1');
|
||||
|
||||
$json = file_get_contents('php://input');
|
||||
$data = json_decode($json, true);
|
||||
|
||||
if (!$data) {
|
||||
echo json_encode(['success' => false, 'error' => 'Keine Daten']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$objType = ($data['upload_type'] != 0) ? 'tr' : 'jb';
|
||||
$referenceId = $conn->real_escape_string($data['reference_id'] ?? '');
|
||||
$filename = $conn->real_escape_string($data['filename'] ?? '');
|
||||
$viewUrl = $conn->real_escape_string($data['view_url'] ?? '');
|
||||
$counter = intval($data['counter'] ?? 0);
|
||||
$remark = $conn->real_escape_string($data['remark'] ?? '');
|
||||
$remark = str_replace('|', ' ', $remark);
|
||||
$context = $conn->real_escape_string($remark . '|' . $viewUrl . '|' . $counter);
|
||||
|
||||
$sql = "INSERT INTO genericdatacontainer
|
||||
(gdc_obj_type, gdc_obj_id, gdc_gen_fieldname, gdc_content, gdc_context)
|
||||
VALUES ('$objType', $referenceId, 'file_upload', '$filename', '$context')";
|
||||
|
||||
$conn->query($sql);
|
||||
|
||||
$insertId = $conn->insert_id;
|
||||
|
||||
$conn->close();
|
||||
|
||||
echo json_encode(['success' => true, 'gdc_id' => $insertId]);
|
||||
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['success' => false, 'error' => $e->getMessage()]);
|
||||
} catch (Error $e) {
|
||||
echo json_encode(['success' => false, 'error' => $e->getMessage()]);
|
||||
}
|
||||
Reference in New Issue
Block a user