public function actionProses($kd) { $empId = Yii::$app->user->identity->EMP_ID; $dt = Employe::find()->where(['EMP_ID' => $empId])->all(); if ($dt[0]['JAB_ID'] != 'MGR') { return $this->redirect(['esm/requestorder']); } $rostat = Requestorderstatus::find()->where(['KD_RO' => $kd, 'ID_USER' => $empId])->one(); if (count($rostat) == 0) { return $this->redirect([' ']); } $ro = new Requestorder(); $reqro = Requestorder::find()->where(['KD_RO' => $kd])->one(); $detro = $reqro->detro; $employ = $reqro->employe; //$ro = new Requestorderstatus(); $rostat->STATUS = 1; $rostat->save(); return $this->render('proses', ['reqro' => $reqro, 'detro' => $detro, 'employ' => $employ]); }
'KD_RO', 'nmemp', 'KD_CORP', [ 'class' => 'yii\grid\ActionColumn', 'template' => '{link} {edit} {delete} {cetak}', 'buttons' => [ 'link' => function ($url,$model) { return Html::a('', ['view','kd'=>$model->KD_RO],['class'=>'fa fa-info-circle fa-lg', 'title'=>'Detail']);}, 'edit' => function ($url,$model) { return Html::a('', ['buatro','id'=>$model->KD_RO],['class'=>'fa fa-pencil-square-o fa-lg', 'title'=>'Ubah RO']); }, 'delete' => function ($url,$model) { return Html::a('', ['hapusro','id'=>$model->KD_RO],['class'=>'fa fa-trash-o fa-lg', 'title'=>'Hapus RO','data-confirm'=>'Anda yakin ingin menghapus RO ini?']); }, 'cetak' => function ($url,$model) { return Html::a('', ['cetakpdf','kd'=>$model->KD_RO],[ 'class'=>'fa fa-print fa-lg', 'target' => '_blank', 'title'=>'Cetak RO', 'data-pjax' => '0',]);}, ], ], ]; } */ echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $gridColumns, 'rowOptions' => function ($model, $index, $widget, $grid) use($empId) { $ro = new Requestorderstatus(); $reqro = Requestorderstatus::find()->where(['KD_RO' => $model->KD_RO, 'ID_USER' => $empId])->one(); if (count($reqro) != 0) { if ($reqro->STATUS == 0) { return ['class' => 'danger']; } else { return []; } } }, 'pjax' => true, 'toolbar' => ['{export}'], 'panel' => ['heading' => '<h3 class="panel-title">' . Html::encode($this->title) . '</h3>', 'type' => 'warning', 'before' => Html::a('<i class="fa fa-plus fa-fw"></i> Permintaan Barang (RO)', ['create'], ['class' => 'btn btn-warning', 'data' => ['confirm' => 'Anda yakin ingin membuat permintaan barang baru?', 'method' => 'post']]), 'showFooter' => false], 'export' => ['target' => GridView::TARGET_BLANK], 'exportConfig' => [GridView::PDF => ['filename' => 'permintaan-barang-' . date('ymdHis')], GridView::EXCEL => ['filename' => 'permintaan-barang-' . date('ymdHis')]]]); ?> </div>