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]);
 }
 /**
  * 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.');
     }
 }
Example #4
0
 public function getParentro()
 {
     return $this->hasOne(Requestorder::className(), ['KD_RO' => 'KD_RO']);
 }
Example #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;