major update

This commit is contained in:
renaldybrada
2026-03-17 10:29:33 +07:00
parent 64aa3480a0
commit 9f7f55c98d
5 changed files with 71 additions and 47 deletions
+15 -3
View File
@@ -21,6 +21,9 @@ switch ($action) {
case "searchTindakan":
searchTindakan($db, $q);
break;
case "postLaporanOperasi":
postLaporanOperasi($db, $_POST);
break;
default :
echo json_encode([
"error" => "invalid action"
@@ -28,15 +31,15 @@ switch ($action) {
}
function searchDPJP(PostgresDb $db, string $q) {
$query = "SELECT kddokter, namadokter, kdsmf, kode_dpjp FROM public.m_dokter WHERE kdsmf LIKE '%BEDAH%'";
$query = "SELECT kddokter, namadokter, kdsmf, kode_dpjp, nip FROM public.m_dokter WHERE kdsmf LIKE '%BEDAH%'";
if ($q != '') {
$query .= " AND (namadokter ILIKE '%$q%' OR kode_dpjp ILIKE '%$q%')";
}
$query .= " LIMIT 10";
$sql_dokter_bedah = $db->query($query);
$query .= " LIMIT 10";
$arr_dokter_bedah = array();
foreach ($sql_dokter_bedah->fetchAll() as $ds) {
@@ -91,4 +94,13 @@ function searchTindakan(PostgresDb $db, string $q) {
"data" => $result
]);
}
function postLaporanOperasi(PostgresDb $db, $data) {
$query = "INSERT into t_operasi ()";
echo json_encode([
"message" => "success post laporan operasi",
"data" => $data
]);
}
?>