load->model('Orders_model'); $this->load->model('CustomerLineInfo_model'); $this->site_code = strtolower($this->config->item('Site_Code')); //屏蔽掉非法IP49.157.0.226 if($this->input->ip_address() == '116.93.127.114' || $this->input->ip_address() == '116.202.14.3'){ send_404(); die(); } } public function index() { redirect(); } //水灯节表单入库 public function lantern_save() { $this->prevent_spam_order(); $this->Orders_model->COLI_ID = $this->Orders_model->MakeOrderNumber(); $this->Orders_model->COLI_SenderIP = $this->input->ip_address(); $this->Orders_model->COLI_OrderDetailText = ReplaceFieldName($_POST); $this->Orders_model->COLI_Servicetype = 'T'; $emailtitle = 'Asia Highlights Enquiry Confirmation'; $this->Orders_model->COLI_sourcetype = '32113'; //utm广告跟踪链接 $utm_source = get_cookie('__ah_utm_source'); $utm_source_map = array( 'googleppc' => 78001, 'newsletters' => 78005, 'facebook' => 78006, 'instagram' => 78010, 'pin' => 78011, 'chinahighlights' => 99999 ); if (!empty($utm_source) && array_key_exists($utm_source, $utm_source_map)) { $this->Orders_model->COLI_LineClass = $utm_source_map[$utm_source]; // 关联订单后统一删除 utm 的 cookie delete_cookie('__ah_utm_source', '.asiahighlights.com'); delete_cookie('__ah_utm_medium', '.asiahighlights.com'); delete_cookie('__ah_utm_campaign', '.asiahighlights.com'); } $this->Orders_model->COLI_GroupType = '19009'; $this->Orders_model->COLI_PersonNum = $this->input->post('adult_number'); $this->Orders_model->COLI_ChildNum = 0; $this->Orders_model->MEI_MailList = $this->input->post('email'); $fullname = $this->input->post('fullname'); $this->Orders_model->MEI_FirstName = $fullname; // 水灯节默认绑定线路 ah-24(13349); 其他由页面来确定,比如:YDFW-AH(13949); $product_sn = $this->input->post('product_sn'); if (empty($product_sn)) { $this->Orders_model->COLI_ProductSN = 13349; } else { $this->Orders_model->COLI_ProductSN = $product_sn; } $this->Orders_model->COLI_OrderStartDate = date('Y-m-d',strtotime($this->input->post('ticket_date'))); $this->Orders_model->MEI_Phone = $this->input->post('PhoneNo'); if (!empty($third_webcode)) { $this->Orders_model->COLI_WebCode = $third_webcode; } $this->Orders_model->TourOrderSave(); $this->Orders_model->SendMail($fullname, $this->input->post('email'), $this->config->item('Site_ServiceName'), $this->config->item('Site_ServiceEmail'),$emailtitle , $this->Orders_model->COLI_OrderDetailText); //发送邮件给客人 $email_data = array( 'full_name' => $this->input->post('fullname'), 'email' => $this->input->post('email'), 'starting_date' => format_date($this->input->post('ticket_date')), 'contact_info' => $this->input->post('PhoneNo'), 'itinerary' => $this->input->post('itinerary'), 'requirements' => $this->input->post('form_additionalrequirements'), 'lanternFestival' => true ); $this->email_customer($email_data); //生成支付链接 $this->load->library('Currency'); $addurl = ''; $totalprice = $this->input->post('totalprice'); $total_rmb = $this->currency->get_USD_RMB_SUM($totalprice); $signstr = 'currency=USD&order_id='.$this->Orders_model->COLI_ID.'_T&rmb_amount='.$total_rmb.'&total_amount='.$totalprice.'&key=7a46484300f04031b42fdd44559578e4'; $sign = md5($signstr); $addurl .= base64_encode('order_id='.$this->Orders_model->COLI_ID.'_T&subject=Booking Yi Peng Festival Tickets&body=Booking Yi Peng Festival Tickets&total_amount='.$totalprice.'¤cy=USD&rmb_amount='.$total_rmb.'&sign='.$sign.'&lg=en_US&return_url=https://www.asiahighlights.com/orders/thankyou?inquire'); $payurl = 'https://secure.chinahighlights.com/pay/paymentservice/?'.$addurl; //跳转到thankyou页面 redirect($payurl); } public function tailormade_save(){ $this->prevent_spam_order(); $this->form_validation->set_rules('name', 'lang:Firstname', 'required'); $this->form_validation->set_rules('email', 'lang:email', 'required|valid_email'); if ($this->form_validation->run() == false) { send_404(); die(); }else{ $this->Orders_model->COLI_ID = $this->Orders_model->MakeOrderNumber(); $this->Orders_model->COLI_SenderIP = $this->input->ip_address(); $this->Orders_model->COLI_OrderDetailText = ReplaceFieldName($_POST); $this->Orders_model->COLI_Servicetype = 'T'; $emailtitle = 'Asia Highlights Enquiry Confirmation'; //默认就是TM表单 $this->Orders_model->COLI_sourcetype = '32003'; //Trace GOOGLE $COOKIE_inquireTrackGoogle = get_cookie('inquireTrackGoogle'); if (!empty($COOKIE_inquireTrackGoogle)) { $this->Orders_model->COLI_OrderDetailText .= "\n\rGOOGLE关键字:" . $COOKIE_inquireTrackGoogle; delete_cookie('inquireTrackGoogle'); } //HT订单跟踪代码 $COOKIE_inquireTrackFrom = get_cookie('inquireTrackFrom'); if (!empty($COOKIE_inquireTrackFrom) && is_numeric($COOKIE_inquireTrackFrom)) { $this->Orders_model->COLI_sourcetype = (int) $COOKIE_inquireTrackFrom; delete_cookie('inquireTrackFrom'); } //utm广告跟踪链接 $utm_source = get_cookie('__ah_utm_source'); $utm_source_map = array( 'googleppc' => 78001, 'newsletters' => 78005, 'facebook' => 78006, 'instagram' => 78010, 'pin' => 78011, 'chinahighlights' => 99999 ); if (!empty($utm_source) && array_key_exists($utm_source, $utm_source_map)) { $this->Orders_model->COLI_LineClass = $utm_source_map[$utm_source]; // 关联订单后统一删除 utm 的 cookie delete_cookie('__ah_utm_source', '.asiahighlights.com'); delete_cookie('__ah_utm_medium', '.asiahighlights.com'); delete_cookie('__ah_utm_campaign', '.asiahighlights.com'); } $this->Orders_model->COLI_GroupType = '19006'; $this->Orders_model->COLI_OrderType = '19006'; $this->Orders_model->COLI_PersonNum = $this->input->post('adultnumber'); $this->Orders_model->COLI_ChildNum = $this->input->post('kidnumber'); $this->Orders_model->COLI_Days = $this->input->post('cli_days'); $this->Orders_model->MEI_MailList = $this->input->post('email'); $this->Orders_model->MEI_FirstName = $this->input->post('name'); $fullname = $this->input->post('name'); $this->Orders_model->MEI_Nationality = $this->Orders_model->GetNationalityID($this->input->post('Nationality')); $this->Orders_model->COLI_ProductSN = $this->input->post('cli_sn'); if(!empty($this->input->post('Date_Start'))){ $this->Orders_model->COLI_OrderStartDate = $this->input->post('Date_Start'); }else{ $this->Orders_model->COLI_OrderStartDate = $this->input->post('Date_Start_Mobile'); } $this->Orders_model->MEI_Gender = $this->input->post('gender'); $this->Orders_model->MEI_Phone = $this->input->post('PhoneNo'); //是否来至第三方合作网站 $third_webcode = $this->input->post('third_webcode'); if (empty($third_webcode)) { $third_webcode = $this->input->cookie('third_code'); $this->input->set_cookie('third_code', '', ''); $this->input->set_cookie('third%5Fcode', '', ''); } if (!empty($third_webcode)) { $this->Orders_model->COLI_WebCode = $third_webcode; } /*print_r($this->load->view('ah/email/tailormade_email', '', true)); die();*/ $this->Orders_model->TourOrderSave(); $this->Orders_model->SendMail($fullname, $this->input->post('email'), $this->config->item('Site_ServiceName'), $this->config->item('Site_ServiceEmail'),$emailtitle , $this->Orders_model->COLI_OrderDetailText); //发送邮件给客人 $selected_dest_combos = $this->input->post('destination_combos'); $selected_dest = $this->input->post('destination'); $selected_dest_text = $selected_dest_combos; if (!empty($selected_dest)) { $selected_dest_text .= implode(',', $selected_dest); } $selected_dest_text .= ', '.$this->input->post('other_destinations'); $starting_date_value = empty($this->input->post('Date_Start')) ? format_date($this->input->post('Date_Start_Mobile')) : format_date($this->input->post('Date_Start')); $email_data = array( 'full_name' => $this->input->post('name'), 'email' => $this->input->post('email'), 'nationality' => $this->input->post('Nationality'), 'travelers' => $this->input->post('adultnumber'), 'trip_length' => $this->input->post('cli_days'), 'hotel_style' => $this->input->post('hotel'), 'destinations' => $selected_dest_text, 'starting_date' => $starting_date_value, 'contact_info' => $this->input->post('PhoneNo'), 'requirements' => $this->input->post('additionalrequirements') ); $this->email_customer($email_data); redirect(site_url('orders/thankyou?tailormade')); } } public function inquiry_save(){ $this->form_validation->set_rules('name', 'lang:Firstname', 'required'); $this->form_validation->set_rules('email', 'lang:email', 'required|valid_email'); if ($this->form_validation->run() == false) { send_404(); die(); }else{ $this->Orders_model->COLI_ID = $this->Orders_model->MakeOrderNumber(); $this->Orders_model->COLI_SenderIP = $this->input->ip_address(); $this->Orders_model->COLI_OrderDetailText = ReplaceFieldName($_POST); $this->Orders_model->COLI_Servicetype = 'T'; $emailtitle = 'Asia Highlights Enquiry Confirmation'; //默认就是产品订单 $this->Orders_model->COLI_sourcetype = '32001'; //Trace GOOGLE $COOKIE_inquireTrackGoogle = get_cookie('inquireTrackGoogle'); if (!empty($COOKIE_inquireTrackGoogle)) { $this->Orders_model->COLI_OrderDetailText .= "\n\rGOOGLE关键字:" . $COOKIE_inquireTrackGoogle; delete_cookie('inquireTrackGoogle'); } //HT订单跟踪代码 $COOKIE_inquireTrackFrom = get_cookie('inquireTrackFrom'); if (!empty($COOKIE_inquireTrackFrom) && is_numeric($COOKIE_inquireTrackFrom)) { $this->Orders_model->COLI_sourcetype = (int) $COOKIE_inquireTrackFrom; delete_cookie('inquireTrackFrom'); } //utm广告跟踪链接 $utm_source = get_cookie('__ah_utm_source'); $utm_source_map = array( 'googleppc' => 78001, 'newsletters' => 78005, 'facebook' => 78006, 'instagram' => 78010, 'pin' => 78011, 'chinahighlights' => 99999 ); if (!empty($utm_source) && array_key_exists($utm_source, $utm_source_map)) { $this->Orders_model->COLI_LineClass = $utm_source_map[$utm_source]; switch ($utm_source_map[$utm_source]){ case 78001: $this->Orders_model->COLI_sourcetype = 32034; break; case 78005: $this->Orders_model->COLI_sourcetype = 32030; break; case 99999: $this->Orders_model->COLI_sourcetype = 32108; break; } // 关联订单后统一删除 utm 的 cookie delete_cookie('__ah_utm_source', '.asiahighlights.com'); delete_cookie('__ah_utm_medium', '.asiahighlights.com'); delete_cookie('__ah_utm_campaign', '.asiahighlights.com'); } $this->Orders_model->COLI_GroupType = '19006'; $this->Orders_model->COLI_OrderType = '19006'; $this->Orders_model->COLI_PersonNum = $this->input->post('adultnumber'); $this->Orders_model->COLI_ChildNum = $this->input->post('kidnumber'); $this->Orders_model->MEI_MailList = $this->input->post('email'); $this->Orders_model->MEI_LastName = $this->input->post('name'); $fullname = $this->input->post('name'); $this->Orders_model->MEI_Nationality = $this->Orders_model->GetNationalityID($this->input->post('Nationality')); $this->Orders_model->COLI_ProductSN = $this->input->post('cli_sn'); if(empty($this->input->post('Date_Start'))){ $this->Orders_model->COLI_OrderStartDate = $this->input->post('Date_Start_Mobile'); }else{ $this->Orders_model->COLI_OrderStartDate = $this->input->post('Date_Start'); } $this->Orders_model->MEI_Gender = $this->input->post('gender'); $this->Orders_model->MEI_Phone = $this->input->post('PhoneNo'); //是否来至第三方合作网站 $third_webcode = $this->input->post('third_webcode'); if (empty($third_webcode)) { $third_webcode = $this->input->cookie('third_code'); $this->input->set_cookie('third_code', '', ''); $this->input->set_cookie('third%5Fcode', '', ''); } if (!empty($third_webcode)) { $this->Orders_model->COLI_WebCode = $third_webcode; } $this->Orders_model->TourOrderSave(); $this->Orders_model->SendMail($fullname, $this->input->post('email'), $this->config->item('Site_ServiceName'), $this->config->item('Site_ServiceEmail'),$emailtitle , $this->Orders_model->COLI_OrderDetailText); //发送邮件给客人 $this->Orders_model->SendMail($this->config->item('Site_ServiceName'), $this->config->item('Site_ServiceEmail'), $fullname, $this->input->post('email'), $emailtitle, $this->load->view('ah/email/inquiry_email', '', true)); redirect(site_url('orders/thankyou')); } } /** * 返回一个实际上无法成功的 200 状态码,欺骗攻击者误以为成功 */ private function fake_200() { header('HTTP/1.1 200 OK'); header("status: 200 OK"); exit; } public function output_403() { header('HTTP/1.1 403 Forbidden'); header("status: 403 Forbidden"); exit; } private function prevent_spam_order() { if ($this->input->get_post("email") == 'sample@email.tst' || false !== stripos($this->input->get_post("email"), "sample@email.tst") ) { log_message('error', "reject by Acunetix scan Detected. IP: " . $this->input->ip_address()); $this->output_403(); } if (IS_GET) { $this->output_403(); } // 限制字符数量 2048 个。 $requirements = $this->input->post('form_additionalrequirements') . $this->input->post('AdditionalRequirements2'); if (!empty($requirements) && strlen($requirements) > 2048) { log_message('error', "requirements too long. IP: " . $this->input->ip_address()); $this->output_403(); } if (FALSE === $this->detect_spam('realname') || FALSE === $this->detect_spam('form_additionalrequirements') || FALSE === $this->detect_spam('AdditionalRequirements2')) { log_message('error', "reject by remove html tags. IP: " . $this->input->ip_address()); $this->output_403(); } // 屏蔽过于频繁的垃圾订单 IP。 if (in_array($this->input->ip_address(), array("192.40.57.53", "164.132.203.193", "190.2.146.231", "167.235.3.218", "45.82.179.75"))) { $this->output_403(); } if (in_array(strstr($this->input->get_post("email"), "@"), array("@asiahighlights.com", "@hainatravel.com"))) { // 内部测试邮箱,不做 IP 限制。 } else { if (false === $this->Orders_model->ip_limit($this->input->ip_address())) { log_message('error', "reject by IP limit. IP: " . $this->input->ip_address()); $this->output_403(); } } } //快速表单 public function quick_inquiry_save() { $this->prevent_spam_order(); $this->Orders_model->COLI_ID = $this->Orders_model->MakeOrderNumber(); $this->Orders_model->COLI_SenderIP = $this->input->ip_address(); $this->Orders_model->COLI_OrderDetailText = ReplaceFieldName($_POST); $this->Orders_model->COLI_Servicetype = 'T'; $emailtitle = 'Asia Highlights Enquiry Confirmation'; $this->Orders_model->COLI_sourcetype = '32113'; //Trace GOOGLE $COOKIE_inquireTrackGoogle = get_cookie('inquireTrackGoogle'); if (!empty($COOKIE_inquireTrackGoogle)) { $this->Orders_model->COLI_OrderDetailText .= "\n\rGOOGLE关键字:" . $COOKIE_inquireTrackGoogle; delete_cookie('inquireTrackGoogle'); } //HT订单跟踪代码 $COOKIE_inquireTrackFrom = get_cookie('inquireTrackFrom'); if (!empty($COOKIE_inquireTrackFrom) && is_numeric($COOKIE_inquireTrackFrom)) { $this->Orders_model->COLI_sourcetype = (int) $COOKIE_inquireTrackFrom; delete_cookie('inquireTrackFrom'); } //utm广告跟踪链接 $utm_source = get_cookie('__ah_utm_source'); $utm_source_map = array( 'googleppc' => 78001, 'newsletters' => 78005, 'facebook' => 78006, 'instagram' => 78010, 'pin' => 78011, 'chinahighlights' => 99999 ); if (!empty($utm_source) && array_key_exists($utm_source, $utm_source_map)) { $this->Orders_model->COLI_LineClass = $utm_source_map[$utm_source]; // 关联订单后统一删除 utm 的 cookie delete_cookie('__ah_utm_source', '.asiahighlights.com'); delete_cookie('__ah_utm_medium', '.asiahighlights.com'); delete_cookie('__ah_utm_campaign', '.asiahighlights.com'); } $this->Orders_model->COLI_GroupType = '19006'; $this->Orders_model->COLI_OrderType = '19006'; $this->Orders_model->COLI_PersonNum = $this->input->post('adultnumber'); $this->Orders_model->COLI_ChildNum = $this->input->post('kidnumber'); $this->Orders_model->MEI_MailList = $this->input->post('email'); $this->Orders_model->MEI_FirstName = $this->input->post('name'); $fullname = $this->input->post('name'); $this->Orders_model->MEI_Nationality = $this->Orders_model->GetNationalityID($this->input->post('Nationality')); $this->Orders_model->COLI_ProductSN = $this->input->post('cli_sn'); $this->Orders_model->COLI_OrderStartDate = $this->input->post('starting_date'); $this->Orders_model->MEI_Gender = $this->input->post('gender'); $this->Orders_model->MEI_Phone = $this->input->post('PhoneNo'); $cli_no = $this->input->post('cli_no'); // 根据产品编号(CLI_NO)查找并绑定产品SN(CLI_SN) if ($cli_no) { $tour_obj = $this->CustomerLineInfo_model->search($cli_no, 1); if (!empty($tour_obj)) { $this->Orders_model->COLI_ProductSN = $tour_obj->CLI_SN; } } //是否来至第三方合作网站 $third_webcode = $this->input->post('third_webcode'); if (empty($third_webcode)) { $third_webcode = $this->input->cookie('third_code'); $this->input->set_cookie('third_code', '', ''); $this->input->set_cookie('third%5Fcode', '', ''); } if (!empty($third_webcode)) { $this->Orders_model->COLI_WebCode = $third_webcode; } $this->Orders_model->TourOrderSave(); $this->Orders_model->SendMail($fullname, $this->input->post('email'), $this->config->item('Site_ServiceName'), $this->config->item('Site_ServiceEmail'),$emailtitle , $this->Orders_model->COLI_OrderDetailText); //发送邮件给客人 $email_data = array( 'full_name' => $this->input->post('name'), 'email' => $this->input->post('email'), 'starting_date' => format_date($this->input->post('starting_date')), 'contact_info' => $this->input->post('PhoneNo'), 'itinerary' => $this->input->post('itinerary'), 'requirements' => $this->input->post('form_additionalrequirements') ); $this->email_customer($email_data); redirect(site_url('orders/thankyou?inquire')); } //新版tailormade入库程序 public function triprequest_save() { //$this->form_validation->set_rules('Destination', 'lang:Destination', 'required'); //$this->form_validation->set_rules('Date_Start', 'lang:Date_Start', 'required'); //$this->form_validation->set_rules('hotelStyle', 'lang:hotelStyle', 'required'); //$this->form_validation->set_rules('additionalrequirements', 'lang:additionalrequirements', 'required'); //$this->form_validation->set_rules('gender', 'lang:Title', 'required'); $this->form_validation->set_rules('Firstname', 'lang:Firstname', 'required'); //$this->form_validation->set_rules('Lastname', 'lang:Lastname', 'required'); $this->form_validation->set_rules('email', 'lang:email', 'required|valid_email'); //$this->form_validation->set_rules('Nationality', 'lang:Nationality', 'required'); //$this->form_validation->set_rules('hotel', 'lang:hotel', 'required'); //$this->form_validation->set_rules('tourdays', 'lang:tourdays', 'required'); if ($this->form_validation->run() == false) { $data = array(); foreach ($this->form_validation->_error_array as $key => $value) { if($key == 'Destination'){ $key = 'destinations'; } $data[] = array('name' => $key, 'value' => $value); } if ($this->input->post('no_ajax')) { $vali_string = ''; foreach ($data as $v) { $vali_string .= $v['name'] . ' => ' . $v['value'] . ' '; } echo(''); } else { echo json_encode($data); } } else { $this->Orders_model->COLI_ID = $this->Orders_model->MakeOrderNumber(); $this->Orders_model->COLI_SenderIP = $this->input->ip_address(); $this->Orders_model->COLI_OrderDetailText = ReplaceFieldName($_POST); $this->Orders_model->COLI_Servicetype = 'T'; $emailtitle = 'Asia Highlights Enquiry Confirmation'; if($this->input->post('cli_sn')){ //含有cli_sn的是产品订单 $this->Orders_model->COLI_sourcetype = '32001'; }else{ //不含有的是tailormade订单 $this->Orders_model->COLI_sourcetype = '32003'; } //Trace GOOGLE $COOKIE_inquireTrackGoogle = get_cookie('inquireTrackGoogle'); if (!empty($COOKIE_inquireTrackGoogle)) { $this->Orders_model->COLI_OrderDetailText .= "\n\rGOOGLE关键字:" . $COOKIE_inquireTrackGoogle; delete_cookie('inquireTrackGoogle'); } //HT订单跟踪代码 $COOKIE_inquireTrackFrom = get_cookie('inquireTrackFrom'); if (!empty($COOKIE_inquireTrackFrom) && is_numeric($COOKIE_inquireTrackFrom)) { $this->Orders_model->COLI_sourcetype = (int) $COOKIE_inquireTrackFrom; delete_cookie('inquireTrackFrom'); } //utm广告跟踪链接 $utm_source = get_cookie('__ah_utm_source'); $utm_source_map = array( 'googleppc' => 78001, 'newsletters' => 78005, 'facebook' => 78006, 'instagram' => 78010, 'pin' => 78011, 'chinahighlights' => 99999 ); if (!empty($utm_source) && array_key_exists($utm_source, $utm_source_map)) { $this->Orders_model->COLI_LineClass = $utm_source_map[$utm_source]; switch ($utm_source_map[$utm_source]){ case 78001: $this->Orders_model->COLI_sourcetype = 32034; break; case 78005: $this->Orders_model->COLI_sourcetype = 32030; break; case 99999: $this->Orders_model->COLI_sourcetype = 32108; break; } // 关联订单后统一删除 utm 的 cookie delete_cookie('__ah_utm_source', '.asiahighlights.com'); delete_cookie('__ah_utm_medium', '.asiahighlights.com'); delete_cookie('__ah_utm_campaign', '.asiahighlights.com'); } $this->Orders_model->COLI_GroupType = '19006'; $this->Orders_model->COLI_OrderType = '19006'; if (is_numeric($this->input->post('adultsNumber'))) { $this->Orders_model->COLI_PersonNum = $this->input->post('adultsNumber'); } if (is_numeric($this->input->post('ChildrenNumber'))) { $this->Orders_model->COLI_ChildNum = $this->input->post('ChildrenNumber'); } if (is_numeric($this->input->post('BabiesNumber'))) { $this->Orders_model->COLI_BabyNum = $this->input->post('BabiesNumber'); } $this->Orders_model->MEI_MailList = $this->input->post('email'); $this->Orders_model->MEI_Mail = $this->input->post('email2'); /* $pos = strstr($this->input->post('realname'), ' '); if ($pos === false) { $this->Orders_model->MEI_FirstName = $this->input->post('realname'); } else { $this->Orders_model->MEI_FirstName = str_replace($pos, '', $this->input->post('realname')); $this->Orders_model->MEI_LastName = $pos; } */ $this->Orders_model->MEI_FirstName = $this->input->post('Firstname'); $this->Orders_model->MEI_LastName = $this->input->post('Lastname'); $fullname = $this->input->post('Firstname').$this->input->post('Lastname'); $this->Orders_model->MEI_Nationality = $this->Orders_model->GetNationalityID($this->input->post('Nationality')); $this->Orders_model->COLI_ProductSN = $this->input->post('cli_sn'); if ($this->input->post('Date_Start')) { $this->Orders_model->COLI_OrderStartDate = $this->input->post('Date_Start'); }else{ $this->Orders_model->COLI_OrderStartDate = $this->input->post('Date_Start_Mobile'); } $this->Orders_model->MEI_Gender = $this->input->post('gender'); $this->Orders_model->MEI_Phone = $this->input->post('PhoneNo'); //是否来至第三方合作网站 $third_webcode = $this->input->post('third_webcode'); if (empty($third_webcode)) { $third_webcode = $this->input->cookie('third_code'); $this->input->set_cookie('third_code', '', ''); $this->input->set_cookie('third%5Fcode', '', ''); } if (!empty($third_webcode)) { $this->Orders_model->COLI_WebCode = $third_webcode; } //指定操作人 if ($this->input->post('COLI_OPI_SN')) { $this->Orders_model->COLI_OPI_SN = $this->input->post('COLI_OPI_SN'); } //print_r($this->load->view('orders/newemail_template', '', true)); //die(); $this->Orders_model->TourOrderSave(); $this->Orders_model->SendMail($fullname, $this->input->post('email'), $this->config->item('Site_ServiceName'), $this->config->item('Site_ServiceEmail'),$emailtitle , $this->Orders_model->COLI_OrderDetailText); //发送邮件给客人 (20160504tailor_make) $this->Orders_model->SendMail($this->config->item('Site_ServiceName'), $this->config->item('Site_ServiceEmail'), $fullname, $this->input->post('email'), $emailtitle, $this->load->view('orders/newemail_template', '', true)); //是否AJAX提交? $no_ajax = $this->input->post('no_ajax'); if (empty($no_ajax)) { $data[] = array('name' => 'go', 'value' => site_url('orders/thankyou')); echo json_encode($data); } else { $file_alias = $this->input->post('file_alias'); redirect(site_url('orders/thankyou' . $file_alias)); } } } public function question_save() { $this->form_validation->set_rules('realname', 'lang:realname', 'required'); $this->form_validation->set_rules('email', 'lang:email', 'required|valid_email'); $this->form_validation->set_rules('aquestion', 'lang:aquestion', 'required'); if ($this->form_validation->run() == false) { $data = array(); foreach ($this->form_validation->_error_array as $key => $value) { $data[] = array('name' => $key, 'value' => $value); } echo json_encode($data); } else { bind_ip($this->input->ip_address()); $this->Orders_model->COLI_ID = $this->Orders_model->MakeOrderNumber(); $this->Orders_model->COLI_SenderIP = $this->input->ip_address(); $this->Orders_model->COLI_OrderDetailText = ReplaceFieldName($_POST); $this->Orders_model->COLI_Servicetype = 'T'; $this->Orders_model->COLI_sourcetype = '32002'; //HT订单跟踪代码 $COOKIE_inquireTrackFrom = get_cookie('inquireTrackFrom'); if (!empty($COOKIE_inquireTrackFrom) && is_numeric($COOKIE_inquireTrackFrom)) { $this->Orders_model->COLI_sourcetype = (int) $COOKIE_inquireTrackFrom; delete_cookie('inquireTrackFrom'); } //Trace GOOGLE $COOKIE_inquireTrackGoogle = get_cookie('inquireTrackGoogle'); if (!empty($COOKIE_inquireTrackGoogle)) { $this->Orders_model->COLI_OrderDetailText .= "\n\rGOOGLE关键字:" . $COOKIE_inquireTrackGoogle; delete_cookie('inquireTrackGoogle'); } //utm广告跟踪链接 $utm_source = get_cookie('__ah_utm_source'); $utm_source_map = array( 'googleppc' => 78001, 'newsletters' => 78005, 'facebook' => 78006, 'instagram' => 78010, 'pin' => 78011, 'chinahighlights' => 99999 ); if (!empty($utm_source) && array_key_exists($utm_source, $utm_source_map)) { if($utm_source_map[$utm_source] != 99999){ $this->Orders_model->COLI_LineClass = $utm_source_map[$utm_source]; }else{ $this->Orders_model->COLI_LineClass = ''; } switch ($utm_source_map[$utm_source]){ case 78001: $this->Orders_model->COLI_sourcetype = 32034; break; case 78005: $this->Orders_model->COLI_sourcetype = 32030; break; case 99999: $this->Orders_model->COLI_sourcetype = 32108; break; } // 关联订单后统一删除 utm 的 cookie delete_cookie('__ah_utm_source', '.asiahighlights.com'); delete_cookie('__ah_utm_medium', '.asiahighlights.com'); delete_cookie('__ah_utm_campaign', '.asiahighlights.com'); } $this->Orders_model->COLI_GroupType = '19006'; $this->Orders_model->COLI_OrderType = '19006'; $this->Orders_model->MEI_MailList = $this->input->post('email'); $pos = strstr($this->input->post('realname'), ' '); if ($pos === false) { $this->Orders_model->MEI_FirstName = $this->input->post('realname'); } else { $this->Orders_model->MEI_FirstName = str_replace($pos, '', $this->input->post('realname')); $this->Orders_model->MEI_LastName = $pos; } $this->COLI_ProductSN = ''; bind_email($this->Orders_model->MEI_MailList); $this->Orders_model->TourOrderSave(); $this->Orders_model->SendMail($this->input->post('realname'), $this->input-> post('email'), $this->config->item('Site_ServiceName'), $this->config->item('Site_ServiceEmail'), 'Question Orders', $this->Orders_model->COLI_OrderDetailText); //发送邮件给客人 $this->Orders_model->SendMail($this->config->item('Site_ServiceName'), $this->config->item('Site_ServiceEmail'), $this->input->post('realname'), $this->input-> post('email'), 'Question Orders', $this->load->view('ah/email/email_template', '', true)); //是否AJAX提交? $no_ajax = $this->input->post('no_ajax'); if (empty($no_ajax)) { $data[] = array('name' => 'ok', 'value' => site_url('orders/question-thankyou/')); echo json_encode($data); } else { $file_alias = $this->input->post('file_alias'); redirect(site_url('orders/question-thankyou/' . $file_alias)); } } } public function question_thankyou() { $data = array(); $this->html_do->head($data, 'r'); $data['PPCCode'] = $this->lang->line('PPC_question'); $this->load->view('orders/r_thankyou/' . $this->site_code, $data); } public function detect_spam($param_name) { $html_tag = '#<\s*\/?(meta|script|html|a|div|body|input|img|title|link|form)\s+[^>]*?>#im'; $http_url = '/((https|http)?:\/\/)(?!www\.asiahighlights)\S+/'; $chinese_string = '/(赢|美女|注册|领取|红包|彩金)/'; $html_encode = '/&#(.*);/';// 包含 HTML 编码的字符,如:我 $tinyurl = '/www.tinyurl.com\S+/'; $param_value = $this->input->post($param_name); $end_str = $param_value; $end_str = preg_replace($html_tag, '', $end_str); $end_str = preg_replace($http_url, '', $end_str); $end_str = preg_replace($chinese_string, '', $end_str); $end_str = preg_replace($html_encode, '', $end_str); $end_str = preg_replace($tinyurl, '', $end_str); return strcasecmp($param_value, $end_str) === 0; } /** * * contact-us.htm 订单入库 * */ public function contactus_save() { $this->prevent_spam_order(); $this->Orders_model->COLI_ID = $this->Orders_model->MakeOrderNumber(); $this->Orders_model->COLI_SenderIP = $this->input->ip_address(); $this->Orders_model->COLI_OrderDetailText = ReplaceFieldName($_POST); $this->Orders_model->COLI_Servicetype = 'T'; $this->Orders_model->COLI_sourcetype = '32007'; //HT订单跟踪代码 $COOKIE_inquireTrackFrom = get_cookie('inquireTrackFrom'); if (!empty($COOKIE_inquireTrackFrom) && is_numeric($COOKIE_inquireTrackFrom)) { $this->Orders_model->COLI_sourcetype = (int) $COOKIE_inquireTrackFrom; delete_cookie('inquireTrackFrom'); } //Trace GOOGLE $COOKIE_inquireTrackGoogle = get_cookie('inquireTrackGoogle'); if (!empty($COOKIE_inquireTrackGoogle)) { $this->Orders_model->COLI_OrderDetailText .= "\n\rGOOGLE关键字:" . $COOKIE_inquireTrackGoogle; delete_cookie('inquireTrackGoogle'); } //utm广告跟踪链接 $utm_source = get_cookie('__ah_utm_source'); $utm_source_map = array( 'googleppc' => 78001, 'newsletters' => 78005, 'facebook' => 78006, 'instagram' => 78010, 'pin' => 78011, 'chinahighlights' => 99999 ); if (!empty($utm_source) && array_key_exists($utm_source, $utm_source_map)) { if ($utm_source_map[$utm_source] != 99999) { $this->Orders_model->COLI_LineClass = $utm_source_map[$utm_source]; } else { $this->Orders_model->COLI_LineClass = ''; $this->Orders_model->COLI_sourcetype = 32108; } // 关联订单后统一删除 utm 的 cookie delete_cookie('__ah_utm_source', '.asiahighlights.com'); delete_cookie('__ah_utm_medium', '.asiahighlights.com'); delete_cookie('__ah_utm_campaign', '.asiahighlights.com'); } $this->Orders_model->COLI_GroupType = '19006'; $this->Orders_model->COLI_OrderType = '19006'; $this->Orders_model->MEI_MailList = $this->input->post('email'); $pos = strstr($this->input->post('realname'), ' '); if ($pos === false) { $this->Orders_model->MEI_FirstName = $this->input->post('realname'); } else { $this->Orders_model->MEI_FirstName = str_replace($pos, '', $this->input->post('realname')); $this->Orders_model->MEI_LastName = $pos; } $this->Orders_model->MEI_Phone = $this->input->post('contactInfo'); $this->COLI_ProductSN = ''; $this->Orders_model->TourOrderSave(); $this->Orders_model->SendMail($this->input->post('realname'), $this->input->post('email'), $this->config->item('Site_ServiceName'), $this->config->item('Site_ServiceEmail'), 'Asia Highlights Enquiry Confirmation', $this->Orders_model->COLI_OrderDetailText); $country_code = $this->input->post('country_code'); $contact_info = $country_code . ' ' .$this->input->post('contactInfo'); //发送邮件给客人 $email_data = array( 'full_name' => $this->input->post('realname'), 'email' => $this->input->post('email'), 'contact_info' => $contact_info, 'requirements' => $this->input->post('AdditionalRequirements2') ); $this->email_customer($email_data); redirect(site_url('orders/thankyou?contactus')); } // 发送订单自动回复邮件 public function email_customer($email_data) { $email_text = $this->load->view('ah/email/ah-auto-mail', $email_data, true); $this->Orders_model->SendMail( $this->config->item('Site_ServiceName'), $this->config->item('Site_ServiceEmail'), $email_data['full_name'], $email_data['email'], "Asia highlights has receive your inquiry", $email_text ); } public function thankyou() { $data = array(); $data['seo_title'] = 'Thank you for your inquiry | Asia Highlights'; //$data['PPCCode'] = $this->lang->line('PPC_contact_us'); $this->load->view('header', $data); $this->load->view('orders/thank_you', $data); $this->load->view('footer'); } /** * 联系我们订单入库 * @author lmr */ public function callus_save() { $this->form_validation->set_rules('realname', 'lang:realname', 'required'); $this->form_validation->set_rules('email', 'lang:email', 'required|valid_email'); $this->form_validation->set_rules('comments', 'lang:comments', 'required'); if ($this->form_validation->run() == false) { $data = array(); foreach ($this->form_validation->_error_array as $key => $value) { $data[] = array('name' => $key, 'value' => $value); } echo json_encode($data); } else { $this->Orders_model->COLI_ID = $this->Orders_model->MakeOrderNumber(); $this->Orders_model->COLI_SenderIP = $this->input->ip_address(); $this->Orders_model->COLI_OrderDetailText = ReplaceFieldName($_POST); $this->Orders_model->COLI_Servicetype = 'T'; $this->Orders_model->COLI_sourcetype = '32004'; //HT订单跟踪代码 $COOKIE_inquireTrackFrom = get_cookie('inquireTrackFrom'); if (!empty($COOKIE_inquireTrackFrom) && is_numeric($COOKIE_inquireTrackFrom)) { $this->Orders_model->COLI_sourcetype = (int) $COOKIE_inquireTrackFrom; delete_cookie('inquireTrackFrom'); } //Trace GOOGLE $COOKIE_inquireTrackGoogle = get_cookie('inquireTrackGoogle'); if (!empty($COOKIE_inquireTrackGoogle)) { $this->Orders_model->COLI_OrderDetailText .= "\n\rGOOGLE关键字:" . $COOKIE_inquireTrackGoogle; delete_cookie('inquireTrackGoogle'); } //utm广告跟踪链接 $utm_source = get_cookie('__ah_utm_source'); $utm_source_map = array( 'googleppc' => 78001, 'newsletters' => 78005, 'facebook' => 78006, 'instagram' => 78010, 'pin' => 78011, 'chinahighlights' => 99999 ); if (!empty($utm_source) && array_key_exists($utm_source, $utm_source_map)) { if($utm_source_map[$utm_source] != 99999){ $this->Orders_model->COLI_LineClass = $utm_source_map[$utm_source]; }else{ $this->Orders_model->COLI_LineClass = ''; } switch ($utm_source_map[$utm_source]){ case 78001: $this->Orders_model->COLI_sourcetype = 32034; break; case 78005: $this->Orders_model->COLI_sourcetype = 32030; break; case 99999: $this->Orders_model->COLI_sourcetype = 32108; break; } // 关联订单后统一删除 utm 的 cookie delete_cookie('__ah_utm_source', '.asiahighlights.com'); delete_cookie('__ah_utm_medium', '.asiahighlights.com'); delete_cookie('__ah_utm_campaign', '.asiahighlights.com'); } $this->Orders_model->COLI_GroupType = '19006'; $this->Orders_model->COLI_OrderType = '19006'; $this->Orders_model->MEI_MailList = $this->input->post('email'); $pos = strstr($this->input->post('realname'), ' '); if ($pos === false) { $this->Orders_model->MEI_FirstName = $this->input->post('realname'); } else { $this->Orders_model->MEI_FirstName = str_replace($pos, '', $this->input->post('realname')); $this->Orders_model->MEI_LastName = $pos; } $this->COLI_ProductSN = ''; bind_email($this->Orders_model->MEI_MailList); $this->Orders_model->TourOrderSave(); $this->Orders_model->SendMail($this->input->post('realname'), $this->input-> post('email'), $this->config->item('Site_ServiceName'), $this->config->item('Site_ServiceEmail'), 'Contactus Orders', $this->Orders_model->COLI_OrderDetailText); //发送邮件给客人 $this->Orders_model->SendMail($this->config->item('Site_ServiceName'), $this->config->item('Site_ServiceEmail'), $this->input->post('realname'), $this->input-> post('email'), 'Contactus Orders', $this->load->view('ah/email/email_template', '', true)); $data[] = array('name' => 'ok', 'value' => site_url('orders/callus-thankyou/')); echo json_encode($data); } } public function callus_thankyou() { $data = array(); $data['PPCCode'] = $this->lang->line('PPC_callus'); $data['seo_title'] = 'Thank you for your inquiry | Asia Highlights'; $this->load->view('header', $data); $this->load->view('orders/thank_you', $data); $this->load->view('footer'); } //ch 过来的 public function ch_tailormade_save() { $this->form_validation->set_rules('city', 'lang:city', 'required'); $this->form_validation->set_rules('realname', 'lang:realname', 'required'); //$this->form_validation->set_rules('nationality', 'lang:nationality', 'required'); $this->form_validation->set_rules('email', 'lang:email', 'required|valid_email'); //$this->form_validation->set_rules('additionalrequirements', 'lang:additionalrequirements', 'required'); //$this->form_validation->set_rules('cli_tourdays', 'lang:cli_tourdays', 'required'); if ($this->form_validation->run() == false) { $data = array(); foreach ($this->form_validation->_error_array as $key => $value) { $data[] = array('name' => $key, 'value' => $value); } if ($this->input->post('no_ajax')) { $vali_string = ''; foreach ($data as $v) { $vali_string .= $v['name'] . ' => ' . $v['value'] . ' '; } echo(''); } else { echo json_encode($data); } } else { $this->Orders_model->COLI_ID = $this->Orders_model->MakeOrderNumber(); $this->Orders_model->COLI_SenderIP = $this->input->ip_address(); $this->Orders_model->COLI_OrderDetailText = ReplaceFieldName($_POST); $this->Orders_model->COLI_Servicetype = 'T'; $this->Orders_model->COLI_sourcetype = '32108'; //HT订单跟踪代码 $COOKIE_inquireTrackFrom = get_cookie('inquireTrackFrom'); if (!empty($COOKIE_inquireTrackFrom) && is_numeric($COOKIE_inquireTrackFrom)) { $this->Orders_model->COLI_sourcetype = (int) $COOKIE_inquireTrackFrom; delete_cookie('inquireTrackFrom'); } //Trace GOOGLE $COOKIE_inquireTrackGoogle = get_cookie('inquireTrackGoogle'); if (!empty($COOKIE_inquireTrackGoogle)) { $this->Orders_model->COLI_OrderDetailText .= "\n\rGOOGLE关键字:" . $COOKIE_inquireTrackGoogle; delete_cookie('inquireTrackGoogle'); } //utm广告跟踪链接 $utm_source = get_cookie('__ah_utm_source'); $utm_source_map = array( 'googleppc' => 78001, 'newsletters' => 78005, 'facebook' => 78006, 'instagram' => 78010, 'pin' => 78011, 'chinahighlights' => 99999 ); if (!empty($utm_source) && array_key_exists($utm_source, $utm_source_map)) { if($utm_source_map[$utm_source] != 99999){ $this->Orders_model->COLI_LineClass = $utm_source_map[$utm_source]; }else{ $this->Orders_model->COLI_LineClass = ''; } switch ($utm_source_map[$utm_source]){ case 78001: $this->Orders_model->COLI_sourcetype = 32034; break; case 78005: $this->Orders_model->COLI_sourcetype = 32030; break; case 99999: $this->Orders_model->COLI_sourcetype = 32108; break; } // 关联订单后统一删除 utm 的 cookie delete_cookie('__ah_utm_source', '.asiahighlights.com'); delete_cookie('__ah_utm_medium', '.asiahighlights.com'); delete_cookie('__ah_utm_campaign', '.asiahighlights.com'); } $this->Orders_model->COLI_GroupType = '19006'; $this->Orders_model->COLI_OrderType = '19006'; if (is_numeric($this->input->post('adultsNumber'))) { $this->Orders_model->COLI_PersonNum = $this->input->post('adultsNumber'); } if (is_numeric($this->input->post('ChildrenNumber'))) { $this->Orders_model->COLI_ChildNum = $this->input->post('ChildrenNumber'); } if (is_numeric($this->input->post('BabiesNumber'))) { $this->Orders_model->COLI_BabyNum = $this->input->post('BabiesNumber'); } $this->Orders_model->MEI_MailList = $this->input->post('email'); $this->Orders_model->MEI_Mail = $this->input->post('email2'); $pos = strstr($this->input->post('realname'), ' '); if ($pos === false) { $this->Orders_model->MEI_FirstName = $this->input->post('realname'); } else { $this->Orders_model->MEI_FirstName = str_replace($pos, '', $this->input->post('realname')); $this->Orders_model->MEI_LastName = $pos; } $this->Orders_model->MEI_Nationality = $this->Orders_model->GetNationalityID($this-> input->post('nationality')); $this->COLI_ProductSN = ''; if ($this->input->post('Date_Start')) { $this->Orders_model->COLI_OrderStartDate = $this->input->post('Date_Start'); } $this->Orders_model->MEI_Gender = $this->input->post('gender'); $this->Orders_model->MEI_Phone = $this->input->post('PhoneNo'); //是否来至第三方合作网站 $third_webcode = $this->input->post('third_webcode'); if (empty($third_webcode)) { $third_webcode = $this->input->cookie('third_code'); $this->input->set_cookie('third_code', '', ''); $this->input->set_cookie('third%5Fcode', '', ''); } if (!empty($third_webcode)) { $this->Orders_model->COLI_WebCode = $third_webcode; } //指定操作人 if ($this->input->post('COLI_OPI_SN')) { $this->Orders_model->COLI_OPI_SN = $this->input->post('COLI_OPI_SN'); } $this->Orders_model->TourOrderSave(); $this->Orders_model->SendMail($this->input->post('realname'), $this->input-> post('email'), $this->config->item('Site_ServiceName'), $this->config->item('Site_ServiceEmail'), 'Tailor Made Orders', $this->Orders_model->COLI_OrderDetailText); //发送邮件给客人 (20160504tailor_make) $this->Orders_model->SendMail($this->config->item('Site_ServiceName'), $this->config->item('Site_ServiceEmail'), $this->input->post('realname'), $this->input->post('email'), 'Tailor Made Orders', $this->load->view('ah/email/email_template', '', true)); //是否AJAX提交? $no_ajax = $this->input->post('no_ajax'); if (empty($no_ajax)) { $data[] = array('name' => 'go', 'value' => site_url('orders/thankyou')); echo json_encode($data); } else { // $file_alias = $this->input->post('file_alias'); redirect("https://www.chinahighlights.com/forms/thankyou-asia-tours.asp"); } } } public function tailormade_thankyou() { $data = array(); $data['seo_title'] = 'Asia Highlights Travel'; $this->load->view('header', $data); $this->load->view('orders/thank_you', $data); $this->load->view('footer'); $this->output->cache(99999); } public function asia_tour() { $data = array(); $this->form_validation->set_rules('cli_no', 'lang:cli_no', 'required'); if ($this->form_validation->run() == false) { redirect(); } $data['post_cli_no'] = $this->input->post('cli_no'); $data['post_cli_sn'] = $this->input->post('cli_sn'); $data['post_days'] = $this->input->post('cli_days'); $data['post_destinations'] = $this->input->post('destinations'); $data['adultsNumber'] = $this->input->post('adultsNumber'); $data['ChildrenNumber'] = $this->input->post('ChildrenNumber'); $data['BabiesNumber'] = $this->input->post('BabiesNumber'); $data['post_Starting_Date'] = $this->input->post('Starting_Date'); $this->load->view('header', $data); $this->load->view('orders/asia_tour_form'); $this->load->view('footer'); } public function asia_tour_save() { $this->form_validation->set_rules('realname', 'lang:realname', 'required'); $this->form_validation->set_rules('nationality', 'lang:nationality', 'required'); $this->form_validation->set_rules('email', 'lang:email', 'required|valid_email'); $this->form_validation->set_rules('additionalrequirements', 'lang:additionalrequirements', 'required'); $this->form_validation->set_rules('hotel', 'lang:hotel', 'required'); $this->form_validation->set_rules('starting_date', 'lang:starting_date', 'required'); if ($this->form_validation->run() == false) { $data = array(); foreach ($this->form_validation->_error_array as $key => $value) { $data[] = array('name' => $key, 'value' => $value); } echo json_encode($data); } else { $this->Orders_model->COLI_ID = $this->Orders_model->MakeOrderNumber(); $this->Orders_model->COLI_SenderIP = $this->input->ip_address(); $this->Orders_model->COLI_OrderDetailText = ReplaceFieldName($_POST); $this->Orders_model->COLI_Servicetype = 'T'; $this->Orders_model->COLI_sourcetype = '32001'; //HT订单跟踪代码 $COOKIE_inquireTrackFrom = get_cookie('inquireTrackFrom'); if (!empty($COOKIE_inquireTrackFrom) && is_numeric($COOKIE_inquireTrackFrom)) { $this->Orders_model->COLI_sourcetype = (int) $COOKIE_inquireTrackFrom; delete_cookie('inquireTrackFrom'); } //Trace GOOGLE $COOKIE_inquireTrackGoogle = get_cookie('inquireTrackGoogle'); if (!empty($COOKIE_inquireTrackGoogle)) { $this->Orders_model->COLI_OrderDetailText .= "\n\rGOOGLE关键字:" . $COOKIE_inquireTrackGoogle; delete_cookie('inquireTrackGoogle'); } //utm广告跟踪链接 $utm_source = get_cookie('__ah_utm_source'); $utm_source_map = array( 'googleppc' => 78001, 'newsletters' => 78005, 'facebook' => 78006, 'instagram' => 78010, 'pin' => 78011, 'chinahighlights' => 99999 ); if (!empty($utm_source) && array_key_exists($utm_source, $utm_source_map)) { if($utm_source_map[$utm_source] != 99999){ $this->Orders_model->COLI_LineClass = $utm_source_map[$utm_source]; }else{ $this->Orders_model->COLI_LineClass = ''; } switch ($utm_source_map[$utm_source]){ case 78001: $this->Orders_model->COLI_sourcetype = 32034; break; case 78005: $this->Orders_model->COLI_sourcetype = 32030; break; case 99999: $this->Orders_model->COLI_sourcetype = 32108; break; } // 关联订单后统一删除 utm 的 cookie delete_cookie('__ah_utm_source', '.asiahighlights.com'); delete_cookie('__ah_utm_medium', '.asiahighlights.com'); delete_cookie('__ah_utm_campaign', '.asiahighlights.com'); } $this->Orders_model->COLI_GroupType = '19001'; $this->Orders_model->COLI_OrderType = '19001'; $this->Orders_model->COLI_Name = $this->input->post('cli_no') . ' ' . $this-> input->post('cli_tourtitle'); $this->Orders_model->COLI_PersonNum = $this->input->post('adultsNumber'); $this->Orders_model->COLI_ChildNum = $this->input->post('ChildrenNumber'); $this->Orders_model->COLI_BabyNum = $this->input->post('BabiesNumber'); $this->Orders_model->COLI_OrderStartDate = $this->input->post('starting_date'); $this->Orders_model->COLI_Days = $this->input->post('cli_tourdays'); $this->Orders_model->MEI_MailList = $this->input->post('email'); $this->Orders_model->MEI_Mail = $this->input->post('email2'); $pos = strstr($this->input->post('realname'), ' '); if ($pos === false) { $this->Orders_model->MEI_FirstName = $this->input->post('realname'); } else { $this->Orders_model->MEI_FirstName = str_replace($pos, '', $this->input->post('realname')); $this->Orders_model->MEI_LastName = $pos; } $this->Orders_model->MEI_Nationality = $this->Orders_model->GetNationalityID($this-> input->post('nationality')); $this->Orders_model->MEI_Gender = $this->input->post('gender'); if (empty($this->Orders_model->MEI_Phone) || !isset($this->Orders_model-> MEI_Phone)) { $this->Orders_model->MEI_Phone = @$this->input->post('PhoneNo'); } $this->Orders_model->COLI_ProductSN = $this->input->post('cli_sn'); //是否来至第三方合作网站 $third_webcode = $this->input->post('third_webcode'); if (empty($third_webcode)) { $third_webcode = $this->input->cookie('third_code'); $this->input->set_cookie('third_code', '', ''); $this->input->set_cookie('third%5Fcode', '', ''); } if (!empty($third_webcode)) { $this->Orders_model->COLI_WebCode = $third_webcode; } $this->Orders_model->TourOrderSave(); $this->Orders_model->SendMail($this->input->post('realname'), $this->input-> post('email'), $this->config->item('Site_ServiceName'), $this->config->item('Site_ServiceEmail'), 'Tour Orders', $this->Orders_model->COLI_OrderDetailText); //发送邮件给客人(20160504inquiry_form) $this->Orders_model->SendMail($this->config->item('Site_ServiceName'), $this->config->item('Site_ServiceEmail'), $this->input->post('realname'), $this->input-> post('email'), 'Tour Orders', $this->load->view('ah/email/email_template', '', true)); $data[] = array('name' => 'go', 'value' => site_url('orders/asia_tour_thankyou')); echo json_encode($data); } } public function asia_tour_thankyou() { $data = array(); $data['seo_title'] = 'Tour Inquiry | Asia Highlights'; $this->load->view('header', $data); $this->load->view('orders/thank_you', $data); $this->load->view('footer'); } }