66 lines
2.9 KiB
PHP
66 lines
2.9 KiB
PHP
<?php
|
|
include "model/koneksi.php";
|
|
// db settings
|
|
date_default_timezone_set('Asia/Jakarta'); //Menyesuaikan waktu dengan tempat kita tinggal
|
|
session_start();
|
|
// db connection
|
|
// $con = mysqli_connect($hostname, $username, $password, $database) or die("Error " . mysqli_error($con));
|
|
|
|
// fetch records
|
|
$nama_login = $_SESSION['nama'];
|
|
$sql = "SELECT * FROM datapasien_ok WHERE ruang='$nama_login' AND status_tunggu= 'menunggu'";
|
|
$result = mysqli_query($open, $sql);
|
|
$array = array();
|
|
$no = 0;
|
|
|
|
while ($data = mysqli_fetch_assoc($result)) {
|
|
$no++;
|
|
// $tsql = "SELECT * FROM tb_tindakan WHERE id_pasien='$data[id_pasien]' AND ruang='$nama_login' AND masalah='belum'";
|
|
// $sqlcount = mysqli_num_rows(mysqli_query($open, $tsql));
|
|
// if ($sqlcount > 0) {
|
|
// $count = 'Proses';
|
|
// } else {
|
|
$count = '';
|
|
// }
|
|
|
|
$awal = date_create($data['jam_daftar']);
|
|
$akhir = date_create(); // waktu sekarang
|
|
$diff = date_diff($awal, $akhir);
|
|
$jam_daftar = date('d-m-Y H:i', strtotime($data['jam_daftar']));
|
|
$hour = $diff->h < 6;
|
|
$day = $diff->d == 0;
|
|
|
|
// if ($hour && $day) {
|
|
// $btnprolong = "btn btn-success btn-sm";
|
|
// } else {
|
|
// $btnprolong = "btn btn-danger btn-sm";
|
|
// }
|
|
|
|
$sub_array['no'] = "<a class='btn btn-light position-relative'style='font-size: 9pt;' href='dataview.php?id_pasien=$data[id_pasien]' >$no</a>";
|
|
$sub_array['nama'] = "<a class=''style='font-size:9pt;font-weight:bold;' href='dataview.php?id_ok=$data[id_ok]&id_pasien=$data[id_pasien]&status_keluar=$data[status_keluar]' title='Detail pasien $data[nama]'>$data[nama]</a>
|
|
<p style='font-size: 8pt;'>No.RM : $data[register]<br>
|
|
Ruang : $data[ruang_asal]</p>";
|
|
|
|
$sub_array['prioritas'] = "<a class='btn btn-light position-relative' style='font-size: 9pt;' >$data[kriteria_tindakan]<span class='position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger'>$count</span></a>";
|
|
$sub_array['diagnosa_medis'] = "<p style='font-size: 9pt;'>$data[diagnosa_medis]</p>";
|
|
$sub_array['rencana'] = "<p style='font-size: 9pt;'>Rencana $data[rencana_tindakan]</p>";
|
|
$sub_array['operator'] = "<select class='form-select' style='font-size: 9pt; font-weight: bold;'>
|
|
<option value=''style='font-weight: bold;' >Operator</option>
|
|
<option value='' > $data[operator]</option>
|
|
<option><li role='divider'></li></option>
|
|
<option value='' style='font-weight: bold;'>Anestesi</option>
|
|
<option value='' >$data[anestesi]</option>
|
|
</select>";
|
|
$sub_array['waktu_tunggu'] = "<a class= '$btnprolong' style='font-size: 9pt;' data-bs-toggle='modal' data-bs-target='#prolong$data[id_pasien]'> $diff->d hari- $diff->h jam- $diff->i menit</a>";
|
|
$array[] = $sub_array;
|
|
}
|
|
|
|
$dataset = array(
|
|
"echo" => 1,
|
|
"totalrecords" => count($array),
|
|
"totaldisplayrecords" => count($array),
|
|
"data" => $array
|
|
);
|
|
|
|
echo json_encode($dataset);
|