Exemple #1
0
 public function getPositionType()
 {
     return @$this->hasOne(LibPosition::className(), ['ref' => 'position']);
 }
Exemple #2
0
use yii\helpers\ArrayHelper;
/* @var $this yii\web\View */
/* @var $searchModel app\models\NurseStaffSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'รายชื่อเจ้าหน้าที่');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="nurse-staff-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a(Yii::t('app', 'เพิ่มเจ้าหน้าที่'), ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'no', 'title', 'name', 'surname', ['label' => 'ตำแหน่ง', 'options' => ['class' => 'col-md-3'], 'attribute' => 'positionName', 'filter' => ArrayHelper::map(LibPosition::find()->all(), 'ref', 'position'), 'value' => function ($model) {
    return $model->positionName;
}], 'priority', ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Exemple #3
0
        <div class="col-md-5">
            <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
        </div>
        <div class="col-md-5">
            <?php 
echo $form->field($model, 'surname')->textInput(['maxlength' => true]);
?>
        </div>
    </div>

    <div class="row">
        <div class="col-md-4">
            <?php 
echo $form->field($model, 'position')->dropDownList(ArrayHelper::map(LibPosition::find()->all(), 'ref', 'position'));
?>
        </div>
    </div> 

    <div class="row">
        <div class="col-md-1"><?php 
echo $form->field($model, 'hn')->checkbox();
?>
</div>
        <div class="col-md-1"><?php 
echo $form->field($model, 'part_time')->checkbox();
?>
</div>
        <div class="col-md-1"><?php 
echo $form->field($model, 'assist')->checkbox();