Initial import
This commit is contained in:
43
one-api/application/controllers/v1/report-v8/Lookup.php
Normal file
43
one-api/application/controllers/v1/report-v8/Lookup.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
class Lookup extends MY_Controller
|
||||
{
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
$this->db_smartone = $this->load->database("regional", 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user