Initial import
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user