Пример #1
0
 public function caripo($params)
 {
     $query = Requestorder::find()->where("r0001.status <> 3 and r0001.status <> 0");
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $dataProvider->setSort(['attributes' => ['KD_RO']]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['like', 'KD_RO', $this->KD_RO]);
     return $dataProvider;
 }
 public function actionCreate($kdpo)
 {
     $model = new Purchaseorder();
     $qq = Purchaseorder::find()->where(['KD_PO' => $kdpo])->count();
     if ($qq == 0) {
         return $this->redirect([' ']);
     }
     if ($kdpo == '') {
         return $this->redirect([' ']);
     }
     if ($kdpo == null) {
         return $this->redirect([' ']);
     }
     $que = Requestorder::find()->where('STATUS <> 3 and STATUS <> 0')->all();
     $searchModel = new RequestorderSearch();
     $dataProvider = $searchModel->caripo(Yii::$app->request->queryParams);
     $podet = Purchasedetail::find()->where(['KD_PO' => $kdpo])->andWhere('STATUS <> 3')->all();
     $quer = Purchaseorder::find()->where(['KD_PO' => $kdpo])->one();
     return $this->render('create', ['model' => $model, 'que' => $que, 'quer' => $quer, 'podet' => $podet, 'searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Пример #3
0
 public function actionApprovedAuthorizeSave()
 {
     $loginSig = new LoginForm();
     /*Ajax Load*/
     if (Yii::$app->request->isAjax) {
         $loginSig->load(Yii::$app->request->post());
         return Json::encode(\yii\widgets\ActiveForm::validate($loginSig));
     } else {
         /*Normal Load*/
         if ($loginSig->load(Yii::$app->request->post())) {
             $hsl = \Yii::$app->request->post();
             $kdro = $hsl['LoginForm']['kd_ro'];
             $cons = \Yii::$app->db_esm;
             $roHeader = Requestorder::find()->where(['KD_RO' => $kdro])->one();
             $profile = Yii::$app->getUserOpt->Profile_user();
             $roHeader->STATUS = 101;
             $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');
             $roHeader->save();
             return $this->redirect(['approved', 'kd' => $kdro]);
         }
     }
     //return $this->render('approved');
     //return actionApproved('RO.2015.12.000004');
     //return $this->home();
     //$request=Yii::$app->request;
     //$test= $request->post('empNm');
     //print_r($test);
     //return "sucess";
     /*  //$rodetails = new Rodetail();
     		$ts = Yii::$app->request->post();
     		if(count($ts) == 0){ return $this->redirect([' ']); }
     		$kd = $ts['kd'];
     		
     		foreach($ts['ck'] as $ts){
     			$rodetail  = Rodetail::findOne($ts);
     			$rodetail->STATUS = 1;
     			if($rodetail->save()){
     				$roHeader = Requestorder::find()->where(['KD_RO' => $kd])->one();
     				$roHeader->STATUS = 1;
     				$roHeader->save();
     			}
     		}
     		return $this->redirect(['proses', 'kd' => $kd]);
     	
     		//$rodetail->save(); */
 }
 /**
  * Prosess Agree Manager
  * @param string $id
  * @return mixed
  * @author ptrnov  <*****@*****.**>
  * @since 1.1
  */
 public function actionSimpanproses()
 {
     //$rodetails = new Rodetail();
     $ts = Yii::$app->request->post();
     if (count($ts) == 0) {
         return $this->redirect([' ']);
     }
     $kd = $ts['kd'];
     foreach ($ts['ck'] as $ts) {
         $rodetail = Rodetail::findOne($ts);
         $rodetail->STATUS = 1;
         if ($rodetail->save()) {
             $reqro = Requestorder::find()->where(['KD_RO' => $kd])->one();
             $reqro->STATUS = 1;
             $reqro->save();
         }
     }
     return $this->redirect(['proses', 'kd' => $kd]);
     //$rodetail->save();
 }
Пример #5
0
					<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;