Example #1
0
 public function getPttype($id)
 {
     $model = Pttype::find()->where(['pttype' => $id])->one();
     $name = @$model->name;
     return $name;
 }
Example #2
0
$this->title = 'รายการเรียกเก็บผู้ป่วยนอก';
$this->params['breadcrumbs'][] = $this->title;
//print_r($pttype);
?>
<div class="vn-stat-index">

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

<!--    <p>
        <?php 
echo Html::a('Create Vn Stat', ['create'], ['class' => 'btn btn-success']);
?>
    </p>-->

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => true, 'containerOptions' => ['style' => 'overflow: auto'], 'headerRowOptions' => ['class' => 'kartik-sheet-style'], 'filterRowOptions' => ['class' => 'kartik-sheet-style'], 'columns' => [['class' => 'kartik\\grid\\SerialColumn', 'contentOptions' => ['class' => 'kartik-sheet-style']], ['filterType' => GridView::FILTER_DATE_RANGE, 'attribute' => 'vstdate', 'label' => 'Vist Date', 'width' => '150px'], ['attribute' => 'cid', 'label' => 'หมายเลขบัตรประชาชน', 'width' => '150px'], ['attribute' => 'hn', 'label' => 'HN', 'width' => '80px'], ['class' => 'kartik\\grid\\FormulaColumn', 'mergeHeader' => true, 'attribute' => 'fullname', 'label' => 'ชื่อ - สกุล'], ['class' => 'kartik\\grid\\FormulaColumn', 'mergeHeader' => true, 'attribute' => 'birthday', 'width' => '90px'], ['attribute' => 'pttype', 'label' => 'สิทธิการรักษา', 'value' => function ($data) {
    //$a = $pttype->getPttype();
    return Pttype::getPttype($data['pttype']);
}, 'filterType' => GridView::FILTER_SELECT2, 'width' => '290px', 'pageSummary' => 'Total', 'filter' => ArrayHelper::map(frontend\models\Pttype::find()->orderBy('pttype')->asArray()->all(), 'pttype', 'name'), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'สิทธิการรักษา'], 'format' => 'raw'], ['class' => 'kartik\\grid\\FormulaColumn', 'mergeHeader' => true, 'vAlign' => 'middle', 'hAlign' => 'right', 'label' => 'เรียกเก็บ', 'attribute' => 'amount', 'format' => ['decimal', 2], 'pageSummary' => true, 'footer' => true], ['label' => 'ชำระแล้ว', 'vAlign' => 'middle', 'hAlign' => 'right', 'attribute' => 'rcpt_money', 'format' => ['decimal', 2], 'mergeHeader' => true, 'pageSummary' => true, 'footer' => true], ['label' => 'ค้างชำระ', 'value' => function ($data) {
    return $data['paid_money'] - $data['rcpt_money'];
}, 'vAlign' => 'middle', 'hAlign' => 'right', 'attribute' => 'total', 'format' => ['decimal', 2], 'mergeHeader' => true, 'pageSummary' => true, 'footer' => true]], 'toolbar' => ['{toggleData}', '{export}'], 'export' => ['fontAwesome' => true], 'bordered' => true, 'responsive' => true, 'hover' => true, 'condensed' => true, 'persistResize' => false, 'showPageSummary' => true, 'exportConfig' => [GridView::EXCEL => ['label' => 'Save as Excel']], 'condensed' => true, 'panel' => ['type' => GridView::TYPE_PRIMARY, 'heading' => 'สรุปรายการ']]);
?>

</div>
Example #3
0
<div class="ipt-index">

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

<!--    <p>
        <?php 
echo Html::a('Create Ipt', ['create'], ['class' => 'btn btn-success']);
?>
    </p>-->

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => true, 'containerOptions' => ['style' => 'overflow: auto'], 'headerRowOptions' => ['class' => 'kartik-sheet-style'], 'filterRowOptions' => ['class' => 'kartik-sheet-style'], 'columns' => [['class' => 'kartik\\grid\\SerialColumn', 'contentOptions' => ['class' => 'kartik-sheet-style']], ['attribute' => 'an', 'label' => 'AN', 'width' => '60px'], ['attribute' => 'admdoctor', 'label' => 'Admin Doctor', 'width' => '200px', 'value' => function ($model) use($doctor) {
    return $doctor->getDName($model->admdoctor);
}], ['filterType' => GridView::FILTER_DATE_RANGE, 'attribute' => 'regdate', 'label' => 'Admit Date', 'width' => '150px'], ['filterType' => GridView::FILTER_DATE_RANGE, 'attribute' => 'dchdate', 'label' => 'Dch Date', 'width' => '150px'], ['class' => 'kartik\\grid\\FormulaColumn', 'mergeHeader' => true, 'label' => 'Name', 'width' => '260px', 'value' => function ($model) use($patient) {
    return $patient->getPName($model->hn);
}], ['label' => 'สิทธิการรักษา', 'attribute' => 'pttype', 'pageSummary' => 'Total', 'value' => function ($data) {
    //$a = $pttype->getPttype();
    return Pttype::getPttype($data['pttype']);
}, 'filterType' => GridView::FILTER_SELECT2, 'width' => '290px', 'filter' => ArrayHelper::map(frontend\models\Pttype::find()->orderBy('pttype')->asArray()->all(), 'pttype', 'name'), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'สิทธิการรักษา'], 'format' => 'raw'], ['label' => 'เรียกเก็บ', 'value' => function ($model) {
    return $model->getSummery($model->an);
}], ['label' => 'ชำระแล้ว'], ['label' => 'ค้างชำระ']], 'toolbar' => ['{toggleData}', '{export}'], 'export' => ['fontAwesome' => true], 'bordered' => true, 'responsive' => true, 'hover' => true, 'condensed' => true, 'persistResize' => false, 'showPageSummary' => true, 'exportConfig' => [GridView::EXCEL => ['label' => 'Save as Excel']], 'condensed' => true, 'panel' => ['type' => GridView::TYPE_PRIMARY, 'heading' => 'สรุปรายการ']]);
?>

</div>