60 lines
1.7 KiB
PHP
60 lines
1.7 KiB
PHP
<?php
|
|
class Birt_exercise extends MY_Controller {
|
|
var $db;
|
|
|
|
public function index()
|
|
{
|
|
echo "BIRT EXERCISE API";
|
|
}
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
// $this->db = $this->load->database("nas_report", true);
|
|
}
|
|
|
|
// rpt invoice
|
|
public function getData()
|
|
{
|
|
$param = $this->sys_input;
|
|
$PID = $param['PID'];
|
|
$username = $param['username'];
|
|
$sql = "call sp_rpt_t_001 ($PID, '$username')";
|
|
$qry = $this->db->query($sql);
|
|
|
|
if(!$qry){
|
|
$this->db->trans_rollback();
|
|
$this->sys_error_db(["status" => "ERR", "message" => "error call sp_rpt_t_001 | " .
|
|
$this->db->error()["message"], "debug" => $this->db->last_query()]);
|
|
exit;
|
|
}else{
|
|
$data = $qry->result_array();
|
|
$this->clean_mysqli_connection($this->db->conn_id);
|
|
$this->sys_ok($data);
|
|
}
|
|
}
|
|
|
|
// rpt thorax so xray
|
|
public function getDataHasilSoXray()
|
|
{
|
|
$param = $this->sys_input;
|
|
$PID = $param['PID'];
|
|
$username = $param['username'];
|
|
$lang = $param['lang'];
|
|
$sql = "call sp_rpt_t_hasil_so_xray ($PID, $lang,'$username')";
|
|
// $sql = "call sp_rpt_t_hasil_so_xray('131769', '1', 'ADMIN')";
|
|
$qry = $this->db->query($sql);
|
|
|
|
if(!$qry){
|
|
$this->db->trans_rollback();
|
|
$this->sys_error_db(["status" => "ERR", "message" => "error call sp_rpt_t_hasil_so_xray | " .
|
|
$this->db->error()["message"], "debug" => $this->db->last_query()]);
|
|
exit;
|
|
}else{
|
|
$data = $qry->result_array();
|
|
$this->clean_mysqli_connection($this->db->conn_id);
|
|
$this->sys_ok($data);
|
|
}
|
|
}
|
|
}
|
|
?>
|