本文整理汇总了PHP中hikashop_search函数的典型用法代码示例。如果您正苦于以下问题:PHP hikashop_search函数的具体用法?PHP hikashop_search怎么用?PHP hikashop_search使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hikashop_search函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listing
function listing()
{
$app = JFactory::getApplication();
$database = JFactory::getDBO();
$toggleClass = hikashop_get('helper.toggle');
$this->assignRef('toggleClass', $toggleClass);
$pageInfo = $this->getPageInfo('a.warehouse_id');
$filters = array();
$order = '';
$searchMap = array('a.warehouse_id', 'a.warehouse_name', 'a.warehouse_description');
$this->processFilters($filters, $order, $searchMap);
$query = ' FROM ' . hikashop_table('warehouse') . ' AS a' . $filters . $order;
$this->getPageInfoTotal($query, '*');
$database->setQuery('SELECT a.*' . $query, $pageInfo->limit->start, $pageInfo->limit->value);
$rows = $database->loadObjectList();
if (!empty($pageInfo->search)) {
$rows = hikashop_search($pageInfo->search, $rows, 'warehouse_id');
}
$database->setQuery('SELECT count(*)' . $query);
$pageInfo->elements->page = count($rows);
$toggleClass = hikashop_get('helper.toggle');
$this->assignRef('toggleClass', $toggleClass);
$this->assignRef('rows', $rows);
$this->assignRef('pageInfo', $pageInfo);
$this->getPagination();
$this->getOrdering('a.warehouse_ordering', true);
$this->assignRef('order', $order);
hikashop_setTitle(JText::_($this->nameListing), $this->icon, $this->ctrl);
$config =& hikashop_config();
$manage = hikashop_isAllowed($config->get('acl_warehouse_manage', 'all'));
$this->assignRef('manage', $manage);
$this->toolbar = array(array('name' => 'addNew', 'display' => $manage), array('name' => 'editList', 'display' => $manage), array('name' => 'deleteList', 'check' => JText::_('HIKA_VALIDDELETEITEMS'), 'display' => hikashop_isAllowed($config->get('acl_warehouse_delete', 'all'))), '|', array('name' => 'pophelp', 'target' => $this->ctrl . '-listing'), 'dashboard');
}
示例2: listing
function listing()
{
$app = JFactory::getApplication();
$pageInfo = new stdClass();
$pageInfo->filter = new stdClass();
$pageInfo->filter->order = new stdClass();
$pageInfo->limit = new stdClass();
$pageInfo->search = $app->getUserStateFromRequest($this->paramBase . ".search", 'search', '', 'string');
$pageInfo->filter->order->value = $app->getUserStateFromRequest($this->paramBase . ".filter_order", 'filter_order', 'a.waitlist_id', 'cmd');
$pageInfo->filter->order->dir = $app->getUserStateFromRequest($this->paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
$pageInfo->limit->value = $app->getUserStateFromRequest($this->paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
$pageInfo->limit->start = $app->getUserStateFromRequest($this->paramBase . '.limitstart', 'limitstart', 0, 'int');
$database = JFactory::getDBO();
$filters = array();
$searchMap = array('a.waitlist_id', 'a.email', 'a.name', 'a.product_id', 'b.product_name', 'b.product_code');
if (!empty($pageInfo->search)) {
$searchVal = '\'%' . hikashop_getEscaped(JString::strtolower(trim($pageInfo->search)), true) . '%\'';
$filters[] = implode(" LIKE {$searchVal} OR ", $searchMap) . " LIKE {$searchVal}";
}
$order = '';
if (!empty($pageInfo->filter->order->value)) {
$order = ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
}
if (!empty($filters)) {
$filters = ' WHERE (' . implode(') AND (', $filters) . ')';
} else {
$filters = '';
}
$query = ' FROM ' . hikashop_table('waitlist') . ' AS a LEFT JOIN ' . hikashop_table('product') . ' AS b ON a.product_id=b.product_id ' . $filters . $order;
$database->setQuery('SELECT *' . $query, (int) $pageInfo->limit->start, (int) $pageInfo->limit->value);
$rows = $database->loadObjectList();
$class = hikashop_get('class.product');
foreach ($rows as $i => $element) {
if ($element->product_type == 'variant') {
$database->setQuery('SELECT * FROM ' . hikashop_table('variant') . ' AS a LEFT JOIN ' . hikashop_table('characteristic') . ' AS b ON a.variant_characteristic_id=b.characteristic_id WHERE a.variant_product_id=' . (int) $element->product_id . ' ORDER BY a.ordering');
$element->characteristics = $database->loadObjectList();
$parentProduct = $class->get((int) $element->product_parent_id);
$class->checkVariant($element, $parentProduct);
$rows[$i] = $element;
}
}
if (!empty($pageInfo->search)) {
$rows = hikashop_search($pageInfo->search, $rows, 'waitlist_id');
}
$database->setQuery('SELECT COUNT(*)' . $query);
$pageInfo->elements = new stdClass();
$pageInfo->elements->total = $database->loadResult();
$pageInfo->elements->page = count($rows);
$toggleClass = hikashop_get('helper.toggle');
$this->assignRef('toggleClass', $toggleClass);
$this->assignRef('rows', $rows);
$this->assignRef('pageInfo', $pageInfo);
$this->getPagination();
hikashop_setTitle(JText::_($this->nameListing), $this->icon, $this->ctrl);
$config =& hikashop_config();
$manage = hikashop_isAllowed($config->get('acl_waitlist_manage', 'all'));
$this->assignRef('manage', $manage);
$this->toolbar = array(array('name' => 'addNew', 'display' => $manage), array('name' => 'editList', 'display' => $manage), array('name' => 'deleteList', 'display' => hikashop_isAllowed($config->get('acl_waitlist_delete', 'all'))), '|', array('name' => 'pophelp', 'target' => $this->ctrl . '-listing'), 'dashboard');
}
示例3: product_select
function product_select()
{
$app = JFactory::getApplication();
$config =& hikashop_config();
$this->assignRef('config', $config);
$this->paramBase .= "_product_select";
$element = new stdClass();
$element->order_id = JRequest::getInt('order_id');
$this->assignRef('element', $element);
$pageInfo = new stdClass();
$pageInfo->filter = new stdClass();
$pageInfo->filter->order = new stdClass();
$pageInfo->limit = new stdClass();
$pageInfo->filter->order->value = $app->getUserStateFromRequest($this->paramBase . ".filter_order", 'filter_order', 'a.ordering', 'cmd');
$pageInfo->filter->order->dir = $app->getUserStateFromRequest($this->paramBase . ".filter_order_Dir", 'filter_order_Dir', 'asc', 'word');
if (JRequest::getVar('search') != $app->getUserState($this->paramBase . ".search")) {
$app->setUserState($this->paramBase . '.limitstart', 0);
$pageInfo->limit->start = 0;
} else {
$pageInfo->limit->start = $app->getUserStateFromRequest($this->paramBase . '.limitstart', 'limitstart', 0, 'int');
}
$pageInfo->search = $app->getUserStateFromRequest($this->paramBase . ".search", 'search', '', 'string');
$pageInfo->search = JString::strtolower(trim($pageInfo->search));
$pageInfo->limit->value = $app->getUserStateFromRequest($this->paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
if (empty($pageInfo->limit->value)) {
$pageInfo->limit->value = 500;
}
$selectedType = $app->getUserStateFromRequest($this->paramBase . ".filter_type", 'filter_type', 0, 'int');
$pageInfo->filter->filter_id = $app->getUserStateFromRequest($this->paramBase . ".filter_id", 'filter_id', 0, 'string');
$pageInfo->filter->filter_product_type = $app->getUserStateFromRequest($this->paramBase . ".filter_product_type", 'filter_product_type', 'main', 'word');
$database = JFactory::getDBO();
$filters = array();
$searchMap = array('b.product_name', 'b.product_description', 'b.product_id', 'b.product_code');
if (empty($pageInfo->filter->filter_id) || !is_numeric($pageInfo->filter->filter_id)) {
$pageInfo->filter->filter_id = 'product';
$class = hikashop_get('class.category');
$class->getMainElement($pageInfo->filter->filter_id);
}
if (!empty($pageInfo->search)) {
$searchVal = '\'%' . hikashop_getEscaped($pageInfo->search, true) . '%\'';
$filters[] = implode(" LIKE {$searchVal} OR ", $searchMap) . " LIKE {$searchVal}";
}
$order = '';
if (!$selectedType) {
$filters[] = 'a.category_id=' . (int) $pageInfo->filter->filter_id;
$select = 'SELECT a.ordering, b.*';
} else {
$categoryClass = hikashop_get('class.category');
$categoryClass->parentObject =& $this;
$children = $categoryClass->getChildren((int) $pageInfo->filter->filter_id, true, array(), '', 0, 0);
$filter = 'a.category_id IN (';
foreach ($children as $child) {
$filter .= $child->category_id . ',';
}
$filters[] = $filter . (int) $pageInfo->filter->filter_id . ')';
$select = 'SELECT DISTINCT b.*';
}
if ($pageInfo->filter->filter_product_type == 'all') {
if (!empty($pageInfo->filter->order->value)) {
$select .= ',' . $pageInfo->filter->order->value . ' as sorting_column';
$order = ' ORDER BY sorting_column ' . $pageInfo->filter->order->dir;
}
} else {
if (!empty($pageInfo->filter->order->value)) {
$order = ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
}
}
JPluginHelper::importPlugin('hikashop');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onBeforeProductListingLoad', array(&$filters, &$order, &$this, &$select, &$select2, &$a, &$b, &$on));
if ($pageInfo->filter->filter_product_type == 'all') {
$query = '( ' . $select . ' FROM ' . hikashop_table('product_category') . ' AS a LEFT JOIN ' . hikashop_table('product') . ' AS b ON a.product_id=b.product_id WHERE ' . implode(' AND ', $filters) . ' AND b.product_id IS NOT NULL )
UNION
( ' . $select . ' FROM ' . hikashop_table('product_category') . ' AS a LEFT JOIN ' . hikashop_table('product') . ' AS b ON a.product_id=b.product_parent_id WHERE ' . implode(' AND ', $filters) . ' AND b.product_parent_id IS NOT NULL ) ';
$database->setQuery($query . $order, (int) $pageInfo->limit->start, (int) $pageInfo->limit->value);
} else {
$filters[] = 'b.product_type = ' . $database->Quote($pageInfo->filter->filter_product_type);
if ($pageInfo->filter->filter_product_type != 'variant') {
$lf = 'a.product_id=b.product_id';
} else {
$lf = 'a.product_id=b.product_parent_id';
}
$query = ' FROM ' . hikashop_table('product_category') . ' AS a LEFT JOIN ' . hikashop_table('product') . ' AS b ON ' . $lf . ' WHERE ' . implode(' AND ', $filters);
$database->setQuery($select . $query . $order, (int) $pageInfo->limit->start, (int) $pageInfo->limit->value);
}
$rows = $database->loadObjectList();
if (!empty($pageInfo->search)) {
$rows = hikashop_search($pageInfo->search, $rows, 'product_id');
}
if ($pageInfo->filter->filter_product_type == 'all') {
$database->setQuery('SELECT COUNT(*) FROM (' . $query . ') as u');
} else {
$database->setQuery('SELECT COUNT(DISTINCT(b.product_id))' . $query);
}
$pageInfo->elements = new stdClass();
$pageInfo->elements->total = $database->loadResult();
$pageInfo->elements->page = count($rows);
if ($pageInfo->elements->page) {
$this->_loadPrices($rows);
}
//.........这里部分代码省略.........
示例4: foreach
if ($this->singleSelection) {
if ($this->confirm) {
$data = '{id:' . $product->product_id;
foreach ($this->elemStruct as $s) {
if ($s == 'id') {
continue;
}
$data .= ',' . $s . ':\'' . str_replace(array('\'', '"'), array('\\\'', '\\\''), $product->{$s}) . '\'';
}
$data .= '}';
$extraTr = ' style="cursor:pointer" onclick="window.top.hikashop.submitBox(' . $data . ');"';
} else {
$extraTr = ' style="cursor:pointer" onclick="hikashop_setId(\'' . $product->product_id . '\');"';
}
if (!empty($this->pageInfo->search)) {
$row = hikashop_search($this->pageInfo->search, $product, 'product_id');
}
} else {
$lbl1 = '<label for="cb' . $i . '">';
$lbl2 = '</label>';
$extraTr = ' onclick="hikashop.checkRow(\'cb' . $i . '\');"';
}
?>
<tr class="row<?php
echo $k;
?>
"<?php
echo $extraTr;
?>
>
<td align="center"><?php
示例5: downloads
function downloads()
{
$user = hikashop_loadUser(true);
if (hikashop_loadUser() == null) {
return false;
}
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$config = hikashop_config();
$this->assignRef('config', $config);
$order_statuses = explode(',', $config->get('order_status_for_download', 'shipped,confirmed'));
foreach ($order_statuses as $k => $o) {
$order_statuses[$k] = $db->Quote(trim($o));
}
$download_time_limit = $config->get('download_time_limit', 0);
$this->assignRef('download_time_limit', $download_time_limit);
$paramBase = HIKASHOP_COMPONENT . '.' . $this->getName();
$pageInfo = new stdClass();
$pageInfo->filter = new stdClass();
$pageInfo->filter->order = new stdClass();
$pageInfo->limit = new stdClass();
$pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . '.filter_order', 'filter_order', 'max_order_created', 'cmd');
$pageInfo->filter->order->dir = $app->getUserStateFromRequest($paramBase . '.filter_order_Dir', 'filter_order_Dir', 'desc', 'word');
$pageInfo->search = $app->getUserStateFromRequest($paramBase . '.search', 'search', '', 'string');
$pageInfo->search = JString::strtolower($pageInfo->search);
$pageInfo->limit->start = $app->getUserStateFromRequest($paramBase . '.limitstart', 'limitstart', 0, 'int');
$oldValue = $app->getUserState($paramBase . '.list_limit');
$searchMap = array('op.order_product_name', 'f.file_name');
$order = '';
if (!empty($pageInfo->filter->order->value)) {
if ($pageInfo->filter->order->value == 'f.file_name') {
$order = ' ORDER BY f.file_name ' . $pageInfo->filter->order->dir . ', f.file_path ' . $pageInfo->filter->order->dir;
} else {
$order = ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
}
}
$filters = array('o.order_type = \'sale\'', 'o.order_status IN (' . implode(',', $order_statuses) . ')', 'f.file_ref_id > 0', 'f.file_type = \'file\'', 'o.order_user_id = ' . $user->user_id);
if (!empty($pageInfo->search)) {
$searchVal = '\'%' . hikashop_getEscaped(JString::strtolower(trim($pageInfo->search)), true) . '%\'';
$filter = '(' . implode(' LIKE ' . $searchVal . ' OR ', $searchMap) . ' LIKE ' . $searchVal . ')';
$filters[] = $filter;
}
$filters = implode(' AND ', $filters);
if (empty($oldValue)) {
$oldValue = $app->getCfg('list_limit');
}
$pageInfo->limit->value = $app->getUserStateFromRequest($paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
if ($oldValue != $pageInfo->limit->value) {
$pageInfo->limit->start = 0;
$app->setUserState($paramBase . '.limitstart', 0);
}
$select = 'o.order_id, o.order_created, p.*, f.*, op.* ';
$selectSum = ', MIN(o.order_created) as min_order_created, MAX(o.order_created) as max_order_created, SUM(op.order_product_quantity) as file_quantity ';
$selectUniq = ', IF( REPLACE(LEFT(f.file_path, 1) , \'#\', \'@\') = \'@\', CONCAT(f.file_id, \'@\', o.order_id), f.file_id ) as uniq_id';
$query = ' FROM ' . hikashop_table('order') . ' AS o ' . ' INNER JOIN ' . hikashop_table('order_product') . ' AS op ON op.order_id = o.order_id ' . ' INNER JOIN ' . hikashop_table('product') . ' AS p ON op.product_id = p.product_id ' . ' INNER JOIN ' . hikashop_table('file') . ' AS f ON (op.product_id = f.file_ref_id OR p.product_parent_id = f.file_ref_id) ' . ' WHERE ' . $filters;
$groupBy = ' GROUP BY uniq_id ';
$db->setQuery('SELECT ' . $select . $selectSum . $selectUniq . $query . $groupBy . $order, (int) $pageInfo->limit->start, (int) $pageInfo->limit->value);
$downloadData = $db->loadObjectList('uniq_id');
if (!empty($pageInfo->search)) {
$downloadData = hikashop_search($pageInfo->search, $downloadData, 'order_id');
}
$db->setQuery('SELECT COUNT(*) as all_results_count FROM (SELECT f.file_id ' . $selectUniq . $query . $groupBy . ') AS all_results');
$pageInfo->elements = new stdClass();
$pageInfo->elements->total = $db->loadResult('total');
$pageInfo->elements->page = count($downloadData);
$file_ids = array();
$order_ids = array();
foreach ($downloadData as $k => $data) {
if ((int) $data->order_id > 0) {
$order_ids[(int) $data->order_id] = (int) $data->order_id;
}
$downloadData[$k]->download_total = 0;
$downloadData[$k]->downloads = array();
$downloadData[$k]->orders = array();
if (strpos($k, '@') === false) {
$file_ids[] = $k;
}
}
if (!empty($file_ids)) {
$db->setQuery('SELECT ' . $select . $query . ' AND f.file_id IN (' . implode(',', $file_ids) . ')');
$orders = $db->loadObjectList();
foreach ($orders as $o) {
if (isset($downloadData[$o->file_id])) {
$downloadData[$o->file_id]->orders[(int) $o->order_id] = $o;
$downloadData[$o->file_id]->orders[(int) $o->order_id]->file_qty = 0;
$downloadData[$o->file_id]->orders[(int) $o->order_id]->download_total = 0;
}
$order_ids[(int) $o->order_id] = (int) $o->order_id;
}
}
if (!empty($order_ids)) {
$db->setQuery('SELECT * FROM ' . hikashop_table('download') . ' WHERE order_id IN (' . implode(',', $order_ids) . ')');
$downloads = $db->loadObjectList();
foreach ($downloads as $download) {
$uniq_id = $download->file_id . '@' . $download->order_id;
if (isset($downloadData[$uniq_id])) {
$downloadData[$uniq_id]->download_total += (int) $download->download_number;
$downloadData[$uniq_id]->downloads[$download->file_pos] = $download;
} else {
if (isset($downloadData[$download->file_id])) {
//.........这里部分代码省略.........
示例6: leads
function leads()
{
$this->paramBase = 'leads';
$app = JFactory::getApplication();
$pageInfo = new stdClass();
$pageInfo->filter = new stdClass();
$pageInfo->filter->order = new stdClass();
$pageInfo->limit = new stdClass();
$fieldsClass = hikashop_get('class.field');
$fields = $fieldsClass->getData('backend_listing', 'user', false);
$this->assignRef('fields', $fields);
$this->assignRef('fieldsClass', $fieldsClass);
$pageInfo->search = $app->getUserStateFromRequest($this->paramBase . ".search", 'search', '', 'string');
$pageInfo->filter->order->value = $app->getUserStateFromRequest($this->paramBase . ".filter_order", 'filter_order', 'a.user_id', 'cmd');
$pageInfo->filter->order->dir = $app->getUserStateFromRequest($this->paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
$pageInfo->limit->value = $app->getUserStateFromRequest($this->paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
$pageInfo->limit->start = $app->getUserStateFromRequest($this->paramBase . '.limitstart', 'limitstart', 0, 'int');
$database = JFactory::getDBO();
$user_id = hikashop_getCID('user_id');
$userClass = hikashop_get('class.user');
$user = $userClass->get($user_id);
$this->assignRef('user', $user);
$filters = array('a.user_partner_id=' . $user_id, 'a.user_partner_paid=0');
$searchMap = array('a.user_id', 'a.user_email', 'b.username', 'b.email', 'b.name');
foreach ($fields as $field) {
$searchMap[] = 'a.' . $field->field_namekey;
}
if (!empty($pageInfo->search)) {
$searchVal = '\'%' . hikashop_getEscaped($pageInfo->search, true) . '%\'';
$filters[] = implode(" LIKE {$searchVal} OR ", $searchMap) . " LIKE {$searchVal}";
}
$order = '';
if (!empty($pageInfo->filter->order->value)) {
$order = ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
}
if (!empty($filters)) {
$filters = ' WHERE (' . implode(') AND (', $filters) . ')';
} else {
$filters = '';
}
$query = ' FROM ' . hikashop_table('user') . ' AS a LEFT JOIN ' . hikashop_table('users', false) . ' AS b ON a.user_cms_id=b.id ' . $filters . $order;
$database->setQuery('SELECT a.*,b.*' . $query, (int) $pageInfo->limit->start, (int) $pageInfo->limit->value);
$rows = $database->loadObjectList();
$fieldsClass->handleZoneListing($fields, $rows);
if (!empty($pageInfo->search)) {
$rows = hikashop_search($pageInfo->search, $rows, 'user_id');
}
$database->setQuery('SELECT COUNT(*)' . $query);
$pageInfo->elements = new stdClass();
$pageInfo->elements->total = $database->loadResult();
$pageInfo->elements->page = count($rows);
$this->assignRef('rows', $rows);
$this->assignRef('pageInfo', $pageInfo);
$this->getPagination();
$currencyClass = hikashop_get('class.currency');
$this->assignRef('currencyHelper', $currencyClass);
}
示例7: showcarts
//.........这里部分代码省略.........
$l = --$k;
if (isset($products[$l])) {
if (!isset($products[$l]) || !is_object($products[$l])) {
$products[$l] = new stdClass();
}
$products[$l]->hide = 1;
}
}
$row_1 = $row;
}
$currentId = 0;
$values = null;
$price = 0;
$price_with_tax = 0;
$quantity = 0;
$currency = hikashop_getCurrency();
foreach ($products as $product) {
if (isset($product->cart_id) && isset($product->product_id)) {
if ($product->cart_id != $currentId) {
$price = 0;
$price_with_tax = 0;
$quantity = 0;
$currentId = $product->cart_id;
if (isset($product->prices[0]->price_currency_id)) {
$currency = $product->prices[0]->price_currency_id;
}
}
if (isset($product->prices[0])) {
$price += $product->cart_product_quantity * $product->prices[0]->price_value;
}
if (isset($product->prices[0]->price_value_with_tax)) {
$price_with_tax += $product->cart_product_quantity * $product->prices[0]->price_value_with_tax;
}
if (!isset($product->prices[0]->price_value)) {
$variant = new stdClass();
$variant->product_parent_id = $product->product_parent_id;
$variant->quantity = $product->cart_product_quantity;
}
if (isset($variant) && isset($product->prices[0]) && $product->product_id == $variant->product_parent_id) {
$price += $variant->quantity * $product->prices[0]->price_value;
$price_with_tax += $variant->quantity * $product->prices[0]->price_value_with_tax;
}
$quantity += $product->cart_product_quantity;
if (!isset($values[$currentId])) {
$values[$currentId] = new stdClass();
}
$values[$currentId]->price = $price;
$values[$currentId]->price_with_tax = isset($price_with_tax) ? $price_with_tax : $price;
$values[$currentId]->quantity = $quantity;
$values[$currentId]->currency = $currency;
}
}
$totalCart = 0;
$limit = 0;
foreach ($rows as $k => $row) {
if ($limit >= (int) $pageInfo->limit->start && $limit < (int) $pageInfo->limit->value && isset($values[$row->cart_id]) && $values[$row->cart_id] != null) {
$rows[$k]->price = $values[$row->cart_id]->price;
$rows[$k]->price_with_tax = $values[$row->cart_id]->price_with_tax;
$rows[$k]->quantity = $values[$row->cart_id]->quantity;
$rows[$k]->currency = $values[$row->cart_id]->currency;
$totalCart++;
} else {
unset($rows[$k]);
$limit--;
}
$limit++;
}
}
$pageInfo->elements = new stdClass();
$pageInfo->elements->total = count($rows);
if (!empty($pageInfo->search)) {
$rows = hikashop_search($pageInfo->search, $rows, 'cart_id');
}
$pageInfo->elements->page = count($rows);
if (!$pageInfo->elements->page) {
if (hikashop_loadUser() != null) {
$app = JFactory::getApplication();
if ($cart_type == 'cart') {
$app->enqueueMessage(JText::_('HIKA_NO_CARTS_FOUND'));
} else {
$app->enqueueMessage(JText::_('HIKA_NO_WISHLISTS_FOUND'));
}
}
}
jimport('joomla.html.pagination');
$pagination = hikashop_get('helper.pagination', $pageInfo->elements->total, $pageInfo->limit->start, $pageInfo->limit->value);
$pagination->hikaSuffix = '';
$this->assignRef('pagination', $pagination);
$this->assignRef('pageInfo', $pageInfo);
$cart = hikashop_get('helper.cart');
$this->assignRef('cart', $cart);
$this->assignRef('config', $config);
$this->assignRef('carts', $rows);
if ($cart_type == 'cart') {
$title = JText::_('CARTS');
} else {
$title = JText::_('WISHLISTS');
}
hikashop_setPageTitle($title);
}
示例8: select_coupon
function select_coupon()
{
$badge = JRequest::getVar('badge', 'false');
$this->assignRef('badge', $badge);
$app = JFactory::getApplication();
$pageInfo = new stdClass();
$pageInfo->filter = new stdClass();
$pageInfo->filter->order = new stdClass();
$pageInfo->limit = new stdClass();
$pageInfo->filter->order->value = $app->getUserStateFromRequest($this->paramBase . ".filter_order", 'filter_order', 'a.discount_id', 'cmd');
$pageInfo->filter->order->dir = $app->getUserStateFromRequest($this->paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
$pageInfo->search = $app->getUserStateFromRequest($this->paramBase . ".search", 'search', '', 'string');
$pageInfo->search = JString::strtolower(trim($pageInfo->search));
$pageInfo->filter->filter_type = $app->getUserStateFromRequest($this->paramBase . ".filter_type", 'filter_type', '', 'string');
$pageInfo->limit->value = $app->getUserStateFromRequest($this->paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
if (empty($pageInfo->limit->value)) {
$pageInfo->limit->value = 500;
}
$pageInfo->limit->start = $app->getUserStateFromRequest($this->paramBase . '.limitstart', 'limitstart', 0, 'int');
$database = JFactory::getDBO();
$searchMap = array('a.discount_code', 'a.discount_id');
$filters = array();
if ($badge != 'false') {
$filters[] = 'a.discount_type="discount"';
}
if (!empty($pageInfo->search)) {
$searchVal = '\'%' . hikashop_getEscaped($pageInfo->search, true) . '%\'';
$filters[] = implode(" LIKE {$searchVal} OR ", $searchMap) . " LIKE {$searchVal}";
}
$query = ' FROM ' . hikashop_table('discount') . ' AS a';
if ($badge == 'false' && !empty($pageInfo->filter->filter_type)) {
switch ($pageInfo->filter->filter_type) {
case 'all':
break;
default:
$filters[] = 'a.discount_type = ' . $database->Quote($pageInfo->filter->filter_type);
break;
}
}
if (!empty($filters)) {
$query .= ' WHERE (' . implode(') AND (', $filters) . ')';
}
if (!empty($pageInfo->filter->order->value)) {
$query .= ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
}
$database->setQuery('SELECT a.*' . $query, $pageInfo->limit->start, $pageInfo->limit->value);
$rows = $database->loadObjectList();
if (!empty($pageInfo->search)) {
$rows = hikashop_search($pageInfo->search, $rows, 'discount_id');
}
$database->setQuery('SELECT count(*)' . $query);
$pageInfo->elements = new stdClass();
$pageInfo->elements->total = $database->loadResult();
$pageInfo->elements->page = count($rows);
if ($pageInfo->limit->value == 500) {
$pageInfo->limit->value = 100;
}
hikashop_setTitle(JText::_($this->nameListing), $this->icon, $this->ctrl);
$config =& hikashop_config();
$manage = hikashop_isAllowed($config->get('acl_discount_manage', 'all'));
$this->assignRef('manage', $manage);
$this->toolbar = array(array('name' => 'custom', 'icon' => 'copy', 'task' => 'copy', 'alt' => JText::_('HIKA_COPY'), 'display' => $manage), array('name' => 'addNew', 'display' => $manage), array('name' => 'editList', 'display' => $manage), array('name' => 'deleteList', 'display' => hikashop_isAllowed($config->get('acl_discount_delete', 'all'))), '|', array('name' => 'pophelp', 'target' => $this->ctrl . '-listing'), 'dashboard');
$discountType = hikashop_get('type.discount');
$this->assignRef('filter_type', $discountType);
$toggleClass = hikashop_get('helper.toggle');
$this->assignRef('toggleClass', $toggleClass);
$this->assignRef('rows', $rows);
$this->assignRef('pageInfo', $pageInfo);
$this->getPagination();
$currencyHelper = hikashop_get('class.currency');
$this->assignRef('currencyHelper', $currencyHelper);
}
示例9: selectcategory
function selectcategory()
{
$this->paramBase .= '_category';
$app = JFactory::getApplication();
$pageInfo = new stdClass();
$pageInfo->filter = new stdClass();
$pageInfo->filter->order = new stdClass();
$pageInfo->limit = new stdClass();
$pageInfo->filter->order->value = $app->getUserStateFromRequest($this->paramBase . ".filter_order", 'filter_order', 'a.category_ordering', 'cmd');
$pageInfo->filter->order->dir = $app->getUserStateFromRequest($this->paramBase . ".filter_order_Dir", 'filter_order_Dir', 'asc', 'word');
$pageInfo->search = $app->getUserStateFromRequest($this->paramBase . ".search", 'search', '', 'string');
$pageInfo->search = JString::strtolower(trim($pageInfo->search));
$pageInfo->limit->value = $app->getUserStateFromRequest($this->paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
$pageInfo->limit->start = $app->getUserStateFromRequest($this->paramBase . '.limitstart', 'limitstart', 0, 'int');
$selectedType = $app->getUserStateFromRequest($this->paramBase . ".filter_type", 'filter_type', 0, 'int');
$pageInfo->filter->filter_id = $app->getUserStateFromRequest($this->paramBase . ".filter_id", 'filter_id', 'product', 'string');
$database = JFactory::getDBO();
$searchMap = array('a.category_name', 'a.category_description', 'a.category_id');
$filters = array();
if (!empty($pageInfo->search)) {
$searchVal = '\'%' . hikashop_getEscaped($pageInfo->search, true) . '%\'';
$filters[] = implode(" LIKE {$searchVal} OR ", $searchMap) . " LIKE {$searchVal}";
}
$order = '';
if (!empty($pageInfo->filter->order->value)) {
$order = ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
}
$class = hikashop_get('class.category');
$class->parentObject =& $this;
$rows = $class->getChildren($pageInfo->filter->filter_id, $selectedType, $filters, $order, $pageInfo->limit->start, $pageInfo->limit->value, false);
if (!empty($pageInfo->search)) {
$rows = hikashop_search($pageInfo->search, $rows, 'category_id');
}
$database->setQuery('SELECT COUNT(*)' . $class->query);
$pageInfo->elements = new stdClass();
$pageInfo->elements->total = $database->loadResult();
$pageInfo->elements->page = count($rows);
hikashop_setTitle(JText::_($this->nameListing), $this->icon, $this->ctrl);
$this->toolbar = array('addNew', 'editList', 'deleteList', '|', array('name' => 'pophelp', 'target' => $this->ctrl . '-listing'), 'dashboard');
$toggleClass = hikashop_get('helper.toggle');
$this->assignRef('toggleClass', $toggleClass);
$childClass = hikashop_get('type.childdisplay');
$childDisplay = $childClass->display('filter_type', $selectedType, false);
$this->assignRef('childDisplay', $childDisplay);
$breadcrumbClass = hikashop_get('type.breadcrumb');
$breadcrumb = $breadcrumbClass->display('filter_id', $pageInfo->filter->filter_id, 'product');
$this->assignRef('breadCrumb', $breadcrumb);
$this->assignRef('rows', $rows);
$this->assignRef('pageInfo', $pageInfo);
$order = new stdClass();
$order->ordering = false;
$order->orderUp = 'orderup';
$order->orderDown = 'orderdown';
$order->reverse = false;
if ($pageInfo->filter->order->value == 'a.category_ordering') {
$order->ordering = true;
if ($pageInfo->filter->order->dir == 'desc') {
$order->orderUp = 'orderdown';
$order->orderDown = 'orderup';
$order->reverse = true;
}
}
$this->assignRef('order', $order);
$config =& hikashop_config();
$this->assignRef('config', $config);
$this->getPagination();
}
示例10: str_replace
continue;
}
$data .= ',' . $s . ':\'' . str_replace(array('\'', '"'), array('\\\'', '\\\''), $row->{$s}) . '\'';
}
$data .= '}';
$extraTr = ' style="cursor:pointer" onclick="window.top.hikashop.submitBox(' . $data . ');"';
} else {
$extraTr = ' style="cursor:pointer" onclick="hikashop_setId(\'' . $row->user_id . '\');"';
}
} else {
$lbl1 = '<label for="cb' . $i . '">';
$lbl2 = '</label>';
$extraTr = ' onclick="hikashop.checkRow(\'cb' . $i . '\');"';
}
if (!empty($this->pageInfo->search)) {
$row = hikashop_search($this->pageInfo->search, $row, 'user_id');
}
?>
<tr class="row<?php
echo $k;
?>
"<?php
echo $extraTr;
?>
>
<td align="center">
<?php
echo $this->pagination->getRowOffset($i);
?>
</td>
<?php
示例11: listing
function listing()
{
$app = JFactory::getApplication();
$pageInfo = new stdClass();
$pageInfo->filter = new stdClass();
$pageInfo->filter->order = new stdClass();
$pageInfo->limit = new stdClass();
$pageInfo->filter->order->value = $app->getUserStateFromRequest($this->paramBase . ".filter_order", 'filter_order', 'a.order_created', 'cmd');
$pageInfo->filter->order->dir = $app->getUserStateFromRequest($this->paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
$pageInfo->search = $app->getUserStateFromRequest($this->paramBase . ".search", 'search', '', 'string');
$pageInfo->search = JString::strtolower(trim($pageInfo->search));
$pageInfo->limit->start = $app->getUserStateFromRequest($this->paramBase . '.limitstart', 'limitstart', 0, 'int');
$oldValue = $app->getUserState($this->paramBase . '.list_limit');
if (empty($oldValue)) {
$oldValue = $app->getCfg('list_limit');
}
$pageInfo->limit->value = $app->getUserStateFromRequest($this->paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
if ($oldValue != $pageInfo->limit->value) {
$pageInfo->limit->start = 0;
$app->setUserState($this->paramBase . '.limitstart', 0);
}
$database = JFactory::getDBO();
$searchMap = array('a.order_id', 'a.order_status', 'a.order_number');
$filters = array();
$order = '';
if (!empty($pageInfo->filter->order->value)) {
$order = ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
}
if (!empty($pageInfo->search)) {
$searchVal = '\'%' . hikashop_getEscaped(JString::strtolower(trim($pageInfo->search)), true) . '%\'';
$filter = '(' . implode(" LIKE {$searchVal} OR ", $searchMap) . " LIKE {$searchVal}" . ')';
$filters[] = $filter;
}
if (is_array($filters) && count($filters)) {
$filters = ' AND ' . implode(' AND ', $filters);
} else {
$filters = '';
}
$query = 'FROM ' . hikashop_table('order') . ' AS a WHERE a.order_type = ' . $database->Quote('sale') . ' AND a.order_user_id=' . (int) hikashop_loadUser() . $filters . $order;
$database->setQuery('SELECT a.* ' . $query, (int) $pageInfo->limit->start, (int) $pageInfo->limit->value);
$rows = $database->loadObjectList();
if (!empty($pageInfo->search)) {
$rows = hikashop_search($pageInfo->search, $rows, 'order_id');
}
$database->setQuery('SELECT COUNT(*) ' . $query);
$pageInfo->elements = new stdClass();
$pageInfo->elements->total = $database->loadResult();
$pageInfo->elements->page = count($rows);
$currencyClass = hikashop_get('class.currency');
$this->assignRef('currencyHelper', $currencyClass);
if (!$pageInfo->elements->page) {
$app->enqueueMessage(JText::_('NO_ORDERS_FOUND'));
}
$pagination = hikashop_get('helper.pagination', $pageInfo->elements->total, $pageInfo->limit->start, $pageInfo->limit->value);
$pagination->hikaSuffix = '';
$this->assignRef('pagination', $pagination);
$this->assignRef('pageInfo', $pageInfo);
$string = '';
$params = new HikaParameter($string);
$params->set('show_quantity_field', 0);
$config =& hikashop_config();
if (hikashop_level(1) && $config->get('allow_payment_button', 1)) {
$unpaid_statuses = explode(',', $config->get('order_unpaid_statuses', 'created'));
if (!empty($rows)) {
foreach ($rows as $k => $order) {
if (in_array($order->order_status, $unpaid_statuses)) {
$rows[$k]->show_payment_button = true;
}
}
}
$payment_change = $config->get('allow_payment_change', 1);
$this->assignRef('payment_change', $payment_change);
$pluginsPayment = hikashop_get('type.plugins');
$pluginsPayment->type = 'payment';
$this->assignRef('payment', $pluginsPayment);
}
if ($config->get('cancellable_order_status', '') != '') {
$cancellable_order_status = explode(',', $config->get('cancellable_order_status', ''));
foreach ($rows as $k => $order) {
if (in_array($order->order_status, $cancellable_order_status)) {
$rows[$k]->show_cancel_button = true;
}
}
}
$this->assignRef('params', $params);
$this->assignRef('rows', $rows);
$this->assignRef('config', $config);
$cart = hikashop_get('helper.cart');
$this->assignRef('cart', $cart);
$category = hikashop_get('type.categorysub');
$category->type = 'status';
$category->load(true);
$this->assignRef('order_statuses', $category);
hikashop_setPageTitle('ORDERS');
}