Files
2026-04-27 10:31:17 +07:00

50 lines
1.1 KiB
PHP

<?php
/*
template function {
$this->sys_debug();
try {
if (! $this->isLogin) {
$this->sys_error("Invalid Token");
exit;
}
$prm = $this->sys_input;
} catch(Exception $exc) {
$message = $exc->getMessage();
$this->sys_error($message);
}
}
*/
class Patientaddress extends MY_Controller
{
var $db_smartone;
public function index()
{
echo "Patient API";
}
public function __construct()
{
parent::__construct();
$this->db_smartone = $this->load->database("onedev", true);
}
public function get_all()
{
$prm = $this->sys_input;
$sql = "select M_PatientAddressID, M_PatientAddressNote,
M_PatientAddressDescription, M_KelurahanName as M_KelurahanName
from m_patientaddress
left join m_kelurahan on m_patientaddressm_kelurahanid = m_kelurahanid
where m_patientaddressm_patientid = ?";
$query = $this->db_smartone->query($sql, array($prm['patient_id']));
$rows = $query->result_array();
$result = array("status" => "OK", "records" => $rows);
$this->sys_ok($result);
}
}