diff --git a/.htaccess b/.htaccess index 2b6e4b75..62adce5b 100644 --- a/.htaccess +++ b/.htaccess @@ -34,8 +34,8 @@ RewriteRule ^/(tours|vietnam|guide|cambodia|laos|myanmar|thailand|southeast-asia #orders RewriteRule ^/create-my-trip.htm$ /index.php/orders/tailormade/ [U,L] -RewriteRule ^/orders/triprequest.htm$ /index.php/orders/triprequest/ [U,L] -RewriteRule ^/orders/lantern_form$ /index.php/orders/lantern_form/ [U,L] +RewriteRule ^/orders/triprequest.htm$ /index.php/forms/triprequest/ [U,L] +RewriteRule ^/forms/lantern_form$ /index.php/forms/lantern_form/ [U,L] RewriteRule ^/orders/(lantern_save|tailormade_thankyou|tailormade_save|contactus_save|contactus_thankyou|asia_tour|asia_tour_save|asia_tour_thankyou|ch_tailormade_save|triprequest_save)$ /index.php/orders/$1 [U,L] RewriteRule ^/orders/inquiry_thankyou$ /index.php/orders/tailormade_thankyou [U,L] diff --git a/application/controllers/forms.php b/application/controllers/forms.php new file mode 100644 index 00000000..82aee2e1 --- /dev/null +++ b/application/controllers/forms.php @@ -0,0 +1,82 @@ +load->model('Orders_model'); + } + + //水灯节表单 + public function lantern_form(){ + $data = array(); + $data['location'] = $this->input->get_post('location'); + $data['TicketStandard'] = $this->input->get_post('TicketStandard'); + $data['ticketonlyselection'] = $this->input->get_post('ticketonlyselection'); + $data['date'] = $this->input->get_post('date'); + $data['travelNumber'] = $this->input->get_post('travelNumber'); + $data['totalprice'] = $this->input->get_post('totalprice'); + + $this->load->view('header'); + $this->load->view('orders/lantern_form',$data); + $this->load->view('footer'); + } + + //tailormade和产品页面 + public function triprequest($third_part_code = '') { + $data = array(); + $cli_sn = $this->input->get_post('cli_sn'); + $data['countrylist'] = ['Vietnam','Cambodia','India','Thailand','Myanmar','Japan','Laos','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'); + } + + //inquiry 表单移动端 + public function inquirymobile(){ + $data = array(); + $cli_sn = $this->input->get_post('cli_sn'); + $data['countrylist'] = ['Vietnam','Cambodia','India','Thailand','Myanmar','Japan','Laos','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'); + }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/inquiry_mobile'); + $this->load->view('footer'); + } + + +} \ No newline at end of file diff --git a/application/controllers/orders.php b/application/controllers/orders.php index d18acfe9..02ce6bd5 100644 --- a/application/controllers/orders.php +++ b/application/controllers/orders.php @@ -14,47 +14,6 @@ class Orders extends CI_Controller { function __construct() { parent::__construct(); $this->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')); //屏蔽掉非法IP49.157.0.226 if($this->input->ip_address() == '116.93.127.114' || $this->input->ip_address() == '116.202.14.3'){ @@ -67,23 +26,9 @@ class Orders extends CI_Controller { redirect(); } - //水灯节表单 - public function lantern_form(){ - $data = array(); - $data['ticketType'] = $this->input->get_post('TicketType'); - $data['TicketStandard'] = $this->input->get_post('TicketStandard'); - $data['ticketonlyselection'] = $this->input->get_post('ticketonlyselection'); - $data['date'] = $this->input->get_post('date'); - $data['travelNumber'] = $this->input->get_post('travelNumber'); - - $this->load->view('header'); - $this->load->view('orders/lantern_form',$data); - $this->load->view('footer'); - } - //水灯节表单入库 public function lantern_save() { - $this->form_validation->set_rules('Firstname', 'lang:Firstname', 'required'); + $this->form_validation->set_rules('fullname', 'lang:Firstname', 'required'); $this->form_validation->set_rules('email', 'lang:email', 'required|valid_email'); if ($this->form_validation->run() == false) { send_404(); @@ -144,9 +89,9 @@ class Orders extends CI_Controller { $this->Orders_model->COLI_ChildNum = $this->input->post('child_number'); $this->Orders_model->MEI_MailList = $this->input->post('email'); - $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_FirstName = $this->input->post('fullname'); + $this->Orders_model->MEI_LastName = $this->input->post('fullname'); + $fullname = $this->input->post('fullname'); $this->Orders_model->MEI_Nationality = $this->Orders_model->GetNationalityID($this->input->post('Nationality')); $this->Orders_model->COLI_ProductSN = $this->input->post('cli_sn'); @@ -163,42 +108,21 @@ class Orders extends CI_Controller { $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)); - - //价格计算后转到支付中心 - - //跳转到thankyou页面 - redirect(site_url('orders/asia_tour_thankyou')); + + //生成支付链接 + $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 Lantern Festival Tickets&body=Booking Lantern Festival Tickets&total_amount='.$totalprice.'¤cy=USD&rmb_amount='.$total_rmb.'&sign='.$sign.'&return_url=https://www.asiahighlights.com/orders/inquiry_thankyou'); + $payurl = 'https://secure.chinahighlights.com/pay/paymentservice/?'.$addurl; + //跳转到thankyou页面 + redirect($payurl); } } - //新版tailormade和产品页面 - public function triprequest($third_part_code = '') { - $data = array(); - $cli_sn = $this->input->get_post('cli_sn'); - $data['countrylist'] = ['Vietnam','Cambodia','India','Thailand','Myanmar','Japan','Laos','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'); @@ -467,21 +391,6 @@ class Orders extends CI_Controller { $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); - } - /** * * 联系我们订单入库 @@ -723,127 +632,6 @@ class Orders extends CI_Controller { $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('city', 'lang:city', 'required'); @@ -980,6 +768,7 @@ class Orders extends CI_Controller { } } } + public function tailormade_thankyou() { $data = array(); $data['seo_title'] = 'Asia Highlights Travel'; @@ -989,162 +778,6 @@ class Orders extends CI_Controller { $this->output->cache(99999); } - 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'); - } - //utm广告跟踪链接 - $utm_source = get_cookie('__ah_utm_source'); - $utm_source_map = array( - 'google' => 78001, - 'newsletters' => 78005, - '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 = '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(); @@ -1163,7 +796,7 @@ class Orders extends CI_Controller { $data['post_Starting_Date'] = $this->input->post('Starting_Date'); $this->load->view('header', $data); - $this->load->view('orders/inquiry_form'); + $this->load->view('orders/asia_tour_form'); $this->load->view('footer'); } @@ -1290,146 +923,4 @@ class Orders extends CI_Controller { $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; - } - - //utm广告跟踪链接 - $utm_source = get_cookie('__ah_utm_source'); - $utm_source_map = array( - 'google' => 78001, - 'newsletters' => 78005, - '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 = '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; - } - } - } diff --git a/application/views/orders/inquiry_form.php b/application/views/orders/asia_tour_form.php similarity index 99% rename from application/views/orders/inquiry_form.php rename to application/views/orders/asia_tour_form.php index 767be39b..ac088096 100644 --- a/application/views/orders/inquiry_form.php +++ b/application/views/orders/asia_tour_form.php @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/application/views/orders/lantern_form.php b/application/views/orders/lantern_form.php index 91ccb7de..65a9c29a 100644 --- a/application/views/orders/lantern_form.php +++ b/application/views/orders/lantern_form.php @@ -1,180 +1,172 @@ - -
- - -