diff --git a/admin-dev/tabs/AdminSearch.php b/admin-dev/tabs/AdminSearch.php deleted file mode 100644 index 9ab30d08e..000000000 --- a/admin-dev/tabs/AdminSearch.php +++ /dev/null @@ -1,304 +0,0 @@ - -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 6844 $ -* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ - - -class AdminSearch extends AdminTab -{ - public function searchIP($query) - { - if (!ip2long(trim($query))) - return; - - $this->_list['customers'] = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' - SELECT DISTINCT c.* - FROM `'._DB_PREFIX_.'customer` c - LEFT JOIN `'._DB_PREFIX_.'guest` g ON g.id_customer = c.id_customer - LEFT JOIN `'._DB_PREFIX_.'connections` co ON g.id_guest = co.id_guest - WHERE co.`ip_address` = \''.ip2long(trim($query)).'\''); - } - - /** - * Search a specific string in the products and categories - * - * @params string $query String to find in the catalog - */ - public function searchCatalog($query) - { - $this->context = Context::getContext(); - $this->_list['products'] = Product::searchByName($this->context->language->id, $query); - if (!empty($this->_list['products'])) - for ($i = 0; $i < count($this->_list['products']); $i++) - $this->_list['products'][$i]['nameh'] = str_ireplace($query, ''.Tools::htmlentitiesUTF8($query).'', $this->_list['products'][$i]['name']); - - $this->_list['categories'] = Category::searchByName($this->context->language->id, $query); - } - - /** - * Search a specific name in the customers - * - * @params string $query String to find in the catalog - */ - public function searchCustomer($query) - { - $this->_list['customers'] = Customer::searchByName($query); - } - - function postProcess() - { - $this->context = Context::getContext(); - $query = trim(Tools::getValue('bo_query')); - $searchType = (int)Tools::getValue('bo_search_type'); - - /* Handle empty search field */ - if (empty($query)) - $this->_errors[] = Tools::displayError('Please fill in search form first.'); - else - { - echo '
| '.($i == 0 ? htmlentities($key, ENT_COMPAT, 'utf-8') : ' ').' | -- - '.htmlentities(stripslashes($tab[$i]['value']), ENT_COMPAT, 'utf-8').' - - | -
|---|
| '.rtrim(getPath(self::$currentIndex.'?tab=AdminCatalog', $category['id_category'], '', $query), ' >').' |
| '.$field['title'].' | '; - echo '|||||||
|---|---|---|---|---|---|---|---|
| '.$product['id_product'].' | -'.($product['manufacturer_name'] != NULL ? stripslashes($product['manufacturer_name']) : '--').' | -'.$product['reference'].' | -'.stripslashes($product['nameh']).' | -'.Tools::displayPrice($product['price'], $this->context->currency).' | -'.$product['quantity'].' | -
- ![]() |
-
-
-
-
-
- |
-
| '.$field['title'].' | '; - echo '||||||||
|---|---|---|---|---|---|---|---|---|
| '.$customer['id_customer'].' | -'.stripslashes($customer['lastname']).' '.stripslashes($customer['firstname']).' | -'.stripslashes($customer['email']).' ![]() |
- '.Tools::displayDate($customer['birthday'], $this->context->language->id).' | -'.Tools::displayDate($customer['date_add'], $this->context->language->id).' | -'.Order::getCustomerNbOrders($customer['id_customer']).' | -![]() |
-
-
-
-
-
-
-
- |
-