28 lines
874 B
PHP
28 lines
874 B
PHP
<?php
|
|
class Andy extends MY_Controller
|
|
{
|
|
function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
function index()
|
|
{
|
|
echo "Api: Training Playground";
|
|
}
|
|
function query($qry)
|
|
{
|
|
// $qry = "%$qry%";
|
|
$sql = "select * from nat_instrument where nat_instrument.nat_instrumentID in (select t_instrument_local.T_InstrumentLocalNat_InstrumentID from t_instrument_local where t_instrument_local.T_InstrumentLocalIsActive ='Y' )";
|
|
$qry = $this->db->query($sql);
|
|
if (!$qry) {
|
|
echo json_encode([
|
|
"status" => "ERR", "message" => $this->db->error()["message"],
|
|
"sql" => $this->db->last_query()
|
|
]);
|
|
exit;
|
|
}
|
|
$rows = $qry->result_array();
|
|
echo json_encode(["status" => "OK", "rows" => $rows]);
|
|
}
|
|
}
|