where([
- 'id_case' => $case_surgical->id_case
- ])->count() > 0) { ?>
- = GridView::widget([
- 'dataProvider' => new ActiveDataProvider([
- 'query' => SurgicalDiagnosis::find()->andFilterWhere([
- 'id_case' => $case_surgical->id_case
- ]),
- 'sort' => [
- 'defaultOrder' => [
- 'pathologist_at' => SORT_DESC
- ]
- ]
+ 'id_case' => $case_surgical->id_case
+ ])->count() > 0) { ?>
+ = GridView::widget([
+ 'dataProvider' => new ActiveDataProvider([
+ 'query' => SurgicalDiagnosis::find()->andFilterWhere([
+ 'id_case' => $case_surgical->id_case
]),
- 'tableOptions' => ['class' => 'table align-middle table-hover m-0 truncate'],
- 'layout' => "{summary}
{pager}
",
- 'columns' => [
- ['class' => 'yii\grid\SerialColumn'],
- 'id_case',
- 'pathologist_at',
- [
- 'attribute' => 'status_id',
- 'value' => function ($model) {
- // return isset($model->status) ? Html::encode($model->status->name) : '';
- return isset($model->status) ? ($model->status->name) : '';
- }
- ],
- [
- 'class' => 'yii\grid\ActionColumn',
- 'template' => '{view}',
- 'buttons' => [
- 'view' => function ($url, $model, $key) {
- if ($model->status_id >= 4) {
- $ap = '';
- $approve = ApproveStatus::findOne(['id_case' => $model->id_case, 'report_type' => $model->report_type, 'ref_id' => $model->id]);
- if ($approve && $approve->approve_status < 4) {
- return '
รอตรวจสอบ';
- }
- $case_type = Yii::$app->pathology->getCaseType($model->id_case);
- $case = Yii::$app->pathology->getCase($model->id_case);
-
- if ($model->report_type == 'outlab') {
- foreach ($model->getReport() as $file => $val) {
- return Html::a('
View Report', Yii::getAlias('@web') . '/' . $model->uploadReportFolder . '/' . $val, ['class' => 'btn btn-md btn-info btn-block', 'target' => '_blank']);
- }
- } elseif ($model->report_type == 'consult-outlab') {
- foreach ($model->getConsultReport() as $file => $val) {
- return Html::a('
View Report', Yii::getAlias('@web') . '/' . $model->uploadConsultReportFolder . '/' . $val, ['class' => 'btn btn-md btn-info btn-block', 'target' => '_blank']);
- }
- } else {
- return Html::a('
View Report', ['/report/case/' . $case_type . '-pdf', 'id_case' => $model->id_case, 'report_type' => $model->report_type, 'id' => $model->id, 'mode' => 'final', 'file' => false, 'watermark' => false], ['class' => 'btn btn-md btn-info btn-block', 'target' => '_blank']) . $ap;
- }
- }
- },
- ],
+ 'sort' => [
+ 'defaultOrder' => [
+ 'pathologist_at' => SORT_DESC
]
]
- ]) ?>
+ ]),
+ 'tableOptions' => ['class' => 'table align-middle table-hover m-0 truncate'],
+ 'layout' => "{summary}
{pager}
",
+ 'columns' => [
+ ['class' => 'yii\grid\SerialColumn'],
+ 'id_case',
+ 'pathologist_at',
+ [
+ 'attribute' => 'status_id',
+ 'value' => function ($model) {
+ // return isset($model->status) ? Html::encode($model->status->name) : '';
+ return isset($model->status) ? ($model->status->name) : '';
+ }
+ ],
+ [
+ 'class' => 'yii\grid\ActionColumn',
+ 'template' => '{view}',
+ 'buttons' => [
+ 'view' => function ($url, $model, $key) {
+ if ($model->status_id >= 4) {
+ $ap = '';
+ $approve = ApproveStatus::findOne(['id_case' => $model->id_case, 'report_type' => $model->report_type, 'ref_id' => $model->id]);
+ if ($approve && $approve->approve_status < 4) {
+ return '
รอตรวจสอบ';
+ }
+ $case_type = Yii::$app->pathology->getCaseType($model->id_case);
+ $case = Yii::$app->pathology->getCase($model->id_case);
+
+ if ($model->report_type == 'outlab') {
+ foreach ($model->getReport() as $file => $val) {
+ return Html::a('
View Report', Yii::getAlias('@web') . '/' . $model->uploadReportFolder . '/' . $val, ['class' => 'btn btn-md btn-info btn-block', 'target' => '_blank']);
+ }
+ } elseif ($model->report_type == 'consult-outlab') {
+ foreach ($model->getConsultReport() as $file => $val) {
+ return Html::a('
View Report', Yii::getAlias('@web') . '/' . $model->uploadConsultReportFolder . '/' . $val, ['class' => 'btn btn-md btn-info btn-block', 'target' => '_blank']);
+ }
+ } else {
+ return Html::a('
View Report', ['/report/case/' . $case_type . '-pdf', 'id_case' => $model->id_case, 'report_type' => $model->report_type, 'id' => $model->id, 'mode' => 'final', 'file' => false, 'watermark' => false], ['class' => 'btn btn-md btn-info btn-block', 'target' => '_blank']) . $ap;
+ }
+ }
+ },
+ ],
+ ]
+ ]
+ ]) ?>