Example #1
0
?>
    </p>
    
    <?php 
Modal::begin(['header' => '<h4>บันทึกข้อมูลผู้ป่วย STROKE</h4>', 'id' => 'modal2', 'size' => 'modal-lg', 'options' => ['tabindex' => false]]);
echo "<div id='modalContent2'></div>";
Modal::end();
?>
 

    <?php 
Pjax::begin(['id' => 'stoke-gridview']);
?>
 
    <?php 
echo \kartik\grid\GridView::widget(['dataProvider' => $dataProvider, 'formatter' => ['class' => 'yii\\i18n\\Formatter', 'nullDisplay' => '-'], 'filterModel' => $searchModel, 'responsive' => TRUE, 'hover' => true, 'panel' => ['before' => '', 'type' => \kartik\grid\GridView::TYPE_SUCCESS], 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], ['attribute' => 'name', 'width' => '180px', 'headerOptions' => ['class' => 'text-center']], ['label' => 'อายุ(ปี)', 'attribute' => 'age', 'headerOptions' => ['class' => 'text-center'], 'contentOptions' => ['class' => 'text-center']], ['label' => 'บ้านเลขที่', 'attribute' => 'village', 'headerOptions' => ['class' => 'text-center'], 'contentOptions' => ['class' => 'text-center']], ['label' => 'หมู่ที่', 'attribute' => 'address', 'headerOptions' => ['class' => 'text-center'], 'contentOptions' => ['class' => 'text-center']], ['attribute' => 'tambon', 'value' => 'tambons.tambonname', 'filter' => ArrayHelper::map(\frontend\models\Ctambon::find()->orderBy('tambonname')->asArray()->all(), 'tambonname', 'tambonname'), 'vAlign' => 'middle', 'width' => '140px', 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'headerOptions' => ['class' => 'text-center'], 'filterInputOptions' => ['placeholder' => 'เลือก ตำบล']], ['attribute' => 'amphur', 'value' => 'ampurs.ampurname', 'filter' => ArrayHelper::map(\frontend\models\Campur::find()->orderBy('ampurname')->asArray()->all(), 'ampurname', 'ampurname'), 'vAlign' => 'middle', 'width' => '160px', 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'headerOptions' => ['class' => 'text-center'], 'filterInputOptions' => ['placeholder' => 'เลือก อำเภอ']], ['attribute' => 'pdx', 'value' => 'pdx', 'filter' => ArrayHelper::map(\frontend\models\Cdisease::find()->asArray()->all(), 'diagcode', 'diagcode'), 'vAlign' => 'middle', 'width' => '200px', 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'headerOptions' => ['class' => 'text-center'], 'contentOptions' => ['class' => 'text-center'], 'filterInputOptions' => ['placeholder' => 'เลือก โรค']], ['attribute' => 'hospcode', 'value' => 'hospcodes.hospname', 'filter' => ArrayHelper::map(\frontend\models\Chospital::find()->orderBy('hospcode')->asArray()->all(), 'hospname', 'hospname'), 'vAlign' => 'middle', 'width' => '200px', 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'headerOptions' => ['class' => 'text-center'], 'filterInputOptions' => ['placeholder' => 'เลือก สถานพยาบาล']], ['attribute' => 'discharge_type', 'value' => 'discharge.discharge_name', 'filter' => ArrayHelper::map(\frontend\models\Cdischarcetype::find()->orderBy('discharge_id')->asArray()->all(), 'discharge_name', 'discharge_name'), 'vAlign' => 'middle', 'width' => '100px', 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'headerOptions' => ['class' => 'text-center'], 'filterInputOptions' => ['placeholder' => 'เลือก การจำหน่าย']], ['attribute' => 'sex', 'filter' => Patient::$sexs, 'value' => function ($data) {
    return Patient::$sexs[$data->sex];
}], ['class' => 'yii\\grid\\ActionColumn', 'options' => ['style' => 'width:120px;'], 'template' => '<div class="btn-group btn-group-sm" role="group" aria-label="...">{view}{update}</div>', 'buttons' => ['view' => function ($url, $model, $key) {
    return Html::a('<i class="glyphicon glyphicon-eye-open"></i>', $url, ['class' => 'btn btn-default']);
}, 'update' => function ($url, $model, $key) {
    return Html::a('<i class="glyphicon glyphicon-pencil"></i>', $url, ['class' => 'btn btn-default']);
}]]]]);
?>
  

<?php 
Pjax::end();
?>

</div>
Example #2
0
 public function getHospcodes()
 {
     return $this->hasOne(Chospital::className(), ['hospcode' => 'hospcode']);
 }
Example #3
0
            <?php 
echo $form->field($model, 'tambon')->widget(DepDrop::className(), ['data' => $tambon, 'options' => ['id' => 'ddl-tambon', 'placeholder' => '<--คลิกเลือกหรือพิมพ์ชื่อตำบล-->'], 'type' => DepDrop::TYPE_SELECT2, 'select2Options' => ['pluginOptions' => ['allowClear' => true]], 'pluginOptions' => ['depends' => ['ddl-ampur'], 'url' => Url::to(['/patient/get-tambon']), 'loadingText' => 'Loading1...']]);
?>
             
        </div> 
</div>
        <hr/> 
        
<div class="page-header-line">
    <h3><label class="label label-danger">ข้อมูลเข้ารับการรักษาพยาบาล</label></h3>
</div>

        <div class="row">
        <div class="col-xs-4 col-sm-4 col-md-4">
            <?php 
echo $form->field($model, 'hospcode')->widget(Select2::className(), ['data' => ArrayHelper::map(Chospital::find()->orderBy('hospname')->all(), 'hospcode', 'hospname'), 'options' => ['placeholder' => '<--คลิกเลือกชื่อสถานพยาบาล-->'], 'pluginOptions' => ['allowClear' => true]]);
?>
        </div>
        <div class="col-xs-4 col-sm-4 col-md-4">
            <?php 
echo $form->field($model, 'ward')->textInput(['maxlength' => true]);
?>
        </div> 
        <div class="col-xs-4 col-sm-4 col-md-4">
            <?php 
echo $form->field($model, 'hn')->textInput(['maxlength' => true]);
?>
        </div>    
        </div> 
        <div class="row">        
         <div class="col-xs-4 col-sm-4 col-md-4">