|
|
|
|
@ -25,8 +25,9 @@ class Api extends CI_Controller {
|
|
|
|
|
header('Access-Control-Allow-Headers:x-requested-with, Content-Type');
|
|
|
|
|
header('Access-Control-Allow-Credentials:true');
|
|
|
|
|
($find===null) ? $find = $this->input->get_post('q') : null;
|
|
|
|
|
$find = (mb_strlen($find)<9) ? null : $this->input->get_post('q');
|
|
|
|
|
$order_project = $this->Orders_model->get_package_order($find);
|
|
|
|
|
if ($order_project == null) {
|
|
|
|
|
if ($find===null || $order_project == null) {
|
|
|
|
|
$ret['status'] = 0;
|
|
|
|
|
$ret['msg'] = "Not Found.";
|
|
|
|
|
return $this->output->set_content_type('application/json')->set_output(json_encode($ret));
|
|
|
|
|
@ -79,45 +80,45 @@ class Api extends CI_Controller {
|
|
|
|
|
$vro['dateDay_text'] = date('d', $out_datetime);
|
|
|
|
|
$vro['dateMonth_text'] = date('M', $out_datetime);
|
|
|
|
|
$vro['dateYear_text'] = date('Y', $out_datetime);
|
|
|
|
|
$poi = $order_project[0];
|
|
|
|
|
foreach ($order_project as $kd => $poi_info) {
|
|
|
|
|
if (strcmp($vro['start_date'], substr($poi_info->COLD_StartDate, 0, 10) ) === 0) {
|
|
|
|
|
$poi = $poi_info;
|
|
|
|
|
} else {
|
|
|
|
|
$poi = $order_project[0];
|
|
|
|
|
}
|
|
|
|
|
$vro['tour_name'] = $poi->PAG2_Name;
|
|
|
|
|
// 领队名字
|
|
|
|
|
$vro['leader_name'] = trim($poi->GUT_FirstName . " " . $poi->GUT_LastName);
|
|
|
|
|
// 行程人数
|
|
|
|
|
$vro['personNum_text'] = $poi->COLD_PersonNum + $poi->COLD_ChildNum;
|
|
|
|
|
$vro['personNum_text'] .= " (" . $poi->COLD_PersonNum . " Adult(s)";
|
|
|
|
|
if ($poi->COLD_ChildNum > 0) {
|
|
|
|
|
$vro['personNum_text'] .= " " . $poi->COLD_ChildNum . " Child(ren)";
|
|
|
|
|
}
|
|
|
|
|
$vro['personNum_text'] .= ")" ;
|
|
|
|
|
// 人数
|
|
|
|
|
$vro['adult_number'] = $order_project[0]->COLD_PersonNum;
|
|
|
|
|
$vro['kid_number'] = $order_project[0]->COLD_ChildNum;
|
|
|
|
|
// 酒店
|
|
|
|
|
$vro['hotel_name'] = $poi->POI_Hotel;
|
|
|
|
|
$vro['hotel_address'] = $poi->POI_HotelAddress;
|
|
|
|
|
$vro['hotel_tel'] = $poi->POI_HotelPhone;
|
|
|
|
|
// 航班/车次
|
|
|
|
|
$vro['flights_no'] = $poi->POI_FlightsNo;
|
|
|
|
|
$vro['flights_airport'] = $poi->POI_AirPort;
|
|
|
|
|
// 接送信息
|
|
|
|
|
$vro['pick_up'] = "";
|
|
|
|
|
$vro['drop_off'] = "";
|
|
|
|
|
$decode_MemoText = $memo_text_tmp = "";
|
|
|
|
|
if ($poi->COLD_MemoText != null && json_decode($poi->COLD_MemoText) != null) {
|
|
|
|
|
$decode_MemoText = json_decode($poi->COLD_MemoText, true);
|
|
|
|
|
$vro['pick_up'] = $decode_MemoText['Pick up'];
|
|
|
|
|
$vro['drop_off'] = $decode_MemoText['Drop off'];
|
|
|
|
|
} else {
|
|
|
|
|
$vro['pick_up'] = trim(substr(strstr(strstr($poi->COLI_OrderDetailText, "Pick Up From:"), "\n", true), 13));
|
|
|
|
|
$vro['drop_off'] = trim(substr(strstr(strstr($poi->COLI_OrderDetailText, "Drop Off:"), "\n" , true), 9));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$vro['tour_name'] = $poi->PAG2_Name;
|
|
|
|
|
// 领队名字
|
|
|
|
|
$vro['leader_name'] = trim($poi->GUT_FirstName . " " . $poi->GUT_LastName);
|
|
|
|
|
// 行程人数
|
|
|
|
|
$vro['personNum_text'] = $poi->COLD_PersonNum + $poi->COLD_ChildNum;
|
|
|
|
|
$vro['personNum_text'] .= " (" . $poi->COLD_PersonNum . " Adult(s)";
|
|
|
|
|
if ($poi->COLD_ChildNum > 0) {
|
|
|
|
|
$vro['personNum_text'] .= " " . $poi->COLD_ChildNum . " Child(ren)";
|
|
|
|
|
}
|
|
|
|
|
$vro['personNum_text'] .= ")" ;
|
|
|
|
|
// 人数
|
|
|
|
|
$vro['adult_number'] = $order_project[0]->COLD_PersonNum;
|
|
|
|
|
$vro['kid_number'] = $order_project[0]->COLD_ChildNum;
|
|
|
|
|
// 酒店
|
|
|
|
|
$vro['hotel_name'] = $poi->POI_Hotel;
|
|
|
|
|
$vro['hotel_address'] = $poi->POI_HotelAddress;
|
|
|
|
|
$vro['hotel_tel'] = $poi->POI_HotelPhone;
|
|
|
|
|
// 航班/车次
|
|
|
|
|
$vro['flights_no'] = $poi->POI_FlightsNo;
|
|
|
|
|
$vro['flights_airport'] = $poi->POI_AirPort;
|
|
|
|
|
// 接送信息
|
|
|
|
|
$vro['pick_up'] = "";
|
|
|
|
|
$vro['drop_off'] = "";
|
|
|
|
|
$decode_MemoText = $memo_text_tmp = "";
|
|
|
|
|
if ($poi->COLD_MemoText != null && json_decode($poi->COLD_MemoText) != null) {
|
|
|
|
|
$decode_MemoText = json_decode($poi->COLD_MemoText, true);
|
|
|
|
|
$vro['pick_up'] = $decode_MemoText['Pick up'];
|
|
|
|
|
$vro['drop_off'] = $decode_MemoText['Drop off'];
|
|
|
|
|
} else {
|
|
|
|
|
$vro['pick_up'] = trim(substr(strstr(strstr($poi->COLI_OrderDetailText, "Pick Up From:"), "\n", true), 13));
|
|
|
|
|
$vro['drop_off'] = trim(substr(strstr(strstr($poi->COLI_OrderDetailText, "Drop Off:"), "\n" , true), 9));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
unset($vro);
|
|
|
|
|
}
|
|
|
|
|
|