'€' function mcStr(&$aStr, $search = ";", $replace = "") { $aStr = str_replace(" ", " ", $aStr); $aStr = str_replace("%u20AC", '€', $aStr); $aStr = str_replace($search, $replace, $aStr); return $aStr; // Optional return value } // Path for download $tempPath = getParameterValue("0", "TEMP_PATH", $hq_id); if ($tempPath == "") : $tempPath = getParameterValue("0", "TEMP_PATH", "0"); endif; if ($tempPath == "") : $tempPath = "../temp/download/"; endif; $numOfRows = 0; $htmlClass01 = "class=\"smaller\""; // input $htmlClass02 = "class=\"f7np1\" style=\"width:100px; height:20px; border-radius: 5px;\""; // select $tableOfRows = ""; $pageHeadline = ""; $outArr2File = array(); $fileExportDelimiter = ";"; // Flag for "show invisible couriers" if ($f_show_invisible == "" || count($f_show_invisible) == 0) : $f_show_invisible = "0"; else: $f_show_invisible = "1"; endif; // Flag for "show invisible INTERNAL couriers" if ($f_show_invisible_internal == "" || count($f_show_invisible_internal) == 0) : $f_show_invisible_internal = "0"; else: $f_show_invisible_internal = "1"; endif; // Flag for contractors if ($f_contractors_only == "" || count($f_contractors_only) == 0) : $f_contractors_only = "0"; else: $f_contractors_only = "1"; endif; // Flag for pda infos if ($f_pda_infos == "" || count($f_pda_infos) == 0) : $f_pda_infos = "0"; else: $f_pda_infos = "1"; endif; // Drop down for devices in VPA infos if (!isset($f_cr_pda_infos_device)) : $f_cr_pda_infos_device = ""; endif; // Check access to CSV export of current courier list if ($fileOutput == "" || count($fileOutput) == 0 || !$empHasAccessCrCsvExport) : $fileOutput = "0"; else : $fileOutput = "1"; endif; // For usage of meta database get connection if requested if ($f_pda_infos == "1") : /* $db_conn = getConnectionToMetaDB("temp","conn_context"); if ($db_conn == "ERR_DB") : // $f_pda_infos = "0"; $statusMessage = getLngt("Die VPA-Informationen können nur partiell abgerufen werden! Bitte kontaktieren Sie den Support!") . " "; endif; */ endif; // Mandator filter if ($f_hq_id == "") : $f_hq_id = array(); endif; if (count($f_hq_id) == 0) : array_push($f_hq_id, $hq_id); endif; mcTrim($f_cr_sid); mcTrim($f_cr_eid); mcTrim($f_cmp_comp); mcTrim($f_cmp_freetext1); mcTrim($f_usr_name); mcTrim($f_usr_firstname); mcTrim($f_usr_phone); mcTrim($f_usr_email); mcTrim($f_usr_account); mcTrim($f_cr_mobile_pda); mcTrim($f_cr_imei); mcTrim($f_crvh_prov); mcTrim($f_ad_street); mcTrim($f_ad_zipcode); mcTrim($f_ad_city); mcTrim($f_crvh_vh_sign); mcTrim($f_crvh_comm_no); mcTrim($f_crvh_mobile); mcTrim($f_crvh_remark); mcTrim($f_crvh_freetext_1); mcTrim($f_crvh_measurement); mcTrim($f_crvh_length); mcTrim($f_crvh_width); mcTrim($f_crvh_height); mcTrim($f_crvh_position); mcTrim($f_crvh_payload); mcTrim($f_crvh_totalweight); mcTrim($f_crvh_env_badge_level); mcTrim($f_crvh_corporate_identity); mcTrim($f_crvh_drivetype); mcTrim($f_vht_id_inv); mcTrim($f_cmp_iln); mcTrim($f_cmp_tax_idno); mcTrim($f_cmp_bank); mcTrim($f_cmp_bankno); mcTrim($f_cmp_bankacc); // $f_crvh_licence_date = str_replace("-", "", trim($f_crvh_licence_date)); $f_crvh_licence_date = preg_replace('/[^\d0-9]/i', '', $f_crvh_licence_date); // Get vehicle types out of "metatype" $vhtTypeArray = getColVectorFromDB2ArrayByClause("metatype", "mt_value", "mt_type = 'vehicletype'", "mt_sort", "mt_sort", ""); // Get the names of the "Corporate Identity" (CI) for vehicles out of "metatype" $vhtCINamesArray = getColVectorFromDB2ArrayByClause("metatype", "mt_value", "mt_type = 'vehicle_ci'", "mt_sort", "mt_sort", ""); // Get drive types out of "metatype" $vhtDriveTypeArray = getColVectorFromDB2ArrayByClause("metatype", "mt_value", "mt_type = 'drivetype'", "mt_sort", "mt_sort", ""); // Get the parameter to set the order of the columns to be displayed $displayedListCols = getParameterValue($emp_id, "MASK_CR_LIST_COLS"); if ($displayedListCols == "") : $displayedListCols = getParameterValue("0", "MASK_CR_LIST_COLS", $hqId); if ($displayedListCols == "") : // Default settings if (CR_SID_STATUS == "1") : $displayedListCols = "cr_sid,cr_vh_sign,cr_eid,usr_name,usr_firstname,usr_phone,cr_mobile_pda,cmp_authenticated_img,cr_id_history,cr_id_report,cmp_id_edit,ad_zipcode,cr_serialno"; else : $displayedListCols = "cr_sid,crvh_vh_sign,cr_eid,crvh_prov,usr_name,usr_firstname,usr_phone,cr_mobile_pda,cmp_authenticated_img,cr_id_history,cr_id_report,cmp_id_edit,ad_zipcode,cr_serialno"; endif; endif; endif; $displayedListColsArray = explode(",",$displayedListCols); $displayedListColsArrayLen = count($displayedListColsArray); // If called e.g. by the first time with empty search-fields $searchValues = $f_cr_sid . $f_cr_eid . $f_cmp_comp . $f_cmp_freetext1 . $f_usr_name . $f_usr_firstname . $f_usr_phone . $f_usr_email . $f_usr_account . $f_cr_mobile_pda . $f_cr_imei . $f_crvh_vh_sign . $f_crvh_comm_no . $f_crvh_mobile . $f_cr_vh_sign . $f_crvh_prov . $f_ad_street . $f_ad_zipcode . $f_ad_city . $f_crvh_remark . $f_crvh_freetext_1 . $f_crvh_measurement . $f_crvh_length . $f_crvh_width . $f_crvh_height . $f_crvh_position . $f_crvh_payload . $f_crvh_env_badge_level . $f_crvh_corporate_identity . $f_crvh_licence_date . $f_crvh_drivetype . $f_vht_id_inv . $f_crvh_totalweight . $f_cr_serialno; $doSearch = FALSE; if (strlen($searchValues) == 0) : if (getCountOfTable("courier") <= MAX_CARDINALITY) : $doSearch = TRUE; endif; endif; if ($g_filter != "") : $doSearch = TRUE; endif; // Gets VPA info header function getVPAInfoHeader ($mode = "") { $retStr = getLngt("VPA-Infos"); if (true) : if ($mode == "1") : $retStr .= ": "; else : $retStr .= "
"; endif; $colArr = array("green", "black", "blue", "red", "yellow", "orange"); // $vpaInfoHeaderArr = array("Modell", "Hersteller", "Betriebssystem", "BS‑Version", "Framework", "APP‑Version"); // All available infos $vpaInfoHeaderArr = array("APP‑Version", "BS‑Version", "Modell"); $vpaInfoHeaderBaseArr = array("APP-Version", "BS-Version", "Modell"); $vpaInfoHeaderArrLen = count($vpaInfoHeaderArr); for ($i = 0; $i < $vpaInfoHeaderArrLen; $i++) : if ($mode == "1") : if ($retStr != getLngt("VPA-Infos") . ": ") : $retStr .= "|"; endif; $retStr .= getLngt($vpaInfoHeaderBaseArr[$i]); else : $retStr .= " " . getLngt($vpaInfoHeaderArr[$i]) . " "; endif; endfor; endif; return $retStr; } // Gets VPA info data function getVPAInfoData ($crPdaInfos, $mode = "") { $retStr = ""; if ($crPdaInfos != "") : $crPdaInfoArr = getKeyValueArrayFromString($crPdaInfos); if (is_array($crPdaInfoArr)) : $colArr = array("green", "black", "blue", "red", "yellow", "orange"); // $vpaKeyArr = array("mod", "man", "os", "os_ver", "fx", "app_ver"); // All available infos $vpaKeyArr = array("app_ver", "os_ver", "mod"); $vpaKeyArrLen = count($vpaKeyArr); for ($i = 0; $i < $vpaKeyArrLen; $i++) : $val = $crPdaInfoArr[$vpaKeyArr[$i]]; if ($val != "" && $val != "nil") : if ($mode == "1") : if ($retStr != "") : $retStr .= "|"; endif; $retStr .= $val; else : $retStr .= " " . $val . " "; endif; endif; endfor; endif; endif; return $retStr; } // OUTPUT: Table header search fields $tableHeaderSearchFields = ""; if (TRUE) : $dspColHeaderSearchFieldArray = array(); $dspColHeaderSearchFieldArray["cr_sid"] = ""; if (CR_SID_STATUS == "1") : $dspColHeaderSearchFieldArray["cr_vh_sign"] = ""; $dspColHeaderSearchFieldArray["cr_eid"] = ""; else : $dspColHeaderSearchFieldArray["crvh_vh_sign"] = ""; $dspColHeaderSearchFieldArray["crvh_comm_no"] = ""; $dspColHeaderSearchFieldArray["crvh_mobile"] = ""; $dspColHeaderSearchFieldArray["cr_eid"] = ""; $dspColHeaderSearchFieldArray["crvh_prov"] = ""; $dspColHeaderSearchFieldArray["crvh_remark"] = ""; $dspColHeaderSearchFieldArray["crvh_freetext_1"] = ""; $dspColHeaderSearchFieldArray["crvh_measurement"] = ""; $dspColHeaderSearchFieldArray["crvh_length"] = ""; $dspColHeaderSearchFieldArray["crvh_width"] = ""; $dspColHeaderSearchFieldArray["crvh_height"] = ""; $dspColHeaderSearchFieldArray["crvh_position"] = ""; $dspColHeaderSearchFieldArray["crvh_payload"] = ""; $dspColHeaderSearchFieldArray["crvh_env_badge_level"] = ""; $dspColHeaderSearchFieldArray["crvh_corporate_identity"] = ""; $dspColHeaderSearchFieldArray["crvh_licence_date"] = ""; // $dspColHeaderSearchFieldArray["crvh_drivetype"] = ""; $dspColHeaderSearchFieldArray["crvh_drivetype"] = ""; $dspColHeaderSearchFieldArray["vht_id_inv"] = ""; $dspColHeaderSearchFieldArray["crvh_totalweight"] = ""; endif; $dspColHeaderSearchFieldArray["usr_name"] = ""; $dspColHeaderSearchFieldArray["usr_firstname"] = ""; $dspColHeaderSearchFieldArray["usr_phone"] = ""; $dspColHeaderSearchFieldArray["usr_email"] = ""; $dspColHeaderSearchFieldArray["usr_account"] = ""; $dspColHeaderSearchFieldArray["cr_mobile_pda"] = ""; $dspColHeaderSearchFieldArray["cr_imei"] = ""; $dspColHeaderSearchFieldArray["cr_serialno"] = ""; $dspColHeaderSearchFieldArray["cmp_comp"] = ""; $dspColHeaderSearchFieldArray["cmp_freetext1"] = ""; $dspColHeaderSearchFieldArray["cmp_authenticated_img"] = " " . getLngt("Suchen") . " "; if ($f_mode != "0" && $f_mode != "1" && $f_mode != "2" && $f_mode != "3"): $dspColHeaderSearchFieldArray["cr_id_history"] = " "; // History $dspColHeaderSearchFieldArray["cr_id_report"] = " "; // Berichte $dspColHeaderSearchFieldArray["cmp_id_edit"] = " "; // Edit $dspColHeaderSearchFieldArray["cr_num_of_documents"] = " "; // Documents courier $dspColHeaderSearchFieldArray["crvh_num_of_documents"] = " "; // Documents vehicle endif; if ($f_pda_infos == "1") : $tmpDeviceTypeArr = getColVectorFromDB2ArrayByClause("courier", "SUBSTRING_INDEX(SUBSTRING(cr_device_info, 1, (INSTR(cr_device_info, '|') - 1)), '=', -1) AS cr_device_info", "cr_device_info != ''", "", "", "DISTINCT", ""); /* if ($db_conn != "ERR_DB") : $tmpDeviceTypeArr2 = getColVectorFromDB2ArrayByClause("conn_context", "SUBSTRING_INDEX(SUBSTRING(cc_appver, 1, (INSTR(cc_appver, '|') - 1)), '=', -1) AS cr_device_info", "cust_id = '1' AND inst_id = '0' AND cc_appver != ''", "", "", "DISTINCT", $db_conn); $tmpDeviceTypeArr = array_merge($tmpDeviceTypeArr, $tmpDeviceTypeArr2); $tmpDeviceTypeArr = array_unique($tmpDeviceTypeArr); sort($tmpDeviceTypeArr); endif; */ $dspColHeaderSearchFieldArray["cr_pda_infos"] = ""; $dspColHeaderSearchFieldArray["cr_pda_infos"] .= ""; endif; $dspColHeaderSearchFieldArray["ad_street"] = ""; $dspColHeaderSearchFieldArray["ad_zipcode"] = ""; $dspColHeaderSearchFieldArray["ad_city"] = ""; // Use "check-array" to avoid search fields by multiple columns of the same (DB) field $chkArr = array(); $tmpKeys = array_keys($dspColHeaderSearchFieldArray); for ($i = 0; $i < $displayedListColsArrayLen; $i++) { // Search for the value "$displayedListColsArray" in "$dspColArray" and get the key (index) $j = array_search($displayedListColsArray[$i], $tmpKeys); if (!($j === FALSE)) : $cellColor = getListColor(1, 1); if (!in_array($tmpKeys[$j], $chkArr)) : $tableHeaderSearchFields .= "" . $dspColHeaderSearchFieldArray[$tmpKeys[$j]] . ""; array_push($chkArr, $tmpKeys[$j]); else : $tableHeaderSearchFields .= "" . " " . ""; endif; endif; } // Add potential extra cols if ($f_pda_infos == "1") : $cellColor = getListColor(1, 1); $tableHeaderSearchFields .= "" . $dspColHeaderSearchFieldArray["cr_pda_infos"] . ""; endif; endif; // OUTPUT: Table header column links $tableHeaderLinks = ""; if (TRUE) : $dspColHeaderLinksArray = array(); $titleArray = array(); if (CR_SID_STATUS == "1") : $titleArray["cr_sid"] = getLngt("SID"); $dspColHeaderLinksArray["cr_sid"] = " " . $titleArray["cr_sid"] . " "; $titleArray["cr_vh_sign"] = getLngt("Kennz."); $dspColHeaderLinksArray["cr_vh_sign"] = " " . $titleArray["cr_vh_sign"] . " "; $titleArray["cr_eid"] = getLngt("ExtID"); $dspColHeaderLinksArray["cr_eid"] = " " . $titleArray["cr_eid"] . " "; else : $titleArray["cr_sid"] = getLngt("SID"); $dspColHeaderLinksArray["cr_sid"] = " " . $titleArray["cr_sid"] . " "; $titleArray["crvh_vh_sign"] = getLngt("Kennz."); $dspColHeaderLinksArray["crvh_vh_sign"] = " " . $titleArray["crvh_vh_sign"] . " "; $titleArray["crvh_comm_no"] = getLngt("Kommiss."); $dspColHeaderLinksArray["crvh_comm_no"] = " " . $titleArray["crvh_comm_no"] . " "; $titleArray["crvh_mobile"] = getLngt("VPA-Nr"); $dspColHeaderLinksArray["crvh_mobile"] = " " . $titleArray["crvh_mobile"] . " "; $titleArray["cr_eid"] = getLngt("ExtID"); $dspColHeaderLinksArray["cr_eid"] = " " . $titleArray["cr_eid"] . " "; $titleArray["crvh_prov"] = getLngt("Prov."); $dspColHeaderLinksArray["crvh_prov"] = " " . $titleArray["crvh_prov"] . " "; $titleArray["crvh_remark"] = getLngt("Fzg.Bemerk."); $dspColHeaderLinksArray["crvh_remark"] = " " . $titleArray["crvh_remark"] . " "; $titleArray["crvh_freetext_1"] = getLngt("Fzg.Freitext"); $dspColHeaderLinksArray["crvh_freetext_1"] = " " . $titleArray["crvh_freetext_1"] . " "; $titleArray["crvh_measurement"] = getLngt("Fzg.Maße (L,B,H,S)"); $dspColHeaderLinksArray["crvh_measurement"] = " " . $titleArray["crvh_measurement"] . " "; $titleArray["crvh_length"] = getLngt("Länge"); $dspColHeaderLinksArray["crvh_length"] = " " . $titleArray["crvh_length"] . " "; $titleArray["crvh_width"] = getLngt("Breite"); $dspColHeaderLinksArray["crvh_width"] = " " . $titleArray["crvh_width"] . " "; $titleArray["crvh_height"] = getLngt("Höhe"); $dspColHeaderLinksArray["crvh_height"] = " " . $titleArray["crvh_height"] . " "; $titleArray["crvh_position"] = getLngt("Stellplätze"); $dspColHeaderLinksArray["crvh_position"] = " " . $titleArray["crvh_position"] . " "; $titleArray["crvh_payload"] = getLngt("Nutzlast"); $dspColHeaderLinksArray["crvh_payload"] = " " . $titleArray["crvh_payload"] . " "; $titleArray["crvh_env_badge_level"] = getLngt("Umweltstufe"); $dspColHeaderLinksArray["crvh_env_badge_level"] = " " . $titleArray["crvh_env_badge_level"] . " "; $titleArray["crvh_corporate_identity"] = getLngt("CI"); $dspColHeaderLinksArray["crvh_corporate_identity"] = " " . $titleArray["crvh_corporate_identity"] . " "; $titleArray["crvh_licence_date"] = getLngt("Erstzulasung"); $dspColHeaderLinksArray["crvh_licence_date"] = " " . $titleArray["crvh_licence_date"] . " "; $titleArray["crvh_drivetype"] = getLngt("Antriebsart"); $dspColHeaderLinksArray["crvh_drivetype"] = " " . $titleArray["crvh_drivetype"] . " "; $titleArray["vht_id_inv"] = getLngt("Rechnungsfahrzeugtyp"); $dspColHeaderLinksArray["vht_id_inv"] = " " . $titleArray["vht_id_inv"] . " "; $titleArray["crvh_totalweight"] = getLngt("Zul.Ges.Gewicht"); $dspColHeaderLinksArray["crvh_totalweight"] = " " . $titleArray["crvh_totalweight"] . " "; endif; $titleArray["usr_name"] = getLngt("Name"); $dspColHeaderLinksArray["usr_name"] = " " . $titleArray["usr_name"] . " "; $titleArray["usr_firstname"] = getLngt("Vorname"); $dspColHeaderLinksArray["usr_firstname"] = " " . $titleArray["usr_firstname"] . " "; $titleArray["usr_phone"] = getLngt("Telefon"); $dspColHeaderLinksArray["usr_phone"] = " " . $titleArray["usr_phone"] . " "; $titleArray["usr_email"] = getLngt("E-Mail"); $dspColHeaderLinksArray["usr_email"] = " " . $titleArray["usr_email"] . " "; $titleArray["usr_account"] = getLngt("Anmeldename"); $dspColHeaderLinksArray["usr_account"] = " " . $titleArray["usr_account"] . " "; $titleArray["cr_mobile_pda"] = getLngt("Mobil-PDA"); $dspColHeaderLinksArray["cr_mobile_pda"] = " " . $titleArray["cr_mobile_pda"] . " "; $titleArray["cr_imei"] = getLngt("IMEI"); $dspColHeaderLinksArray["cr_imei"] = " " . $titleArray["cr_imei"] . " "; $titleArray["cr_serialno"] = getLngt("Seriennr."); $dspColHeaderLinksArray["cr_serialno"] = " " . $titleArray["cr_serialno"] . " "; $titleArray["cmp_comp"] = getLngt("Firma"); $dspColHeaderLinksArray["cmp_comp"] = " " . $titleArray["cmp_comp"] . " "; $titleArray["cmp_freetext1"] = getLngt(wrapPhrase("Freitext", $objecttypemode)); $dspColHeaderLinksArray["cmp_freetext1"] = " " . $titleArray["cmp_freetext1"] . " "; $titleArray["cmp_authenticated_img"] = getLngt("Freigabe"); $dspColHeaderLinksArray["cmp_authenticated_img"] = " " . $titleArray["cmp_authenticated_img"] . " "; if ($f_mode != "0" && $f_mode != "1" && $f_mode != "2" && $f_mode != "3"): $titleArray["cr_id_history"] = ""; $dspColHeaderLinksArray["cr_id_history"] = " " . getLngt("Historie") . " "; // History $titleArray["cr_id_report"] = ""; $dspColHeaderLinksArray["cr_id_report"] = " " . getLngt("Berichte") . " "; // Berichte $titleArray["cmp_id_edit"] = ""; $dspColHeaderLinksArray["cmp_id_edit"] = " " . getLngt("Bearbeiten") . " "; // Edit $titleArray["cr_num_of_documents"] = getLngt("Tp.Dokumente"); $dspColHeaderLinksArray["cr_num_of_documents"] = " " . $titleArray["cr_num_of_documents"] . " "; // Documents courier $titleArray["crvh_num_of_documents"] = getLngt("Fzg.Dokumente"); $dspColHeaderLinksArray["crvh_num_of_documents"] = " " . $titleArray["crvh_num_of_documents"] . " "; // Documents vehicle endif; if ($f_pda_infos == "1") : // $titleArray["cr_pda_infos"] = getLngt("VPA-Infos"); $dspColHeaderLinksArray["cr_pda_infos"] = " " . $titleArray["cr_pda_infos"] . " "; // $titleArray["cr_pda_infos"] = getLngt("VPA-Infos"); $dspColHeaderLinksArray["cr_pda_infos"] = " " . $titleArray["cr_pda_infos"] . " "; $titleArray["cr_pda_infos"] = getVPAInfoHeader("1"); $dspColHeaderLinksArray["cr_pda_infos"] = " " . getVPAInfoHeader() . " "; endif; $titleArray["ad_street"] = getLngt("Strasse"); $dspColHeaderLinksArray["ad_street"] = " " . $titleArray["ad_street"] . " "; $titleArray["ad_zipcode"] = getLngt("PLZ"); $dspColHeaderLinksArray["ad_zipcode"] = " " . $titleArray["ad_zipcode"] . " "; $titleArray["ad_city"] = getLngt("Ort"); $dspColHeaderLinksArray["ad_city"] = " " . $titleArray["ad_city"] . " "; $tmpKeys = array_keys($dspColHeaderLinksArray); for ($i = 0; $i < $displayedListColsArrayLen; $i++) { // Search for the value "$displayedListColsArray" in "$dspColArray" and get the key (index) $j = array_search($displayedListColsArray[$i], $tmpKeys); if (!($j === FALSE)) : $cellColor = getListColor(0, 0); $tableHeaderLinks .= "" . $dspColHeaderLinksArray[$tmpKeys[$j]] . ""; // File export if ($fileOutput == "1" && $titleArray[$tmpKeys[$j]] != "") : $outArr2File[0][] .= mcStr($titleArray[$tmpKeys[$j]]); endif; endif; } // Add potential extra cols if ($f_pda_infos == "1") : $cellColor = getListColor(0, 0); $tableHeaderLinks .= "" . $dspColHeaderLinksArray["cr_pda_infos"] . ""; // File export if ($fileOutput == "1" && $titleArray["cr_pda_infos"] != "") : $outArr2File[0][] .= mcStr($titleArray["cr_pda_infos"]); endif; endif; endif; // Generate search-resultset if ($f_act == "search" && ($doSearch || $searchValues != "")) : if ($doSearch || strlen($f_cr_sid) >= 2 || strlen($f_cr_eid) >= 2 || strlen($f_usr_name) >= 2 || strlen($f_usr_firstname) >= 2 || strlen($f_cmp_comp) >= 2 || strlen($f_cmp_freetext1) >= 3 || strlen($f_usr_phone) >= 2 || strlen($f_usr_email) >= 2 || strlen($f_usr_account) >= 2 || strlen($f_cr_mobile_pda) >= 2 || strlen($f_cr_imei) >= 3 || strlen($f_cr_serialno) >= 3 || strlen($f_crvh_vh_sign) >= 2 || strlen($f_crvh_comm_no) >= 2 || strlen($f_crvh_mobile) >= 2 || strlen($f_cr_vh_sign) >= 2 || strlen($f_crvh_prov) >= 2 || strlen($f_ad_street) >= 3 || strlen($f_ad_zipcode) >= 3 || strlen($f_ad_city) > 2 || strlen($f_crvh_remark) >= 2 || strlen($f_crvh_freetext_1) >= 2 || strlen($f_crvh_measurement) >= 1 || strlen($f_crvh_length) >= 1 || strlen($f_crvh_width) >= 1 || strlen($f_crvh_height) >= 1 || strlen($f_crvh_position) >= 1 || strlen($f_crvh_payload) >= 1 || strlen($f_crvh_totalweight) >= 1 || strlen($f_crvh_env_badge_level) >= 1 || strlen($f_crvh_corporate_identity) >= 1 || strlen($f_crvh_licence_date) >= 4 || strlen($f_crvh_drivetype) >= 1 || strlen($f_vht_id_inv) >= 1 || ($f_pda_infos == "1" && strlen($f_cr_pda_infos) >= 3) ) : // ******************************************* // * Selection of the customers for the list * // ******************************************* $fieldClause = ""; $fromClause = "company AS cmp LEFT JOIN address AS ad ON ad.ad_id = cmp.ad_id, courier AS cr LEFT JOIN genericdatacontainer AS gdc_1 ON cr.cr_id = gdc_1.gdc_obj_id AND gdc_1.gdc_obj_type = 'cr' AND gdc_1.gdc_gen_fieldname = 'num_of_documents', user AS usr"; $whereClause = ""; if ($f_cmp_comp != "") : $whereClause .= "cmp.cmp_comp LIKE '%" . $f_cmp_comp . "%'"; endif; if ($whereClause != "" && $f_cmp_comp2 != "") : $whereClause .= " AND "; endif; if ($f_cmp_comp2 != "") : $whereClause .= "cmp.cmp_comp2 LIKE '%" . $f_cmp_comp2 . "%'"; endif; if ($whereClause != "" && $f_cmp_freetext1 != "") : $whereClause .= " AND "; endif; if ($f_cmp_freetext1 != "") : $whereClause .= "cmp.cmp_freetext1 LIKE '%" . $f_cmp_freetext1 . "%'"; endif; if (CR_SID_STATUS == "1") : $fieldClause = ", cr.cr_vh_sign"; if ($whereClause != "" && $f_cr_sid != "") : $whereClause .= " AND "; endif; if ($f_cr_sid != "") : $whereClause .= "cr.cr_sid LIKE '%" . $f_cr_sid . "%'"; endif; if ($whereClause != "" && $f_crvh_vh_sign != "") : $whereClause .= " AND "; endif; else: $fieldClause = ", crvh.crvh_id, crvh.crvh_sid, crvh.crvh_vh_sign, crvh.crvh_comm_no, crvh.crvh_mobile, crvh.crvh_prov, crvh.crvh_remark, crvh.crvh_freetext_1,"; $fieldClause .= " crvh.crvh_length, crvh.crvh_width, crvh.crvh_height, crvh.crvh_position, crvh.crvh_payload, crvh.crvh_totalweight, crvh.crvh_env_badge_level, crvh.crvh_corporate_identity, crvh.crvh_drivetype,"; $fieldClause .= "CONCAT(crvh.crvh_length,',',crvh.crvh_width,',',crvh.crvh_height,',',crvh.crvh_position) AS crvh_measurement, LEFT(crvh.crvh_licence_date,7) AS crvh_licence_date "; $fromClause = "company AS cmp LEFT JOIN address AS ad ON ad.ad_id = cmp.ad_id, user AS usr, courier AS cr LEFT JOIN couriervehicle AS crvh ON cr.cr_id = crvh.cr_id "; $fromClause .= "LEFT JOIN genericdatacontainer AS gdc_1 ON cr.cr_id = gdc_1.gdc_obj_id AND gdc_1.gdc_obj_type = 'cr' AND gdc_1.gdc_gen_fieldname = 'num_of_documents' "; $fromClause .= "LEFT JOIN genericdatacontainer AS gdc_2 ON crvh.crvh_id = gdc_2.gdc_obj_id AND gdc_2.gdc_obj_type = 'crvh' AND gdc_2.gdc_gen_fieldname = 'num_of_documents' "; // if ($whereClause != "") : $whereClause .= " AND "; endif; // $whereClause .= "cr.cr_id = crvh.cr_id"; if ($whereClause != "" && $f_cr_sid != "") : $whereClause .= " AND "; endif; if ($f_cr_sid != "") : $whereClause .= "crvh.crvh_sid LIKE '%" . $f_cr_sid . "%'"; endif; if ($f_vht_id_inv != "" && is_numeric($f_vht_id_inv) && $f_vht_id_inv > "0") : if ($whereClause != "" && $f_vht_id_inv != "") : $whereClause .= " AND "; endif; $whereClause .= "cr.vht_id_inv = '" . $f_vht_id_inv . "'"; endif; if ($f_crvh_vh_sign != "") : if ($whereClause != "" && $f_crvh_vh_sign != "") : $whereClause .= " AND "; endif; $whereClause .= "crvh.crvh_vh_sign LIKE '%" . $f_crvh_vh_sign . "%'"; endif; if ($f_crvh_comm_no != "") : if ($whereClause != "" && $f_crvh_comm_no != "") : $whereClause .= " AND "; endif; $whereClause .= "crvh.crvh_comm_no LIKE '%" . $f_crvh_comm_no . "%'"; endif; if ($f_crvh_mobile != "") : if ($whereClause != "" && $f_crvh_mobile != "") : $whereClause .= " AND "; endif; $whereClause .= "crvh.crvh_mobile LIKE '%" . $f_crvh_mobile . "%'"; endif; if ($f_crvh_prov != "" && is_numeric($f_crvh_prov)) : if ($whereClause != "" && $f_crvh_prov != "") : $whereClause .= " AND "; endif; $whereClause .= "crvh.crvh_prov LIKE '%" . $f_crvh_prov . "%'"; endif; if ($f_crvh_remark != "") : if ($whereClause != "" && $f_crvh_remark != "") : $whereClause .= " AND "; endif; $whereClause .= "crvh.crvh_remark LIKE '%" . $f_crvh_remark . "%'"; endif; if ($f_crvh_freetext_1 != "") : if ($whereClause != "" && $f_crvh_freetext_1 != "") : $whereClause .= " AND "; endif; $whereClause .= "crvh.crvh_freetext_1 LIKE '%" . $f_crvh_freetext_1 . "%'"; endif; if ($f_crvh_measurement != "") : if ($whereClause != "" && $f_crvh_measurement != "") : $whereClause .= " AND "; endif; $whereClause .= "(crvh.crvh_length = '" . $f_crvh_measurement . "' OR crvh.crvh_width = '" . $f_crvh_measurement . "' OR crvh.crvh_height = '" . $f_crvh_measurement . "' OR crvh.crvh_position = '" . $f_crvh_measurement . "')"; endif; if ($f_crvh_length != "" && is_numeric($f_crvh_length)) : if ($whereClause != "" && $f_crvh_length != "") : $whereClause .= " AND "; endif; $whereClause .= "crvh.crvh_length >= '" . $f_crvh_length . "'"; endif; if ($f_crvh_width != "" && is_numeric($f_crvh_width)) : if ($whereClause != "" && $f_crvh_width != "") : $whereClause .= " AND "; endif; $whereClause .= "crvh.crvh_width >= '" . $f_crvh_width . "'"; endif; if ($f_crvh_height != "" && is_numeric($f_crvh_height)) : if ($whereClause != "" && $f_crvh_height != "") : $whereClause .= " AND "; endif; $whereClause .= "crvh.crvh_height >= '" . $f_crvh_height . "'"; endif; if ($f_crvh_position != "" && is_numeric($f_crvh_position)) : if ($whereClause != "" && $f_crvh_position != "") : $whereClause .= " AND "; endif; $whereClause .= "crvh.crvh_position >= '" . $f_crvh_position . "'"; endif; if ($f_crvh_payload != "" && is_numeric($f_crvh_payload)) : if ($whereClause != "" && $f_crvh_payload != "") : $whereClause .= " AND "; endif; $whereClause .= "crvh.crvh_payload >= '" . $f_crvh_payload . "'"; endif; if ($f_crvh_totalweight != "" && is_numeric($f_crvh_totalweight)) : if ($whereClause != "" && $f_crvh_totalweight != "") : $whereClause .= " AND "; endif; $whereClause .= "crvh.crvh_totalweight >= '" . $f_crvh_totalweight . "'"; endif; if ($f_crvh_env_badge_level != "" && is_numeric($f_crvh_env_badge_level)) : if ($whereClause != "" && $f_crvh_env_badge_level != "") : $whereClause .= " AND "; endif; $whereClause .= "crvh.crvh_env_badge_level >= '" . $f_crvh_env_badge_level . "'"; endif; if ($f_crvh_corporate_identity != "" && is_numeric($f_crvh_corporate_identity)) : if ($whereClause != "" && $f_crvh_corporate_identity != "") : $whereClause .= " AND "; endif; $whereClause .= "crvh.crvh_corporate_identity >= '" . $f_crvh_corporate_identity . "'"; endif; if ($f_crvh_licence_date != "" && is_numeric($f_crvh_licence_date)) : if ($whereClause != "" && $f_crvh_licence_date != "") : $whereClause .= " AND "; endif; $whereClause .= "DATE_FORMAT(crvh.crvh_licence_date,'%Y%m') >= '" . $f_crvh_licence_date . "'"; endif; if ($f_crvh_drivetype != "" && is_numeric($f_crvh_drivetype) && $f_crvh_drivetype > "0") : if ($whereClause != "" && $f_crvh_drivetype != "") : $whereClause .= " AND "; endif; $whereClause .= "crvh.crvh_drivetype = '" . $f_crvh_drivetype . "'"; endif; endif; if ($whereClause != "" && $f_cr_eid != "") : $whereClause .= " AND "; endif; if ($f_cr_eid != "") : $whereClause .= "cr.cr_eid LIKE '%" . $f_cr_eid . "%'"; endif; if ($whereClause != "" && $f_cr_mobile_pda != "") : $whereClause .= " AND "; endif; if ($f_cr_mobile_pda != "") : $whereClause .= "cr.cr_mobile_pda LIKE '%" . $f_cr_mobile_pda . "%'"; endif; if ($whereClause != "" && $f_cr_imei != "") : $whereClause .= " AND "; endif; if ($f_cr_imei != "") : $whereClause .= "cr.cr_imei LIKE '%" . $f_cr_imei . "%'"; endif; if ($whereClause != "" && $f_cr_serialno != "") : $whereClause .= " AND "; endif; if ($f_cr_serialno != "") : $whereClause .= "cr.cr_serialno LIKE '%" . $f_cr_serialno . "%'"; endif; if ($whereClause != "" && $f_usr_name != "") : $whereClause .= " AND "; endif; if ($f_usr_name != "") : $whereClause .= "usr.usr_name LIKE '%" . $f_usr_name . "%'"; endif; if ($whereClause != "" && $f_usr_firstname != "") : $whereClause .= " AND "; endif; if ($f_usr_firstname != "") : $whereClause .= "usr.usr_firstname LIKE '%" . $f_usr_firstname . "%'"; endif; if ($whereClause != "" && $f_usr_phone != "") : $whereClause .= " AND "; endif; if ($f_usr_phone != "") : $whereClause .= "usr.usr_phone LIKE '%" . $f_usr_phone . "%'"; endif; if ($whereClause != "" && $f_usr_email != "") : $whereClause .= " AND "; endif; if ($f_usr_email != "") : $whereClause .= "usr.usr_email LIKE '%" . $f_usr_email . "%'"; endif; if ($whereClause != "" && $f_usr_account != "") : $whereClause .= " AND "; endif; if ($f_usr_account != "") : $whereClause .= "usr.usr_account LIKE '%" . $f_usr_account . "%'"; endif; if ($whereClause != "" && $f_cmp_iln != "") : $whereClause .= " AND "; endif; if ($f_cmp_iln != "") : $whereClause .= "cmp.cmp_iln LIKE '%" . $f_cmp_iln . "%'"; endif; if ($whereClause != "" && $f_cmp_tax_idno != "") : $whereClause .= " AND "; endif; if ($f_cmp_tax_idno != "") : $whereClause .= "cmp.cmp_tax_idno LIKE '%" . $f_cmp_tax_idno . "%'"; endif; if ($whereClause != "" && $f_cmp_bank != "") : $whereClause .= " AND "; endif; if ($f_cmp_bank != "") : $whereClause .= "cmp.cmp_bank LIKE '%" . $f_cmp_bank . "%'"; endif; if ($whereClause != "" && $f_cmp_bankno != "") : $whereClause .= " AND "; endif; if ($f_cmp_bankno != "") : $whereClause .= "cmp.cmp_bankno LIKE '%" . $f_cmp_bankno . "%'"; endif; if ($whereClause != "" && $f_cmp_bankacc != "") : $whereClause .= " AND "; endif; if ($f_cmp_bankacc != "") : $whereClause .= "cmp.cmp_bankacc LIKE '%" . $f_cmp_bankacc . "%'"; endif; // VPA infos if ($f_pda_infos == "1") : if ($whereClause != "" && $f_cr_pda_infos != "") : $whereClause .= " AND "; endif; if ($f_cr_pda_infos != "") : $whereClause .= "cr.cr_device_info LIKE '%" . $f_cr_pda_infos . "%'"; endif; endif; // LEFT JOIN table(s) ... if ($whereClause != "" && $f_ad_street != "") : $whereClause .= " AND "; endif; if ($f_ad_street != "") : $whereClause .= "ad.ad_street LIKE '" . $prefix . $f_ad_street . "%'"; endif; if ($whereClause != "" && $f_ad_zipcode != "") : $whereClause .= " AND "; endif; if ($f_ad_zipcode != "") : $whereClause .= "ad.ad_zipcode LIKE '" . $prefix . $f_ad_zipcode . "%'"; endif; if ($whereClause != "" && $f_ad_city != "") : $whereClause .= " AND "; endif; if ($f_ad_city != "") : $whereClause .= "ad.ad_city LIKE '" . $prefix . $f_ad_city . "%'"; 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; // Check visibles $whereClauseVisibility = " cmp.cmp_visible = '1' "; if ($f_show_invisible == "1") : $whereClauseVisibility = ""; endif; if ($whereClause != "" && $whereClauseVisibility != "") : $whereClauseVisibility = " AND " . $whereClauseVisibility; endif; $whereClause .= $whereClauseVisibility; // Check visibles INTERNAL $whereClauseVisibilityInternal = " cmp.cmp_visible_internal = '0' "; if ($f_show_invisible_internal == "1" && $empIdRootAdmin == $emp_id) : $whereClauseVisibilityInternal = ""; endif; if ($whereClause != "" && $whereClauseVisibilityInternal != "") : $whereClauseVisibilityInternal = " AND " . $whereClauseVisibilityInternal; endif; $whereClause .= $whereClauseVisibilityInternal; // Check only contractors visible $whereClauseContractors = ""; if ($f_contractors_only == "1") : $whereClauseContractors = " (isnull(cr.cr_id_parent) OR cr.cr_id_parent = '0') "; endif; if ($whereClause != "" && $whereClauseContractors != "") : $whereClauseContractors = " AND " . $whereClauseContractors; endif; $whereClause .= $whereClauseContractors; // Check filter if ($g_filter != "") : // Get all filter for checking the filter type $filterArr = getColVectorFromDB2ArrayByClause("courierfilter", "crf_type", "crf_type IN (0,1)", "crf_short", "crf_short", "", ""); // Check type of selected filters and define clause $tmpFilter = spliti(",",$g_filter); $lenTmp = count($tmpFilter); for ($i = 0; $i < $lenTmp; $i++) : if ($whereClause != "") : $whereClause .= " AND "; endif; if ($filterArr[$tmpFilter[$i]] == "1") : $whereClause .= " cr.cr_filter LIKE '%," . $tmpFilter[$i] . ",%' "; else : $whereClause .= " crvh.crvh_filter LIKE '%," . $tmpFilter[$i] . ",%' "; endif; endfor; endif; if ($whereClause != "") : $whereClause .= " AND "; endif; if ($orderClause == "") : $orderClause = "cmp.cmp_comp"; endif; $sqlquery = "SELECT cmp.cmp_id, cmp.cmp_comp, cmp.cmp_comp2, cmp.cmp_iln, cmp.cmp_tax_idno," . " cmp.cmp_bank, cmp.cmp_bankno, cmp.cmp_bankacc, cmp.cmp_freetext1, cmp.cmp_authenticated," . " cr.cr_id, cr.cr_sid, cr.cr_eid, cr.vht_id, cr.vht_id_inv, cr.cr_maxweight, cr.cr_outlay," . " cr.cr_available, cr.cr_mobile_pda, cr.cr_imei, cr.cr_serialno," . " gdc_1.gdc_content AS cr_num_of_documents, gdc_2.gdc_content AS crvh_num_of_documents," . " ad.ad_street, ad.ad_zipcode, ad.ad_city," . " usr.usr_id, usr.usr_name, usr.usr_firstname, usr.usr_email, usr.usr_account, usr.usr_phone," . " usr.usr_phone2, usr.usr_fax" . $fieldClause . " FROM " . $fromClause . " WHERE " . $whereClause . " cmp.cmp_id = cr.cmp_id AND" . " cmp.cmp_archived = '0' AND" . " cr.usr_id = usr.usr_id AND" . " usr.hq_id IN " . getSQLMandatorArray($f_hq_id) . " ORDER BY " . $orderClause; // echo $sqlquery . "
"; $result = $db->query($sqlquery); if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage()); // Table body $wordingWrapperObjecttypemode = ""; if ($objecttypemode != "") : $wordingWrapperObjecttypemode = "&objecttypemode=" . ec($objecttypemode); endif; $rowCounter = 0; $lineToggler = 0; while ($row = $result->fetch_assoc()): $numOfRows++; $dspColArray = array(); $fieldArray = array(); $tableOfRows .= ""; $fieldArray["cmp_comp"] = $row["cmp_comp"]; $dspColArray["cmp_comp"] = " " . $fieldArray["cmp_comp"] . ""; $fieldArray["cmp_comp2"] = $row["cmp_comp2"]; $dspColArray["cmp_comp2"] = " " . $fieldArray["cmp_comp2"] . ""; $fieldArray["cmp_freetext1"] = nl2br($row["cmp_freetext1"]); $dspColArray["cmp_freetext1"] = " " . $fieldArray["cmp_freetext1"] . ""; if (CR_SID_STATUS == "1") : // SID comes out of the table "courier" if ($f_mode == "0") : $fieldArray["cr_sid"] = $row["cr_sid"]; $dspColArray["cr_sid"] = " " . $row["cr_sid"] . ""; elseif ($f_mode == "1") : $fieldArray["cr_sid"] = $row["cr_sid"]; $dspColArray["cr_sid"] = " " . $row["cr_sid"] . ""; elseif ($f_mode == "2") : $fieldArray["cr_sid"] = $row["cr_sid"]; $dspColArray["cr_sid"] = " " . $row["cr_sid"] . ""; else: $fieldArray["cr_sid"] = $row["cr_sid"] ; $dspColArray["cr_sid"] = " " . $fieldArray["cr_sid"] . ""; endif; $fieldArray["cr_eid"] = $row["cr_eid"]; $dspColArray["cr_eid"] = " " . $fieldArray["cr_eid"] . ""; else : // SID comes out of the table "couriervehicle" $fieldArray["cr_sid"] = $row["crvh_sid"]; $dspColArray["cr_sid"] = " " . $fieldArray["cr_sid"] . ""; $fieldArray["crvh_vh_sign"] = $row["crvh_vh_sign"]; $dspColArray["crvh_vh_sign"] = " " . $fieldArray["crvh_vh_sign"] . ""; $fieldArray["crvh_comm_no"] = $row["crvh_comm_no"]; $dspColArray["crvh_comm_no"] = " " . $fieldArray["crvh_comm_no"] . ""; $fieldArray["crvh_mobile"] = $row["crvh_mobile"]; $dspColArray["crvh_mobile"] = " " . $fieldArray["crvh_mobile"] . ""; if ($f_mode == "0") : $fieldArray["cr_eid"] = $row["cr_eid"]; $dspColArray["cr_eid"] = " " . $row["cr_eid"] . ""; elseif ($f_mode == "1") : $fieldArray["cr_eid"] = $row["cr_eid"]; $dspColArray["cr_eid"] = " " . $row["cr_eid"] . ""; elseif ($f_mode == "2") : $fieldArray["cr_eid"] = $row["cr_eid"]; $dspColArray["cr_eid"] = " " . $row["cr_eid"] . ""; elseif ($f_mode == "3") : $fieldArray["cr_eid"] = $row["cr_eid"]; $dspColArray["cr_eid"] = " " . $row["cr_eid"] . ""; else: $fieldArray["cr_eid"] = $row["cr_eid"]; $dspColArray["cr_eid"] = " " . $row["cr_eid"] . ""; // Overwrite! $fieldArray["cr_sid"] = $row["crvh_sid"]; $dspColArray["cr_sid"] = " " . $row["crvh_sid"] . ""; endif; $fieldArray["crvh_prov"] = $row["crvh_prov"]; $dspColArray["crvh_prov"] = " " . $fieldArray["crvh_prov"] . "  "; $fieldArray["crvh_remark"] = $row["crvh_remark"]; $dspColArray["crvh_remark"] = " " . $fieldArray["crvh_remark"] . "  "; $fieldArray["crvh_freetext_1"] = $row["crvh_freetext_1"]; $dspColArray["crvh_freetext_1"] = " " . $fieldArray["crvh_freetext_1"] . "  "; $fieldArray["crvh_measurement"] = $row["crvh_measurement"]; $dspColArray["crvh_measurement"] = " " . $fieldArray["crvh_measurement"] . "  "; $fieldArray["crvh_length"] = $row["crvh_length"]; $dspColArray["crvh_length"] = " " . $fieldArray["crvh_length"] . "  "; $fieldArray["crvh_width"] = $row["crvh_width"]; $dspColArray["crvh_width"] = " " . $fieldArray["crvh_width"] . "  "; $fieldArray["crvh_height"] = $row["crvh_height"]; $dspColArray["crvh_height"] = " " . $fieldArray["crvh_height"] . "  "; $fieldArray["crvh_position"] = $row["crvh_position"]; $dspColArray["crvh_position"] = " " . $fieldArray["crvh_position"] . "  "; $fieldArray["crvh_payload"] = $row["crvh_payload"]; $dspColArray["crvh_payload"] = " " . $fieldArray["crvh_payload"] . "  "; $fieldArray["crvh_env_badge_level"] = $row["crvh_env_badge_level"]; $dspColArray["crvh_env_badge_level"] = " " . $fieldArray["crvh_env_badge_level"] . "  "; // $fieldArray["crvh_corporate_identity"] = $vhtCINamesArray[$row["crvh_corporate_identity"]]; $dspColArray["crvh_corporate_identity"] = " " . $vhtCINamesArray[$row["crvh_corporate_identity"]] . " [" . $row["crvh_corporate_identity"] . "]  "; $tmpCI1 = ((int)$row["crvh_corporate_identity"] & 15); $tmpCI2 = (((int)$row["crvh_corporate_identity"] / 16) & 15); $fieldArray["crvh_corporate_identity"] = mcArrIsSet($vhtCINamesArray, $tmpCI1) . ($tmpCI1 > 0 || $tmpCI2 > 0 ? " | " : "") . mcArrIsSet($vhtCINamesArray, $tmpCI2); $dspColArray["crvh_corporate_identity"] = " " . $fieldArray["crvh_corporate_identity"] . "  "; $fieldArray["crvh_licence_date"] = $row["crvh_licence_date"]; $dspColArray["crvh_licence_date"] = " " . $fieldArray["crvh_licence_date"] . "  "; $fieldArray["crvh_drivetype"] = str_replace(" "," ",mcArrIsSet($vhtDriveTypeArray, $row["crvh_drivetype"])); $dspColArray["crvh_drivetype"] = " " . $fieldArray["crvh_drivetype"] . "  "; $fieldArray["vht_id_inv"] = str_replace(" "," ",mcArrIsSet($vhtTypeArray, $row["vht_id_inv"])); $dspColArray["vht_id_inv"] = " " . $fieldArray["vht_id_inv"] . "  "; $fieldArray["crvh_totalweight"] = $row["crvh_totalweight"]; $dspColArray["crvh_totalweight"] = " " . $fieldArray["crvh_totalweight"] . "  "; endif; // $fieldArray[""] = ; $dspColArray["usr_name"] = " " . $row["usr_name"] . ""; $fieldArray["usr_name"] = $row["usr_name"]; $dspColArray["usr_name"] = " " . $fieldArray["usr_name"] . ""; $fieldArray["usr_firstname"] = $row["usr_firstname"]; $dspColArray["usr_firstname"] = " " . $fieldArray["usr_firstname"] . ""; $fieldArray["usr_phone"] = $row["usr_phone"]; $dspColArray["usr_phone"] = " " . $fieldArray["usr_phone"] . ""; $fieldArray["usr_email"] = $row["usr_email"]; $dspColArray["usr_email"] = " " . $fieldArray["usr_email"] . ""; $fieldArray["usr_account"] = $row["usr_account"]; $dspColArray["usr_account"] = " " . $fieldArray["usr_account"] . ""; $fieldArray["cr_mobile_pda"] = $row["cr_mobile_pda"]; $dspColArray["cr_mobile_pda"] = " " . $fieldArray["cr_mobile_pda"] . ""; $fieldArray["cr_imei"] = $row["cr_imei"]; $dspColArray["cr_imei"] = " " . $fieldArray["cr_imei"] . ""; $fieldArray["cr_serialno"] = $row["cr_serialno"]; $dspColArray["cr_serialno"] = " " . $fieldArray["cr_serialno"] . ""; if ($f_pda_infos == "1") : $crPdaInfos = getFieldValueFromId("courier", "cr_id", $row["cr_id"], "cr_device_info"); /* if ($crPdaInfos == "" && $db_conn != "ERR_DB") : $crPdaInfos = getFieldValueFromClause("conn_context","cc_appver","cust_id = '1' AND inst_id = '0' AND usr_id = '" . $row["usr_id"] . "'", $db_conn); endif; */ $fieldArray["cr_pda_infos"] = getVPAInfoData($crPdaInfos, "1"); // Init $dspColArray["cr_pda_infos"] = " " . getVPAInfoData($crPdaInfos) . ""; endif; $fieldArray["ad_street"] = $row["ad_street"]; $dspColArray["ad_street"] = " " . $fieldArray["ad_street"] . ""; $fieldArray["ad_zipcode"] = $row["ad_zipcode"]; $dspColArray["ad_zipcode"] = " " . $fieldArray["ad_zipcode"] . ""; $fieldArray["ad_city"] = $row["ad_city"]; $dspColArray["ad_city"] = " " . $fieldArray["ad_city"] . ""; $authImgName = "circle_red.png"; $fieldArray["cmp_authenticated_img"] = getLngt("Nein"); if ($row["cmp_authenticated"] == "1") : $authImgName = "circle_green.png"; $fieldArray["cmp_authenticated_img"] = getLngt("Ja"); endif; $dspColArray["cmp_authenticated_img"] = ""; if ($f_mode != "0" && $f_mode != "1" && $f_mode != "2" && $f_mode != "3") : // History of the courier // $fieldArray["cr_id_history"] = ""; $dspColArray["cr_id_history"] = "" . "" . ""; // Reports of the courier // $fieldArray["cr_id_report"] = ""; $dspColArray["cr_id_report"] = "" . "" . ""; // Edit the courier // $fieldArray["cmp_id_edit"] = ""; $dspColArray["cmp_id_edit"] = "" . "" . ""; // Number of documents associated to the courier $fieldArray["cr_num_of_documents"] = ($row["cr_num_of_documents"] != "" && $row["cr_num_of_documents"] != "0" ? $row["cr_num_of_documents"] : "0"); $dspColArray["cr_num_of_documents"] = "" . "" . ($row["cr_num_of_documents"] != "" && $row["cr_num_of_documents"] != "0" ? "[" . $row["cr_num_of_documents"] . "]" : " ") . "" . ""; // Number of documents associated to the vehicle $fieldArray["crvh_num_of_documents"] = ($row["crvh_num_of_documents"] != "" && $row["crvh_num_of_documents"] != "0" ? $row["crvh_num_of_documents"] : "0"); $dspColArray["crvh_num_of_documents"] = "" . "" . ($row["crvh_num_of_documents"] != "" && $row["crvh_num_of_documents"] != "0" ? "[" . $row["crvh_num_of_documents"] . "]" : " ") . "" . ""; endif; // Generate list $rowCounter++; $tmpKeys = array_keys($dspColArray); for ($i = 0; $i < $displayedListColsArrayLen; $i++) { // Search for the value "$displayedListColsArray" in "$dspColArray" and get the key (index) $j = array_search($displayedListColsArray[$i], $tmpKeys); if (!($j === FALSE)) : if ($lineToggler == 0) : $lineToggler = 1; else : $lineToggler = 0; endif; $cellColor = getListColor($rowCounter, $lineToggler); $dspColArray[$tmpKeys[$j]] = str_replace("__BGCOL__", " bgcolor=\"" . $cellColor ."\"", $dspColArray[$tmpKeys[$j]]); $tableOfRows .= $dspColArray[$tmpKeys[$j]]; // File export if ($fileOutput == "1" && $titleArray[$tmpKeys[$j]] != "") : $outArr2File[$rowCounter][] .= mcStr($fieldArray[$tmpKeys[$j]]); endif; endif; } // Add potential extra cols if ($f_pda_infos == "1") : if ($lineToggler == 0) : $lineToggler = 1; else : $lineToggler = 0; endif; $cellColor = getListColor($rowCounter, $lineToggler); $dspColArray["cr_pda_infos"] = str_replace("__BGCOL__", " bgcolor=\"" . $cellColor ."\"", $dspColArray["cr_pda_infos"]); $tableOfRows .= $dspColArray["cr_pda_infos"]; // File export if ($fileOutput == "1" && $titleArray["cr_pda_infos"] != "") : $outArr2File[$rowCounter][] .= mcStr($fieldArray["cr_pda_infos"]); endif; endif; $tableOfRows .= ""; endwhile; $result->free(); // Optional output to file $f_secretFileName = ""; if ($fileOutput == "1") : // Remove old files foreach (glob($tempPath . "*.cr_list.csv") as $fileNameToBoRemoved) { if ((time() - filemtime($fileNameToBoRemoved)) > 60) : if (file_exists($fileNameToBoRemoved)) : unlink($fileNameToBoRemoved); endif; endif; } // Convert matrix to CSV $outputLinesArray = convertMatrixToCsv($outArr2File); $outputLinesArrayLen = count($outputLinesArray); if ($outputLinesArrayLen > 0) : $f_fileName = "COURIERLIST_" . date("YmdHis"); $f_secretFileName = md5($f_fileName) . ".cr_list.csv"; for ($i = 0; $i < $outputLinesArrayLen; $i++) : writeToFile($tempPath . $f_secretFileName, $outputLinesArray[$i]); // write statistic data endfor; else : $statusMessage = "Es wurden keine Daten gefunden! Eine Datei wurde deshalb nicht generiert!"; $fileOutput = "0"; endif; endif; else : $statusMessage .= getLngt("Bei Eingabe weniger als 2 Zeichen in mindestens einem Feld erfolgt keine Suche!"); endif; endif; // Output $jsOut = ""; // Set relation to calling parent field if ($f_mode == "0") : $jsOut .= "function setParentGeneric(crParentId,crParentValue) {\n"; $jsOut .= " opener.document.forms[0]." . $genJsParName . ".value = crParentValue;\n"; $jsOut .= " this.close();\n"; $jsOut .= "};\n"; endif; // Set relation between courier and subcontractor if ($f_mode == "1") : $jsOut .= "function setParent(crParentId,crParentValue) {\n"; $jsOut .= " opener.document.forms[0].f_cr_id_parent.value = crParentId;\n"; if (CR_SID_STATUS == "1") : $jsOut .= " opener.document.forms[0].f_cr_sid_parent.value = crParentValue;\n"; else : $jsOut .= " opener.document.forms[0].f_cr_eid_parent.value = crParentValue;\n"; endif; $jsOut .= " this.close();\n"; $jsOut .= "};\n"; endif; // Set relation between customer and courier (blocked/favoured) if ($f_mode == "2") : $jsOut .= "function setCustomerRelation(crId,crEid,crSid,crFirstname,crName,crPhone,crEmail) {\n"; $jsOut .= " opener.document.forms[0].g_cr_id.value = crId;\n"; $jsOut .= " opener.document.forms[0].g_cr_eid.value = crEid;\n"; $jsOut .= " opener.document.forms[0].g_cr_sid.value = crSid;\n"; $jsOut .= " opener.document.forms[0].g_usr_firstname.value = crFirstname;\n"; $jsOut .= " opener.document.forms[0].g_usr_name.value = crName;\n"; $jsOut .= " opener.document.forms[0].g_usr_phone.value = crPhone;\n"; $jsOut .= " opener.document.forms[0].g_usr_email.value = crEmail;\n"; $jsOut .= " this.close();\n"; $jsOut .= "};\n"; endif; // Set single courier (statistics, etc.) if ($f_mode == "3") : $jsOut .= "function setSingleCourier(crId,crEid) {\n"; $jsOut .= " opener.document.forms[0].g_cr_id.value = crId;\n"; $jsOut .= " opener.document.forms[0].g_cr_eid.value = crEid;\n"; $jsOut .= " this.close();\n"; $jsOut .= "};\n"; endif; // Link to enter a new customer or to switch "visibility output" $wordingWrapperObjecttypemode = ""; if ($objecttypemode != "") : $wordingWrapperObjecttypemode = "?objecttypemode=" . ec($objecttypemode); endif; $headerOps = "   |   "; $headerOps .= "" . getLngt("Neuer " . wrapPhrase("Transporteur", $objecttypemode)) . ""; $headerOps .= "   |   "; $headerOps .= getLngt("Nur Unternehmer anzeigen") . " "; $headerOps .= "   |   "; $headerOps .= getLngt("VPA-Infos anzeigen") . " "; $headerOps .= "   |   "; $headerOps .= getLngt("Ausgeblendete anzeigen") . " "; if ($empIdRootAdmin == $emp_id) : $headerOps .= "   |   "; $headerOps .= getLngt("Interne anzeigen") . " "; endif; if ($empHasAccessCrCsvExport) : $headerOps .= "   |   "; $headerOps .= getLngt("CSV-Export") . " "; endif; // Special search fields $extraSearchFields = "
 " . getLngt("Filter:") . " " . " 
" . defineButtonType08("...", "action_filter", "openFilters();", "20", "left", "2"); // print_r($outArr2File); echo "\n\n

"; ?> <?php echo $pageTitel ?> ">
      |