TM 表单增加移动端判断,加载不同的试图

master
LiaoYijun 4 years ago
parent 8c659e5f40
commit 9c6d414d98

File diff suppressed because one or more lines are too long

@ -3,11 +3,15 @@
if (!defined('BASEPATH')) if (!defined('BASEPATH'))
exit('No direct script access allowed'); exit('No direct script access allowed');
require_once 'Mobile_Detect.php';
class forms extends CI_Controller { class forms extends CI_Controller {
function __construct() { function __construct() {
parent::__construct(); parent::__construct();
$this->load->model('Orders_model'); $this->load->model('Orders_model');
$detect = new Mobile_Detect;
} }
//水灯节表单 //水灯节表单
@ -127,7 +131,7 @@ class forms extends CI_Controller {
$this->load->view('footer'); $this->load->view('footer');
} }
public function tailormade(){ public function tailormade() {
$data['countrylist'] = ['Vietnam','Cambodia','India','Thailand','Myanmar','Japan','Laos','Nepal','Sri Lanka','China','Mongolia','Indonesia']; $data['countrylist'] = ['Vietnam','Cambodia','India','Thailand','Myanmar','Japan','Laos','Nepal','Sri Lanka','China','Mongolia','Indonesia'];
$data['action'] = '/orders/triprequest_save'; $data['action'] = '/orders/triprequest_save';
$data['seo_title'] = "Create my trip | Asia Highlights"; $data['seo_title'] = "Create my trip | Asia Highlights";
@ -144,8 +148,14 @@ class forms extends CI_Controller {
} }
$this->load->view('header', $data); $this->load->view('header', $data);
$this->load->view('orders/tailormade');
$this->load->view('footer'); if ($detect->isMobile() && !$detect->isTablet()) {
$this->load->view('orders/tailormademobile');
} else {
$this->load->view('orders/tailormade');
}
$this->load->view('footer');
} }
public function tailormademobile(){ public function tailormademobile(){

Loading…
Cancel
Save