public function actionIndex()
 {
     if (\Yii::$app->user->isGuest) {
         return $this->render('../../../views/site/index_nologin');
     } else {
         /*SALESMAN VISIT REPORT*/
         $searchModel = new ScheduledetailSearch();
         $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
         $dataGroup = ArrayHelper::map(Schedulegroup::find()->orderBy('SCDL_GROUP_NM')->asArray()->all(), 'ID', 'SCDL_GROUP_NM');
         return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'nmGroup' => $dataGroup]);
     }
 }
Esempio n. 2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Schedulegroup::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['ID' => $this->ID, 'STATUS' => $this->STATUS, 'CREATE_AT' => $this->CREATE_AT, 'UPDATE_AT' => $this->UPDATE_AT]);
     $query->andFilterWhere(['like', 'SCDL_GROUP_NM', $this->SCDL_GROUP_NM])->andFilterWhere(['like', 'KETERANGAN', $this->KETERANGAN])->andFilterWhere(['like', 'CREATE_BY', $this->CREATE_BY])->andFilterWhere(['like', 'UPDATE_BY', $this->UPDATE_BY]);
     return $dataProvider;
 }
Esempio n. 3
0
 public function actionViewVisit()
 {
     $searchModel = new ScheduledetailSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $dataGroup = ArrayHelper::map(Schedulegroup::find()->orderBy('SCDL_GROUP_NM')->asArray()->all(), 'ID', 'SCDL_GROUP_NM');
     return $this->render('_view_visit', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'nmGroup' => $dataGroup]);
 }
Esempio n. 4
0
 public function getCustgrp()
 {
     return $this->hasOne(Schedulegroup::className(), ['ID' => 'SCDL_GROUP']);
 }