Ejemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = ClnStaff::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(['STAFF_ID' => $this->STAFF_ID, 'TITLE_GEN_NO' => $this->TITLE_GEN_NO]);
     $query->andFilterWhere(['like', 'FIRST_NAME', $this->FIRST_NAME])->andFilterWhere(['like', 'LAST_NAME', $this->LAST_NAME])->andFilterWhere(['like', 'GENDER', $this->GENDER])->andFilterWhere(['like', 'BIRTH_DATE', $this->BIRTH_DATE])->andFilterWhere(['like', 'STAFF_TYPE', $this->STAFF_TYPE])->andFilterWhere(['like', 'CREATE_BY', $this->CREATE_BY])->andFilterWhere(['like', 'CREATE_DATE', $this->CREATE_DATE])->andFilterWhere(['like', 'LAST_UPD_BY', $this->LAST_UPD_BY])->andFilterWhere(['like', 'LAST_UPD_DATE', $this->LAST_UPD_DATE]);
     $query->with = array('clnTitle');
     //jointable
     return $dataProvider;
 }
Ejemplo n.º 2
0
 /**
  * Finds the ClnStaff model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return ClnStaff the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = ClnStaff::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Ejemplo n.º 3
0
 public function getClnStaff()
 {
     return $this->hasOne(ClnStaff::className(), ['STAFF_ID' => 'STAFF_ID']);
 }
Ejemplo n.º 4
0
use kartik\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel app\models\ClnTranInjRespSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Cln Tran Inj Resps');
$this->params['breadcrumbs'][] = $this->title;
?>
 

<div class="cln-tran-inj-resp-index">

            <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['TRAN_INJ_RESP_ID', 'STAFF_ID', ['attribute' => 'clnStaff.STAFF_TYPE', 'vAlign' => 'middle', 'value' => function ($model, $key, $index, $widget) {
    $staff_type_desc = ['D' => 'แพทย์', 'P' => 'นักกายภาพบำบัด', 'N' => 'พยาบาล'];
    return $staff_type_desc[$model->STAFF_TYPE];
}, 'filterType' => GridView::FILTER_SELECT2, 'filter' => ['D' => 'แพทย์', 'P' => 'นักกายภาพบำบัด', 'N' => 'พยาบาล'], 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => '']], ['attribute' => 'STAFF_ID', 'value' => 'clnStaff.FIRST_NAME', 'filterType' => GridView::FILTER_SELECT2, 'filter' => ArrayHelper::map(\app\models\ClnStaff::find()->all(), 'STAFF_ID', 'FIRST_NAME'), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true, 'width' => '100%']], 'filterInputOptions' => ['placeholder' => '']], 'CREATE_BY', 'CREATE_DATE', 'TRAN_INJ_GEN_NO', ['class' => 'kartik\\grid\\ActionColumn', 'template' => '{update} {delete}', 'headerOptions' => ['width' => '20%', 'class' => 'activity-view-link'], 'contentOptions' => ['class' => 'padding-left-5px'], 'buttons' => ['update' => function ($url, $model, $key) {
    return Html::a('<span class="glyphicon glyphicon-pencil"></span>', '#', ['class' => 'modal-cln-tran-inj-resp-button', 'title' => Yii::t('yii', 'Update'), 'data-value' => 'index.php?r=clntraninjresp/update&id=' . $key]);
}, 'delete' => function ($url, $model, $key) {
    return Html::a('<span class="glyphicon glyphicon-trash"></span>', '#', ['class' => 'delete-cln-tran-inj-resp-button', 'title' => Yii::t('yii', 'Delete'), 'data-value' => 'index.php?r=clntraninjresp/delete&id=' . $key]);
}]], ['class' => 'kartik\\grid\\CheckboxColumn', 'headerOptions' => ['class' => 'kartik-sheet-style']]], 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-plus"></i>', '#', ['class' => 'btn btn-success modal-cln-tran-inj-resp-button', 'title' => Yii::t('yii', 'View'), 'data-value' => 'index.php?r=clntraninjresp/create&tran_inj_gen_no=8']) . ' ' . Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['grid-demo'], ['data-pjax' => 0, 'class' => 'btn btn-default', 'title' => 'Reset Grid'])], '{export}', '{toggleData}'], 'export' => ['fontAwesome' => true], 'bordered' => true, 'striped' => true, 'condensed' => true, 'responsive' => true, 'hover' => true, 'showPageSummary' => true, 'panel' => ['heading' => 'รายการประเภทโครงการ', 'type' => GridView::TYPE_PRIMARY], 'persistResize' => false, 'export' => false]);
?>

</div>

<?php 
Modal::begin(['id' => 'modal-cln-tran-inj-resp', 'size' => 'modal-lg']);
echo "<div id = 'modal-cln-tran-inj-resp-content'></div>";
Modal::end();
$script = <<<JS

        PNotify.prototype.options.styling = "bootstrap3";