Blame | Last modification | View Log | RSS feed
<?phpApp::uses('AppController', 'Controller');/*** Exceptionalnlcs Controller** @property Exceptionalnlc $Exceptionalnlc* @property PaginatorComponent $Paginator*/class ReportsController extends AppController {/*** Components** @var array*/public $components = array('Paginator');public function beforeFilter() {parent::beforeFilter();// Configure::load('live');$this->apihost = Configure::read('pythonapihost');}public function admin_orders() {$page = $this->request->query('page');if(!isset($page)){$page = 1;}$limit = Configure::read('admindashboardlimit');$params = array('fields' => array('_id','subOrders','storeId', 'userId', 'merchantOrderId'),// 'conditions' => array('source_id' => array('$ne' => 0)),'order' => array('_id' => -1),'limit' => $limit,'page' => $page,);$orders = $this->Report->find('all', $params);// $this->loadModel('Category');// $categories = $this->Category->find('list');// $storemapping = Configure::read('storemapping');$this->set(compact('orders'));}public function admin_ordersjson() {$this->layout = 'ajax';$page = $this->request->query('page');if(!isset($page)){$page = 1;}$limit = $this->request->query('limit');$limit = Configure::read('admindashboardlimit');$params = array('fields' => array('_id','subOrders','storeId', 'userId', 'merchantOrderId'),// 'conditions' => array('source_id' => array('$ne' => 0)),'order' => array('_id' => -1),'limit' => $limit,'page' => $page,);$orders = $this->Report->find('all', $params);$result = array('orders'=>$orders);$this->set(array('result' => $result,'_serialize' => array('result')));$this->render('/Elements/json');}}