Esempio n. 1
0
 /**
  * Displays a list of groups
  *
  * @return  void
  */
 public function displayTask()
 {
     // Instantiate a new view
     $this->view->store_enabled = $this->config->get('store_enabled');
     // Get paging variables
     $this->view->filters = array('limit' => Request::getState($this->_option . '.items.limit', 'limit', Config::get('list_limit'), 'int'), 'start' => Request::getState($this->_option . '.items.limitstart', 'limitstart', 0, 'int'), 'filterby' => Request::getState($this->_option . '.items.filterby', 'filterby', 'all'), 'sortby' => Request::getState($this->_option . '.items.sortby', 'sortby', 'date'));
     $obj = new Store($this->database);
     $this->view->total = $obj->getItems('count', $this->view->filters, $this->config);
     $this->view->rows = $obj->getItems('retrieve', $this->view->filters, $this->config);
     // how many times ordered?
     if ($this->view->rows) {
         $oi = new OrderItem($this->database);
         foreach ($this->view->rows as $o) {
             // Active orders
             $o->activeorders = $oi->countActiveItemOrders($o->id);
             // All orders
             $o->allorders = $oi->countAllItemOrders($o->id);
         }
     }
     // Output the HTML
     $this->view->display();
 }
Esempio n. 2
0
 /**
  * Display items for sale
  *
  * @return  void
  */
 public function displayTask()
 {
     // Incoming
     $this->view->filters = array('limit' => Request::getInt('limit', Config::get('list_limit')), 'start' => Request::getInt('limitstart', 0), 'sortby' => Request::getVar('sortby', ''));
     // Get the most recent store items
     $obj = new Store($this->database);
     $this->view->rows = $obj->getItems('retrieve', $this->view->filters, $this->config);
     // Set page title
     $this->_buildTitle();
     // Set the pathway
     $this->_buildPathway();
     // Output HTML
     $this->view->title = $this->_title;
     $this->view->infolink = $this->infolink;
     $this->view->display();
 }