PATH:
home
/
centosnipponia
/
public_html
/
nipponiacom2
/
components
/
com_djcatalog2
/
models
<?php /** * @version $Id: orders.php 278 2014-05-27 12:51:04Z michal $ * @package DJ-Catalog2 * @copyright Copyright (C) 2012 DJ-Extensions.com LTD, All rights reserved. * @license http://www.gnu.org/licenses GNU/GPL * @author url: http://dj-extensions.com * @author email contact@dj-extensions.com * @developer Michal Olczyk - michal.olczyk@design-joomla.eu * * DJ-Catalog2 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * DJ-Catalog2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with DJ-Catalog2. If not, see <http://www.gnu.org/licenses/>. * */ // no direct access defined('_JEXEC') or die; jimport('joomla.application.component.modellist'); class Djcatalog2ModelOrders extends JModelList { public function __construct($config = array()) { if (empty($config['filter_fields'])) { $config['filter_fields'] = array( 'a.id', 'a.order_number', 'a.invoice_number', 'a.created_date', 'a.status', 'a.grand_total' ); } parent::__construct($config); } protected function populateState($ordering = null, $direction = null) { // List state information. parent::populateState('a.order_number', 'desc'); // Initialise variables. $app = JFactory::getApplication(); $session = JFactory::getSession(); $search = $this->getUserStateFromRequest($this->context.'.filter.search', 'filter_search'); $this->setState('filter.search', $search); $this->setState('filter.user', JFactory::getUser()->id); $limit = 10; $this->setState('list.limit', $limit); $limitstart = $app->input->get( 'limitstart', 0, 'int' ); $this->setState('list.start', $limitstart); // Load the parameters. $params = JComponentHelper::getParams('com_djcatalog2'); $this->setState('params', $params); } protected function getStoreId($id = '') { // Compile the store id. $id .= ':'.$this->getState('filter.search'); return parent::getStoreId($id); } protected function getListQuery() { // Create a new query object. $db = $this->getDbo(); $query = $db->getQuery(true); // Select the required fields from the table. $query->select( $this->getState( 'list.select', 'a.*' ) ); $query->from('#__djc2_orders AS a'); $search = $this->getState('filter.search'); if (!empty($search)) { if (stripos($search, 'id:') === 0) { $query->where('a.id = '.(int) substr($search, 3)); } else { $search = $db->quote('%'.$db->escape($search, true).'%'); $query->where('(a.order_number LIKE '.$search.' OR a.email LIKE '.$search.' OR a.firstname LIKE '.$search.' OR a.lastname LIKE '.$search.' OR a.company LIKE '.$search.')'); } } $user = (int)$this->getState('filter.user', -1); if ($user > 0){ $query->where('a.user_id='.$user); } // Add the list ordering clause. $orderCol = $this->state->get('list.ordering'); $orderDirn = $this->state->get('list.direction'); $query->order($db->escape($orderCol.' '.$orderDirn)); return $query; } }
[+]
..
[+]
forms
[-] index.html
[edit]
[-] item.php
[edit]
[-] itemform.php
[edit]
[-] items.php
[edit]
[-] modfrontpage.php
[edit]
[-] order.php
[edit]
[-] orders.php
[edit]
[-] producer.php
[edit]
[-] producers.php
[edit]
[-] query.php
[edit]
[-] .htaccess.disabled
[edit]