Flatten mockup repo
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?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 M_CompanyID, M_CompanyName
|
||||
from m_company
|
||||
where M_CompanyName like ?
|
||||
and M_CompanyIsActive = 'Y'
|
||||
limit 0,30";
|
||||
$query = $this->db_smartone->query($sql, array($qry) );
|
||||
if ($query) {
|
||||
$rows = $query->result_array();
|
||||
$rows[] = array("M_CompanyID" => 0, "M_CompanyName" => "Semua");
|
||||
$result = array("data" => $rows );
|
||||
$this->sys_ok($result);
|
||||
}
|
||||
else {
|
||||
$this->sys_error_db("", $this->db_smartone);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user