Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
}, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '100px', 'font-family' => 'verdana, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(126, 189, 188, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '100px', 'font-family' => 'verdana, arial, sans-serif', 'font-size' => '8pt']]], ['class' => 'kartik\\grid\\ActionColumn', 'dropdown' => true, 'template' => '{approved} {reject} {cancel} {closed}', 'dropdownOptions' => ['class' => 'pull-right dropup'], 'buttons' => ['approved' => function ($url, $model) use($headerStatus) {
    if ($headerStatus !== 103) {
        return tombolApproval($url, $model);
    } else {
    }
}, 'reject' => function ($url, $model) use($headerStatus) {
    if ($headerStatus !== 103) {
        return tombolReject($url, $model);
    }
}, 'cancel' => function ($url, $model) use($headerStatus) {
    if ($headerStatus !== 103) {
        return tombolCancel($url, $model);
    }
}, 'closed' => function ($url, $model) use($headerStatus) {
    /*Check Status Checked on Requestorderstatus TYPE=102*/
    $checkedMdl = Requestorderstatus::find()->where(['KD_RO' => $model->KD_RO, 'TYPE' => 102, 'ID_USER' => getPermissionEmp()->EMP_ID])->one();
    if ($headerStatus == 103 or $checkedMdl != '') {
        //return Html::label('<i class="glyphicon glyphicon-lock dm"></i> LOCKED','',['class'=>'label label-danger','style'=>['align'=>'center']]);
        return tombolKonci($url, $model);
    }
}], 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '100px', 'font-family' => 'verdana, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(126, 189, 188, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '100px', 'font-family' => 'verdana, arial, sans-serif', 'font-size' => '8pt']]]], 'pjax' => true, 'pjaxSettings' => ['options' => ['enablePushState' => false, 'id' => 'ro-process']], 'hover' => true, 'responsive' => true, 'responsiveWrap' => true, 'bordered' => true, 'striped' => '4px', 'autoXlFormat' => true, 'export' => false]);
?>
	</div>
	
	<!-- Signature !-->
	<div  class="col-md-12">
		<div  class="row" >
			<div class="col-md-6">
				<table id="tblRo" class="table table-bordered" style="font-family: tahoma ;font-size: 8pt;">					
					<!-- Tanggal!-->
					 <tr>
Esempio n. 4
0
 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;
 }