Пример #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Modulerp::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['MODUL_ID' => $this->MODUL_ID, 'MODUL_STS' => $this->MODUL_STS, 'SORT' => $this->SORT]);
     $query->andFilterWhere(['like', 'MODUL_NM', $this->MODUL_NM])->andFilterWhere(['like', 'MODUL_DCRP', $this->MODUL_DCRP]);
     return $dataProvider;
 }
Пример #2
0
    <p>
        <?php 
echo "Html::a('Create ERP Permission', ['create'], ['class' => 'btn btn-success'])";
//echo "<a data-toggle="modal" href="#myModal" class="btn btn-primary btn-lg">Launch demo modal</a>";
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'USER_ID', 'format' => 'html', 'value' => function ($model) {
    $username = Userlogin::find()->where(['id' => $model->USER_ID])->one();
    return Html::decode($username->username);
}, 'filter' => ArrayHelper::map(Userlogin::find()->asArray()->all(), 'id', 'username')], ['attribute' => 'MODUL_ID', 'format' => 'html', 'value' => function ($model) {
    $MODUL_NM = Modulerp::find()->where(['MODUL_ID' => $model->MODUL_ID])->one();
    return Html::decode($MODUL_NM->MODUL_NM);
}, 'filter' => ArrayHelper::map(Modulerp::find()->asArray()->all(), 'MODUL_ID', 'MODUL_NM')], ['attribute' => 'STATUS', 'format' => 'html', 'value' => function ($model) {
    if ($model->STATUS == 0) {
        return Html::a('<i class="fa fa-lock"></i>');
    } else {
        if ($model->STATUS == 1) {
            return Html::a('<i class="fa fa-unlock "></i>');
        }
    }
}], ['attribute' => 'BTN_CREATE', 'format' => 'html', 'value' => function ($model) {
    if ($model->BTN_CREATE == 0) {
        return Html::a('<i class="fa fa-lock"></i>');
    } else {
        if ($model->BTN_CREATE == 1) {
            return Html::a('<i class="fa fa-unlock "></i>');
        }
    }
Пример #3
0
use kartik\builder\Form;
use kartik\icons\Icon;
$this->sideCorp = 'PT.Lukisongroup';
/* Title Select Company pada header pasa sidemenu/menu samping kiri */
$this->sideMenu = 'admin';
/* kd_menu untuk list menu pada sidemenu, get from table of database */
$this->title = Yii::t('app', 'ERP - Administrator');
/* title pada header page */
$username = Userlogin::find()->where(['id' => $model->USER_ID])->one();
$vUser = $username->username;
$MODUL_NM = Modulerp::find()->where(['MODUL_ID' => $model->MODUL_ID])->one();
$vModul = $MODUL_NM->MODUL_NM;
?>
 
    <?php 
$attribute = ['ID', ['label' => 'UserName', 'attribute' => 'USER_ID', 'format' => 'raw', 'value' => Html::a($vUser), 'type' => DetailView::INPUT_SELECT2, 'widgetOptions' => ['data' => ArrayHelper::map(Userlogin::find()->asArray()->all(), 'id', 'username'), 'options' => ['placeholder' => 'Select ...'], 'pluginOptions' => ['allowClear' => true]]], ['label' => 'MODUL ERP', 'attribute' => 'MODUL_ID', 'format' => 'raw', 'value' => Html::a($vModul), 'type' => DetailView::INPUT_SELECT2, 'widgetOptions' => ['data' => ArrayHelper::map(Modulerp::find()->asArray()->all(), 'MODUL_ID', 'MODUL_NM'), 'options' => ['placeholder' => 'Select ...'], 'pluginOptions' => ['allowClear' => true]]], 'STATUS', 'CREATE', 'EDIT', 'TOMBOL1', 'TOMBOL2', 'TOMBOL3', 'TOMBOL4', 'TOMBOL5', 'TOMBOL6', 'TOMBOL7', 'TOMBOL8', 'TOMBOL9', 'TOMBOL10'];
?>
</div class="body-content">
	<div class="col-sm-3"> </div> 
		<div class="col-sm-5">  
			<?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
$grd1 = DetailView::widget(['model' => $model, 'condensed' => true, 'hover' => true, 'mode' => DetailView::MODE_VIEW, 'panel' => ['heading' => 'Permissio Request Order', 'type' => DetailView::TYPE_INFO], 'attributes' => $attribute]);
Modal::begin(['id' => 'ro_permission_view']);
echo $grd1;
// refer the demo page for widget settings
Modal::end();
ActiveForm::end();
?>
		</div>
	</div>
Пример #4
0
 /**
  * Finds the Modulerp model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return Modulerp the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Modulerp::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }