/** * IMPORT DATA EXCEL * @return mixed * @author piter [ptr.nov@gmail.com] */ public function actionIndex() { $paramFile = Yii::$app->getRequest()->getQueryParam('id'); //echo $paramCari; $model = new UserFile(); $username = Yii::$app->user->identity->username; $user_id = ['USER_ID' => $username]; /*IMPORT VALIDATION*/ $searchModel = new TempDataSearch($user_id); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); /*VIEW IMPORT*/ $searchModelViewImport = new ImportViewSearch(); $dataProviderViewImport = $searchModelViewImport->search(Yii::$app->request->queryParams); //echo $this->actionExport_format(); return $this->render('index', ['getArryFile' => $this->getArryFile($paramFile), 'fileName' => $paramFile, 'gvColumnAryFile' => $this->gvColumnAryFile(), 'gvValidateColumn' => $this->gvValidateColumn(), 'gvValidateArrayDataProvider' => $dataProvider, 'searchModelValidate' => $searchModel, 'modelFile' => $model, 'gvRows' => $this->gvRows(), 'searchModelViewImport' => $searchModelViewImport, 'dataProviderViewImport' => $dataProviderViewImport]); }
/** * IMPORT DATA EXCEL * TYPE : 3= stock-salespo /SELL OUT Distributor. * @return mixed * @author piter [ptr.nov@gmail.com] */ public function actionIndex() { $username = Yii::$app->user->identity->username; $user_id = ['USER_ID' => $username]; $paramFile = Yii::$app->getRequest()->getQueryParam('id'); if ($paramFile) { self::setDataImport($paramFile); } else { //DELETE STOCK GUDANG | SO_TYPE=1 $cmd_clear = Yii::$app->db_esm->createCommand("\n\t\t\t\t\tDELETE FROM so_t2_tmp_file WHERE USER_ID='" . $username . "' AND SO_TYPE=3;\n\t\t\t"); $cmd_clear->execute(); } //echo $paramCari; $model = new UserFileSalesPo(); /*IMPORT VALIDATION*/ $searchModel = new TempDataSearch($user_id); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); /*VIEW IMPORT*/ $searchModelViewImport = new ImportViewSearch(); $dataProviderViewImport = $searchModelViewImport->search(Yii::$app->request->queryParams); //echo $this->actionExport_format(); //print_r($dataProvider->getModels()); return $this->render('index', ['getArryFile' => $dataProvider, 'fileName' => $paramFile, 'gvValidateArrayDataProvider' => $dataProvider, 'searchModelValidate' => $searchModel, 'modelFile' => $model, 'searchModelViewImport' => $searchModelViewImport, 'dataProviderViewImport' => $dataProviderViewImport]); }
/** * Lists all ImportView models. * @return mixed */ public function actionIndex() { $searchModel = new ImportViewSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }