public function queryItemWhereClause($mItemIndex = '', $mItemno = '') { $sql = " WHERE "; if ($mItemno != '') { if (\is_array($mItemno)) { $sItemno = "'" . \implode("','", \filter_var_array($mItemno, FILTER_SANITIZE_SPECIAL_CHARS)) . "'"; $sql .= 'item_base.itm_no IN (' . $sItemno . ')'; } else { $sql .= 'item_base.itm_no = :itemno'; } } elseif (isset($_REQUEST["searchtext"]) && \strlen($_REQUEST["searchtext"]) > 2) { if (isset($_REQUEST["artnoexact"])) { $sql .= 'item_base.itm_no = :searchtext'; } else { $sql .= '(item_base.itm_no LIKE :searchtextwild1 OR itm_name LIKE :searchtextwild2'; $sql .= ' OR itml_name_override LIKE :searchtextwild3 OR itml_text1 LIKE :searchtextwild4'; $sql .= ' OR itml_text2 LIKE :searchtextwild5)'; } } else { if (is_array($mItemIndex)) { $sql .= "("; foreach ($mItemIndex as $sAIndex) { $sql .= "itm_index LIKE '%" . filter_var($sAIndex, FILTER_SANITIZE_SPECIAL_CHARS) . "%' OR "; } $sql = \HaaseIT\Tools::cutStringend($sql, 4); $sql .= ")"; } else { $sql .= "itm_index LIKE '%" . filter_var($mItemIndex, FILTER_SANITIZE_SPECIAL_CHARS) . "%'"; } } $sql .= ' AND itm_index NOT LIKE \'%!%\' AND itm_index NOT LIKE \'%AL%\''; return $sql; }
private function getRoutingoverride($aPath) { $aRoutingoverride = []; // /xxxx/item/0010.html $aTMP["parts_in_path"] = count($aPath); // if the last dir in path is 'item' and the last part of the path is not empty if ($aPath[$aTMP["parts_in_path"] - 2] == 'item' && $aPath[$aTMP["parts_in_path"] - 1] != '') { // explode the filename by . $aTMP["exploded_request_file"] = explode('.', $aPath[$aTMP["parts_in_path"] - 1]); // if the filename ends in '.html', get the requested itemno if ($aTMP["exploded_request_file"][count($aTMP["exploded_request_file"]) - 1] == 'html') { // to allow dots in the filename, we have to iterate through all parts of the filename $aRoutingoverride["itemno"] = ''; for ($i = 0; $i < count($aTMP["exploded_request_file"]) - 1; $i++) { $aRoutingoverride["itemno"] .= $aTMP["exploded_request_file"][$i] . '.'; } // remove the trailing dot $aRoutingoverride["itemno"] = \HaaseIT\Tools::cutStringend($aRoutingoverride["itemno"], 1); $aRoutingoverride["cb_pagetype"] = 'itemdetail'; // rebuild the path string without the trailing '/item/itemno.html' $this->sPath = ''; for ($i = 0; $i < $aTMP["parts_in_path"] - 2; $i++) { $this->sPath .= $aPath[$i] . '/'; } } } return $aRoutingoverride; }
/** * @return string */ private function getNotification() { $return = ''; if (isset($this->get["msg"]) && trim($this->get["msg"]) != '') { if ($this->get["msg"] == 'updated' && isset($this->get["cartkey"]) && isset($this->get["amount"]) || $this->get["msg"] == 'removed' && isset($this->get["cartkey"])) { $return .= $this->textcats->T("shoppingcart_msg_" . $this->get["msg"] . "_1") . ' '; if (isset(HelperConfig::$shop["custom_order_fields"]) && mb_strpos($this->get["cartkey"], '|') !== false) { $mCartkeys = explode('|', $this->get["cartkey"]); foreach ($mCartkeys as $sKey => $sValue) { if ($sKey == 0) { $return .= $sValue . ', '; } else { $TMP = explode(':', $sValue); $return .= $this->textcats->T("shoppingcart_item_" . $TMP[0]) . ' ' . $TMP[1] . ', '; unset($TMP); } } $return = Tools::cutStringend($return, 2); } else { $return .= $this->get["cartkey"]; } $return .= ' ' . $this->textcats->T("shoppingcart_msg_" . $this->get["msg"] . "_2"); if ($this->get["msg"] == 'updated') { $return .= ' ' . $this->get["amount"]; } $return .= '<br><br>'; } } return $return; }