major update
This commit is contained in:
+15
-3
@@ -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
|
||||
]);
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user