新增shanghai站点(上海站移动化)

hotfix/paypal-note
赵鹏 2 years ago
parent e0e19ae926
commit 763181b050

@ -415,6 +415,7 @@ $config['site'] = array(
'ts' => array('site_code' => 'ts', 'site_id' => 149, 'site_lgc' => '1', 'sitemap_name' => '', 'site_image_url' => '', 'site_url' => 'https://www.trainspread.com', 'site_sitemap' => '', 'site_authors' => array('X', 'sfx'), 'site_user' => array(',ycc,sfx,X,')),
'bht' => array('site_code' => 'bht', 'site_id' => 6565, 'site_lgc' => '1', 'site_image_url' => '', 'site_url' => 'https://www.beijinghighlights.com', 'site_authors' => array('cj')),
'trippest' => array('site_code' => 'trippest', 'site_id' => 145, 'site_lgc' => '1', 'site_image_url' => '', 'site_url' => 'https://www.trippest.com', 'site_authors' => array('cj'), 'site_user' => array(',ycc,zp,')),
'shanghai' => array('site_code' => 'shanghai', 'site_id' => 96, 'site_lgc' => '107', 'site_url' => 'http://www.shanghaihighlights.com/', 'site_image_url' => 'https://images.shanghaihighlights.com', 'site_authors' => array('ll', 'D'), 'site_user' => ',ycc,vz,bhn,J,wj,ll,D,ZP,lyy,'),
);
//静态文件生成路径
@ -712,6 +713,7 @@ $config['css_source_ah'] = 'https://data.asiahighlights.com/css/mobile-first.css
$config['css_source_gh'] = 'https://data.globalhighlights.com/css/gh-global.css';
$config['css_source_ct'] = 'https://data.chinatravel.com/css/min.php?f=/css/css3/bootstrap/bootstrap.css,/css/css3/style.css,/css/css3/destination-details.css';
$config['css_source_chinatravel'] = 'https://data.chinatravel.com/css/newcss3/base.css';
$config['css_source_shanghai'] = 'https://data.shanghaihighlights.com/css/css3/base.css';
$config['css_source_ts'] = 'https://www.trainspread.com/css/bootstrap.min.css';
//静态文件生成路径
@ -726,6 +728,7 @@ $config['cache']['ch']['cache_path'] = 'D:\wwwcache\chinahighlights.com';
$config['cache']['ah']['cache_path'] = 'D:\wwwcache\asiahighlights.com';
$config['cache']['gh']['cache_path'] = 'D:\wwwcache\globalhighlights.com';
$config['cache']['chinatravel']['cache_path'] = 'D:\wwwcache\mobile-first\chinatravel.com';
$config['cache']['shanghai']['cache_path'] = 'D:\wwwcache\mobile-first\shanghaihighlights.com';
//静态文件更新接口
$config['cache']['jp']['cache_api'] = '/info.php/information/update_cache/';

@ -444,6 +444,9 @@ class Information extends CI_Controller
$information_new = $this->Information_model->Detail($this->input->post('is_id'));
$this->make_www_cache_ct($information_new);
// $this->make_www_cache_ct('pc', $information_new);
} else if (strcasecmp($site_code, "shanghai") == 0 && !empty($auto_update_cache)){
$information_new = $this->Information_model->Detail($this->input->post('is_id'));
$this->make_www_cache_sh($information_new);
} else if (strcasecmp($site_code, "cht") == 0 && !empty($auto_update_cache)) {
$update_info_log = $this->update_cache($ic_url);
} else if (strcasecmp($site_code, "ah") == 0 && !empty($auto_update_cache)) {
@ -534,6 +537,8 @@ class Information extends CI_Controller
} else if ($this->config->item('site_code') == 'chinatravel') {
$this->make_www_cache_ct($information);
// $this->make_www_cache_ct('mobile', $information);
} else if ($this->config->item('site_code') == 'shanghai') {
$this->make_www_cache_sh($information);
} else if ($this->config->item('site_code') == 'gh') {
$this->make_www_cache_gh('pc', $information, $recommand_information);
$this->make_www_cache_gh('mobile', $information, $recommand_information);
@ -2327,6 +2332,330 @@ class Information extends CI_Controller
}
/**
* 上海站
*/
public function make_www_cache_sh($information)
{
$data = array();
#region 公用数据
//$apiurl = "http://202.103.68.104:61/info.php"; //本地测试
$apiurl = "https://ct.mycht.cn/info.php"; //网前
//先准备数据,采用直接赋值视图然后返回视图字符串的模式,不使用一次次替换视图模板内容的模式。
$data["TITLE"] = $information->ic_seo_title;
$data["DESCRIPTION"] = $information->ic_seo_description;
$data["KEYWORDS"] = $information->ic_seo_keywords;
$data["CANONICAL"] = $this->config->item('site_url') . $information->ic_url;
$meta_ct_page_type = "";
$meta_ct_page_type = get_meta($information->ic_id, 'meta_ct_page_type'); //页面类型
$meta_product_code = get_meta($information->ic_id, 'meta_product_code'); //绑定的产品编号
$template_path = 'mobile_first/' . $this->config->item('site_code'); //模板位置
//面包屑
$crumb = "";
$crumb_data = $this->Information_model->get_path_exclude_ct($information->is_id, $information->is_path);
if (count($crumb_data) > 0) { //至少有一个父类面包屑才显示
$crumb = "<div class=\"crumb\"><a href=\"/\">Home</a>";
foreach ($crumb_data as $index => $item) {
$crumb .= '<a href="' . $item['ic_url'] . '" data-index="' . $index . '" data-is-id="' . $item['is_id'] . '">' . $item['ic_url_title'] . '</a>';
}
$crumb .= "</div>";
}
$data["crumb"] = $crumb;
//作者字符串,信息页或者城市天气页加载 2022-7-26
$str_author = "";
$author = $this->Operator_model->get_author_nikename($information->ic_author);
if ((empty($meta_product_code) && !($meta_ct_page_type !== false && $meta_ct_page_type != "")) || $meta_ct_page_type == "weatherpage") {
$OPI_FirstName = !empty($author) ? $author->OPI_FirstName : 'author nickname';
$str_author = '<div class="authorupdate">Written by <strong>' . $OPI_FirstName . '</strong> Updated <span>' . date("M. j, Y", strtotime($information->ic_datetime)) . '</span></div>';
}
/* 详细内容 */
$ic_content = $information->ic_content;
/** 替换H1加面包屑,加作者 */
$ic_content = preg_replace('/<h1>(.*)<\/h1>/i', $crumb . "\r\n" . '<H1>$1</H1>' . "\r\n" . $str_author . "\r\n", $ic_content, 1);
// //图片加延迟
// $ic_content = $this->html_optimize_lib->set_lazy_loader($ic_content, 'https://data.shanghaihighlights.com/image/grey.gif');
// $ic_content = $this->html_optimize_lib->set_image_size($ic_content);
//非产品页面
$data["PRODUCTJS"] = "";
$data["ISPRODUCT"] = "no"; //判断是否是产品页
$data["addthis_widget"] = "";
$data["FloatIcon"] = ""; //浮动图标替代addthis
$arrExitUrl = array("/", "/culture", "/guide", "/tour", "/citytour", "/daytrip", "/asia-tour", "/china-trains");
if (empty(get_meta($information->ic_id, 'meta_product_code')) || in_array($information->ic_url, $arrExitUrl)) {
$data["FloatIcon"] = "<div class=\"fixed-tm\"><a href=\"/forms/customize\" >Create My Trip</a></div>";
} else {
$data["ISPRODUCT"] = "yes";
}
//顶部视频
$data["TOPVIDEO"] = "";
$meta_news_video = get_meta($information->ic_id, 'meta_news_video');
$meta_video_picture = get_meta($information->ic_id, 'meta_video_picture');
if (!empty($meta_news_video) && !empty($meta_video_picture)) {
$data["TOPVIDEO"] = '<div class="banner"><video autoplay="" controls="controls" id="bgvid" poster="' . $meta_video_picture . '" src="' . $meta_news_video . '" style="position: inherit;"> </video></div>';
}
//主样式表,内联模式
//$apiweb="http://202.103.68.104:81"; //本地测试
$apiweb = "https://data.shanghaihighlights.com";
$cssUrl = $apiweb . "/css/css3/base.css?v=" . time();
$main_css_string = compress_css(GET_HTTP($cssUrl));
$data["MAINCSS"] = '<style type="text/css">' . $main_css_string . '</style>';
//额外样式
$data["ADDONCSS"] = "";
$meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
if (!empty($meta_addon_css)) {
//引用方式
//$data["ADDONCSS"]= '<link href="' . $meta_addon_css . '" rel="stylesheet" />';
//内联方式
$meta_addon_css_string = compress_css(GET_HTTP($meta_addon_css));
$data["ADDONCSS"] = '<style type="text/css">' . $meta_addon_css_string . '</style>';
}
//社媒分享图片
$data["OGIMAGE"] = "";
if (!empty($information->ic_photo)) {
if (strpos($information->ic_photo, "shanghaihighlights.com") != false) {
$full_ic_photo = $information->ic_photo;
} else {
$full_ic_photo = $this->config->item('site_image_url') . $information->ic_photo;
}
$data["OGIMAGE"] = '<meta property="og:image" content="' . $full_ic_photo . '"><meta property="og:image:secure_url" content="' . $full_ic_photo . '"><meta property="og:image:width" content="800"><meta property="og:image:height" content="450">';
}
//结构化标签
$data["ConstructionCode"] = "";
$meta_construction_code = get_meta($information->ic_id, 'meta_construction_code');
if (!empty($meta_construction_code)) {
$data["ConstructionCode"] = $meta_construction_code;
}
//总JS为了方便以后js好维护必须的把一些公用的JS统计到一个文件。但是又不是所有页面都需要调用这个基础js所以必须在这里进行判断
$addBaseJs = false;
$addonJs = "";
$meta_ct_page_price = get_meta($information->ic_id, 'meta_ct_page_price'); //是否包含价格
if ($meta_ct_page_price == "yes") {
$addBaseJs = true;
} else if ($meta_ct_page_type !== false && $meta_ct_page_type != "") {
$addBaseJs = true;
}
if ($addBaseJs) {
$addonJs = '<script src="' . $apiweb . '/js/mobile-first/base.js" defer></script>';
}
/// ----- 总JS判断完成-----
//额外js
$data["ADDONJS"] = "";
$meta_addon_js = get_meta($information->ic_id, 'meta_addon_js');
if (!empty($meta_addon_js)) {
$addonJs .= '<script src="' . $meta_addon_js . '" defer></script>';
}
//价格js
if ($meta_ct_page_price == "yes") {
$addonJs .= '<script src="' . $apiweb . '/js/mobile-first/getprice.js" defer></script>';
}
//列表js
if (in_array($meta_ct_page_type, array('daytripindex', 'tourindex', 'attractionindex'))) {
$addonJs .= '<script src="' . $apiweb . '/js/mobile-first/getlist.js" defer></script>';
}
//天气
if (in_array($meta_ct_page_type, array('weatherpage'))) {
$addonJs .= '<script src="' . $apiweb . '/js/mobile-first/getweather.js" defer></script>';
}
//页面传递参数
$passParam = "";
if (in_array($meta_ct_page_type, array("daytripindex", "tourindex", "attractionindex", "weatherpage"))) { //一日游和线路列表
//产品首页
$meta_ct_page_value = get_meta($information->ic_id, 'meta_ct_page_value');
if (in_array($meta_ct_page_type, array("attractionindex"))) {
//旧信息id,景点等信息类
$passParam .= '<input type="hidden" name="param_old_pid" id="param_old_pid" value="' . $meta_ct_page_value . '"/>';
} else {
//城市名称,产品类用
$passParam .= '<input type="hidden" name="param_city" id="param_city" value="' . $meta_ct_page_value . '"/>';
}
//加信息平台的is_id
$passParam .= '<input type="hidden" name="param_parentId" id="param_parentId" value="' . $information->is_id . '"/>';
}
//产品详细页
$productType = "";
$productCode = "";
if ($meta_ct_page_type == "daytripdetail") {
//一日游
if (!empty($meta_ct_page_type)) {
$productType = $meta_ct_page_type;
}
$meta_ct_page_value = get_meta($information->ic_id, 'meta_ct_page_value');
if (!empty($meta_ct_page_value)) {
$productCode = $meta_ct_page_value;
}
$addonJs .= '<script src="' . $apiweb . '/js/mobile-first/daytripdetail.js" defer></script>';
//$addonJs .= '<script src="'.$apiweb.'/js/mobile-first/flatpickr.js"></script>';
$data["ADDONCSS"] .= '<link href="' . $apiweb . '/css/css3/flatpickr.css" rel="preload" as="style" onload="this.rel=\'stylesheet\'" />';
//一日游表单的替换
$DayTripData["productCode"]=$productCode;
$template_form_daydetail = $this->load->view($template_path.'-daydetail-form',$DayTripData,true); //模板内容
//使用simple_html_dom_lib库来进行表单添加
$ic_content = $this->html_optimize_lib->add_htmlcode($ic_content,"#maincontent",$template_form_daydetail);
}
if ($meta_ct_page_type == "tourdetail") {
//线路
$productType = $meta_ct_page_type;
$meta_ct_page_value = get_meta($information->ic_id, 'meta_ct_page_value');
if (!empty($meta_ct_page_value)) {
$productCode = $meta_ct_page_value;
}
//获取cli_sn
$tourdata = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getCliSn/?param=" . $productCode));
$data["clisn"] = $tourdata->clisn;
//调取模板
$dataform["TourCode"] = $productCode;
$dataform["CLI_SN"] = $tourdata->clisn;
$dataform["TourName"] = $information->ic_title;
$template_form_tourqi = $this->load->view($template_path . '-form-tourqi', $dataform, true);
$data["template_form_tourqi"] = $template_form_tourqi; //表单模板字符串
}
//表单页
if (in_array($meta_ct_page_type, array("customize", "contactus", "pagewithform", "tourdetail"))) {
$productType = $meta_ct_page_type;
$addonJs .= '<script src="' . $apiweb . '/js/mobile-first/form.js" defer></script>';
$data["ADDONCSS"] .= '<link href="' . $apiweb . '/css/css3/flatpickr.css" rel="preload" as="style" onload="this.rel=\'stylesheet\'" />';
}
$data["productType"] = $productType;
$data["productCode"] = $productCode;
//页面添加的元素
$data["ADDONJS"] = $addonJs;
$data["passParam"] = $passParam;
//页面详细内容放最后,这样上面都可以进行内容的替换,比如一日游表单
$data["CUSTOMCONENT"] = $ic_content;
#endregion
#region 移动端和PC端差别处理区域
$arrDevice = array("mobile", "pc");
foreach ($arrDevice as $device) {
//顶部全屏大图
$data["TOPBANNER"] = "";
$ImgText = ""; //图文字
$meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url');
$meta_addon_picture_text = get_meta($information->ic_id, 'meta_addon_picture_text');
if ($device == 'mobile') { //移动端读取移动大图
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile');
$bannerImg = '<img class="img-responsive" alt="' . $information->ic_title . '" src="' . $meta_addon_picture . '" width="750" height="500">';
if (!empty($meta_addon_picture_url) && !empty($meta_addon_picture_text)) {
$ImgText = '<div class="carousel-caption"><p class="ads-title"><a href="' . $meta_addon_picture_url . '">' . $meta_addon_picture_text . '</a></p></div>';
} else if (!empty($meta_addon_picture_text)) {
$ImgText = '<div class="carousel-caption"><p class="ads-title">' . $meta_addon_picture_text . '</p></div>';
}
} else {
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture');
$bannerImg = '<img class="img-responsive" alt="' . $information->ic_title . '" src="' . $meta_addon_picture . '" width="1920" height="600">';
if (!empty($meta_addon_picture_url) && !empty($meta_addon_picture_text)) {
$ImgText = '<div class="carousel-caption"><p class="ads-title"><a href="' . $meta_addon_picture_url . '">' . $meta_addon_picture_text . '</a></p></div>';
} else if (!empty($meta_addon_picture_text)) {
$ImgText = '<div class="carousel-caption"><p class="ads-title">' . $meta_addon_picture_text . '</p></div>';
}
}
// 搜索框
$template_TrainSearch = "";
if ($information->ic_url == "/china-trains/hometest" || $information->ic_url == "/china-trains") {
//火车票首页
$template_TrainSearch = $this->load->view($template_path . '-train-index', null, true);
$ImgText = "";
//火车票移动端去掉头部图片保证搜索框CLS
if ($device == 'mobile') {
$meta_addon_picture = "";
$data["TOPBANNER"] = '<div class="banner">' . $template_TrainSearch . '</div>';
}
} else if ($information->ic_url == "/china-flights") {
//机票首页
$template_TrainSearch = $this->load->view($template_path . '-flight-index', null, true);
$ImgText = "";
//飞机票移动端去掉头部图片保证搜索框CLS
if ($device == 'mobile') {
$meta_addon_picture = "";
$data["TOPBANNER"] = '<div class="banner">' . $template_TrainSearch . '</div>';
}
}
if (!empty($meta_addon_picture)) {
if (!empty($meta_addon_picture_url)) {
$data["TOPBANNER"] = '<div class="banner"><a href="' . $meta_addon_picture_url . '">' . $bannerImg . ' </a>' . $ImgText . $template_TrainSearch . '</div>';
} else {
$data["TOPBANNER"] = '<div class="banner">' . $bannerImg . $ImgText . $template_TrainSearch . '</div>';
}
}
//两种设备分别调用两种模板 ,静态化
switch ($device) {
case 'mobile':
//获取移动优先的模板,如果有的话
$template_path = 'mobile_first/' . $this->config->item('site_code');
if (is_file(APPPATH . 'views/' . $template_path . EXT)) {
$template = $this->load->view($template_path, $data, true);
$html_path_ext = '-mobile.htm';
} else {
return false;
}
break;
case 'pc':
//获取PC的模板如果有的话
$template_path = 'mobile_first/' . $this->config->item('site_code');
if (is_file(APPPATH . 'views/' . $template_path . '-pc' . EXT)) {
$template = $this->load->view($template_path . '-pc', $data, true);
$html_path_ext = '-pc.htm';
} else {
return false;
}
break;
default:
}
//生成静态文件
$html_path = $this->config->item('cache')[$this->config->item('site_code')]['cache_path'] . $information->ic_url;
$html_path = str_replace("\\", "/", $html_path);
if (substr($html_path, -1, 1) == '/') {
$html_path = $html_path . 'index.htm';
}
$html_path .= $html_path_ext;
create_folder_by_path(dirname($html_path));
file_put_contents($html_path, $template, LOCK_EX);
}
#endregion
}
//通过内容找到第一张图片
public function set_photo_content($ic_photo, $ic_content)
{

@ -103,7 +103,7 @@ function is_mobile_first()
{
$CI = &get_instance();
$sitecode = $CI->config->item('site_code');
if ($sitecode == 'ch' || $sitecode == 'ah' || $sitecode=='chinatravel' || $sitecode == 'gh') {
if ($sitecode == 'ch' || $sitecode == 'ah' || $sitecode=='chinatravel' || $sitecode == 'gh' || $sitecode=='shanghai') {
return true;
} else {
return false;

@ -136,4 +136,13 @@ class html_optimize_lib
return $html_object->save();
}
///查询html的标签然后后面添加新html
public function add_htmlcode($html,$findTag,$addHtml){
$html_object = str_get_html($html);
$findE = $html_object->find($findTag,0);
$findE->outertext = $findE->outertext . $addHtml ;
return $html_object->save();
$html_object->clear();
}
}

@ -0,0 +1,297 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Api extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('apish_model');
$this->load->library('Currency');
}
var $imageCdn = "//images.shanghaihighlights.com";//有些HT绑定图片需要加cdn
public function index()
{
echo("<1>apish</h1>");
}
/**
* @description: 返回一日游价格
* @param {*} $returntype
* @return {*}
* @Date Changed:
*/
public function getDaytripsPrice(){
if (isset($_GET["param"])){
$param = $_GET["param"];
if (strpos($param,",")!== false){
$pagecode = explode(",",$param)[0];
$personnum=explode(",",$param)[1];
}else{
$pagecode = $param;
$personnum=2;
}
if (isset($_GET["personnum"])){
$personnum=$_GET["personnum"];
}else{
$personnum=2;
}
$result["status"]="ok";
$price = $this->apish_model->getDaytripsPrice($pagecode,$personnum);
$PKP_AdultSpecialPrice = $price->PKP_AdultSpecialPrice;
$PKP_AdultPrice = $price->PKP_AdultPrice;
if ($PKP_AdultPrice!=$PKP_AdultSpecialPrice && $PKP_AdultSpecialPrice>0){
$result["price"] = $this->currency->convert_moneny_by_char($PKP_AdultSpecialPrice,"USD");
}else{
$result["price"] = $this->currency->convert_moneny_by_char($PKP_AdultPrice,"USD");
}
echo json_encode($result);
}else {
$result["status"]="no param";
echo json_encode($result);
}
}
/**
* @description: 获取精华线路价格2人等)
* @param {*}
* @return {*}
* @Date Changed:
*/
public function getTourPrice(){
if (isset($_GET["param"])){
$param = $_GET["param"];
$result["status"]="ok";
$price = $this->apish_model->getTourPrice($param);
$result["pricecn"]=$price;
if (is_numeric($price)){
$price = $this->currency->calc_show_price($price);
}else{
$price = "0";
}
$result["price"] = $price;
echo json_encode($result);
}else{
$result["status"]="no param";
echo json_encode($result);
}
}
/**
* @description: 获取HT及信息平台的一日游列表数据
* @param {*}
* @return {*}
* @Date Changed:
*/
public function getDaytripList(){
//先处理传递过来的参数逗号隔开两个参数的格式城市名称父ID
$whereHT="";
$whereInfo="";
if (isset($_GET["param"])){
$param = str_replace("'","''",$_GET["param"]);
if (strpos($param,",")!== false){
$city = explode(",",$param)[0];
$whereHT = " and (CII2_Name ='".$city."') ";
$parentid = explode(",",$param)[1];
$whereInfo = " and is_parent_id = '".$parentid."'";
}else{
$whereHT = " and (CII2_Name ='".$param."') ";
$whereInfo = " and is_parent_id = -1 ";
}
}
$list = $this->apish_model->getDaytripList($whereHT,$whereInfo);
foreach ($list as $row) {
//获取价格
$price = $this->apish_model->getDaytripsPrice($row->code,2);
if ($price!=null){
$PKP_AdultSpecialPrice = $price->PKP_AdultSpecialPrice;
$PKP_AdultPrice = $price->PKP_AdultPrice;
if ($PKP_AdultPrice!=$PKP_AdultSpecialPrice && $PKP_AdultSpecialPrice>0){
$addPrice = $this->currency->convert_moneny_by_char($PKP_AdultSpecialPrice,"USD");
}else{
$addPrice= $this->currency->convert_moneny_by_char($PKP_AdultPrice,"USD");
}
}else{
$addPrice=0;
}
//URL
if (empty($row->url)){
$str_Url = "/shanghai-day-trips/".strtolower($row->code).".htm";
$row->url = $str_Url; //更新url
}
//图片
if (!empty($row->pic1)){
$picurl = $row->pic1;
}else if(!empty($row->pic2)){
$picurl = $row->pic2;
}else{
$picurl="//data.shanghaihighlights.com/image/loading.gif";
}
$row->price = $addPrice; //新增价格属性
$picurl = $this->apish_model->getPicCdn($picurl).$picurl;
$row->pic =$picurl; //图片地址
}
echo json_encode($list);
}
/**
* @description: 获取新旧网站的子类列表
* @param {*} $old_pid
* @param {*} $new_pid
* @return {*}
* @Date Changed:
*/
public function getGuideList($old_pid = null,$new_pid=null)
{
//处理参数
if (isset($_GET["param"])){
$param = str_replace("'","''",$_GET["param"]);
if (strpos($param,",")!== false){
$new_pid = explode(",",$param)[0];
$old_pid = explode(",",$param)[1];
}else{
$old_pid = -1;
$new_pid = $param;
}
}
if (empty($old_pid) || !is_numeric($old_pid)){
$old_pid = -1 ;
}
if (empty($new_pid)|| !is_numeric($new_pid)){
$new_pid = -1;
}
$list = $this->apish_model->getGuideList($old_pid,$new_pid);
foreach ($list as $row) {
//图片
if (!empty($row->ic_photo)){
$picurl = $row->ic_photo;
}else if (!empty($row->pic1)){
$picurl = $row->pic1;
}else{
$picurl="//data.chinatravel.com/images/no-photos.jpg";
}
// if (strpos($picurl,"chinatravel.com")!== false){
// }else{
// $picurl = $this->imageCdn.$picurl;
// }
$picurl = $this->apish_model->getPicCdn($picurl).$picurl;
$row->pic = $picurl; //显示图片地址
}
echo json_encode($list);
}
/**
* @description: 获取线路sn
* @param {*} $clino
* @return {*}
* @Date Changed:
*/
public function getCliSn(){
//处理参数
if (isset($_GET["param"])){
$param = $_GET["param"];
$result["status"]="ok";
$tour = $this->apish_model->getCliSn($param);
$CLI_SN = $tour->CLI_SN;
if (!empty($CLI_SN)){
$result["clisn"]=$CLI_SN;
}else {
$result["clisn"]=0;
}
}else{
$result["status"]="no param";
$result["clisn"]=0;
}
echo json_encode($result);
}
/**
* @description: 一日游价格表
* @param {*}
* @return {*}
* @Date Changed:
*/
public function getDaytripPriceList(){
if (isset($_GET["param"])){
$param = str_replace("'","''",$_GET["param"]);
$list = $this->apish_model->getDaytripPriceList($param);
if (!empty($list)){
if (count($list)==1){
//echo "1";
foreach ($list as $row) {
$PKP_AdultPrice = $row->PKP_AdultPrice;
$PKP_AdultSpecialPrice = $row->PKP_AdultSpecialPrice;
if ($PKP_AdultPrice!=$PKP_AdultSpecialPrice && $PKP_AdultSpecialPrice>0){
$PKP_AdultPrice=$PKP_AdultSpecialPrice;
}
$PKP_AdultPrice = $this->currency->convert_moneny_by_char($PKP_AdultPrice,"USD");
echo '<table border="0" align="center" cellpadding="10" cellspacing="1" class="pricetable"><tr><th>>1 Person</th></tr><tr><td><strong class="orange"> $'.$PKP_AdultPrice.'</strong></td></tr></table>';
}
}else{
//echo "2";
$str_th="";
$str_td="";
foreach ($list as $row) {
$PKP_AdultPrice = $row->PKP_AdultPrice;
$PKP_AdultSpecialPrice = $row->PKP_AdultSpecialPrice;
if ($PKP_AdultPrice!=$PKP_AdultSpecialPrice && $PKP_AdultSpecialPrice>0){
$PKP_AdultPrice=$PKP_AdultSpecialPrice;
}
$PKP_AdultPrice = $this->currency->convert_moneny_by_char($PKP_AdultPrice,"USD");
$PKP_PersonStart = $row->PKP_PersonStart;
$PKP_PersonStop = $row->PKP_PersonStop;
//'根据数据生成显示内容
if ($PKP_PersonStart == $PKP_PersonStop){
$str_th .= "<th> ".$PKP_PersonStart." Person</th>";
}
else if ($PKP_PersonStop=="1000") {
$str_th .= "<th> >".$PKP_PersonStart." Person</th>";
}
else{
$str_th .= "<th> ".$PKP_PersonStart." - ".$PKP_PersonStop." Person</th>";
}
$str_td .="<td><strong class='orange'> $ ".$PKP_AdultPrice."</strong></td>";
}
echo '<table border="0" align="center" cellpadding="10" cellspacing="1" class="pricetable"><tr>'.$str_th.'</tr><tr>'.$str_td.'</tr></table>';
}
}
}else{
echo "";
}
}
}
/* End of file Api.php */

@ -0,0 +1,444 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Apish_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->HT = $this->load->database('HT', TRUE);
$this->InfoCT = $this->load->database('INFORMATION', TRUE);
}
var $dei_sn = 25; //组别ID
var $CTLGC = 107; //语种
/**
* @description: 根据一日游code获取对应人数的成人价格
* @param {string} $pagecode 线路代码
* @param int $personnum 人数
* @return:
*/
function getDaytripsPrice($pagcode, $personnum)
{
$sql = "select top 1 isnull(PKP_AdultPrice,0) as PKP_AdultPrice,isnull(PKP_AdultSpecialPrice,0) as PKP_AdultSpecialPrice
,PAG_DefaultVEI_SN
from BIZ_PackagePrice
inner join BIZ_PackageInfo on BIZ_PackageInfo.PAG_SN = BIZ_PackagePrice.PKP_PAG_SN
and BIZ_PackagePrice.PKP_VEI_SN = BIZ_PackageInfo.PAG_DefaultVEI_SN
where (BIZ_PackageInfo.PAG_Code = ?) AND (pag_dei_sn= ? )
and ? between PKP_PersonStart and PKP_PersonStop and CONVERT(varchar(12),getdate(),111) between pkp_validdate and pkp_invaliddate
order by isnull( BIZ_PackageInfo.PAG_DefaultVEI_SN,0) desc,PKP_PriceGrade ";
$param = array($pagcode,$this->dei_sn, $personnum);
$query = $this->HT->query($sql, $param);
if ($query->num_rows() > 0) {
return $query->row();
} else {
//'第二种有默认供应商但是没有当前日期价格的时候
$sql = "select top 1 isnull(PKP_AdultPrice,0) as PKP_AdultPrice,isnull(PKP_AdultSpecialPrice,0) as PKP_AdultSpecialPrice
,PAG_DefaultVEI_SN
from BIZ_PackagePrice
inner join BIZ_PackageInfo on BIZ_PackageInfo.PAG_SN = BIZ_PackagePrice.PKP_PAG_SN
and BIZ_PackagePrice.PKP_VEI_SN = BIZ_PackageInfo.PAG_DefaultVEI_SN
where (BIZ_PackageInfo.PAG_Code = ? ) AND (pag_dei_sn= ? )
and ? between PKP_PersonStart and PKP_PersonStop
order by pkp_invaliddate desc,PKP_PriceGrade ";
$query = $this->HT->query($sql, $param);
if ($query->num_rows() > 0) {
return $query->row();
}else{
//'第三种没有默认供应商但是有当前日期价格的时候
$sql = "select top 1 isnull(PKP_AdultPrice,0) as PKP_AdultPrice,isnull(PKP_AdultSpecialPrice,0) as PKP_AdultSpecialPrice
,PAG_DefaultVEI_SN
from BIZ_PackagePrice
inner join BIZ_PackageInfo on BIZ_PackageInfo.PAG_SN = BIZ_PackagePrice.PKP_PAG_SN
where (BIZ_PackageInfo.PAG_Code = ? ) AND (pag_dei_sn= ? )
and ? between PKP_PersonStart and PKP_PersonStop and CONVERT(varchar(12),getdate(),111) between pkp_validdate and pkp_invaliddate
order by isnull( BIZ_PackageInfo.PAG_DefaultVEI_SN,0) desc,PKP_PriceGrade ";
$query = $this->HT->query($sql, $param);
if ($query->num_rows() > 0) {
return $query->row();
}else{
//'第四种无默认供应商无当前日期价格
$sql = "select top 1 isnull(PKP_AdultPrice,0) as PKP_AdultPrice,isnull(PKP_AdultSpecialPrice,0) as PKP_AdultSpecialPrice
,PAG_DefaultVEI_SN
from BIZ_PackagePrice
inner join BIZ_PackageInfo on BIZ_PackageInfo.PAG_SN = BIZ_PackagePrice.PKP_PAG_SN
where (BIZ_PackageInfo.PAG_Code = ? ) AND (pag_dei_sn= ? )
and ? between PKP_PersonStart and PKP_PersonStop
order by pkp_invaliddate desc,PKP_PriceGrade ";
$query = $this->HT->query($sql, $param);
if ($query->num_rows() > 0) {
return $query->row();
}else {
return null;
}
}
}
}
}
/**
* @description: 获取精华线路价格2人等
* @param {*}
* @return {*}
* @Date Changed:
*/
function getTourPrice($cli_no){
$CLI_SN = "";
$reust = "";
//'新的GP没有设置以前的2-5人等价格导致读不出价格。把Gp价格放前面计算
$sql = "select top 1 CLI_SN,CLI_PackageClass from CustomerLineInfo
where CLI_NO=? and CLI_State=1005004
AND (CLI_DEI_SN= ? )";
$query = $this->HT->query($sql,array($cli_no,$this->dei_sn));
if (!$query->num_rows()>0){
return null;
}else{
$row = $query->row();
if (isset($row)){
$CLI_SN = $row->CLI_SN;
}
//'获取线路是否有travelbuddy,也就是有固定的发团日期
$fut_sql = "SELECT count(*) as CountBuddy FROM FixedGroupDate WHERE FGD_CLI_SN='".$CLI_SN."'";
$futQuery = $this->HT->query($fut_sql);
$futrow = $futQuery->row();
$fut_CountBuddy = $futrow->CountBuddy;
if ($fut_CountBuddy>0){
//读取GP价格
$gpSql ="SELECT TOP 1 FGD_AdultPrice,FGD_Departure,
isnull(FGD_ProAdultPrice,0) as FGD_ProAdultPrice
FROM FixedGroupDate
WHERE (FGD_Departure >= GETDATE())
AND (FGD_CLI_SN = ".$CLI_SN.") AND (FGD_State = 1) ORDER BY FGD_AdultPrice";
$gpquery = $this->HT->query($gpSql);
if ($gpquery->num_rows()>0){
$gpRow = $gpquery->row();
$FGD_AdultPrice = $gpRow->FGD_AdultPrice;
$FGD_ProAdultPrice = $gpRow->FGD_ProAdultPrice;
if ($FGD_ProAdultPrice>0){
$reust = $FGD_ProAdultPrice; //促销价
}else{
$reust=$FGD_AdultPrice;
}
}
}else {
//普通线路价格
$sql = "select top 1
CLI_SN,CLP_TwoToFiveAdultPrice,CLI_PackageClass
FROM CustomerLineInfo INNER JOIN
CustomerLinePrice ON CustomerLineInfo.CLI_SN = CustomerLinePrice.CLP_CLI_SN INNER JOIN
CustomerLineInfo2 ON CustomerLineInfo.CLI_SN = CustomerLineInfo2.CLI2_CLI_SN
where CLI_SN= ? and CLI2_LGC=? and (CLP_Area=1 or CLP_Area=2)
and CLI_State = 1005004 ORDER BY CLP_TwoToFiveAdultPrice";
$query = $this->HT->query($sql,array($CLI_SN,$this->CTLGC));
if ($query->num_rows()>0){
$reust = $query->row()->CLP_TwoToFiveAdultPrice;
}
}
}
return $reust;
}
/**
* @description: 一日游列表,包含信息平台和HT
* @param {*} $whereHT HT的查询条件
* @param {*} $whereInfo 信息平台的查询条件
* @return {*}
* @Date Changed:
*/
function getDaytripList($whereHT="",$whereInfo=""){
$sql = "select * from(
select * from(
SELECT p2.PAG2_Name as title
,P1.PAG_Code as code
,'' as url
,isnull(p2.PAG2_ImageURL,'') as pic1
,isnull((select top 1 PAP_ImageURL from BIZ_PackagePic where PAP_PII_SN=p2.PAG2_PII_SN),'') as pic2
,'2' as sortby
FROM dbo.BIZ_PackageInfo P1
INNER JOIN dbo.BIZ_PackageInfo2 p2 ON P1.PAG_SN = p2.PAG2_PAG_SN
INNER JOIN dbo.CItyInfo2 ON P1.PAG_CII_SN = dbo.CItyInfo2.CII2_CII_SN AND dbo.CItyInfo2.CII2_LGC = 1
WHERE 1=2 and (p2.PAG2_LGC = 104)
AND (p1.pag_dei_sn = 25)
AND (p2.PAG2_Check = 2)
AND (PAG_Code not in(
SELECT convert(varchar(100),(
SELECT TOP 1 im_value
FROM information_ct.dbo.infoMetas
WHERE im_key = 'meta_product_code'
AND im_ic_id = ic_id
)) AS code
FROM information_ct.dbo.infoContents
INNER JOIN information_ct.dbo.infoStructures ON ic_id = is_ic_id
WHERE is_sitecode = 'shanghai'".$whereInfo."
AND ic_status = 1
))
AND (isnull(P1.DeleteFlag,0) <>1) ".$whereHT."
) Tmp
UNION ALL
SELECT * from (
select ic_url_title as title
,(select top 1 im_value from information_ct.dbo.infoMetas where im_key='meta_product_code' and im_ic_id=ic_id) as code
,ic_url as url , ic_photo as pic1
,(select top 1 im_value from information_ct.dbo.infoMetas where im_key='meta_addon_picture_mobile' and im_ic_id=ic_id) as pic2
,'1' as sortby
FROM information_ct.dbo.infoContents
inner join information_ct.dbo.infoStructures on ic_id=is_ic_id
WHERE is_sitecode='shanghai' ".$whereInfo."
and ic_status=1
) as t
) tball
where 1=1
ORDER BY tball.sortBy ASC
";
$query = $this->HT->query($sql);
return $query->result();
}
/**
* @description: HT获取一日游列表
* @param {*} $city 一日游城市 ,默认必须有城市,不然太多
* @param {*} $where 其它条件
* @return {*}
* @Date Changed:
*/
function getDaytripListHT($city="beijing",$where=""){
$sql = " select * from(
SELECT p2.PAG2_Name
,p2.PAG2_Intro
,P1.PAG_NeedTime
,P1.PAG_SN
,P1.PAG_Leve
,p2.PAG2_Order
,P1.PAG_Code
,p2.PAG2_Attraction
,CItyInfo2.CII2_Name
,isnull((select top 1 PAP_ImageURL from BIZ_PackagePic where PAP_PII_SN=p2.PAG2_PII_SN),'') as NewListImage
,isnull(p2.PAG2_ImageURL,'') as NewListImage2
,dbo.GetFullPathByPII_SN(p2.PAG2_PII_SN, 2) AS picpath
,p2.PAG2_Title
,p1.PAG_Type
,pag2_summary
FROM dbo.BIZ_PackageInfo P1
INNER JOIN dbo.BIZ_PackageInfo2 p2 ON P1.PAG_SN = p2.PAG2_PAG_SN
INNER JOIN dbo.CItyInfo2 ON P1.PAG_CII_SN = dbo.CItyInfo2.CII2_CII_SN AND dbo.CItyInfo2.CII2_LGC = 1
WHERE (p2.PAG2_LGC = ?)
AND (p1.pag_dei_sn = ?)
AND (p2.PAG2_Check = 2)
AND (isnull(P1.DeleteFlag,0) <>1)
) Tmp
where 1=1 ";
if ($city!=""){
$sql .= " AND (CII2_Name ='".$city."')";
}
// $sql .= "and PAG_Code in ('SHALC-1','SHALC-7')";
$sql .= " order by isnull(pag2_order,0) desc,pag_code ";
// echo ($sql);
$param = array($this->CTLGC,$this->dei_sn);
$query = $this->HT->query($sql,$param);
return $query->result();
}
/**
* @description: 获取子类信息列表
* @param {type} $old_pid$new_pid 父类的Id,分为旧网站的和新网站的
* @return:
* @Date Changed:
*/
function getGuideList($old_pid,$new_pid){
$sql = " select top 1 ic_url from dbo.infoContents
inner join infoStructures on ic_id=is_ic_id
where is_id = ? ";
$query = $this->InfoCT->query ($sql ,array($new_pid));
if ($query->num_rows()>0){
$url = $query->row()->ic_url;
}else{
$url = "";
}
if ($url==""){$url="nourl";}
////原来读取旧信息数据
// SELECT ic_url,ic_url_title,ic_photo
// ,(select top 1 im_value from infoMetas where im_key='meta_addon_picture_mobile' and im_ic_id=ic_id) as pic2
// ,'2' as sortby
// FROM dbo.infoContents
// inner join infoStructures on ic_id=is_ic_id
// WHERE is_sitecode='ct'
// and ic_status=1
// and is_parent_id = ?
$sql = "
select * from (
SELECT ic_url,ic_url_title,ic_photo
,(select top 1 im_value from infoMetas where im_key='meta_addon_picture_mobile' and im_ic_id=ic_id) as pic2
,'2' as sortby , is_sort
FROM dbo.infoContents
inner join infoStructures on ic_id=is_ic_id
WHERE is_sitecode='shanghai'
and ic_status=1
and ic_url like ?
and is_parent_id <> ?
UNION ALL
SELECT ic_url,ic_url_title,ic_photo
,(select top 1 im_value from infoMetas where im_key='meta_addon_picture_mobile' and im_ic_id=ic_id) as pic2
,'1' as sortby ,is_sort
FROM dbo.infoContents
inner join infoStructures on ic_id=is_ic_id
WHERE is_sitecode='shanghai'
and ic_status=1
and is_parent_id = ?
) allbt
order by sortby ,is_sort
";
$qurey = $this->InfoCT->query($sql,array($url."/%",$new_pid,$new_pid));
return $qurey->result();
}
/**
* @description: 获取线路的sn
* @param {*} $clino 线路编码
* @return {*}
* @Date Changed:
*/
function getCliSn($clino=""){
$sql = "select top 1 CLI_SN,CLI_PackageClass from CustomerLineInfo
where CLI_NO=? and CLI_State=1005004
AND (CLI_DEI_SN= ? )";
$query = $this->HT->query($sql,array($clino,$this->dei_sn));
if (!$query->num_rows()>0){
return null;
}else{
return $query->row();
}
}
/**
* @description: 获取一日游价格列表
* @param {*} $pagcode
* @return {*}
* @Date Changed:
*/
function getDaytripPriceList($pagcode){
//1.先根据编码获取SN
$sql = "select top 1 PAG_SN from BIZ_PackageInfo p1
inner join BIZ_PackageInfo2 p2 on p1.PAG_SN = p2.PAG2_PAG_SN
where p1.pag_dei_sn = ?
and p2.PAG2_LGC = ?
and p1.PAG_Code = ?
and p2.PAG2_Check = 2
AND (isnull(P1.DeleteFlag,0) <>1) ";
$query = $this->HT->query($sql,array($this->dei_sn,$this->CTLGC,$pagcode));
if ($query->num_rows()>0){
//2.根据SN获取获取一个供应商的ID不然所有供应商的价格都出来了。
$pagsn = $query->row()->PAG_SN;
$sql = "select top 10 PAG_DefaultVEI_SN,pkp_vei_sn ,*
from BIZ_PackagePrice
left join BIZ_PackageInfo on BIZ_PackageInfo.PAG_DefaultVEI_SN=BIZ_PackagePrice.PKP_VEI_SN
and BIZ_PackageInfo.PAG_SN = BIZ_PackagePrice.PKP_PAG_SN
where PKP_PAG_SN =?
order by isnull( BIZ_PackageInfo.PAG_DefaultVEI_SN,0) desc ,PKP_InvalidDate desc";
$query = $this->HT->query($sql,array($pagsn));
if ($query->num_rows()>0){
$veisn = $query->row()->pkp_vei_sn;
if (!empty($query->row()->PAG_DefaultVEI_SN)){
$veisn = $query->row()->PAG_DefaultVEI_SN;
}
}else{
$veisn=0;
}
//3.根据供应商ID获取对应价格列表
$sql = "SELECT isnull(PKP_AdultPrice, 0) AS PKP_AdultPrice
,isnull(PKP_AdultSpecialPrice, 0) AS PKP_AdultSpecialPrice
,PKP_PersonStart
,PKP_PersonStop
FROM BIZ_PackagePrice
WHERE PKP_PAG_SN = ?
AND PKP_VEI_SN = ?
AND getdate() BETWEEN pkp_validdate AND pkp_invaliddate
and Checked=2
ORDER BY PKP_PersonStart ";
$query = $this->HT->query($sql,array($pagsn,$veisn));
if (!$query->num_rows()>0){
//如果今年没价格,获取去年的价格
$nowYear = date('Y');
for ($i=1;$i<6;$i++){
$price_pyears = $nowYear-$i ."-1-1";
$price_pyears_2 = $nowYear-$i . "-12-31";
$sql = "SELECT isnull(PKP_AdultPrice, 0) AS PKP_AdultPrice
,isnull(PKP_AdultSpecialPrice, 0) AS PKP_AdultSpecialPrice
,PKP_PersonStart
,PKP_PersonStop
FROM BIZ_PackagePrice
WHERE PKP_PAG_SN = ?
AND PKP_VEI_SN = ?
AND pkp_validdate BETWEEN '".$price_pyears."' AND '".$price_pyears_2."' ORDER BY PKP_PersonStart ";
$query = $this->HT->query($sql,array($pagsn,$veisn));
if ($query->num_rows()>0){
break;
}
}
}
if ($query->num_rows()>0){
//4.价格列表返回
return $query->result();
}else {
return null;
}
}else{
return null;
}
}
//根据图片URL判断CDN的地址
function getPicCdn($picurl){
$strCdn ="";
if (strpos($picurl,"shanghaihighlights.com")!== false) {
$strCdn="";
} else if (strpos($picurl,"allpicture")!== false){
$strCdn = "//images.shanghaihighlights.com";
}else if (strpos($picurl,"/album/userupload/")!== false){
$strCdn = "//data.shanghaihighlights.com";
}else if (strpos($picurl,"/image/")!== false) {
$strCdn = "//data.shanghaihighlights.com";
}else{
$strCdn = "//images.shanghaihighlights.com";
}
return $strCdn;
}
}
/* End of file Api_model.php */

@ -841,7 +841,7 @@ if (!empty($setting_website_nav)) {
</div>
</div>
<?php if ($information->ic_sitecode == 'chinatravel') {
<?php if ($information->ic_sitecode == 'chinatravel' || $information->ic_sitecode == 'shanghai' ) {
?>
<div>
<div class="col-sm-8">
@ -2535,7 +2535,7 @@ foreach ($author_list as $author_item) {
<input type="checkbox" name="ignore_url_check" id="ignore_url_check" />忽略URL重复
</label>
<div class="clearfix"></div>
<?php if (in_array($this->config->item('site_code'), array('ch', 'cht', 'gm', 'ah', 'gh', 'ct', 'chinatravel'))) {?>
<?php if (in_array($this->config->item('site_code'), array('ch', 'cht', 'gm', 'ah', 'gh', 'ct', 'chinatravel' ,'shanghai'))) {?>
<label class="checkbox col-xs-24" style="font-weight: normal;margin-top:0;padding-left: 21px;">
<input type="checkbox" name="auto_update_cache_checkbox" id="auto_update_cache_checkbox"
onclick="get_update_cache_url();" value="<?php echo $information->ic_url; ?>" />静态更新

@ -26,7 +26,7 @@
<?php } ?>
</div>
<div class="col-md-16">
<?php if ($this->config->item("site_code")=="chinatravel" ){ ?>
<?php if ($this->config->item("site_code")=="chinatravel" || $this->config->item("site_code")=="shanghai" ){ ?>
<div class="row">
<div class="col-md-24">
<div class="panel panel-default">

@ -161,7 +161,7 @@
<?php if ($productType == "daytripdetail") { // 一日游表单?>
<div class="inquirybutton"><a href="#iqnuirybutton">Inquire This Tour <i class="fa fa-angle-down font20" aria-hidden="true"></i> </a></div>
<a id="iqnuirybutton"></a>
<div class="container-details">
<div class="container-details">
<div class="bookingbox">
<div class="booking">
<div class="bookingtitle">
@ -204,8 +204,8 @@
</form>
</div>
</div>
</div>
<?php } ?>
</div>
<?php } ?>
<?php if ($productType == "tourdetail") { // 线路?>
<div class="inquirybutton"><a href="#iqnuirybutton">Inquire This Tour <i class="fa fa-angle-down font20" aria-hidden="true"></i> </a></div>

@ -0,0 +1,49 @@
<div class="container-right"> <a id="iqnuirybutton"></a>
<div class="rightbook">
<form name="private_form" id="private_form" action="" method="post">
<div class="bookingprice">
<div class="bookPricetit">
<p>from US $ <span class="tourPricebig"> <span class="js_getDayTripPrice" data="<?php echo $productCode ?>"></span> </span>p/p</p>
<p class="priceAddons"> <a href="javascript:;" class="js_PriceDetails">Price details</a></p>
</div>
<div class="bookf">
<p><span>1</span>Select Trave Date</p>
<div class="mleft43">
<input name="Starting_Date" type="text" class="form-control calendar3 hasDatepicker block" id="Starting_Date" value="" placeholder="Starting date" readonly>
</div>
</div>
<div class="bookf">
<p><span>2</span>Number of Travelers</p>
<div class="mleft43">
<select class="form-control" name="AdultsNumber" id="AdultsNumber">
<option value="1">1</option>
<option value="2" selected="selected">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
</select>
</div>
</div>
<div class="bookf">
<div class="mleft43"> <a href="javascript:;" id="js_submitform" class="btn btn-red block" role="button">Book Now</a>
<input name="pag_code" type="hidden" id="pag_code" value="<?php echo $productCode ?>">
</div>
</div>
</div>
</form>
</div>
</div>
<div class="inquirybutton visible-xs visible-sm"><a href="#iqnuirybutton">Inquire This Tour <i class="fa fa-angle-down font20" aria-hidden="true"></i></a></div>

@ -0,0 +1,185 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>test</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta name="apple-mobile-web-app-title" content="China Travel: China Travel Agency Featured in Multiple-Destination Tour Design">
<meta name="keywords" content="China Travel, China Tours, China city day trips, China Trains">
<meta name="description" content="China Travel organizes China trips with multiple destinations. Single city day tours, Yangtze River cruises and China train bookings are also available.">
<!--@OG:IMAGE@-->
<link rel="canonical" href="https://www.shanghaihighlights.com/">
<link rel="shortcut icon" href="/favicon.ico">
<link rel="preconnect" href="//data.shanghaihighlights.com">
<link rel="dns-prefetch" href="//data.shanghaihighlights.com">
<link rel="dns-prefetch" href="//images.shanghaihighlights.com">
<link rel="dns-prefetch" href="//www.googletagmanager.com">
<link rel="dns-prefetch" href="//www.googleadservices.com">
<link rel="dns-prefetch" href="//www.google-analytics.com">
<link rel="dns-prefetch" href="//connect.facebook.net">
<link rel="dns-prefetch" href="//www.facebook.com">
<link rel=preload href='https://data.shanghaihighlights.com/css/css3/fonts/fontawesome-webfont.woff2?v=4.7.0' as=font type='font/woff2' crossorigin />
<link rel=preload href='https://data.shanghaihighlights.com//css/css3/fonts/feather.woff2?1gafuo' as=font type='font/woff2' crossorigin />
<!--@MAIN-CSS@--><?php echo $MAINCSS ?>
<!--@ADDON-CSS@--><?php echo $ADDONCSS ?>
<!--@CONSTRUCTION-CODE@--><?php echo $ConstructionCode ?>
</head>
<body>
<!--header-->
<header id="header">
<div class="container">
<div id="logo"><a href="/"><img src="//data.shanghaihighlights.com/pic/home/logo.png" alt="Shanghaihig Hlights Logo" width="118" height="85" class="img-responsive"></a></div>
<div class="pull-right">
<div class="top-box">
<ul>
<li><a href="/about-us/">About Us</a> | <a href="/contact-us/">Contact Us</a></li>
<li><i class="fa fa-phone" aria-hidden="true"></i><strong>86-773-286-5632</strong> (Intl rates apply)<span class="t-arrow tag hidden"></span></li>
<li><i class="fa fa-envelope-o" aria-hidden="true"></i><a href="mailto:service@chinatravel.com">service@chinatravel.com</a>
</li>
</ul>
</div>
<div class="clear"></div>
</div>
</div>
<nav class="topnav" role="navigation"><div class="container">
<ul id="js_menuBox">
<li><a href="/shanghai-water-town-tours/">Water Town Tours<i class="fa fa-angle-down" aria-hidden="true"></i></a>
<ul>
<span class="container">
<li><a href="/tongli-tour/">Tongli Tours</a></li>
<li><a href="/wuzhen-tour/">Wuzhen Tours</a></li>
<li><a href="/zhouzhuang-tour/">Zhouzhuang Tours</a></li>
<li><a href="/xitang-tour/">Xitang Tours</a></li>
<li><a href="/nanxun-tour/">Nanxun Tours</a></li>
</span>
</ul>
</li>
<li><a href="/shanghai-day-trips/">Shanghai Day Trips<i class="fa fa-angle-down" aria-hidden="true"></i></a>
<ul>
<span class="container">
<li><a href="/shanghai-day-trips/top-day-trips.htm">Top 5 Shanghai Tours</a></li>
<li><a href="/shanghai-day-trips/culture-experience/">Shanghai City Exploration</a></li>
<li><a href="/shanghai-day-trips/layover-tour/">Shanghai Layover</a></li>
<li><a href="/shanghai-theme-tours/">Shanghai theme tours</a></li>
<li><a href="/shanghai-day-trips/transfer-service.htm">Shanghai Transport</a></li>
</span>
</ul>
</li>
<li><a href="/shanghai-tours/">Shanghai Tours<i class="fa fa-angle-down" aria-hidden="true"></i></a>
<ul>
<span class="container">
<li><a href="/shanghai-tours/top-shanghai-tours.htm">Top Shanghai Tours</a></li>
<li><a href=" /shanghai-city-packages/">Shanghai City Packages</a></li>
<li><a href="/shanghai-china-tours/">Shanghai China Tours</a></li>
<li><a href="/shanghai-tours/visa-free-travel.htm">Visa Free Travel</a></li>
</span>
</ul>
</li>
<li><a href="/shanghai-side-trips/">Side Trips<i class="fa fa-angle-down" aria-hidden="true"></i></a>
<ul>
<span class="container">
<li><a href="/suzhou-tour/">Suzhou Tours</a></li>
<li><a href="/hangzhou-tour/">Hangzhou Tours</a></li>
<li><a href="/huangshan-tour/">Huangshan Tours</a></li>
<li><a href="/huangshan-tour/">Beijing Tours</a></li>
<li><a href="/zhangjiajie-tour/">Zhangjiajie Tours</a></li>
</span>
</ul>
</li>
<li><a href="/shanghai-travel-guide/">Shanghai Guide<i class="fa fa-angle-down" aria-hidden="true"></i></a>
<ul>
<span class="container">
<li><a href="/essential/">Shanghai Facts</a></li>
<li><a href="/shanghai-travel-guide/shanghai-sightseeing/">Shanghai Attraction</a></li>
<li><a href="/shanghai-weather/">Shanghai Weather</a></li>
<li><a href="/travel-articles/">Shanghai Travel Articles</a></li>
<li><a href="/neighbours/">Shanghai Neighbors Guide</a></li>
</span>
</ul>
</li>
<li><a href="/shanghai-train-schedule/">Trains<i class="fa fa-angle-down" aria-hidden="true"></i></a>
<ul>
<span class="container">
<li><a href="/shanghai-train-schedule/shanghai-to-beijing-high-speed-trains/">Beijing Shanghai High-speed Train</a></li>
<li><a href="/shanghai-train-schedule/shanghai-hangzhou-intercity-high-speed-railway.htm">Shanghai Hangzhou Train</a></li>
<li><a href="/shanghai-train-schedule/china-train-types.htm">Shanghai Train Types</a></li>
<li><a href="/shanghai-train-schedule/train-ticket-types.htm">China Train Classes</a></li>
<li><a href="/shanghai-train-schedule/buy-ticket.htm">How to buy Train Tickets</a></li>
</span>
</ul>
</li>
<li><a href="/forms/customize.html">Create My Trip</a></li>
</ul></div>
</nav>
</header>
<!--header end-->
<!--@TOP-BANNER@--><?php if (isset($TOPBANNER)){ echo $TOPBANNER; } ?>
<!--@TOP-VIDEO@--><?php if (isset($TOPVIDEO)) {echo $TOPVIDEO;} ?>
<!--banner end-->
<main id="main">
<?php echo $CUSTOMCONENT ?>
</main>
<!---main end---->
<?php echo $FloatIcon ?>
<!--footer star-->
<footer id="footer">
<div class="container">
<div class="flex-row">
<div class="footer-left vw-width">
<div class="footer-title">Shanghai Highlights</div>
<p>Shanghai Highlights is the leading online Shanghai tour operator, offering one-stop Shanghai travel service and tours. <a href="/about-us/">More...</a></p>
<p><i class="fa fa-map-marker"></i>No.70, Qilidian Road, Guilin, Guangxi, P. R. China</p>
<p><i class="fa fa-phone" aria-hidden="true"></i>86-773-286-5632 (Intl rates apply)</p>
<p class="fl-logo"><img src="//data.shanghaihighlights.com/image/icon/pata-f.jpg" alt="pata" width="80" height="33"><img src="//data.shanghaihighlights.com/image/icon/paypal-f.jpg" alt="paypal" width="80" height="33"></p>
</div>
<div class="footer-right vw-width">
<div class="footer-list footer-about">
<p class="pr-title">ABOUT US</p>
<ul>
<li><a rel="nofollow" href="/contact-us/">Contact Us</a></li>
<li><a rel="nofollow" href="/about-us/">About Us</a></li>
<li><a rel="nofollow" href="/about-us/terms.html">Terms and Conditions</a></li>
<li><a rel="nofollow" href="/about-us/why-us.html">Why Us</a></li>
<li><a rel="nofollow" href="/about-us/volunteer.htm">Work for us</a></li>
</ul>
</div>
<div class="footer-list text-center">
<p class="pr-title">WHAT OUR CUSTOMERS<br>
ARE SAYING</p>
<p><a href="https://www.tripadvisor.com/Attraction_Review-g308272-d7106234-Reviews-China_Travel_Shanghai-Shanghai.html"><img src="//data.shanghaihighlights.com/image/icon/footer-ta.png" alt="Tripadvisor" width="129" height="93"></a></p>
</div></div>
</div>
</div>
<div class="footer-bottom">
<p>Copyright © 1998 - 2023. All Rights Reserved to Shanghai Highlights</p>
</div>
</footer>
<!--footer end-->
<script>
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('8.R=10;(4(){3 h=b 26();4 11(X){8.R=X&&X.1I===\'1b\'?h.1V==1:10;1c()}h.1T=11;h.1Z=11;h.S=\'1M:1R/1x;1F,1Q/1P=\'})();5(!c.g){c.g=(4(){3 1u=y.M.1S;3 P=4(l){6 I l==="4"||1u.Q(l)==="[19 1L]"};3 1j=4(D){3 f=1O(D);5(1N(f)){6 0}5(f===0||!1Y(f)){6 f}6(f>0?1:-1)*o.1X(o.20(f))};3 1y=o.1U(2,1W)-1;3 1a=4(D){3 9=1j(D);6 o.1G(o.1H(9,0),1y)};6 4 g(J){3 C=E;3 U=y(J);5(J==p){F b H("c.g 1K 1J 1E-1D 19 - V p 1k B")}3 n=j.m>1?j[1]:2o B;3 T;5(I n!=="B"){5(!P(n)){F b H("c.g: 2q 2j, 2i 2k 2l 2m 2n a 4")}5(j.m>2){T=j[2]}}3 9=1a(U.m);3 A=P(C)?y(b C(9)):b c(9);3 k=0;3 d;1l(k<9){d=U[k];5(n){A[k]=I T==="B"?n(d,k):n.Q(T,d,k)}z{A[k]=d}k+=1}A.m=9;6 A}}())}5(!c.M.v){c.M.v=4(u){3 T,k;5(E==p){F b H("E 1i p 1k V 2p")}3 O=y(E);3 9=O.m>>>0;5(I u!=="4"){F b H(u+" 1i V a 4")}5(j.m>1){T=j[1]}k=0;1l(k<9){3 d;5(k 13 O){d=O[k];u.Q(T,d,k,O)}k++}}}4 1c(2h){3 14=4(i){i.W("1b",4(){i.r.q=1});5(8.R){i.1z("S",i.1B("1A").25(\'.28\',\'.1x\'))}z{i.1z("S",i.1B("1A"))}};3 1p=c.g(e.1q("h[1C=27]"));1p.v(4(7,Y){7.r.q=0;7.r.1w="q 0.18 1e-13-1m";14(7)});3 w=1o();w();4 12(l,1s,1v){3 N=p,L=b 1r();6 4(){3 K=b 1r();22(N);5(K-L>=1v){l();L=K}z{N=21(l,1s)}}}4 1h(1n){3 16=1n.24();6{15:16.15+8.23-e.t.2e,1t:16.1t+8.2d-e.t.2g}}4 1o(){3 G=c.g(e.1q("h[1C=2f]"));G.v(4(7,Y){7.r.q=0;7.r.1w="q 0.18 1e-13-1m"});6 4(){3 1g=8.2a;3 x=(e.t&&e.t.x)||(e.1d&&e.1d.x);G=G.29(4(7,Y){3 1f=1h(7).15;3 Z=1f<1g+x;5(Z){14(7)}6!Z})}}5(8.W){8.W("2c",12(w,s,s),10)}z{5(8.17){8.17("2b",12(w,s,s))}}};',62,151,'|||var|function|if|return|element|window|len||new|Array|kValue|document|number|from|img|target|arguments||fn|length|mapFn|Math|null|opacity|style|500|documentElement|callback|forEach|lazyloader|scrollTop|Object|else||undefined||value|this|throw|lazyImageList|TypeError|typeof|arrayLike|curTime|startTime|prototype|timeout||isCallable|call|isSupportWebp|src||items|not|addEventListener|event|index|hasVisible|false|getResult|throttle|in|loadImageByUrl|top|box|attachEvent|5s|object|toLength|load|createImageLoader|body|ease|offsetTop|seeHeight|getOffset|is|toInteger|or|while|out|el|createLazyloader|imageList|querySelectorAll|Date|delay|left|toStr|atleast|transition|webp|maxSafeInteger|setAttribute|originalsrc|getAttribute|loader|like|array|base64|min|max|type|an|requires|Function|data|isNaN|Number|vuUAAA|UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA|image|toString|onerror|pow|width|53|floor|isFinite|onload|abs|setTimeout|clearTimeout|pageYOffset|getBoundingClientRect|replace|Image|ready|jpg|filter|innerHeight|onscroll|scroll|pageXOffset|clientTop|lazy|clientLeft|settings|the|provided|second|argument|must|be|void|defined|when'.split('|'),0,{}))
function loadScriptByAsync(src) {var asyncScript = document.createElement("script");asyncScript.async = true;asyncScript.crossorigin = "anonymous";asyncScript.src = src;firstScript=document.getElementsByTagName("script")[0];firstScript.parentNode.insertBefore(asyncScript, firstScript);}
</script>
<!--@PRODUCT-JS@--> <?php echo $PRODUCTJS ?>
<!--@ADDON-JS@--> <?php echo $ADDONJS ?>
<!-- Google -->
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-NRQ3FJR');</script>
<!-- End Google Tag Manager -->
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NRQ3FJR"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<!-- End Google -->
<!--@IN-ARTICLE-GOOGLE@-->
<!--@ADDTHIS-WIDGET@--><?php echo $addthis_widget ?>
<!--@PASSPARAM@--><?php echo $passParam ?>
</body>
</html>

File diff suppressed because one or more lines are too long

@ -82,6 +82,8 @@
break;
case 'trippest':
$media_site_code = 'trippest';
case 'shanghai':
$media_site_code = 'shanghai';
break;
default:
$media_site_code = 'ch';

@ -104,6 +104,9 @@ switch ($sitecode) {
case 'chinatravel':
$site_url = 'https://data.chinatravel.com';
break;
case 'shanghai':
$site_url = 'https://data.shanghaihighlights.com';
break;
default:
$site_url = '';
}

Loading…
Cancel
Save