surat/frontend/modules/register/views/necropsy-consult/view.php

1 line
3.5 KiB
PHP
Raw Normal View History

2024-12-25 03:04:59 +00:00
<?php use yii\helpers\Html; use yii\widgets\DetailView; /* @var $this yii\web\View */ /* @var $model common\models\SurgicalConsult */ $this->title = Html::encode($model->id_case . '-' . $case->getFullname()); $this->params['breadcrumbs'][] = ['label' => 'Necropsy Consults', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; \yii\web\YiiAsset::register($this); ?> <div class="surgical-consult-view"> <div class="card"> <div class="card-header"> <div class="header-top"> <h4 class="card-title"><?= Html::encode($this->title) ?></h4> <div class="card-header-right-icon"> <?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?> </div> </div> </div> <div class="card-body"> <?= DetailView::widget([ 'model' => $model, 'attributes' => [ //'id', 'id_case', 'remark:ntext', [ 'attribute' => 'pathologist1_id', 'value' => function ($model) { return (isset($model->pathologistOwn) ? Html::encode($model->pathologistOwn->report_name) : null); } ], [ 'attribute' => 'pathologist2_id', 'value' => function ($model) { return (isset($model->pathologistConsult) ? Html::encode($model->pathologistConsult->report_name) : null); } ], [ 'attribute' => 'diagnosis_by', 'value' => function ($model) { $arr = [1 => 'Pathologist Owner', 2 => 'Pathologist Consult']; return isset($arr[$model->diagnosis_by]) ? $arr[$model->diagnosis_by] : null; } ], [ 'attribute' => 'status', 'format' => 'raw', '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; } ], //'surgical_diagnosis_id', 'created_at:datetime', 'updated_at:datetime', [ 'attribute' => 'created_by', 'value' => function ($model) { return Html::encode($model->createdBy->report_name); } ], [ 'attribute' => 'updated_by', 'value' => function ($model) { return Html::encode($model->updatedBy->report_name); } ], ], ]) ?> </div> </div> </div>