42 lines
1.1 KiB
PHP
Executable File
42 lines
1.1 KiB
PHP
Executable File
<?php
|
|
|
|
class Delivery extends MY_Controller
|
|
{
|
|
var $db_onedev;
|
|
public function index()
|
|
{
|
|
echo "API";
|
|
}
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->db_onedev = $this->load->database("onedev", true);
|
|
}
|
|
|
|
public function lookup()
|
|
{
|
|
if (! $this->isLogin) {
|
|
$this->sys_error("Invalid Token");
|
|
exit;
|
|
}
|
|
$query = " SELECT M_DeliveryID as id,
|
|
M_DeliveryTypeID as typeid,
|
|
M_DeliveryTypeCode as type,
|
|
M_DeliverySource as source,
|
|
M_DeliveryName as name
|
|
FROM
|
|
m_deliverytype
|
|
JOIN m_delivery ON M_DeliveryM_DeliveryTypeID = M_DeliveryTypeID AND M_DeliveryIsActive = 'Y'
|
|
WHERE
|
|
M_DeliveryTypeIsActive = 'Y'";
|
|
$rows = $this->db_onedev->query($query)->result_array();
|
|
$result = array(
|
|
"total" => count($rows) ,
|
|
"records" => $rows
|
|
);
|
|
$this->sys_ok($result);
|
|
exit;
|
|
}
|
|
}
|