Files
BE_IBL/application/controllers/training/Birtandy.php
2026-04-15 15:23:57 +07:00

79 lines
2.4 KiB
PHP

<?php
class Birtandy extends MY_Controller
{
function __construct()
{
parent::__construct();
}
function get_data()
{
try {
$prm = $this->sys_input;
$PID = "0";
if (isset($prm['PID'])) {
$PID = trim($prm["PID"]);
}
$username = "ADMIN";
if (isset($prm['username'])) {
$username = trim($prm["username"]);
}
$sql = "CALL sp_rpt_t_001 (?,?)";
$qry = $this->db->query($sql, array($PID, $username));
$last_qry = $this->db->last_query();
if (!$qry) {
$error = array(
"message" => $this->db->error()["message"],
"sql" => $last_qry
);
$this->sys_error_db($error);
exit;
}
$result = $qry->result_array();
$this->clean_mysqli_connection($this->db->conn_id);
$this->sys_ok($result);
} catch (Exception $exc) {
$message = $exc->getMessage();
$this->sys_error($message);
}
}
function get_data_usg()
{
try {
$prm = $this->sys_input;
$PID = "0";
// $this->sys_ok(json_encode($prm));
// exit;
if (isset($prm['PID'])) {
$PID = trim($prm["PID"]);
}
$PLang = "1";
if (isset($prm['PLang'])) {
$PLang = trim($prm["PLang"]);
}
$username = "ADMIN";
if (isset($prm['username'])) {
$username = trim($prm["username"]);
}
$sql = "CALL sp_rpt_t_hasil_so_usg(?,?,?)";
$qry = $this->db->query($sql, array($PID, $PLang, $username));
$last_qry = $this->db->last_query();
if (!$qry) {
$error = array(
"message" => $this->db->error()["message"],
"sql" => $last_qry
);
$this->sys_error_db($error);
exit;
}
$result = $qry->result_array();
$this->clean_mysqli_connection($this->db->conn_id);
$this->sys_ok($result);
} catch (Exception $exc) {
$message = $exc->getMessage();
$this->sys_error($message);
}
}
}