diff --git a/dataLaporanOperasi.php b/dataLaporanOperasi.php new file mode 100644 index 0000000..a371fff --- /dev/null +++ b/dataLaporanOperasi.php @@ -0,0 +1,67 @@ + "invalid action" + ]); +} + +function searchDPJP(PostgresDb $db, string $q) { + $query = "SELECT kddokter, namadokter, kdsmf, kode_dpjp FROM public.m_dokter WHERE kdsmf LIKE '%BEDAH%'"; + + if ($q != '') { + $query .= " AND (namadokter ILIKE '%$q%' OR kode_dpjp ILIKE '%$q%')"; + } + + $sql_dokter_bedah = $db->query($query); + + $arr_dokter_bedah = array(); + foreach ($sql_dokter_bedah->fetchAll() as $ds) { + array_push($arr_dokter_bedah, $ds); + } + + echo json_encode([ + "message" => "success get dokter", + "data" => $arr_dokter_bedah + ]); +} + +function searchDokterAnestesi(PostgresDb $db, string $q) { + $query = "SELECT kddokter, namadokter, kdsmf, kode_dpjp FROM public.m_dokter WHERE kdsmf LIKE '%ANESTHESI%'"; + + if ($q != '') { + $query .= " AND (namadokter ILIKE '%$q%' OR kode_dpjp ILIKE '%$q%')"; + } + + $sql_dokter_anestesi = $db->query($query); + + $arr_dokter_anestesi = array(); + foreach ($sql_dokter_anestesi->fetchAll() as $ds) { + array_push($arr_dokter_anestesi, $ds); + } + + echo json_encode([ + "message" => "success get dokter", + "data" => $arr_dokter_anestesi + ]); +} + +?> \ No newline at end of file diff --git a/index.php b/index.php index 2a4b3e7..2f9f3cd 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,27 @@ query( + "SELECT * FROM public.m_dokter WHERE kdsmf LIKE '%BEDAH%'" +); +$arr_dokter_bedah = array(); +foreach ($sql_dokter_bedah->fetchAll() as $ds) { + $arr_dokter_bedah[$ds['kddokter']] = $ds['namadokter']; +} + +// query dokter anestesi +$sql_dokter_anesthesi = $db->query("SELECT * FROM public.m_dokter WHERE kdsmf LIKE '%ANESTHESI%'"); +$arr_dokter_anesthesi = array(); +foreach ($sql_dokter_anesthesi->fetchAll() as $ds) { + $arr_dokter_anesthesi[$ds['kddokter']] = $ds['namadokter']; +} + $riwayat = [ [ "tanggal" => "28/1/2026, 2:27:04 PM", @@ -57,13 +79,21 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {