273 lines
7.3 KiB
PHP
273 lines
7.3 KiB
PHP
<?= $this->extend('layouts/main.php') ?>
|
|
|
|
<?= $this->section('css') ?>
|
|
<style>
|
|
.pagination {
|
|
--bs-pagination-color: #fff;
|
|
--bs-pagination-bg: #4083ff;
|
|
|
|
--bs-pagination-hover-color: #fff;
|
|
--bs-pagination-hover-bg: #73b4ff;
|
|
|
|
--bs-pagination-focus-color: #fff;
|
|
--bs-pagination-focus-bg: #4083ff;
|
|
|
|
--bs-pagination-active-color: #fff;
|
|
--bs-pagination-active-bg: #73b4ffd0;
|
|
|
|
--bs-pagination-disabled-color: #ecf0f1;
|
|
--bs-pagination-disabled-bg: #73b4ff;
|
|
}
|
|
</style>
|
|
<?= $this->endSection() ?>
|
|
|
|
<?= $this->section('content') ?>
|
|
<?php
|
|
$dateObject = new DateTime($firstdate);
|
|
$formatedFirstDate = $dateObject->format('D, d M Y - H:i:s.v');
|
|
|
|
$dateObject = new DateTime($lastdate);
|
|
$formatedLastDate = $dateObject->format('D, d M Y - H:i:s.v');
|
|
|
|
// $startDate = new DateTime($firstdate);
|
|
// $endDate = new DateTime($lastdate);
|
|
// $interval = $startDate->diff($endDate);
|
|
// $months = $interval->y * 12 + $interval->m;
|
|
// // Jika ada bagian bulan yang tidak lengkap, tambahkan satu bulan
|
|
// if ($interval->d > 0) {
|
|
// $months++;
|
|
// }
|
|
// $testpermonth = $testcount / $months;
|
|
// $testpermonth = number_format($testpermonth, 2, ',', '');
|
|
$testpermonth = number_format($testcount / ($days / 30), 2, ',', '');
|
|
$testperday = number_format($testcount / $days, 2, ',', '');
|
|
?>
|
|
|
|
<main id="main" class="main">
|
|
|
|
<div class="card shadow-none">
|
|
|
|
<div class="card-header">
|
|
<?php if ($EquipmentID == '6011310722') : ?>
|
|
<div class="fw-bold">National Hospital Surabaya<span class="float-end p-0">TMS 30i <i class="bi bi-pc-display-horizontal"></i></span></div>
|
|
<?php elseif ($EquipmentID == '6015090124') : ?>
|
|
<div class="fw-bold">Persada Hospital</div>
|
|
<?php elseif ($EquipmentID == '6011320722') : ?>
|
|
<div class="fw-bold">RS Mardi Rahayu Kudus</div>
|
|
<?php elseif ($EquipmentID == '6005840519') : ?>
|
|
<div class="fw-bold">RS dr. Oen Kandang Sapi Solo</div>
|
|
<?php elseif ($EquipmentID == '6006100619') : ?>
|
|
<div class="fw-bold">RS Permata Cibubur</div>
|
|
<?php elseif ($EquipmentID == '6015560324') : ?>
|
|
<div class="fw-bold">ScanMe Labs Jakarta Kelapa Gading</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<div class="card-body p-4">
|
|
|
|
<div class='row m-0'>
|
|
|
|
<div class="col-12 col-sm-6 col-md-4 col-xl-3">
|
|
<div class="card shadow-none info-card sales-card border border-primary">
|
|
<div class="card-body">
|
|
<h5 class="card-title pb-0 pt-4">Test Count</h5>
|
|
<div class="d-flex align-items-center p-0 m-0">
|
|
<div class="">
|
|
<h4><?=$testcount;?></h4>
|
|
<span>Total Test</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-12 col-sm-6 col-md-4 col-xl-3">
|
|
<div class="card shadow-none info-card sales-card border border-primary">
|
|
<div class="card-body">
|
|
<h5 class="card-title pb-0 pt-4">Day Count</h5>
|
|
<div class="d-flex align-items-center p-0 m-0">
|
|
<div class="">
|
|
<h4><?=$days;?></h4>
|
|
<span>Days</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-12 col-sm-6 col-md-4 col-xl-3">
|
|
<div class="card shadow-none info-card sales-card border border-primary">
|
|
<div class="card-body">
|
|
<h5 class="card-title pb-0 pt-4">Monthly (avg)</h5>
|
|
<div class="d-flex align-items-center p-0 m-0">
|
|
<div class="">
|
|
<h4><?=$testpermonth;?></h4>
|
|
<span>Test per month</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-12 col-sm-6 col-md-4 col-xl-3">
|
|
<div class="card shadow-none info-card sales-card border border-primary">
|
|
<div class="card-body">
|
|
<h5 class="card-title pb-0 pt-4">Daily (avg)</h5>
|
|
<div class="d-flex align-items-center p-0 m-0">
|
|
<div class="">
|
|
<h4><?=$testperday;?></h4>
|
|
<span>Test per day</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- <div class="col-12 col-sm-6 col-md-4 col-xl-3">
|
|
<div class="card shadow-none info-card sales-card border border-primary">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Test Count (avg)</h5>
|
|
<div class="d-flex align-items-center">
|
|
<div class="ps-3">
|
|
<h3><?php echo $testpermonth;?></h3>
|
|
<span>Test per month</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div> -->
|
|
|
|
</div>
|
|
|
|
<div class="row mt-0 p-3">
|
|
|
|
<div class="col-12 p-0">
|
|
<h4><i class="bi bi-clipboard-data"></i> Detail Chart</h4>
|
|
</div>
|
|
|
|
<div class="col-12 border border-primary">
|
|
<div class="col-12 mb-3">
|
|
<div class="row text-center p-2 mt-1">
|
|
<div class="col-12 col-md-6">
|
|
Tanggal Awal : <span class="fw-bold"><?=$formatedFirstDate;?></span>
|
|
</div>
|
|
<div class="col-12 col-md-6">
|
|
Tanggal Akhir : <span class="fw-bold"><?=$formatedLastDate;?></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<canvas id="myChart"></canvas>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row mt-0 p-3">
|
|
|
|
<div class="col-12 p-0">
|
|
<h4><i class="bi bi-file-earmark-spreadsheet"></i> Detail Test</h4>
|
|
</div>
|
|
|
|
<div class="col p-0 mt-1">
|
|
<!-- <div class="tab-pane fade show active" id="open-tab-pane" role="tabpanel" tabindex="0"> -->
|
|
<div class="table-responsive">
|
|
<table id="testCountTable" class="table table-striped table-hover">
|
|
<thead>
|
|
<th scope="col">#</th>
|
|
<th scope="col">Sample ID</th>
|
|
<th scope="col">Test Code</th>
|
|
<th scope="col">Result</th>
|
|
<th scope="col">Result Date</th>
|
|
<th scope="col">Create Date</th>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<?php
|
|
$i=1;
|
|
foreach($testData as $value) {
|
|
|
|
$sampleid = $value['SampleID'];
|
|
$testtechcode = $value['TestTechCode'];
|
|
$result = $value['Result'];
|
|
$resultdatetime = $value['ResultDateTime'];
|
|
$createdate = $value['CreateDate'];
|
|
|
|
echo "<tr>";
|
|
echo "<td>$i</td>";
|
|
echo "<td>$sampleid</td>";
|
|
echo "<td>$testtechcode</td>";
|
|
echo "<td>$result</td>";
|
|
echo "<td>$resultdatetime</td>";
|
|
echo "<td>$createdate</td>";
|
|
echo "</tr>";
|
|
|
|
$i++;
|
|
} ?>
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- </div> -->
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</main>
|
|
<?= $this->endSection() ?>
|
|
|
|
<?= $this->section('script') ?>
|
|
<?php
|
|
// chart data
|
|
function monthNumberToName($monthNumber) {
|
|
return date('F', mktime(0, 0, 0, $monthNumber, 1));
|
|
}
|
|
$months = '';
|
|
$countpm = '';
|
|
foreach($counts as $data) {
|
|
$qmonth = $data['month'];
|
|
$qyear = $data['year'];
|
|
$monthname = monthNumberToName($qmonth);
|
|
$months .= "'$monthname $qyear',";
|
|
$qcount = $data['count'];
|
|
$countpm .= "$qcount,";
|
|
}
|
|
$months = rtrim($months,',');
|
|
$countpm = rtrim($countpm,',');
|
|
?>
|
|
<script>
|
|
const ctx = document.getElementById('myChart');
|
|
|
|
new Chart(ctx, {
|
|
type: 'bar',
|
|
data: {
|
|
labels: [ <?=$months;?> ],
|
|
datasets: [{
|
|
label: '# of Tests',
|
|
data: [ <?=$countpm;?> ],
|
|
borderWidth: 1
|
|
}]
|
|
},
|
|
options: {
|
|
scales: {
|
|
y: {
|
|
beginAtZero: true
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
$(function () {
|
|
$('#testCountTable').DataTable({
|
|
"order" : [],
|
|
"pageLength" : 10,
|
|
"info": true,
|
|
"lengthMenu": [ [10, 50, 100, 500, 1000], [10, 50, 100, 500, 1000] ], // Pilihan jumlah baris yang ditampilkan
|
|
});
|
|
});
|
|
</script>
|
|
<?= $this->endSection() ?>
|