"; $dspColHeaderSearchFieldArray["at_name"] = ""; $dspColHeaderSearchFieldArray["at_serialno"] = ""; $dspColHeaderSearchFieldArray["at_mountable"] = ""; $dspColHeaderSearchFieldArray["at_match"] = ""; $dspColHeaderSearchFieldArray["at_barcode"] = ""; $dspColHeaderSearchFieldArray["at_createtime"] = ""; $dspColHeaderSearchFieldArray["at_description"] = ""; $dspColHeaderSearchFieldArray["at_id_history"] = " "; // $dspColHeaderSearchFieldArray["at_id_report"] = " "; $dspColHeaderSearchFieldArray["at_id_edit"] = " "; $dspColHeaderSearchFieldArray["atg_data"] = " "; $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); $tableHeaderSearchFields .= "" . $dspColHeaderSearchFieldArray[$tmpKeys[$j]] . ""; endif; } endif; // OUTPUT: Table header column links $tableHeaderLinks = ""; if (TRUE) : $dspColHeaderLinksArray = array(); $dspColHeaderLinksArray["at_eid"] = " " . getLngt(wrapPhrase("Artikelnr.", $objecttypemode)) . " "; $dspColHeaderLinksArray["at_name"] = " " . getLngt("Bezeichnung") . " "; $dspColHeaderLinksArray["at_serialno"] = " " . getLngt("Seriennr.") . " "; $dspColHeaderLinksArray["at_mountable"] = " " . getLngt("Montierbar") . " "; $dspColHeaderLinksArray["at_match"] = " " . getLngt("Zusatz") . " "; $dspColHeaderLinksArray["at_barcode"] = " " . getLngt("Barcode") . " "; $dspColHeaderLinksArray["at_createtime"] = " " . getLngt("Neuanlagedatum") . " "; $dspColHeaderLinksArray["at_description"] = " " . getLngt("Beschreibung") . " "; $dspColHeaderLinksArray["at_id_history"] = " " . getLngt("Historie"); // $dspColHeaderLinksArray["at_id_report"] = " " . getLngt("Berichte"); $dspColHeaderLinksArray["at_id_edit"] = " " . getLngt("Bearbeiten") . " "; $dspColHeaderLinksArray["atg_data"] = " " . getLngt(wrapPhrase("Warengruppe", $objecttypemode)) . " "; $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 ($f_searchmode == "") : $f_searchmode = "1"; endif; // Generate search-resultset if ($f_act == "search") : $f_at_eid = trim($f_at_eid); $f_at_name = trim($f_at_name); $f_at_match = trim($f_at_match); $f_at_barcode = trim($f_at_barcode); $f_at_description = trim($f_at_description); $doSearch = FALSE; if (strlen($f_at_eid . $f_at_name . $f_at_match . $f_at_description . $f_at_barcode) == 0) : if (getCountOfTable("article") <= MAX_CARDINALITY) : $doSearch = TRUE; endif; endif; if ($doSearch || strlen($f_at_eid) > 1 || strlen($f_at_name) > 1 || strlen($f_at_match) > 1 || strlen($f_at_description) > 1 || strlen($f_at_barcode) > 2) : // ******************************************* // * Selection of the customers for the list * // ******************************************* if ($f_searchmode == "1") : $prefix = "%"; else : $prefix = ""; endif; $whereClause = ""; if ($f_at_eid != "") : $whereClause .= "at.at_eid LIKE '" . $prefix . $f_at_eid . "%'"; endif; if ($whereClause != "" && $f_at_name != "") : $whereClause .= " AND "; endif; if ($f_at_name != "") : $whereClause .= "at.at_name LIKE '" . $prefix . $f_at_name . "%'"; endif; if ($whereClause != "" && $f_at_match != "") : $whereClause .= " AND "; endif; if ($f_at_match != "") : $whereClause .= "at.at_match LIKE '" . $prefix . $f_at_match . "%'"; endif; if ($whereClause != "" && $f_at_barcode != "") : $whereClause .= " AND "; endif; if ($f_at_barcode != "") : $whereClause .= "at.at_barcode LIKE '" . $prefix . $f_at_barcode . "%'"; endif; if ($whereClause != "" && $f_at_description != "") : $whereClause .= " AND "; endif; if ($f_at_description != "") : $whereClause .= "at.at_description LIKE '" . $prefix . $f_at_description . "%'"; endif; // if ($whereClause != "" && $f_cs_eid != "") : $whereClause .= " AND "; endif; // if ($f_cs_eid != "") : $whereClause .= "cs.cs_eid LIKE '" . $prefix . $f_cs_eid . "%'"; endif; // Check authentication // if ($whereClause != "" && $f_at_authenticated == "1") : $whereClause .= " AND "; endif; // if ($f_at_authenticated == "1") : $whereClause .= "at.at_authenticated LIKE '" . $f_at_authenticated . "%'"; endif; // Check visibles $whereClauseVisibility = " at.at_visible = '1' "; if ($f_show_invisible == "1") : $whereClauseVisibility = ""; endif; if ($whereClause != "" && $whereClauseVisibility != "") : $whereClauseVisibility = " AND " . $whereClauseVisibility; endif; $whereClause .= $whereClauseVisibility; if ($whereClause != "") : $whereClause .= " AND "; endif; $whereClause .= " at.hq_id IN " . getSQLMandatorArray($f_hq_id); if ($orderClause == "") : $orderClause = "at.at_eid"; endif; $sqlquery = "SELECT at.at_id, at.hq_id, at.at_eid, at.at_name, at.at_match, at.at_description, at.at_barcode," . " at.at_serialno, at.at_mountable, at.at_authenticated, at.at_visible, at.at_createtime, CONCAT(atg.atg_key,' ',atg.atg_name) AS atg_data" . " FROM article AS at LEFT JOIN articlegroupitem AS atgi ON atgi.md_id = '" . $md_id . "' AND atgi.hq_id IN ('0','" . $hq_id . "') AND atgi.at_id = at.at_id" . " LEFT JOIN articlegroup AS atg ON atg.md_id = '" . $md_id . "' AND atg.atg_id = atgi.atg_id" . " WHERE " . $whereClause . " ORDER BY " . $orderClause; // echo $sqlquery . "
"; $result = $db->query($sqlquery); if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage()); // Table with header $rowCounter = 0; $lineToggler = 0; while ($row = $result->fetch_assoc()): $numOfRows++; $dspColArray = array(); // Only for focussing the first element (link) of the list // Look in tag $elementName = ""; if ($numOfRows == "1") : $elementName = " name=\"at2focus\" "; endif; $tableOfRows .= ""; // Link refers to customer details // $dspColArray["at_eid"] = " " // . $row["at_eid"] . "" . ""; $dspColArray["at_eid"] = " " . $row["at_eid"] . "" . ""; $dspColArray["at_name"] = " " . $row["at_name"] . ""; $dspColArray["at_serialno"] = " " . ($row["at_serialno"] == "1" ? "" : "") . ""; $dspColArray["at_mountable"] = " " . ($row["at_mountable"] == "1" ? "" : "") . ""; $dspColArray["at_match"] = " " . $row["at_match"] . ""; $dspColArray["at_barcode"] = " " . $row["at_barcode"] . ""; $dspColArray["at_createtime"] = " " . $row["at_createtime"] . ""; $dspColArray["at_id_history"] = "" . "" . ""; // $dspColArray["at_id_report"] = "" // . "" // . ""; // $dspColArray["at_id_remove"] = " " . "" // . "" // . "" . ""; $authImgName = "circle_red.png"; if ($row["at_authenticated"] == "1") : $authImgName = "circle_green.png"; endif; $dspColArray["at_authenticated_img"] = ""; // $dspColArray["at_id_edit"] = "" // . "" // . "" . ""; $dspColArray["at_id_edit"] = "" . "" . "" . ""; $dspColArray["atg_data"] = " " . $row["atg_data"] . ""; $dspColArray["at_description"] = " " . $row["at_description"] . ""; // 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]]; endif; } $tableOfRows .= ""; endwhile; $result->free(); else : $statusMessage = getLngt("Bei Eingabe weniger als 2 Zeichen in mindestens einem Feld erfolgt keine Suche!"); endif; endif; // Link to enter a new article or to switch "visibility output" $headerOps = ""; $headerOps .= "   |   "; $headerOps .= "" . getLngt(wrapPhrase("Neuer Artikel", $objecttypemode)) . ""; $headerOps .= "   |   "; $headerOps .= getLngt("Ausgeblendete anzeigen") . " "; ?> <?php echo $pageTitel ?>
      |       |    Option:   > >