Array ( [0] => Array ( [0] => stdClass Object ( [ProductID] => 1 [ProductName] => NAMASTE INDIA ชัยปุระ อัครา เดลี [ProductCode] => CZDEL01 [Country] => INDIA [FileWord] => 1_20190212123611.docx [FilePDF] => 1_20190212123611.pdf [UrlImage] => 1_20190212114657.png [Airline] => 9W [HotelStar] => 3 ) ) [1] => Array ( [0] => stdClass Object ( [PeriodID] => 1 [PeriodStartDate] => 2019-05-03 [PeriodEndDate] => 2019-05-07 [Day] => 5 [Night] => 3 [Airline] => 9W [Price_Twin] => 18999.00 [Price_Single] => 4999.00 [Price_Infant] => 10000.00 [ComAgent] => 1000 [ComSale] => 500 [Groupsize] => 3 [Book] => 0 [Seat] => 20 [Status] => Book [UpdateDate] => 2019-05-03 21:16:00 ) [1] => stdClass Object ( [PeriodID] => 1 [PeriodStartDate] => 2019-05-17 [PeriodEndDate] => 2019-05-21 [Day] => 5 [Night] => 3 [Airline] => 9W [Price_Twin] => 18999.00 [Price_Single] => 4999.00 [Price_Infant] => 10000.00 [ComAgent] => 1000 [ComSale] => 500 [Groupsize] => 3 [Book] => 0 [Seat] => 25 [Status] => Book [UpdateDate] => 2019-05-03 21:16:00 ) [2] => stdClass Object ( [PeriodID] => 1 [PeriodStartDate] => 2019-05-10 [PeriodEndDate] => 2019-05-14 [Day] => 5 [Night] => 3 [Airline] => 9W [Price_Twin] => 17999.00 [Price_Single] => 4999.00 [Price_Infant] => 10000.00 [ComAgent] => 1000 [ComSale] => 500 [Groupsize] => 3 [Book] => 0 [Seat] => 20 [Status] => Book [UpdateDate] => 2019-05-03 21:16:00 ) ) )
Array ( [0] => Array ( [0] => stdClass Object ( [ProductID] => 1 [ProductName] => NAMASTE INDIA ชัยปุระ อัครา เดลี [ProductCode] => CZDEL01 [Country] => INDIA [FileWord] => 1_20190212123611.docx [FilePDF] => 1_20190212123611.pdf [UrlImage] => 1_20190212114657.png [Airline] => 9W [HotelStar] => 3 ) [0] => stdClass Object ( [PeriodID] => 1 [PeriodStartDate] => 2019-05-03 [PeriodEndDate] => 2019-05-07 [Day] => 5 [Night] => 3 [Airline] => 9W [Price_Twin] => 18999.00 [Price_Single] => 4999.00 [Price_Infant] => 10000.00 [ComAgent] => 1000 [ComSale] => 500 [Groupsize] => 3 [Book] => 0 [Seat] => 20 [Status] => Book [UpdateDate] => 2019-05-03 21:16:00 ) [1] => stdClass Object ( [PeriodID] => 1 [PeriodStartDate] => 2019-05-17 [PeriodEndDate] => 2019-05-21 [Day] => 5 [Night] => 3 [Airline] => 9W [Price_Twin] => 18999.00 [Price_Single] => 4999.00 [Price_Infant] => 10000.00 [ComAgent] => 1000 [ComSale] => 500 [Groupsize] => 3 [Book] => 0 [Seat] => 25 [Status] => Book [UpdateDate] => 2019-05-03 21:16:00 ) [2] => stdClass Object ( [PeriodID] => 1 [PeriodStartDate] => 2019-05-10 [PeriodEndDate] => 2019-05-14 [Day] => 5 [Night] => 3 [Airline] => 9W [Price_Twin] => 17999.00 [Price_Single] => 4999.00 [Price_Infant] => 10000.00 [ComAgent] => 1000 [ComSale] => 500 [Groupsize] => 3 [Book] => 0 [Seat] => 20 [Status] => Book [UpdateDate] => 2019-05-03 21:16:00 ) ) )
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Test_Api_Con extends CI_Controller { public function get_api_test_product() { $this->load->model('Models_Api_Product'); $obj = new Models_Api_Product(); $product = new Models_Api_Product(); $periods = new Models_Api_Product(); $list_product = array(); $list_periods = array(); $list = array(); $dataproductall = $obj->testapiproductALL(); foreach ($dataproductall as $listproduct) { $product->DatatoObjProduct($listproduct); $this->db->reconnect(); $subdata_product = $periods->testapiproductList($product->ProductID); $list_product[] = $subdata_product; foreach($subdata_product as $listperiods) { $this->db->reconnect(); $subdata_periods = $periods->testapiperiod($product->ProductID); $list_product[] = $subdata_periods; } } echo json_encode($list_product); /*echo "<pre>"; print_r($list_product); echo "</pre>"; */ }
public function testapiproductALL() { $data = $this->db->query("CALL Test_API_Product()"); $result = $data->result(); return $result; } public function testapiproductList($productid) { $data = $this->db->query("CALL Test_API_Product_list('{$productid}')"); $result = $data->result(); return $result; } public function testapiperiod($periods) { $data = $this->db->query("CALL Test_Periods('{$periods}')"); $result = $data->result(); return $result; }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง