db_onedev = $this->load->database("onedev", true); } function show() { try { //# cek token valid $sql = $this->db_onedev->query("SELECT M_BranchIPAddress as branch_ip_address FROM m_branch WHERE M_BranchIsDefault = 'Y'")->row(); $branch_ip_address = $sql->branch_ip_address; $url = "http://$branch_ip_address/one-api/tools/satu_sehat/resource/organization"; $post_rst = $this->post($url); // echo "to $url \nresponse : $post_rst\n"; $j_rst = json_decode($post_rst,true); $result = array ("total" => 1, "records" => array("xid" => 0),"pesan"=>$post_rst); $this->sys_ok($result); } catch(Exception $exc) { $message = $exc->getMessage(); $this->sys_error($message); } } function post($url) { //$data = $data; $ch = curl_init($url); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); //echo "RST : $result "; return $result; } }