Beispiel #1
0
 public function view()
 {
     $sr = new StoreSalesReport();
     $this->set('sr', $sr);
     $pkg = Package::getByHandle('vivid_store');
     $this->requireAsset('chartist');
     $today = date('Y-m-d');
     $thirtyDaysAgo = date('Y-m-d', strtotime('-30 days'));
     $this->set('defaultFromDate', $thirtyDaysAgo);
     $this->set('defaultToDate', $today);
     $dateFrom = $this->post('dateFrom');
     $dateTo = $this->post('dateTo');
     if (!$dateFrom) {
         $dateFrom = $thirtyDaysAgo;
     }
     if (!$dateTo) {
         $dateTo = $today;
     }
     $this->set('dateFrom', $dateFrom);
     $this->set('dateTo', $dateTo);
     $ordersTotals = $sr::getTotalsByRange($dateFrom, $dateTo);
     $this->set('ordersTotals', $ordersTotals);
     $orders = new StoreOrderList();
     $orders->setFromDate($dateFrom);
     $orders->setToDate($dateTo);
     $orders->setItemsPerPage(10);
     $paginator = $orders->getPagination();
     $pagination = $paginator->renderDefaultView();
     $this->set('orders', $paginator->getCurrentPageResults());
     $this->set('pagination', $pagination);
     $this->set('paginator', $paginator);
     $this->requireAsset('css', 'vividStoreDashboard');
 }
Beispiel #2
0
 public function view($status = '')
 {
     $orderList = new StoreOrderList();
     if ($this->get('keywords')) {
         $orderList->setSearch($this->get('keywords'));
     }
     if ($status) {
         $orderList->setStatus($status);
     }
     $orderList->setItemsPerPage(20);
     $paginator = $orderList->getPagination();
     $pagination = $paginator->renderDefaultView();
     $this->set('orderList', $paginator->getCurrentPageResults());
     $this->set('pagination', $pagination);
     $this->set('paginator', $paginator);
     $this->set('orderStatuses', StoreOrderStatus::getList());
     $this->requireAsset('css', 'vividStoreDashboard');
     $this->requireAsset('javascript', 'vividStoreFunctions');
     $this->set('statuses', StoreOrderStatus::getAll());
 }
Beispiel #3
0
 public function view()
 {
     $sr = new SalesReport();
     $this->set('sr', $sr);
     $pkg = Package::getByHandle('vivid_store');
     $packagePath = $pkg->getRelativePath();
     $this->requireAsset('chartist');
     $today = date('Y-m-d');
     $thirtyDaysAgo = date('Y-m-d', strtotime('-30 days'));
     $this->set('defaultFromDate', $thirtyDaysAgo);
     $this->set('defaultToDate', $today);
     $dateFrom = $this->post('dateFrom');
     $dateTo = $this->post('dateTo');
     if (!$dateFrom) {
         $dateFrom = $thirtyDaysAgo;
     }
     if (!$dateTo) {
         $dateTo = $today;
     }
     $this->set('dateFrom', $dateFrom);
     $this->set('dateTo', $dateTo);
     $ordersTotals = $sr::getTotalsByRange($dateFrom, $dateTo);
     $this->set('ordersTotals', $ordersTotals);
     $orders = new OrderList();
     $orders->setFromDate($dateFrom);
     $orders->setToDate($dateTo);
     $orders->setItemsPerPage(10);
     $paginator = $orders->getPagination();
     $pagination = $paginator->renderDefaultView();
     $this->set('orders', $paginator->getCurrentPageResults());
     $this->set('pagination', $pagination);
     $this->set('paginator', $paginator);
     $js = \Concrete\Package\VividStore\Controller::returnHeaderJS();
     $this->addFooterItem($js);
     $this->requireAsset('css', 'vividStoreDashboard');
     $this->requireAsset('javascript', 'vividStoreFunctions');
 }