surat/frontend/modules/register/views/molecular-consult/index.php

1 line
6.0 KiB
PHP
Raw Normal View History

2024-12-25 03:04:59 +00:00
<?php use common\models\CaseMolecular; use common\models\CenterApprove; use common\models\MolecularDiagnosis; use common\models\User; use kartik\select2\Select2; use yii\helpers\ArrayHelper; use yii\helpers\Html; use yii\grid\GridView; /* @var $this yii\web\View */ /* @var $searchModel frontend\modules\register\models\SurgicalConsultSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = 'Molecular Consults'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="consult-index"> <div class="card"> <div class="card-header"> <div class="header-top"> <h4 class="card-title"><?= Html::encode($this->title) ?></h4> </div> </div> <div class="card-body table-responsive"> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <?= GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], //'id', 'id_case', [ 'attribute' => 'patient_name', 'value' => function ($model) { $case = CaseMolecular::findOne(['id_case' => Html::encode($model->id_case)]); return isset($case) ? Html::encode($case->getFullname()) : null; } ], 'remark:ntext', [ 'attribute' => 'pathologist1_id', 'filter' => Select2::widget([ 'model' => $searchModel, 'attribute' => 'pathologist1_id', 'data' => ArrayHelper::map(User::find()->where(['like', 'role', 'pathologist'])->orderBy(['report_name' => SORT_ASC])->all(), 'id', 'report_name'), 'pluginOptions' => [ 'placeholder' => 'Select Pathologist' ] ]), 'value' => function ($model) { return (isset($model->pathologistOwn) ? Html::encode($model->pathologistOwn->report_name) : null); } ], [ 'attribute' => 'pathologist2_id', 'filter' => Select2::widget([ 'model' => $searchModel, 'attribute' => 'pathologist2_id', 'data' => ArrayHelper::map(User::find()->where(['like', 'role', 'pathologist'])->orderBy(['report_name' => SORT_ASC])->all(), 'id', 'report_name'), 'pluginOptions' => [ 'placeholder' => 'Select Pathologist' ] ]), 'value' => function ($model) { return (isset($model->pathologistConsult) ? Html::encode($model->pathologistConsult->report_name) : null); } ], //'diagnosis_by', [ 'attribute' => 'status', 'format' => 'raw', 'options' => ['style' => 'width:130px;'], 'filter' => [1 => 'Request consult', 2 => 'Send consult', 3 => 'Pathologist approved', 4 => 'Report released'], 'value' => function ($model) { $arr = [1 => '<span class="badge badge-danger">Request consult</span>', 2 => '<span class="badge badge-primary">Send consult</span>', 3 => '<span class="badge badge-warning">Pathologist approved</span>', 4 => '<span class="badge badge-success">Report released</span>']; return isset($arr[$model->status]) ? $arr[$model->status] : null; }