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

35 lines
824 B
PHP

<?php
class Staff extends MY_Controller
{
var $db_onedev;
public function index()
{
echo "Staff API";
}
public function __construct()
{
parent::__construct();
$this->db_onedev = $this->load->database("onedev", true);
}
public function getStaff($sexID)
{
$prm = $this->sys_input;
$sql = "SELECT m_staff.*
FROM m_staff
WHERE M_StaffIsActive = 'Y'
AND M_StaffM_SexID = ?";
$qry = $this->db_onedev->query($sql, [$sexID]);
if (!$qry) {
$this->db_onedev->trans_rollback();
$this->sys_error_db("slect staff error", $this->db_onedev);
exit;
}
$rows = $qry->result_array();
echo json_encode($rows);
}
}