Example #1
0
 public function loginform_saved()
 {
     if ($this->validate()) {
         $roHeader = Requestterm::find()->where(['KD_RO' => $this->kdro])->one();
         $profile = Yii::$app->getUserOpt->Profile_user();
         $roHeader->STATUS = $this->status;
         $roHeader->SIG2_SVGBASE64 = $profile->emp->SIGSVGBASE64;
         $roHeader->SIG2_SVGBASE30 = $profile->emp->SIGSVGBASE30;
         $roHeader->SIG2_NM = $profile->emp->EMP_NM . ' ' . $profile->emp->EMP_NM_BLK;
         $roHeader->SIG2_TGL = date('Y-m-d');
         if ($roHeader->save()) {
             return $roHeader;
         }
         return $roHeader;
     }
     return null;
 }
Example #2
0
 public function cari($params)
 {
     $empId = Yii::$app->user->identity->EMP_ID;
     $dt = Employe::find()->where(['EMP_ID' => $empId])->all();
     $crp = $dt[0]['EMP_CORP_ID'];
     if ($dt[0]['JAB_ID'] == 'MGR') {
         $query = Requestterm::find()->where("r0001.status <> 3 and r0001.status <> 0 and r0001.KD_CORP = '{$crp}' ");
     } else {
         $query = Requestterm::find()->where("r0001.status <> 3 and r0001.status <> 0 and r0001.KD_CORP = '{$crp}' and r0001.ID_USER = '******' ");
     }
     $query->joinWith(['employe' => function ($q) {
         $q->where('a0001.EMP_NM LIKE "%' . $this->nmemp . '%"');
     }]);
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $dataProvider->setSort(['attributes' => ['KD_RO', 'KD_CORP', 'nmemp' => ['asc' => ['a0001.EMP_NM' => SORT_ASC], 'desc' => ['a0001.EMP_NM' => SORT_DESC], 'label' => 'Pembuat']]]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['like', 'a0001.EMP_NM', $this->EMP_NM])->andFilterWhere(['like', 'KD_RO', $this->KD_RO])->andFilterWhere(['like', 'KD_CORP', $this->KD_CORP]);
     return $dataProvider;
 }