コード例 #1
0
ファイル: Auth2Model.php プロジェクト: adem-team/advanced
 public function auth2_saved()
 {
     if ($this->validate()) {
         $roHeader = Requestorder::find()->where(['KD_RO' => $this->kdro])->one();
         $roSignStt = Requestorderstatus::find()->where(['KD_RO' => $this->kdro, 'ID_USER' => $this->getProfile()->EMP_ID])->one();
         $roHeader->STATUS = $this->status;
         $roHeader->SIG2_SVGBASE64 = $this->getProfile()->SIGSVGBASE64;
         $roHeader->SIG2_SVGBASE30 = $this->getProfile()->SIGSVGBASE30;
         $roHeader->SIG2_NM = $this->getProfile()->EMP_NM . ' ' . $this->getProfile()->EMP_NM_BLK;
         $roHeader->SIG2_ID = $this->getProfile()->EMP_ID;
         $roHeader->SIG2_TGL = date('Y-m-d');
         if ($roHeader->save()) {
             if (!$roSignStt) {
                 $roHeaderStt = new Requestorderstatus();
                 $roHeaderStt->KD_RO = $this->kdro;
                 $roHeaderStt->ID_USER = $this->getProfile()->EMP_ID;
                 $roHeaderStt->TYPE = 102;
                 $roHeaderStt->STATUS = 1;
                 $roHeaderStt->UPDATED_AT = date('Y-m-d H:m:s');
                 if ($roHeaderStt->save()) {
                 }
             }
             return $roHeader;
         }
         return $roHeader;
     }
     return null;
 }
コード例 #2
0
ファイル: Auth3Model.php プロジェクト: adem-team/advanced
 public function auth3_saved()
 {
     if ($this->validate()) {
         $roHeader = Requestorder::find()->where(['KD_RO' => $this->kdro])->one();
         $roSignStt = Requestorderstatus::find()->where(['KD_RO' => $this->kdro, 'ID_USER' => $this->getProfile()->EMP_ID, 'TYPE' => $this->status])->one();
         $roHeader->STATUS = $this->status;
         if ($this->status == 103) {
             //
             $roHeader->SIG3_SVGBASE64 = $this->getProfile()->SIGSVGBASE64;
             $roHeader->SIG3_SVGBASE30 = $this->getProfile()->SIGSVGBASE30;
         }
         $roHeader->SIG3_NM = $this->getProfile()->EMP_NM . ' ' . $this->getProfile()->EMP_NM_BLK;
         $roHeader->SIG3_ID = $this->getProfile()->EMP_ID;
         $roHeader->SIG3_TGL = date('Y-m-d');
         if ($roHeader->save()) {
             /* Status Item RO Details 0 menjadi 1 */
             if ($this->status == 103) {
                 /* Direct SQL command and execcute update */
                 $cons = \Yii::$app->db_esm;
                 $command = $cons->createCommand("Update r0003 Set STATUS=1 WHERE KD_RO='" . $this->kdro . "' AND STATUS=0");
                 $command->execute();
             } elseif ($this->status == 4) {
                 $cons = \Yii::$app->db_esm;
                 $command = $cons->createCommand("Update r0003 Set STATUS=4 WHERE KD_RO='" . $this->kdro . "' AND STATUS=0");
                 $command->execute();
             }
             /*Status Auth Signature*/
             if (!$roSignStt and ($this->status == 101 or $this->status == 102)) {
                 /*Status Notify*/
                 $roHeaderStt = new Requestorderstatus();
                 $roHeaderStt->KD_RO = $this->kdro;
                 $roHeaderStt->ID_USER = $this->getProfile()->EMP_ID;
                 $roHeaderStt->TYPE = $this->status;
                 $roHeaderStt->STATUS = 1;
                 $roHeaderStt->UPDATED_AT = date('Y-m-d H:m:s');
                 if ($roHeaderStt->save()) {
                 }
             } else {
                 $roSignSttAuth3 = Requestorderstatus::find()->where("(KD_RO='" . $this->kdro . "' AND ID_USER='******' AND TYPE=103) OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t (KD_RO='" . $this->kdro . "' AND ID_USER='******' AND TYPE=4) OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t (KD_RO='" . $this->kdro . "' AND ID_USER='******' AND TYPE=5)")->one();
                 if (!$roSignSttAuth3) {
                     /*Status Notify*/
                     $roHeaderStt = new Requestorderstatus();
                     $roHeaderStt->KD_RO = $this->kdro;
                     $roHeaderStt->ID_USER = $this->getProfile()->EMP_ID;
                     $roHeaderStt->TYPE = $this->status;
                     $roHeaderStt->STATUS = 1;
                     $roHeaderStt->UPDATED_AT = date('Y-m-d H:m:s');
                     $roHeaderStt->save();
                 } else {
                     $cons = \Yii::$app->db_esm;
                     $command = $cons->createCommand("Update r0002 Set TYPE='" . $this->status . "' WHERE KD_RO='" . $this->kdro . "' AND ID_USER='******' AND (TYPE=103 or TYPE=4 or TYPE=5)");
                     $command->execute();
                 }
             }
             return $roHeader;
         }
         return $roHeader;
     }
     return null;
 }
コード例 #3
0
ファイル: Auth1Model.php プロジェクト: adem-team/advanced
 public function auth1_saved()
 {
     if ($this->validate()) {
         $roHeader = Requestorder::find()->where(['KD_RO' => $this->kdro])->one();
         $empAuth2 = Employe::find()->where(['EMP_ID' => $this->empID])->one();
         $roSignStt = Requestorderstatus::find()->where(['KD_RO' => $this->kdro, 'ID_USER' => $this->getProfile()->EMP_ID])->one();
         //Auth1|Create Destination
         $roHeader->STATUS = $this->status;
         $roHeader->SIG1_SVGBASE64 = $this->getProfile()->SIGSVGBASE64;
         $roHeader->SIG1_SVGBASE30 = $this->getProfile()->SIGSVGBASE30;
         $roHeader->SIG1_NM = $this->getProfile()->EMP_NM . ' ' . $this->getProfile()->EMP_NM_BLK;
         $roHeader->SIG1_ID = $this->getProfile()->EMP_ID;
         $roHeader->SIG1_TGL = date('Y-m-d');
         //Auth2|Checked Destination
         $roHeader->USER_CC = $this->empID;
         $roHeader->SIG2_NM = $empAuth2->EMP_NM . ' ' . $empAuth2->EMP_NM_BLK;
         if ($roHeader->save()) {
             if (!$roSignStt) {
                 $roHeaderStt = new Requestorderstatus();
                 $roHeaderStt->KD_RO = $this->kdro;
                 $roHeaderStt->ID_USER = $this->getProfile()->EMP_ID;
                 $roHeaderStt->TYPE = 101;
                 $roHeaderStt->STATUS = 1;
                 $roHeaderStt->UPDATED_AT = date('Y-m-d H:m:s');
                 if ($roHeaderStt->save()) {
                 }
             }
             return $roHeader;
         }
         return $roHeader;
     }
     return null;
 }
コード例 #4
0
ファイル: LoginForm.php プロジェクト: adem-team/advanced
 public function loginform_saved()
 {
     if ($this->validate()) {
         $roHeader = Requestorder::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;
 }
コード例 #5
0
ファイル: Rodetail.php プロジェクト: adem-team/advanced
 public function getParentro()
 {
     return $this->hasOne(Requestorder::className(), ['KD_RO' => 'KD_RO']);
 }
コード例 #6
0
 /**
  * Finds the Requestorder model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return Requestorder the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Requestorder::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
コード例 #7
0
ファイル: _buat.php プロジェクト: adem-team/advanced
					<thead style="background-color:#FF8533;">
						<tr>
							<th>Kode RO</th>
							<th>Devisi</th>
							<th>Quantity</th>
							<th></th>
						</tr>
					</thead>

					<tbody>
						<?php 
    $pod = Podetail::find()->where(['ID_DET_PO' => $rows->ID])->andWhere('STATUS <> 3')->all();
    $b = 0;
    foreach ($pod as $pods => $pode) {
        $b = $b + 1;
        $ro_dep = Requestorder::find('KD_DEP')->where(['KD_RO' => $pode->KD_RO])->one();
        ?>
						<tr>
							<td><?php 
        echo $pode->KD_RO;
        ?>
</td>
							<td><?php 
        //echo $ro_dep->KD_DEP;
        ?>
</td>
							<td id="<?php 
        echo 'a' . $a . '' . $b;
        ?>
" onclick="edit(<?php 
        echo $a . '' . $b;
コード例 #8
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 = Requestorder::find()->where("r0001.status <> 3 and r0001.status <> 0 and r0001.KD_CORP = '{$crp}' ");
     } else {
         $query = Requestorder::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;
 }
コード例 #9
0
 public function caripo($params)
 {
     $query = Requestorder::find()->where("r0001.status <> 3 and r0001.status <> 0");
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 15]]);
     $dataProvider->setSort(['attributes' => ['KD_RO']]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['like', 'KD_RO', $this->KD_RO]);
     return $dataProvider;
 }
コード例 #10
0
 public function actionViewRo($kd)
 {
     $ro = new Requestorder();
     $roHeader = Requestorder::find()->where(['KD_RO' => $kd])->one();
     if (count($roHeader['KD_RO']) != 0) {
         $detro = $roHeader->detro;
         $employ = $roHeader->employe;
         $dept = $roHeader->dept;
         /*
          * Convert $roHeader->detro to ArrayDataProvider | Identity 'key' => 'ID',
          * @author ptrnov  <*****@*****.**>
          * @since 1.1
          **/
         $detroProvider = new ArrayDataProvider(['key' => 'ID', 'allModels' => $detro, 'pagination' => ['pageSize' => 10]]);
         return $this->renderAjax('view_ro', ['roHeader' => $roHeader, 'detro' => $detro, 'employ' => $employ, 'dept' => $dept, 'dataProvider' => $detroProvider]);
     } else {
         return $this->redirect('index');
     }
 }