public function actionIndex() { if (\Yii::$app->user->isGuest) { return $this->render('../../../views/site/index_nologin'); } else { /* CUSTOMER CATEHORI COUNT [modern,general,horeca,other]*/ $dataProvider_CustPrn = new ArrayDataProvider(['allModels' => Yii::$app->db_esm->createCommand("CALL DASHBOARD_ESM_SALES_custromer_ktg('count_kategory_customer_parent')")->queryAll(), 'pagination' => ['pageSize' => 50]]); $model_CustPrn = $dataProvider_CustPrn->getModels(); $count_CustPrn = $dataProvider_CustPrn->getCount(); //print_r($this->CountChildCustomer()); //die(); return $this->render('index', ['model_CustPrn' => $model_CustPrn, 'count_CustPrn' => $count_CustPrn, 'resultCountChildParen' => $this->CountChildCustomer()]); } }
public function actionIndex() { if (\Yii::$app->user->isGuest) { return $this->render('../../../views/site/index_nologin'); } else { /* CUSTOMER CATEHORI COUNT [modern,general,horeca,other]*/ $dataProvider_CustPrn = new ArrayDataProvider(['key' => 'PARENT_ID', 'allModels' => Yii::$app->db_esm->createCommand("CALL DASHBOARD_ESM_SALES_custromer_ktg('count_kategory_customer_parent')")->queryAll(), 'pagination' => ['pageSize' => 50]]); $model_CustPrn = $dataProvider_CustPrn->getModels(); $count_CustPrn = $dataProvider_CustPrn->getCount(); /* COUNTER SALESMAN VISIT */ $dataCntrVisit = Yii::$app->db_esm->createCommand("CALL DASHBOARD_ESM_SALES_customer_visit_winloss('COUNTER_DAILY','" . date('Y-m-d') . "','','')")->queryAll(); $CntrVisit = $dataCntrVisit[0]['CNT_DAY'] != '' ? $dataCntrVisit[0]['CNT_DAY'] : 0; return $this->render('index'); } }
public function actionViewAllCustomer() { /* CUSTOMER CATEHORI COUNT [modern,general,horeca,other]*/ $dataProvider_CustPrn = new ArrayDataProvider(['allModels' => Yii::$app->db_esm->cache(function ($db_esm) { return $db_esm->createCommand("CALL DASHBOARD_ESM_SALES_custromer_ktg('count_kategory_customer_parent')")->queryAll(); }, 60), 'pagination' => ['pageSize' => 50]]); $model_CustPrn = $dataProvider_CustPrn->getModels(); $count_CustPrn = $dataProvider_CustPrn->getCount(); //print_r($this->CountChildCustomer()); //die(); return $this->render('_view_all_customer', ['model_CustPrn' => $model_CustPrn, 'count_CustPrn' => $count_CustPrn, 'resultCountChildParen' => $this->CountChildCustomer()]); }
/** * CUSTOMER COUNT TOTAL KATEGORY * @author ptr.nov [ptr.nov@gmail.com] * @since 1.2 */ public function actionIndex() { $model = new \yii\base\DynamicModel(['tgl_issue']); $model->addRule(['tgl_issue'], 'safe'); $hsl = Yii::$app->request->post(); $tgl = $hsl['DynamicModel']['tgl_issue']; setcookie('esmDashboardIssueTglVal', $tgl); $setTglCookie = $_COOKIE['esmDashboardIssueTglVal']; $tglParam = $setTglCookie != '' ? $setTglCookie : date('Y-m-d'); //if($this->checkRpt($setTgl)==0 or $this->checkRpt($setTgl)==1){ $searchModelIssue = new IssuemdSearch(['TGL' => $tglParam]); //} $dataProvider_CustPrn = new ArrayDataProvider(['key' => 'PARENT_ID', 'allModels' => $this->getCountCustParent(), 'pagination' => ['pageSize' => 10]]); $model_CustPrn = $dataProvider_CustPrn->getModels(); $count_CustPrn = $dataProvider_CustPrn->getCount(); $dataProviderIssue = $searchModelIssue->search(Yii::$app->request->queryParams); return $this->render('index', ['model_CustPrn' => $model_CustPrn, 'count_CustPrn' => $count_CustPrn, 'dataEsmStockAll' => $this->graphEsmStockAll(), 'graphEsmStockPerSku' => $this->graphEsmStockPerSku(), 'searchModelIssue' => $searchModelIssue, 'dataProviderIssue' => $dataProviderIssue]); }