Files
2026-04-27 10:31:17 +07:00

42 lines
917 B
PHP

<?php
class Company extends MY_Controller
{
var $db_smartone;
public function index()
{
echo "RE Company API";
}
public function __construct()
{
parent::__construct();
$this->db_smartone = $this->load->database("onedev", true);
}
public function search()
{
$prm = $this->sys_input;
$qry = "%" . $prm["qry"] . '%';
$sql = "Select CorporateID, CorporateName
from corporate
where CorporateName like ?
and CorporateIsActive = 'Y'
limit 0,30";
$query = $this->db_smartone->query($sql, array($qry));
if ($query) {
$rows = $query->result_array();
$rows[] = array("CorporateID" => 0, "CorporateName" => "Semua");
$result = array("data" => $rows);
$this->sys_ok($result);
} else {
$this->sys_error_db("", $this->db_smartone);
exit;
}
}
}