Initial import
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
class Delivery 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 search()
|
||||
{
|
||||
$prm = $this->sys_input;
|
||||
$q = [
|
||||
"patient_id" => 0,
|
||||
"doctor_id" => 0,
|
||||
"mou_id" => 0
|
||||
];
|
||||
|
||||
if (isset($prm['patient_id']))
|
||||
$q["patient_id"] = $prm['patient_id'];
|
||||
if (isset($prm['doctor_id']))
|
||||
$q["doctor_id"] = $prm['doctor_id'];
|
||||
if (isset($prm['mou_id']))
|
||||
$q["mou_id"] = $prm['mou_id'];
|
||||
|
||||
$sql = "CALL sp_fo_delivery_address('', '{$q['patient_id']}', '{$q['doctor_id']}', '{$q['mou_id']}')";
|
||||
$query = $this->db_smartone->query($sql);
|
||||
if ($query) {
|
||||
$rows= $query->row();
|
||||
$data = json_decode($rows->x);
|
||||
|
||||
$result = array("records" => $data);
|
||||
$this->sys_ok($result);
|
||||
exit;
|
||||
} else {
|
||||
$this->sys_error_db("delivery address",$this->db_smartone);
|
||||
exit;
|
||||
}
|
||||
|
||||
// $rows = array();
|
||||
// $rows[] = array("id" =>1, "name" => "Ambil Sendiri", "selected" => false, "note" => "");
|
||||
// $rows[] = array("id" =>2, "name" => "Kirim ke dokter", "selected" => false, "note" => "");
|
||||
// $rows[] = array("id" =>3, "name" => "Kirim ke email pasien", "selected" => false, "note" => "");
|
||||
// $rows[] = array("id" =>4, "name" => "Kirim ke email dokter", "selected" => false, "note" => "");
|
||||
// $rows[] = array("id" =>5, "name" => "Kirim ke alamat utama pasien", "selected" => false, "note" => "");
|
||||
// $rows[] = array("id" =>6, "name" => "Kirim ke alamat utama dokter", "selected" => false, "note" => "");
|
||||
// $rows[] = array("id" =>7, "name" => "Kirim ke rekanan");
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user