load->model('Orders_model');
//第三合作网站配置
$this->third_part = array(
'EXPCH' => array(
'url' => 'www.experienciaenchina.com',
'email' => 'experienciaenchina@gmail.com'
),
'MESENLLA' => array(
'url' => 'mesenlla.es',
'email' => 'lmrcits@163.com'
),
'wayaway' => array(
'url' => 'www.way-away.es',
'email' => 'lmrcits@163.com'
),
'traba' => array(
'url' => 'trabajoenchina.org',
'email' => 'lmrcits@163.com'
),
'guias' => array(
'url' => 'http://guias-viajar.com/china/',
'email' => 'lmrcits@163.com'
),
'sapor' => array(
'url' => 'http://www.saporedicina.com/es/viajar-en-tren-por-china/',
'email' => 'lmrcits@163.com'
),
'saporit' => array(
'url' => 'http://www.saporedicina.com/',
'email' => 'lmrcits@163.com'
),
'ctooles' => array(
'url' => 'http://www.chinese-tools.com/',
'email' => 'lmrcits@163.com'
),
'ctoolfr' => array(
'url' => 'http://www.chinese-tools.com/',
'email' => 'lmrcits@163.com'
)
);
$this->site_code = strtolower($this->config->item('Site_Code'));
}
public function index() {
redirect();
}
//新版tailormade和产品页面
public function triprequest($third_part_code = '') {
$data = array();
$cli_sn = $this->input->get_post('cli_sn');
$data['countrylist'] = ['Vietnam','Cambodia','Laos','Thailand','Myanmar','Japan','India','Nepal','Sri Lanka','China','Mongolia','Indonesia'];
if($cli_sn){
$data['countryarr'] = array();
$obj = $this->Orders_model->get_country($cli_sn);
foreach ($obj as $value){
array_push($data['countryarr'],$value->CountryName);
}
$data['ic_title'] = $this->input->get_post('ic_title');
$data['cli_no'] = $this->input->get_post('cli_no');
$data['cli_sn'] = $cli_sn;
$data['cli_days'] = $this->input->get_post('cli_days');
}else{
$data['countryarr'] = [];
}
$data['action'] = '/orders/triprequest_save';
$data['seo_title'] = "Create my trip | Asia Highlights";
//$data['seo_keywords'] = $data['detail']->ic_seo_keywords;
//$data['seo_description'] = $data['detail']->ic_seo_description;
$this->load->view('header', $data);
$this->load->view('orders/form-advanced');
$this->load->view('footer');
}
//新版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('Title', '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')){
$this->Orders_model->COLI_sourcetype = '32001';
}else{
$this->Orders_model->COLI_sourcetype = '32003';
}
//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');
}
$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');
}
$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/tailormade_thankyou'));
echo json_encode($data);
} else {
$file_alias = $this->input->post('file_alias');
redirect(site_url('orders/tailormade_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');
}
$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('orders/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);
}
/**
*
* 联系我们
* @author lmr
*
*/
public function contactus() {
//初始化html结构
$data = array();
$this->html_do->head($data, 'r');
$this->load->view('orders/contact_us/' . $this->site_code, $data);
$this->html_do->foot($data, 'r');
$this->output->cache(10086);
}
/**
*
* 联系我们订单入库
* @author lmr
*
*/
public function contactus_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 {
//添加隐藏字段判断是否为扫描提交
if ( $this->input->get_post("nullemail") != NULL) {
log_message('error', "reject by Robot Detected.".json_encode($_POST));
$data[] = array('name' => 'go', 'value' => site_url('orders/contactus_thankyou/'));
echo json_encode($data);
exit;
}
$this->Orders_model->COLI_ID = $this->Orders_model->MakeOrderNumber();
$this->Orders_model->COLI_SenderIP = $this->input->ip_address();
//屏蔽掉非法IP49.157.0.226
if($this->Orders_model->COLI_SenderIP == '49.157.0.227' || $this->Orders_model->COLI_SenderIP == '49.157.0.226'){
send_404();
die();
}
$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');
}
//垃圾订单过滤('http://外站.com')
$comments = $this->input->post('comments');
$ms = array();
//进行正则匹配
preg_match('/((https|http):[\/]{2})*[\w]+[.]{1}[a-z\d\-]+[.a-z\d-\/.htm]*/', $comments, $ms);
if (!empty($ms)) {
$this->Orders_model->COLI_Purpose = '-1';
$data[] = array('name' => 'go', 'value' => site_url('orders/contactus_thankyou/'));
echo json_encode($data);
exit;
}
$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 = '';
$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('orders/email_template', '', true));
//begin 发送邮件给客人
/*
$this->load->helper('file');
$fileString = read_file('./CodeFrame_Templet/forms/customer-email-review2.asp');
$fileString = str_replace('<#realname#>', $this->input->post('realname'), $fileString);
if ($fileString) {
$mailTitle = $this->language_tags->Set("t-reserve-citytour-save-subject", "You have successfully sent your enquiry", array());
$mailBody = $fileString;
$this->Orders_model->SendMail($this->config->item('Site_ServiceName'), $this->
config->item('Site_ServiceEmail'), $this->input->post('realname'), $this->input->
post('email'), $mailTitle, $mailBody);
}
*/
//end
//是否AJAX提交?
$no_ajax = $this->input->post('no_ajax');
if (empty($no_ajax)) {
$data[] = array('name' => 'go', 'value' => site_url('orders/contactus_thankyou/'));
echo json_encode($data);
} else {
$file_alias = $this->input->post('file_alias');
redirect(site_url('orders/contactus_thankyou/' . $file_alias));
}
}
}
public function contactus_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 {
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 = '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');
}
$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('orders/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');
}
public function tailormade($third_part_code = '') {
$data = array();
$data['anum'] = $this->input->post('anum', true);
$data['bnum'] = $this->input->post('bnum', true);
$data['cnum'] = $this->input->post('cnum', true);
$data['aq'] = $this->input->post('aq', true);
$data['date'] = $this->input->post('date', true);
$data['email'] = $this->input->post('email', true);
$data['realname'] = $this->input->post('realname', true);
$data['third_part_code'] = $third_part_code;
$data['seo_title'] = "Create a unique trip | Ease of Planning | Asia Highlights";
// $data['seo_keywords'] = $data['detail']->ic_seo_keywords;
// $data['seo_description'] = $data['detail']->ic_seo_description;
$this->load->view('header', $data);
$this->load->view('orders/tailor_make');
$this->load->view('footer');
}
public function tailormade_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('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 = '32003';
//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');
}
$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('orders/email_template', '', true));
//是否AJAX提交?
$no_ajax = $this->input->post('no_ajax');
if (empty($no_ajax)) {
$data[] = array('name' => 'go', 'value' => site_url('orders/tailormade_thankyou'));
echo json_encode($data);
} else {
$file_alias = $this->input->post('file_alias');
redirect(site_url('orders/tailormade_thankyou' . $file_alias));
}
}
}
//ch 过来的
public function ch_tailormade_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('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');
}
$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('orders/email_template', '', true));
//是否AJAX提交?
$no_ajax = $this->input->post('no_ajax');
if (empty($no_ajax)) {
$data[] = array('name' => 'go', 'value' => site_url('orders/tailormade_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['PPCCode'] = $this->lang->line('PPC_tailormade');
$data['seo_title'] = 'Asia Highlights Travel';
$this->load->view('header', $data);
$this->load->view('orders/thank_you', $data);
$this->load->view('footer');
}
public function single_city_tour() {
$data = array();
$this->html_do->head($data, 'r');
$this->form_validation->set_rules('cli_no', 'lang:cli_no', 'required');
$data['post_price'] = $this->input->post('cli_price');
if ($this->form_validation->run() == false) {
redirect();
} else {
$this->Tours_model->TopNum = 1;
$this->Tours_model->CLI_NO = $this->input->post('cli_no');
$tourInfo = $this->Tours_model->GetInfo();
if ($tourInfo) {
$data['country'] = $this->Site_model->GetCountry();
$tourInfo->CLI_Price = $this->Tours_model->GetTourPrice($tourInfo->CLI_NO, $this->
input->post('adultenum'), $this->input->post('cli_grade'), $this->input->post('season'), $this->input->post('starting_date'));
$data['postURL'] = site_url('orders/single-city-tour-save/');
$data['tourInfo'] = $tourInfo;
$data['Header'] = $this->load->view('header', array('Navigation' => $this->
Site_model->GetNavigation('single-city-tour')), true);
$this->load->view('orders/tour_simple/' . $this->site_code, $data);
} else {
redirect();
}
}
}
public function single_city_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('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');
}
$this->Orders_model->COLI_GroupType = '19004';
$this->Orders_model->COLI_OrderType = '19004';
$this->Orders_model->COLI_Name = $this->input->post('cli_no') . ' ' . $this->
input->post('cli_tourtitle');
$this->Orders_model->COLI_PersonNum = $this->input->post('adultenum');
$this->Orders_model->COLI_ChildNum = $this->input->post('childnum');
$this->Orders_model->COLI_BabyNum = $this->input->post('babynum');
$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');
$this->Orders_model->MEI_Phone = $this->input->post('phoneno');
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;
}
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'), 'Single City Tour 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'), 'Single City Tour Orders', $this->load->view('orders/email_template', '', true));
//是否AJAX提交?
$no_ajax = $this->input->post('no_ajax');
if (empty($no_ajax)) {
$data[] = array('name' => 'ok', 'value' => site_url('orders/single-city-tour-thankyou/'));
echo json_encode($data);
} else {
$file_alias = $this->input->post('file_alias');
redirect(site_url('orders/single-city-tour-thankyou/' . $file_alias));
}
}
}
public function single_city_tour_thankyou() {
$data = array();
$this->html_do->head($data, 'r');
$data['PPCCode'] = $this->lang->line('PPC_single_city_tour');
$this->load->view('orders/r_thankyou/' . $this->site_code, $data);
}
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/inquiry_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');
}
$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('orders/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';
$data['PPCCode'] = $this->lang->line('PPC_china_tour');
$this->load->view('header', $data);
$this->load->view('orders/thank_you', $data);
$this->load->view('footer');
}
public function group_tour() {
$this->form_validation->set_rules('cli_no', 'lang:cli_no', 'required');
$data['post_price'] = $this->input->post('cli_price');
if ($this->form_validation->run() == false) {
redirect();
} else {
$data['country'] = $this->Site_model->GetCountry();
$this->Tours_model->TopNum = 1;
$this->Tours_model->CLI_NO = $this->input->post('cli_no');
$tourInfo = $this->Tours_model->GetInfo();
if ($tourInfo) {
$tourInfo->CLI_Price = $this->Tours_model->GetGroupTourPrice($tourInfo->CLI_NO, $this->input->post('starting_date'));
$data['postURL'] = site_url('orders/group-tour-save/');
$data['tourInfo'] = $tourInfo;
$data['Header'] = $this->load->view('header', array('Navigation' => $this->
Site_model->GetNavigation('tour')), true);
$this->load->view('orders/tour', $data);
$this->load->view('footer');
} else {
redirect();
}
}
}
public function group_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');
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';
//增加订单跟踪代码
if (isset($_COOKIE['inquireTrackFrom'])) {
if (is_numeric($_COOKIE['inquireTrackFrom'])) {
$this->Orders_model->COLI_sourcetype = (int) $_COOKIE['inquireTrackFrom'];
setcookie("inquireTrackFrom", $_COOKIE['inquireTrackFrom'], 0, '/');
}
}
//Trace GOOGLE
if (isset($_COOKIE['inquireTrackGoogle'])) {
$google_str = get_para_from_url($_COOKIE['inquireTrackGoogle'], 'q');
$this->Orders_model->COLI_OrderDetailText .= "\n\rGOOGLE关键字:" . $google_str;
setcookie("inquireTrackGoogle", $_COOKIE['inquireTrackGoogle'], 0, '/');
$this->Orders_model->COLI_Keywords = $google_str;
}
$this->Orders_model->COLI_GroupType = '19002';
$this->Orders_model->COLI_OrderType = '19002';
$this->Orders_model->COLI_Name = $this->input->post('cli_no') . ' ' . $this->
input->post('cli_tourtitle');
$this->Orders_model->COLI_PersonNum = $this->input->post('adultenum');
$this->Orders_model->COLI_ChildNum = $this->input->post('childnum');
$this->Orders_model->COLI_BabyNum = $this->input->post('babynum');
$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');
$this->Orders_model->MEI_Phone = $this->input->post('phoneno');
$this->Orders_model->COLI_ProductSN = $this->input->post('cli_sn');
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'), 'Group Tour 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'), 'Group Tour Orders', $this->load->view('orders/email_template', '', true));
$data[] = array('name' => 'ok', 'value' => site_url('orders/group-tour-thankyou/'));
echo json_encode($data);
}
}
public function group_tour_thankyou() {
$data = array();
$this->html_do->head($data, 'r');
$data['PPCCode'] = $this->lang->line('PPC_group_tour');
$this->load->view('orders/r_thankyou/' . $this->site_code, $data);
}
public function tour_price() {
$CLI_Price = $this->Tours_model->GetTourPrice($this->input->post('cli_no'), $this->
input->post('adultenum'), $this->input->post('cli_grade'), $this->input->post('season'), $this->input->post('starting_date'));
if ($CLI_Price === false) {
echo 'null';
} else {
echo $CLI_Price->Tour_Price;
}
}
}