add api file from used in s_menu fe accone

This commit is contained in:
2026-07-06 16:44:35 +07:00
parent f3dba31445
commit 5ecf65a820
30 changed files with 23347 additions and 32 deletions

View File

@@ -0,0 +1,43 @@
<?php
class Lookup extends MY_Controller
{
public function __construct() {
parent::__construct();
$this->db_smartone = $this->load->database("onedev", true);
}
function dropdown($sp) {
$sql = "call $sp";
$qry = $this->db_smartone->query($sql);
if (! $qry) {
echo json_encode(array());
}
$rows = $qry->result_array();
if (count($rows) == 0 ) {
echo json_encode(array());
}
echo json_encode($rows);
}
function ac($sp) {
$prm = $this->sys_input;
$search = $prm['search'];
$sql = "call $sp(?)";
if (isset($prm['dep'])) {
$sql = "call $sp(?,?)";
$value = $prm['value'];
$qry = $this->db_smartone->query($sql,array($search,$value));
} else {
$qry = $this->db_smartone->query($sql,array($search));
}
if (! $qry) {
echo json_encode(array());
}
$rows = $qry->result_array();
if (count($rows) == 0 ) {
echo json_encode(array());
exit;
}
echo json_encode($rows);
}
}