genNum = "2", "g3_" <=> genNum = "3") if ($genJsParName == "") : $genJsParName = ""; endif; // Name of a special JS parameter name of the caller page, the value will be associated mcTrim($f_cmp_comp); mcTrim($f_cmp_comp2); mcTrim($f_cmp_iln); mcTrim($f_cmp_tax_idno); mcTrim($f_cmp_bank); mcTrim($f_cmp_bankno); mcTrim($f_cmp_bankacc); // Parameter for displayed column SEQUENCE $displayedListCols = getParameterValue($emp_id, "MASK_CSCSC_LIST_COLS"); if ($displayedListCols == "") : $displayedListCols = getParameterValue("0", "MASK_CSCSC_LIST_COLS", $hqId); if ($displayedListCols == "") : // Default settings $displayedListCols = "cmp_comp,cmp_comp2,cs_eid,csc_name,cmp_match,cmp_authenticated_img,ad_street,cscad_hsno,ad_zipcode,ad_city,cscad_remark,cscad_person,cscad_phone,statistic"; endif; endif; $displayedListColsArray = spliti(",",$displayedListCols); $displayedListColsArrayLen = count($displayedListColsArray); // Parameter for displayed column LENGTH $displayedListLenCols = getParameterValue($emp_id, "MASK_CSCSC_LIST_LEN_COLS"); if ($displayedListLenCols == "") : $displayedListLenCols = getParameterValue("0", "MASK_CSCSC_LIST_LEN_COLS", $hqId); if ($displayedListLenCols == "") : // Default settings $displayedListLenCols = "30,15,11,20,30,5,20,5,5,20,20,20,15"; endif; endif; $displayedListLenColsArray = spliti(",",$displayedListLenCols); // Get constants for fields to be searched in $constSearchCscsclistCmpcompCmpmatch = SEARCH_CSCSCLIST_CMPCOMP_CMPMATCH; $constSearchCscsclistCmpcompCseid = SEARCH_CSCSCLIST_CMPCOMP_CSEID; $constSearchCscsclistCmpcompCscadphone = SEARCH_CSCSCLIST_CMPCOMP_CSCADPHONE; // Check consistence of used fields per JavaScript $tableHeaderSearchFieldsExtra = ""; // Defines the extra hidden fields to be integrated for search $j = array_search("cmp_match",$displayedListColsArray); if ($j === FALSE) : $tableHeaderSearchFieldsExtra .= ""; endif; $j = array_search("cs_eid",$displayedListColsArray); if ($j === FALSE) : $tableHeaderSearchFieldsExtra .= ""; endif; $j = array_search("cscad_phone",$displayedListColsArray); if ($j === FALSE) : $tableHeaderSearchFieldsExtra .= ""; endif; $f_cmp_match = trim($f_cmp_match); if ($constSearchCscsclistCmpcompCmpmatch == "1" && $f_cmp_match == "") : $f_cmp_match = trim($f_cmp_comp); endif; $f_cs_eid = trim($f_cs_eid); if ($constSearchCscsclistCmpcompCseid == "1" && $f_cs_eid == "") : $f_cs_eid = trim($f_cmp_comp); endif; $f_phone = trim($f_phone); if ($constSearchCscsclistCmpcompCscadphone == "1" && $f_phone == "") : $f_phone = trim($f_cmp_comp); endif; $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); $f_phone = trim($f_phone); // Flag for "show invisible customers" if ($f_show_invisible == "" || count($f_show_invisible) == 0) : $f_show_invisible = "0"; else: $f_show_invisible = "1"; endif; // Check for displaying prospects. First check for option "permanently" $displayedProspectsPermanently = getParameterValue("0", "MASK_CSCSC_LIST_SHOW_PROSPECTS_PERMANENTLY", $hqId); if ($displayedProspectsPermanently == "1") : $allowAllCustomerTypes = "1"; else : if ($allowAllCustomerTypes == "" || (is_array($allowAllCustomerTypes) && count($allowAllCustomerTypes) == 0)) : $allowAllCustomerTypes = "0"; else: $allowAllCustomerTypes = "1"; endif; endif; // Check for displaying prospects. First check for option "permanently" $activateCscLinkForProspects = getParameterValue("0", "MASK_CSCSC_LIST_ACTIVATE_PROSPECT_LINKS_FOR_JOBS", $hqId); $numOfHq = getCountOfTable("headquarters", "hq_disabled = 0"); $filterMandators = "
 " . getLngt("Niederlassungen:") . "  " . addCheckboxesFromTable("f_hq_id","headquarters","hq_id","hq_mnemonic","hq_mnemonic","hq_disabled = 0",$f_hq_id, "   ","") . ""; $filterMandators .= defineButtonType08("Alle", "f_hq_check_all", "hqCheckAll(" . $numOfHq . ");", "50px", "left", "3"); $filterMandators .= defineButtonType08("Keine", "f_hq_uncheck_all", "hqUncheckAll(" . $numOfHq . ");", "50px", "left"); // OUTPUT: Page header option fields $pageHeaderOptionFields = ""; if (TRUE) : $pageHeaderOptionFields .= " " . getLngt("Suchen") . " \n"; $pageHeaderOptionFields .= "   |   \n"; $pageHeaderOptionFields .= "" . getLngt("Felder zurücksetzen") . "\n"; $pageHeaderOptionFields .= "   |   \n"; $pageHeaderOptionFields .= "Option:  \n"; $pageHeaderOptionFields .= " " . getLngt("Präfix") . "\n"; $pageHeaderOptionFields .= " " . getLngt("Teilwort") . "\n"; $pageHeaderOptionFields .= "   |   \n"; // $pageHeaderOptionFields .= getLngt("Kostenstellen:") . "  \n"; // $pageHeaderOptionFields .= " " . getLngt("Nur interne") . " \n"; // $pageHeaderOptionFields .= " " . getLngt("Nur externe") . " \n"; // $pageHeaderOptionFields .= " " . getLngt("Alle") . " \n"; $pageHeaderOptionFields .= getLngt("Ausgeblendete") . " " . getLngt("anzeigen") . " \n"; $pageHeaderOptionFields .= "   \n"; $pageHeaderOptionFields .= getLngt("Mit Interessenten") . " \n"; $pageHeaderOptionFields .= "\n"; $pageHeaderOptionFields .= $filterMandators; endif; // OUTPUT: Table header search fields $tableHeaderSearchFields = ""; if (TRUE) : $dspColHeaderSearchFieldArray["cmp_comp"] = ""; $dspColHeaderSearchFieldArray["cmp_comp2"] = ""; $dspColHeaderSearchFieldArray["cs_eid"] = ""; $dspColHeaderSearchFieldArray["csc_name"] = ""; $dspColHeaderSearchFieldArray["cmp_match"] = ""; $dspColHeaderSearchFieldArray["cmp_authenticated_img"] = " " . getLngt("Suchen") . " "; $dspColHeaderSearchFieldArray["usr_name"] = ""; $dspColHeaderSearchFieldArray["usr_phone"] = ""; $dspColHeaderSearchFieldArray["usr_email"] = ""; $dspColHeaderSearchFieldArray["ad_street"] = ""; $dspColHeaderSearchFieldArray["cscad_hsno"] = ""; $dspColHeaderSearchFieldArray["ad_zipcode"] = ""; $dspColHeaderSearchFieldArray["ad_city"] = ""; $dspColHeaderSearchFieldArray["cscad_remark"] = ""; $dspColHeaderSearchFieldArray["cscad_person"] = ""; $dspColHeaderSearchFieldArray["cscad_phone"] = ""; $dspColHeaderSearchFieldArray["statistic"] = " " . getLngt("Suchen") . " "; $dspColHeaderSearchFieldArray["cs_report"] = " " . getLngt("Suchen") . " "; $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)) : // Define length (html attribute "size") of the field and substitute macro mcArrIsSet($displayedListLenColsArray, $i); if ($displayedListLenColsArray[$i] == "" || $displayedListLenColsArray[$i] == "0") : $dspColHeaderSearchFieldArray[$tmpKeys[$j]] = str_replace("_SIZE_MACRO_", "", $dspColHeaderSearchFieldArray[$tmpKeys[$j]]); else : $dspColHeaderSearchFieldArray[$tmpKeys[$j]] = str_replace("_SIZE_MACRO_", " size=\"" . $displayedListLenColsArray[$i] . "\" ", $dspColHeaderSearchFieldArray[$tmpKeys[$j]]); endif; $cellColor = getListColor(1, 1); $tableHeaderSearchFields .= "" . $dspColHeaderSearchFieldArray[$tmpKeys[$j]] . ""; endif; } endif; // OUTPUT: Table header column links $tableHeaderLinks = ""; if (TRUE) : $dspColHeaderLinksArray = array(); $dspColHeaderLinksArray["cmp_comp"] = " " . getLngt("Firma") . " "; $dspColHeaderLinksArray["cmp_comp2"] = " " . getLngt("Firma2") . " "; $dspColHeaderLinksArray["cs_eid"] = " " . getLngt("ExtID") . " "; $dspColHeaderLinksArray["csc_name"] = " " . getLngt("Kostenstelle") . " "; $dspColHeaderLinksArray["cmp_match"] = " " . getLngt("Freitext") . " "; $dspColHeaderLinksArray["cmp_authenticated_img"] = " " . getLngt("Freigabe") . " "; $dspColHeaderLinksArray["usr_name"] = " " . getLngt("Admin-Name") . ""; $dspColHeaderLinksArray["usr_phone"] = " " . getLngt("Admin-Telefon") . ""; $dspColHeaderLinksArray["usr_email"] = " " . getLngt("Admin-Email") . ""; $dspColHeaderLinksArray["ad_street"] = " " . getLngt("Straße") . ""; $dspColHeaderLinksArray["cscad_hsno"] = " " . getLngt("Hausnr.") . ""; $dspColHeaderLinksArray["ad_zipcode"] = " " . getLngt("PLZ") . ""; $dspColHeaderLinksArray["ad_city"] = " " . getLngt("Ort") . ""; $dspColHeaderLinksArray["cscad_remark"] = " " . getLngt("Bemerkung") . ""; $dspColHeaderLinksArray["cscad_person"] = " " . getLngt("Person") . ""; $dspColHeaderLinksArray["cscad_phone"] = " " . getLngt("Telefon") . ""; $dspColHeaderLinksArray["statistic"] = " " . getLngt("Statistik") . " "; $dspColHeaderLinksArray["cs_report"] = " " . getLngt("Berichte") . " "; $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]] . ""; endif; } endif; // if called e.g. by the first time with empty search-fields $searchValues = $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 . $f_phone; // $searchValues .= $f_usr_name . $f_usr_phone . $f_usr_email; // Generate search-resultset if ($f_act == "search" && $searchValues != "") : if (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 || strlen($f_phone) > 2) : // ******************************************* // * Selection of the customers for the list * // ******************************************* if ($f_searchmode == "1") : $prefix = "%"; else : $prefix = ""; endif; $whereClause = ""; // Check for search value in cmp.cmp_comp OR cmp.cmp_match if ($f_cmp_comp != "") : $whereClause .= "cmp.cmp_comp LIKE '" . $prefix . $f_cmp_comp . "%'"; if (($constSearchCscsclistCmpcompCmpmatch == "1" && $f_cmp_match != "") || ($constSearchCscsclistCmpcompCseid == "1" && $f_cs_eid != "") || ($constSearchCscsclistCmpcompCscadphone == "1" && $f_phone != "")) : $whereClause = " (" . $whereClause; if ($constSearchCscsclistCmpcompCmpmatch == "1" && $f_cmp_match != "") : $whereClause .= " OR cmp.cmp_match LIKE '" . $prefix . $f_cmp_match . "%'"; endif; if ($constSearchCscsclistCmpcompCseid == "1" && $f_cs_eid != "") : $whereClause .= " OR cs.cs_eid LIKE '" . $prefix . $f_cs_eid . "%'"; endif; if ($constSearchCscsclistCmpcompCscadphone == "1" && $f_phone != "") : $whereClause .= " OR cscad.cscad_phone LIKE '" . $prefix . $f_phone . "%'"; endif; $whereClause .= ") "; endif; endif; if ($whereClause != "" && $f_cmp_comp2 != "") : $whereClause .= " AND "; endif; if ($f_cmp_comp2 != "") : $whereClause .= "cmp.cmp_comp2 LIKE '" . $prefix . $f_cmp_comp2 . "%'"; endif; // Check for search value in cmp.cmp_comp OR cmp.cmp_match if ($constSearchCscsclistCmpcompCmpmatch != "1") : if ($whereClause != "" && $f_cmp_match != "") : $whereClause .= " AND "; endif; if ($f_cmp_match != "") : $whereClause .= "cmp.cmp_match LIKE '" . $prefix . $f_cmp_match . "%'"; endif; endif; // Check for search value in cmp.cmp_comp OR cs.cs_eid if ($constSearchCscsclistCmpcompCseid != "1") : if ($whereClause != "" && $f_cs_eid != "") : $whereClause .= " AND "; endif; if ($f_cs_eid != "") : $whereClause .= "cs.cs_eid LIKE '" . $prefix . $f_cs_eid . "%'"; endif; endif; // Check for search value in cmp.cmp_comp OR cscad.cscad_phone if ($constSearchCscsclistCmpcompCscadphone != "1") : if ($whereClause != "" && $f_phone != "") : $whereClause .= " AND "; endif; if ($f_phone != "") : $whereClause .= "cscad.cscad_phone LIKE '" . $prefix . $f_phone . "%'"; endif; 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 .= "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 // Enable again 4 cashMode (... damit die "eigentliche" Funktion des Sperrens wieder aufgenommen werden kann !!!!!!!!!!!!!!!!!!) // if ($whereClause != "" && $f_cmp_authenticated == "1") : $whereClause .= " AND "; endif; // if ($f_cmp_authenticated == "1") : $whereClause .= "cmp.cmp_authenticated LIKE '" . $f_cmp_authenticated . "%'"; endif; // Show "invisible" customers $whereClauseCscVisible = ""; if ($f_show_invisible != "1") : if ($whereClause != "") : $whereClause .= " AND "; endif; $whereClause .= " cmp.cmp_visible = '1'"; $whereClauseCscVisible = " csc.csc_visible = '1' AND "; endif; if ($whereClause != "") : $whereClause .= " AND "; endif; // if (!(strpos($displayedListCols, "cmp_comp,") === FALSE)) : $constCscscListOrderBy = getParameterValue("0", "MASK_CSCSC_LIST_ORDER_BY", $hqId); if ($orderClause == "") : $orderClause = "cmp.cmp_comp"; if ($constCscscListOrderBy == "1") : if (!(strpos($displayedListCols, "csc_name,") === FALSE)) : $orderClause .= ", csc.csc_name"; endif; endif; endif; // endif; $whereClause2 = ""; // Internal/External/All costcenters if ($f_csc_is_extern == "0") : $whereClause2 .= " AND csc.csc_is_extern = '0' "; endif; if ($f_csc_is_extern == "1") : $whereClause2 .= " AND csc.csc_is_extern = '1' "; endif; // filter csc_id_payer == CSC_ID_PAYER_CASH (real payer is cash payer) // if ($tourno == -1) : $whereClause2 .= " AND cs.csc_id_payer != '" . CSC_ID_PAYER_CASH . "' "; endif; // Filter according to the customer type $whereClauseCustomerType = " cmp.cmp_type = '0' AND"; if ($allowAllCustomerTypes == "1") : $whereClauseCustomerType = ""; endif; $sqlquery = "SELECT csc.csc_id, csc.csc_name, csc.csc_is_extern, cs.cs_id, cs.cs_eid, cs.cs_eid AS cs_report, cs.csc_id_payer, cs.cs_id_parent, cs.cs_commission_no, cs.cs_jobbatch, cs.cs_discount, cs.cs_filter, cs.cs_fixprice_discount, " . " cs.cs_prov, cs.cs_jb_jam_waittime, cs.cs_tracking, cs.cs_invmode, cmp.cmp_id, cmp.cmp_type, cmp.cmp_comp, cmp.cmp_comp2, cmp.cmp_authenticated, cmp.cmp_remark, cmp.cmp_match, cmp.cmp_cashmode, cmp.cmp_stax_idno," . " cmp.tx_id, cscad.ad_id, cscad.cscad_comp, cscad.cscad_comp2, cscad.cscad_hsno," . " cscad.cscad_remark, cscad.cscad_person, cscad.cscad_phone," . " ad.ad_street, ad.ad_zipcode, ad.ad_city, ad.ad_country, cmp2.cmp_comp AS payer_comp, cmp2.cmp_stax_idno AS payer_cmp_stax_idno, cs2.cs_commission_no AS payer_cs_commission_no, cs.cs_eid AS statistic" . " FROM company AS cmp, costcenter AS csc, customer AS cs" . " LEFT JOIN costcenter AS csc2 ON csc2.csc_id = cs.csc_id_payer" . " LEFT JOIN customer AS cs2 ON cs2.cs_id = csc2.cs_id" . " LEFT JOIN company AS cmp2 ON cmp2.cmp_id = cs2.cmp_id," . " costcenteraddress AS cscad, address AS ad" . " WHERE " .$whereClause . " cs.hq_id IN " . getSQLMandatorArray($f_hq_id) . " AND" . " cmp.cmp_id = cs.cmp_id AND" . " cmp.cmp_archived = '0' AND" . " " . $whereClauseCustomerType . " cs.cs_id = csc.cs_id " . " " . $whereClause2 . " AND" . " " . $whereClauseCscVisible . " csc.csc_id = cscad.csc_id AND" . " cscad.adt_id = '4' AND" . " cscad.ad_id = ad.ad_id" . " ORDER BY " . $orderClause; // echo $sqlquery . "
"; getDb2Connection(); // Try to connect request server because of performance // $result = $db2->query($sqlquery); // if (DB::isError($result)) die ("$PHP_SELF: '$sqlquery': " . $result->getMessage()); $result = $db2->dbQ($sqlquery); // Table with header $rowCounter = 0; $lineToggler = 0; while ($row = $result->fetch_assoc()): $numOfRows++; $dspColArray = array(); $tableOfRows .= ""; $dspColArray["cmp_comp"] = " __START__" . $row["cmp_comp"] . "__END__"; $dspColArray["cmp_comp2"] = " __START__" . $row["cmp_comp2"] . "__END__"; if ($allowAllCustomerTypes == "1" && $row["cmp_type"] != "0") : $dspColArray["cs_eid"] = " " . $row["cs_eid"] . "" . ""; else : $dspColArray["cs_eid"] = " __START__" . $row["cs_eid"] . "__END__"; endif; $payer_comp = ""; $payer_cmp_stax_idno = ""; $payer_cs_commission_no = 0; if ($row["csc_id_payer"] != "" && $row["csc_id_payer"] != 0): // $payer_comp = $db->getOne("SELECT cmp_comp FROM company, customer, costcenter WHERE company.cmp_id = customer.cmp_id AND customer.cs_id = costcenter.cs_id AND costcenter.csc_id = " . $row["csc_id_payer"]); $payer_comp = $row["payer_comp"]; $payer_cmp_stax_idno = $row["payer_cmp_stax_idno"]; $payer_cs_commission_no = $row["payer_cs_commission_no"]; endif; if (trim($row["cscad_comp"] == "")) $row["cscad_comp"] = $row["cmp_comp"]; $cs_comm_prefix = $db->getOne("SELECT par_value FROM parameter WHERE par_key = 'MASK_COMM_PREFIX_" . $row["cs_id"] . "'"); $cs_jb_jam_waittime = $row["cs_jb_jam_waittime"]; if ($cs_jb_jam_waittime > 0) { $cs_jb_jam_waittime = $db->getOne("SELECT cs_jb_jam_waittime_minutes from customer WHERE cs_id = " . $row["cs_id"]); if ($cs_jb_jam_waittime == 0) { $cs_jb_jam_waittime = getParameterValue("0", "CS_JB_JAM_WAITTIME_AD_HOC_DEFAULT", "0"); } } $cs_invmail = $db->getOne("SELECT usr_inv_email from customer, employee, user WHERE cs_id = " . $row["cs_id"] . " AND customer.cs_admin = employee.emp_id AND employee.usr_id = user.usr_id"); $cs_jb_incomplete = $db->getOne("SELECT par_value FROM parameter WHERE par_key = 'CUSTOMER_MASK_JB_INCOMPLETE_" . $row["cs_id"] . "'"); // No Link for entries where csc_id_payer (i.e. real payer) is cash-payer (only when selection for payer only ($tourno == -1)) // if ($tourno == -1 && $row["csc_id_payer"] == CSC_ID_PAYER_CASH) { if (($tourno == -1 && $row["cmp_authenticated"] != "1") || ($allowAllCustomerTypes == "1" && $row["cmp_type"] != "0" && $activateCscLinkForProspects != "1")) { $dspColArray["csc_name"] = " __START__" . my_str_check_html($row["csc_name"]) . "__END__"; } else { $dspColArray["csc_name"] = " __START__" . my_str_check_html($row["csc_name"]) . "__END__"; } $dspColArray["cmp_match"] = " __START__" . $row["cmp_match"] . "__END__"; $authImgName = "circle_red.png"; if ($row["cmp_authenticated"] == "1") : $authImgName = "circle_green.png"; endif; if ($allowAllCustomerTypes == "1") : if ($row["cmp_type"] == "1") : $authImgName = "circle_lightblue.png"; endif; if ($row["cmp_type"] == "2") : $authImgName = "circle_lightblue.png"; endif; if ($row["cmp_type"] == "3") : $authImgName = "circle_lightblue.png"; endif; endif; $dspColArray["cmp_authenticated_img"] = ""; $cashmodeImgName = "circle_green.png"; if ($row["cmp_cashmode"] == "1") : $cashmodeImgName = "circle_red.png"; endif; // Enable 4 cashMode // $dspColArray["usr_name"] = ""; // $dspColArray["usr_name"] = " __START__" . $row["usr_name"] . "__END__"; // $dspColArray["usr_phone"] = " __START__" . $row["usr_phone"] . "__END__"; // $dspColArray["usr_email"] = " __START__" . $row["usr_email"] . "__END__"; $dspColArray["ad_street"] = " __START__" . $row["ad_street"] . "__END__"; $dspColArray["cscad_hsno"] = " __START__" . $row["cscad_hsno"] . "__END__"; $dspColArray["ad_zipcode"] = " __START__" . $row["ad_zipcode"] . "__END__"; $dspColArray["ad_city"] = " __START__" . $row["ad_city"] . "__END__"; $dspColArray["cscad_remark"] = " __START__" . $row["cscad_remark"] . "__END__"; $dspColArray["cscad_person"] = " __START__" . $row["cscad_person"] . "__END__"; $dspColArray["cscad_phone"] = " __START__" . $row["cscad_phone"] . "__END__"; // $dspColArray["statistic"] = " " . getLngt("Statistik") . ""; // $dspColArray["cs_report"] = " " . getLngt("Berichte") . ""; $dspColArray["statistic"] = " "; $dspColArray["cs_report"] = " "; // 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)) : // Define length (html attribute "size") of the field and substitute macro if ($displayedListLenColsArray[$i] == "" || $displayedListLenColsArray[$i] == "0") : $dspColArray[$tmpKeys[$j]] = str_replace("__START__", "", $dspColArray[$tmpKeys[$j]]); $dspColArray[$tmpKeys[$j]] = str_replace("__END__", "", $dspColArray[$tmpKeys[$j]]); else : // content of db-fields $tagBegin = "__START__"; $tagEnd = "__END__"; if (!(strpos($dspColArray[$tmpKeys[$j]], $tagBegin) === FALSE) && !(strpos($dspColArray[$tmpKeys[$j]], $tagEnd) === FALSE)) : $pos0 = strpos($dspColArray[$tmpKeys[$j]], $tagBegin); // begin of tagBegin (first occurrence) $pos1 = strpos($dspColArray[$tmpKeys[$j]], $tagBegin) + strlen($tagBegin); // end of tagBegin (first occurrence) $pos2 = strpos($dspColArray[$tmpKeys[$j]], $tagEnd); // begin of tagEnd (first occurrence) $pos3 = strpos($dspColArray[$tmpKeys[$j]], $tagEnd) + strlen($tagEnd); // end of tagEnd (first occurrence) if ($pos2 - $pos1 > 0) : // first get the content of the tag $fieldContent = substr($dspColArray[$tmpKeys[$j]], $pos1, $pos2 - $pos1); $fieldContent = substr($fieldContent, 0, $displayedListLenColsArray[$i]); // replace original content with string-content $dspColArray[$tmpKeys[$j]] = substr_replace($dspColArray[$tmpKeys[$j]], $fieldContent, $pos0, $pos3 - $pos0); endif; endif; endif; if ($lineToggler == 0) : $lineToggler = 1; else : $lineToggler = 0; endif; $cellColor = getListColor($rowCounter, $lineToggler); $dspColArray[$tmpKeys[$j]] = str_replace("__START__", "", $dspColArray[$tmpKeys[$j]]); $dspColArray[$tmpKeys[$j]] = str_replace("__END__", "", $dspColArray[$tmpKeys[$j]]); $dspColArray[$tmpKeys[$j]] = str_replace("__BGCOL__", " bgcolor=\"" . $cellColor ."\"", $dspColArray[$tmpKeys[$j]]); $tableOfRows .= $dspColArray[$tmpKeys[$j]] . "\n"; endif; } if ($lineToggler == 0) : $lineToggler = 1; else : $lineToggler = 0; endif; $tableOfRows .= "\n"; endwhile; $result->free(); else : $statusMessage = getLngt("Bei Eingabe weniger als 3 Zeichen in mindestens einem Feld erfolgt keine Suche! Mind. ein Zeichen bei Kostenstelle reicht aus!"); endif; endif; ?> <?php echo $pageTitel ?>


0" . " AND job.jb_id = tour.jb_id AND tour.ad_id = address.ad_id ORDER BY jb_tourname, tr_sort" ; $res = $db2->query($sqlquery); // if ($res->numRows() > 0) { if ($db2->dbNumRows($res) > 0) { echo htmlDivLineSpacer("10px"); echo htmlDivLineSpacer("10px"); echo "
" . "Adressen aus gespeicherten Touren" . "
"; echo htmlDivLineSpacer("10px"); $bgCol = getListColor(0, 0); echo "
"; echo ""; } if (DB::isError($res)) die ("$PHP_SELF: '$sqlquery': " . $res->getMessage()); $lineToggler = 0; while ($row = $res->fetch_assoc()): if ($lineToggler == 0) : $lineToggler = 1; else : $lineToggler = 0; endif; $bgCol = getListColor($lineToggler, $lineToggler); echo ""; endwhile; // if ($res->numRows() > 0) if ($db2->dbNumRows($res) > 0) echo ""; echo "
 Name  Station   Firma  Person  Straße  Nr.  PLZ  Ort  Bemerkung 
 " . $row["jb_tourname"] . " " . $row["tr_sort"] . "" . "" . "" . "" . " " . $row["tr_comp"] . " " . $row["tr_person"] . " " . $row["ad_street"] . " " . $row["tr_hsno"] . " " . $row["ad_zipcode"] . " " . $row["ad_city"] . " " . $row["tr_remark"] . "
"; $res->free(); } ?>