surat/frontend/modules/stat/views/surgical/express.php

112 lines
4.1 KiB
PHP
Raw Normal View History

2024-12-25 03:04:59 +00:00
<?php
use common\models\User;
use kartik\date\DatePicker;
use yii\bootstrap5\ActiveForm;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
$this->title = 'สถิติ Turn Around Time การขอผลด่วน Surgical';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="card shadow">
<div class="card-header">
2026-01-19 08:11:15 +00:00
<h5 class="card-title">
<i class="ri-seo-fill"></i> ค้นหาสถิติ Turn Around Time การขอผลด่วน Surgical
</h5>
2024-12-25 03:04:59 +00:00
</div>
<div class="card-body">
2026-01-19 08:11:15 +00:00
<?php $form = ActiveForm::begin(['method' => 'get']) ?>
2024-12-25 03:04:59 +00:00
<div class="row">
<div class="col-md-3">
<?= $form->field($model, 'date_start')->widget(DatePicker::class, [
'pluginOptions' => [
'format' => 'dd/mm/yyyy',
'autoclose' => true,
'todayHighlight' => true,
'endDate' => date('d/m/Y'),
]
]) ?>
</div>
2026-01-19 08:11:15 +00:00
2024-12-25 03:04:59 +00:00
<div class="col-md-3">
<?= $form->field($model, 'date_end')->widget(DatePicker::class, [
'pluginOptions' => [
'format' => 'dd/mm/yyyy',
'autoclose' => true,
'todayHighlight' => true,
'endDate' => date('d/m/Y'),
]
]) ?>
</div>
2026-01-19 08:11:15 +00:00
2024-12-25 03:04:59 +00:00
<div class="col-md-3">
2026-01-19 08:11:15 +00:00
<?= $form->field($model, 'pathologist_id')->dropDownList(
ArrayHelper::map(
User::find()
->where(['like', 'role', 'pathologist'])
->andWhere(['status' => User::STATUS_ACTIVE])
->orderBy(['realname' => SORT_ASC])
->all(),
'id',
'realname'
),
['prompt' => 'เลือกพยาธิแพทย์...']
) ?>
2024-12-25 03:04:59 +00:00
</div>
</div>
2026-01-19 08:11:15 +00:00
<?= Html::submitButton('<i class="ri-search-2-line"></i> ค้นหา', [
'class' => 'btn btn-primary'
]) ?>
2024-12-25 03:04:59 +00:00
<?php ActiveForm::end() ?>
</div>
</div>
2026-01-19 08:11:15 +00:00
<?php if (!empty($data)) : ?>
<div class="card shadow mt-4">
2024-12-25 03:04:59 +00:00
<div class="card-header">
2026-01-19 08:11:15 +00:00
<h5 class="card-title">
<i class="ri-file-chart-line"></i> <?= Html::encode($this->title) ?>
</h5>
2024-12-25 03:04:59 +00:00
</div>
2026-01-19 08:11:15 +00:00
<div class="card-body">
2024-12-25 03:04:59 +00:00
<div class="table-responsive">
2026-01-19 08:11:15 +00:00
<table class="table table-bordered align-middle">
<thead class="table-light">
2024-12-25 03:04:59 +00:00
<tr>
<th>ระยะเวลา (วัน)</th>
2026-01-19 08:11:15 +00:00
<th class="text-end">จำนวน</th>
<th class="text-end">ร้อยละ</th>
<th class="text-end">ร้อยละสะสม</th>
2024-12-25 03:04:59 +00:00
</tr>
</thead>
<tbody>
2026-01-19 08:11:15 +00:00
<?php foreach ($data as $d): ?>
<tr class="<?= $d['summary_time'] == 5 ? 'table-success' : '' ?>">
2024-12-25 03:04:59 +00:00
<td><?= $d['summary_time'] ?></td>
2026-01-19 08:11:15 +00:00
<td class="text-end"><?= number_format($d['cnt']) ?></td>
<td class="text-end"><?= number_format($d['percent'], 2) ?></td>
<td class="text-end"><?= number_format($d['percent_total'], 2) ?></td>
2024-12-25 03:04:59 +00:00
</tr>
2026-01-19 08:11:15 +00:00
<?php endforeach; ?>
2024-12-25 03:04:59 +00:00
2026-01-19 08:11:15 +00:00
<tr class="table-secondary fw-bold">
2024-12-25 03:04:59 +00:00
<td>รวม</td>
2026-01-19 08:11:15 +00:00
<td class="text-end"><?= number_format($total) ?></td>
2024-12-25 03:04:59 +00:00
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
2026-01-19 08:11:15 +00:00
<?php endif; ?>