merge master

feature/trippest
lyt 7 years ago
commit 699f66b9ba

2
.gitignore vendored

@ -1,3 +1,4 @@
.idea
.svn/*
*/logs/log*
/web.config
@ -6,3 +7,4 @@
*/cache/*
*/statement_files/*
*/paypal_activities/*
/author/document/*

@ -7,6 +7,7 @@ staging:
production:
script:
- curl -sSf http://cht.mycht.cn/please_dont_delete_this_file_4a4f500ae61d9e44b931d9f72fb14aaf95517b7e.php?branch=master
- curl -sSf https://www.arachina.com/pull-from-origin-by-icht.php?branch=info
only:
- master
- /^deploy-.*$/

@ -382,6 +382,8 @@ $config['site'] = array(
'mct' => array('site_code' => 'mct', 'site_id' => 6, 'site_lgc' => '101', 'site_image_url' => '', 'site_url' => 'https://www.mychinatours.com', 'site_authors' => array('cj')),
'diy' => array('site_code' => 'diy', 'site_id' => 99, 'site_lgc' => '1', 'sitemap_name' => 'E:/Dropbox/wwwroot/diychinatours.com/information.sitemap.xml', 'site_image_url' => '//images.diychinatours.com', 'site_url' => 'http://www.diychinatours.com', 'site_sitemap' => 'E:/Dropbox/wwwroot/diychinatours.com/information.sitemap.xml', 'site_authors' => array('ycc,lyy')),
'ah' => array('site_code' => 'ah', 'site_id' => 141, 'site_lgc' => '1', 'sitemap_name' => '', 'site_image_url' => '//images.asiahighlights.com', 'site_url' => 'https://www.asiahighlights.com', 'site_sitemap' => '', 'site_authors' => array('X', 'sfx'), 'site_user' => array(',ycc,sfx,X,')),
'pgr' => array('site_code' => 'pgr', 'site_id' => 148, 'site_lgc' => '2', 'sitemap_name' => '', 'site_image_url' => '', 'site_url' => 'http://www.peregrine.cn', 'site_sitemap' => '', 'site_authors' => array('X', 'sfx'), 'site_user' => array(',ycc,sfx,X,')),
'ts' => array('site_code' => 'ts', 'site_id' => 149, 'site_lgc' => '1', 'sitemap_name' => '', 'site_image_url' => '', 'site_url' => 'http://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' => 'http://www.beijinghighlights.com', 'site_authors' => array('cj'))
);
@ -561,42 +563,6 @@ $config['InfoType_citizen'] = array(
'产品' => 'product'
);
//可选模板
$config['templates'] = array(
'通用内容模板' => 'guide_info_detail',
'城市-列表模板' => 'city_info_list',
'城市-首页模板' => 'city_info_index',
'城市-首页模板[简]' => 'city_info_s_index',
'城市-景点列表模板' => 'city_info_attractions_list',
'城市-景点列表模板[简]' => 'city_info_s_attractions_list',
'城市-景点详细模板' => 'city_attractions',
'城市-特色产品模板' => 'city_info_diytour',
'城市-一线城市首页' => 'city_info_index_one',
'省份-首页' => "area_info_index",
'省份-列表模板' => 'area_info_list',
'省份-通用内容模板' => 'area_info_detail',
'文化模板 [列表式]' => "culture_info_detail_just_list",
'文化模板 [单页式]' => 'culture_info_detail_one_page',
'文化模板 [导航式]' => 'culture_info_detail_with_category',
'信息专题模板' => 'guide_top_series',
'火车专题模板' => 'train_top_series',
'旅游攻略' => 'travel_story',
'节庆-详细模板' => 'festival_detail',
'节庆-列表模板' => 'festival_list',
'大使馆-详细页' => 'embassy_info_detail',
'城市-线路详细' => 'city_circuit',
'专题模板(大)' => 'guide_big_series',
'[国际站]响应式-空白模板' => 'r_tpl_empty',
'[国际站]响应式-专题首页' => 'r_tpl_empty_navi0',
'[国际站]响应式-专题列表页' => 'r_tpl_empty_navi1',
'[国际站]响应式-专题列表页+' => 'r_tpl_empty_navi1p',
'[国际站]响应式-专题详细页' => 'r_tpl_empty_navi2',
'[-------已废弃-------]空白模板' => 'tpl_empty',
'[-------已废弃-------]专题-温暖' => 'warm',
'[-------已废弃-------]专题-庄重' => 'solemn',
'[-------已废弃-------]专题-节庆' => 'festival',
'[-------已废弃-------]专题-线路促销' => 'promotion_tour'
);
//可选模板
$config['templates_i'] = array(
@ -605,7 +571,8 @@ $config['templates_i'] = array(
'[城市]C首页模板' => 'city_info_index',
'[城市]C景点列表模板' => 'city_info_attractions_list',
'[城市]C景点详细模板' => 'city_attractions',
'[专题]T0空白模板' => 'r_tpl_empty',
'[专题]T0空白' => 'r_tpl_empty',
'[专题]T0空白带框架' => 'r_empty2',
'----------二级目录----------' => '------2------',
'[专题]T2首页' => 'r_t2_index',
'[专题]T2详细' => 'r_t2_detail',
@ -649,6 +616,7 @@ $config['area_type'] = array(
'大使馆' => 'y',
'公民游' => 'z',
'交换链接' => 'k',
'首页' => 'h',
'FAQ' => 'q'
);
@ -903,6 +871,7 @@ $config['templates'] = array(
'通用内容模板' => 'guide_info_detail',
'城市-列表模板' => 'city_info_list',
'城市-首页模板' => 'city_info_index',
'城市-首页模板(GM)' => 'city_info_index_new',
'城市-首页模板[简]' => 'city_info_s_index',
'城市-景点列表模板' => 'city_info_attractions_list',
'城市-景点列表模板[简]' => 'city_info_s_attractions_list',
@ -938,6 +907,55 @@ $config['templates'] = array(
'food列表' => 'food_list'
);
//德语信息模板
$config['templates_gm'] = array(
'通用内容模板' => 'guide_info_detail',
'城市-列表模板' => 'city_info_list',
'城市-首页模板' => 'city_info_index',
'城市-首页模板(GM)' => 'city_info_index_new',
'城市-首页模板[简]' => 'city_info_s_index',
'城市-景点列表模板' => 'city_info_attractions_list',
'城市-景点列表模板[简]' => 'city_info_s_attractions_list',
'城市-特色产品模板' => 'city_info_diytour',
'城市-一线城市首页' => 'city_info_index_one',
'省份-首页' => "area_info_index",
'文化模板 [列表式]' => "culture_info_detail_just_list",
'文化模板 [单页式]' => 'culture_info_detail_one_page',
'文化模板 [导航式]' => 'culture_info_detail_with_category',
'信息专题模板' => 'guide_top_series',
'空白模板'=>'none'
);
// CHT 信息模板
$config['templates_cht'] = array(
'通用内容模板' => 'guide_info_detail',
'城市-列表模板' => 'city_info_list',
'城市-首页模板' => 'city_info_index',
'城市-首页模板[简]' => 'city_info_s_index',
'城市-景点列表模板' => 'city_info_attractions_list',
'城市-景点列表模板[简]' => 'city_info_s_attractions_list',
'城市-特色产品模板' => 'city_info_diytour',
'城市-一线城市首页' => 'city_info_index_one',
'省份-首页' => "area_info_index",
'省份-列表模板' => 'area_info_list',
'省份-通用内容模板' => 'area_info_detail',
'文化模板 [列表式]' => "culture_info_detail_just_list",
'文化模板 [单页式]' => 'culture_info_detail_one_page',
'文化模板 [导航式]' => 'culture_info_detail_with_category',
'信息专题模板' => 'guide_top_series',
'火车专题模板' => 'train_top_series',
'旅游攻略' => 'travel_story',
'节庆-详细模板' => 'festival_detail',
'节庆-列表模板' => 'festival_list',
'大使馆-详细页' => 'embassy_info_detail',
'城市-线路详细' => 'city_circuit',
'专题模板(大)' => 'guide_big_series',
'三峡游船' => 'yangtze',
'城市article列表' => 'city_article_list',
'food列表' => 'food_list',
'FAQ模板' => 'faq_detail'
);
//产品管理板块模板
$config['templates_product'] = array(
'空白模板' => 'none',
@ -956,6 +974,16 @@ $config['templates_ah'] = array(
'静态页面' => 'static'
);
// 出境游网站模板
$config['templates_pgr'] = array(
'空白模板' => 'guide_info_detail'
,'导航模板' => 'culture_info_detail_with_category'
);
// 国际火车网站模板
$config['templates_ts'] = array(
'空白模板' => 'guide_info_detail'
,'信息导航模板' => 'train_series_with_category'
);
//翰特产品类型,Information控制器的get_products函数有直接调用在这里增加了信息需要去控制器写相关操作代码
$config['ProductType_HT'] = array(

@ -0,0 +1,35 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Amp extends CI_Controller {
function __construct() {
parent::__construct();
$this->permission->is_admin();
//$this->output->enable_profiler(TRUE);
$this->load->model('Information_model');
$this->load->model('InfoMetas_model');
$this->load->library('Amplib');
}
public function index() {
$data = array();
$this->load->view('bootstrap3/header', $data);
$this->load->view('bootstrap3/footer');
}
public function edit($ic_id) {
$this->amplib->edit($ic_id);
}
public function auto_create($ic_id) {
echo $this->amplib->auto_create($ic_id);
}
public function edit_save() {
echo $this->amplib->edit_save();
}
}

@ -138,16 +138,16 @@ class Cache extends CI_Controller
$mydir = dir($dir);
while($f = $mydir->read())
{
if(is_dir("$dir/$f") && $f!="." && $f!=".." && (strpos($dir, '/cn/')==false))
if(is_dir("$dir/$f") && $f!="." && $f!=".." && (strpos($dir, '/cn/')===false) && (strpos($dir, '/amp/')===false))
{
$path[] = "$dir/$f";
$this->tree("$dir/$f", $file, $path, $file_time);
}
else
{
if ($f!='.' && $f!='..' && (strpos($dir, '/cn/')==false) && (strpos($f, '.pdf')===false))
if ($f!='.' && $f!='..' && (strpos($dir, '/cn/')===false) && (strpos($dir, '/amp/')===false) && (strpos($f, '.pdf')===false))
{
$file_temp = str_ireplace('index.htm###', '', $f.'###');
$file_temp = str_ireplace('/index.htm###', '', $f.'###');
$file_temp = str_ireplace('###', '', $file_temp);
$path_temp = str_ireplace($this->dir, '', $dir);
$url_temp = $this->current_domain.$path_temp.'/'.$file_temp;

@ -0,0 +1,42 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Home extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->permission->is_admin();
//$this->output->enable_profiler(TRUE);
$this->load->model('Area_model');
$this->load->model('Information_model');
$this->load->model('InfoContents_model');
$this->load->model('InfoStructures_model');
}
//站点首页
public function index()
{
$home_id=1;
//查询结构根节点,当为空则建立
$rootStructure = $this->Information_model->GetRoot('h', $home_id);
if ($rootStructure == FALSE)
{
$this->InfoContents_model->Add('', 'HomePage', 'root', '', '', '', '', '', '', 0, 0, '', '', 0, 0, '', '', $home_id, 'h', 0,
'','');
$this->InfoStructures_model->Add(0, $this->InfoContents_model->insert_id);
$is_id = $this->InfoStructures_model->insert_id;
}
else
{
$is_id = $rootStructure->is_id;
}
redirect(site_url('information/edit/' . $is_id));
}
}

@ -0,0 +1,309 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Info_amp extends CI_Controller
{
function __construct()
{
parent::__construct();
//$this->permission->is_admin();
$this->load->model('InfoMetas_model');
$this->load->model('InfoContents_model');
$this->load->model('Information_model');
$this->site_code = $this->config->item('site_code');
//CORS TEST
header('Access-Control-Allow-Origin:*');
}
public function save_amp()
{
$icid = $this->input->get_post('icid');
$json = $this->input->get_post('json');
$html = $this->input->get_post('html');
$css = $this->input->get_post('css');
$schema = $this->input->get_post('schema');
$script = $this->input->get_post('script');
$status = $this->input->get_post('status');
if ($icid && $json && $html) {
try {
//html
$meta = $this->InfoMetas_model->get($icid, 'AMP_BODY');
if ($meta === false) {
$this->InfoMetas_model->add($icid, 'AMP_BODY', $html);
} else {
$this->InfoMetas_model->update($icid, 'AMP_BODY', $html);
}
//json
$meta = $this->InfoMetas_model->get($icid, 'AMP_JSON');
if ($meta === false) {
$this->InfoMetas_model->add($icid, 'AMP_JSON', $json);
} else {
$this->InfoMetas_model->update($icid, 'AMP_JSON', $json);
}
//css
$meta = $this->InfoMetas_model->get($icid, 'AMP_CSS');
if ($meta === false) {
$this->InfoMetas_model->add($icid, 'AMP_CSS', $css);
} else {
$this->InfoMetas_model->update($icid, 'AMP_CSS', $css);
}
//script
$meta = $this->InfoMetas_model->get($icid, 'AMP_SCRIPT');
if ($meta === false) {
$this->InfoMetas_model->add($icid, 'AMP_SCRIPT', $script);
} else {
$this->InfoMetas_model->update($icid, 'AMP_SCRIPT', $script);
}
//schema
$meta = $this->InfoMetas_model->get($icid, 'AMP_SCHEMA');
if ($meta === false) {
$this->InfoMetas_model->add($icid, 'AMP_SCHEMA', $schema);
} else {
$this->InfoMetas_model->update($icid, 'AMP_SCHEMA', $schema);
}
//status
$meta = $this->InfoMetas_model->get($icid, 'AMP_STATUS');
if ($meta === false) {
$this->InfoMetas_model->add($icid, 'AMP_STATUS', $status);
} else {
$this->InfoMetas_model->update($icid, 'AMP_STATUS', $status);
}
echo json_encode(array(
"succ" => true
));
} catch(Exception $e) {
echo json_encode(array(
"succ" => false,
"message" => "save_amp() -> ".$e->getMessage()
));
}
} else {
echo json_encode(array(
"succ" => false,
"message" => "save_amp() -> 参数传递错误。"
));
}
}
public function load_amp()
{
$icid = $this->input->get_post('icid');
if (!$icid) {
echo json_encode(array(
"succ" => false,
"message" => "load_amp() -> 参数传递错误。"
));
return false;
}
//信息~返回信息
$ic = $this->InfoContents_model->get_ic_contents2($icid);
if (empty($ic)) {
echo json_encode(array(
"succ" => false,
"message" => "load_amp() -> 无信息"
));
return false;
}
switch (strtolower($ic->ic_sitecode)) {
case 'vac':
$site = 'https://www.viaje-a-china.com';
break;
case 'vc':
$site = 'https://www.voyageschine.com';
break;
case 'jp':
$site = 'https://www.arachina.com';
break;
case 'ru':
$site = 'https://www.chinahighlights.ru';
break;
case 'it':
$site = 'https://www.viaggio-in-cina.it';
break;
case 'cht':
$site = 'https://www.chinahighlights.com';
break;
case 'gm':
$site = 'https://www.chinarundreisen.com/';
break;
default:
$site = '';
break;
}
$json = $this->InfoMetas_model->get($icid, 'AMP_JSON');
$status = $this->InfoMetas_model->get($icid, 'AMP_STATUS');
$schema = $this->InfoMetas_model->get($icid, 'AMP_SCHEMA');
if ($json) {
echo json_encode(array(
"succ" => true,
"icid" => $icid,
"icurl" => $site.$ic->ic_url,
"json" => $json,
"schema" => $schema,
"status" => $status
));
} else {
echo json_encode(array(
"succ" => false,
"message" => "load_amp() -> 无数据返回。"
));
}
}
public function list_amp()
{
$site = $this->input->get_post('site');
switch ($site) {
case 'https://www.viaje-a-china.com':
$site_code = 'vac';
break;
case 'https://www.voyageschine.com':
$site_code = 'vc';
break;
case 'https://www.arachina.com':
$site_code = 'jp';
break;
case 'https://www.chinahighlights.ru':
$site_code = 'ru';
break;
case 'https://www.viaggio-in-cina.it':
$site_code = 'it';
break;
case 'https://www.chinahighlights.com':
$site_code = 'cht';
break;
case 'https://www.chinarundreisen.com/':
$site_code = 'gm';
break;
default:
$site_code = false;
break;
}
if (!$site_code) {
echo json_encode(array(
"succ" => false,
"message" => "list_amp() -> 参数传递错误。"
));
return false;
}
$rs = $this->InfoMetas_model->list_amp($site_code);
if (!empty($rs)) {
echo json_encode($rs);
} else {
echo json_encode(array(
"succ" => false,
"message" => "load_amp() -> 无数据返回。"
));
}
}
public function list_info_children()
{
$site = $this->input->get_post('site');
switch ($site) {
case 'https://www.viaje-a-china.com':
$site_code = 'vac';
break;
case 'https://www.voyageschine.com':
$site_code = 'vc';
break;
case 'https://www.arachina.com':
$site_code = 'jp';
break;
case 'https://www.chinahighlights.ru':
$site_code = 'ru';
break;
case 'https://www.viaggio-in-cina.it':
$site_code = 'it';
break;
case 'https://www.chinahighlights.com':
$site_code = 'cht';
break;
case 'https://www.chinarundreisen.com/':
$site_code = 'gm';
break;
default:
$site_code = false;
break;
}
$is_path = $this->input->get_post('is_path'); // '25693,278002094,'
if (!$site_code || !$is_path) {
echo json_encode(array(
'succ' => false,
'message' => 'list_info_children() -> 参数传递错误。'
));
return false;
}
$rs = $this->InfoMetas_model->list_info_by_path_with_meta($is_path, $site_code);
if (!empty($rs)) {
$newrs = array();
foreach ($rs as $info) {
$show_photo_meta = $this->InfoMetas_model->get($info->ic_id, 'meta_use_list_picture');
if ($show_photo_meta == 'no') {
$use_photo = '';
} else {
$use_photo = $this->config->item('site_image_url').$info->ic_photo;
}
if ($info->ic_type === 'c_attraction' || $info->ic_template === 'city_info_attractions_list' || $info->ic_template === 'r_tpl_empty_navi1p') {
$list_info = true;
} else {
$list_info = false;
}
if ($list_info || !empty($info->ic_content) && !empty($info->ic_url) && stripos($info->ic_url, '/test/')===false) {
array_push($newrs, array(
'is_path' => $info->is_path,
'ic_url' => $info->ic_url,
'ic_id' => $info->ic_id,
'title' => $info->ic_title,
'photo' => $use_photo,
'im_id' => $info->im_id
));
}
}
echo json_encode($newrs);
} else {
echo json_encode(array(
"succ" => false,
"message" => "list_info_children() -> 无数据返回。"
));
}
}
public function load_info()
{
$icid = $this->input->get_post('icid');
if ($icid) {
$ic = $this->InfoContents_model->get_ic_contents2($icid);
if ($ic) {
$show_photo_meta = $this->InfoMetas_model->get($icid, 'meta_use_list_picture');
if ($show_photo_meta == 'no') {
$use_photo = '';
} else {
$use_photo = $this->config->item('site_image_url').$ic->ic_photo;
}
echo json_encode(array(
"succ" => true,
"info" => $ic->ic_content ? $ic->ic_content : "<p>".$ic->ic_seo_description."</p>",
"title" => $ic->ic_title,
"photo" => $use_photo,
"url" => $ic->ic_url,
"site" => $this->config->item('site_url')
));
} else {
echo json_encode(array(
"succ" => false,
"message" => "load_info() -> 无数据返回。"
));
}
} else {
echo json_encode(array(
"succ" => false,
"message" => "load_info() -> 参数传递错误。"
));
}
}
}

@ -0,0 +1,144 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Info_tags extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->permission->is_admin();
//$this->output->enable_profiler(TRUE);
$this->load->model('Information_model');
$this->load->model('InfoTags_model');
}
/**
* 添加标签
*/
public function add_tag()
{
$this->InfoTags_model->it_title = $this->input->get_post('title');
$this->InfoTags_model->it_memo = $this->input->get_post('memo');
$return = $this->InfoTags_model->add_tag();
if ($return)
{
echo(json_encode(array(
'status' => 1,
'message' => $return
)));
}
else
{
echo(json_encode(array(
'status' => -1,
'message' => '添加标签失败'
)));
}
}
/**
* 删除标签
*/
public function remove_tag()
{
$this->InfoTags_model->it_title = $this->input->get_post('title');
$return = $this->InfoTags_model->remove_tag();
if ($return == 'success')
{
echo(json_encode(array(
'status' => 1,
'message' => '删除标签成功'
)));
}
else
{
echo(json_encode(array(
'status' => -1,
'message' => '删除标签失败'
)));
}
}
/**
* 展示标签
*/
public function list_tag($ic_id = '')
{
$ic_id ? $this->InfoTags_model->ic_id = $ic_id : $this->InfoTags_model->ic_id = $this->input->post('ic_id');
$return = $this->InfoTags_model->list_tag();
if ($return != 'fail')
{
echo(json_encode(array(
'status' => 1,
'data' => $return
)));
}
else
{
echo(json_encode(array(
'status' => -1,
'message' => '读出标签失败'
)));
}
}
/**
* 添加关联信息+标签
*/
public function add_tag_to_content()
{
$this->InfoTags_model->ic_id = $this->input->get_post('ic_id');
$this->InfoTags_model->it_id = $this->input->get_post('it_id');
$return = $this->InfoTags_model->add_tag_to_content();
if ($return == 'success')
{
echo(json_encode(array(
'status' => 1,
'message' => '关联信息标签成功'
)));
}
else if ($return == 'exist')
{
echo(json_encode(array(
'status' => 2,
'message' => '关联信息标签已存在'
)));
}
else
{
echo(json_encode(array(
'status' => -1,
'message' => '关联信息标签失败'
)));
}
}
/**
* 移除关联信息+标签
*/
public function remove_tag_to_content()
{
$this->InfoTags_model->ic_id = $this->input->get_post('ic_id');
$this->InfoTags_model->it_id = $this->input->get_post('it_id');
$return = $this->InfoTags_model->remove_tag_to_content();
if ($return == 'success')
{
echo(json_encode(array(
'status' => 1,
'message' => '移除关联信息标签成功'
)));
}
else
{
echo(json_encode(array(
'status' => -1,
'message' => '移除关联信息标签失败'
)));
}
}
}

@ -18,9 +18,8 @@ class Information extends CI_Controller {
$this->load->model('Logs_model');
$this->load->model('InfoMetas_model');
$this->load->model('Infoauthors_model');
$this->load->model('InfoKeywordsanalytics_model', 'analytics_model');
$this->load->model('InfoSMS_model');
$this->load->library('Amplib'); //加载AMP处理类
$this->load->library('Accesscheck');
$this->accesscheck->check_access();
}
@ -183,6 +182,19 @@ class Information extends CI_Controller {
if (in_array($this->config->item('site_code'), array('ah'))) {
$this->config->set_item('templates', $this->config->item('templates_ah'));
}
if (in_array($this->config->item('site_code'), array('pgr'))) {
$this->config->set_item('templates', $this->config->item('templates_pgr'));
}
if (in_array($this->config->item('site_code'), array('ts'))) {
$this->config->set_item('templates', $this->config->item('templates_ts'));
}
if (in_array($this->config->item('site_code'), array('cht'))) {
$this->config->set_item('templates', $this->config->item('templates_cht'));
}
if (in_array($this->config->item('site_code'), array('gm'))) {
$this->config->set_item('templates', $this->config->item('templates_gm'));
}
//信息区域类型
switch ($data['rootInformation']->ic_ht_area_type) {
@ -254,6 +266,26 @@ class Information extends CI_Controller {
//所属导航栏目
$data['setting_website_nav'] = $this->InfoMetas_model->get_list(0, 'setting_website_nav_' . strtolower($this->config->item('site_code')));
$data['my_tags'] = array();
$data['all_tags'] = array();
if (is_series_site()) {
//信息标签
//$this->InfoTags_model->ic_id = null;
//$data['all_tags'] = $this->InfoTags_model->list_tag();
//$this->InfoTags_model->ic_id = $data['information']->ic_id;
//$data['my_tags'] = $this->InfoTags_model->list_tag();
//差集
foreach ($data['all_tags'] as &$it) {
foreach ($data['my_tags'] as $it2) {
if ($it->it_id == $it2->icit_it_id) {
$it = null;
break;
}
}
}
$data['all_tags'] = array_filter($data['all_tags']);
}
$this->load->view('bootstrap3/header', $data);
$this->load->view('bootstrap3/information_edit');
$this->load->view('bootstrap3/footer');
@ -356,26 +388,31 @@ class Information extends CI_Controller {
} else {
$this->InfoContents_model->Update($information->is_ic_id, $this->input->post('ic_url'), $this->input->post('ic_url_title'), $this->input->post('ic_type'), $this->input->post('ic_title'), $this->input->post('ic_content'), $this->input->post('ic_summary'), $this->input->post('ic_seo_title'), $this->input->post('ic_seo_description'), $this->input->post('ic_seo_keywords'), $this->input->post('ic_show_bread_crumbs'), $this->input->post('ic_status'), $this->input->post('ic_template'), $this->input->post('ic_photo'), $this->input->post('ic_photo_width'), $this->input->post('ic_photo_height'), $this->input->post('ic_recommend_tours'), $this->input->post('ic_recommend_packages'), $this->input->post('ic_ht_area_id'), $this->input->post('ic_ht_area_type'), $this->input->post('ic_ht_product_id'), $this->input->post('ic_ht_product_type'), $this->input->post('ic_author'));
//收录查询,只在发布上线并且url不为空的时候检查
$embody_url = $this->input->post('ic_url');
$embody_url = trim($embody_url);
if ($this->input->post('ic_status') == 1 && $embody_url != '') {
$embody = $this->InfoMetas_model->get($information->is_ic_id, 'meta_embody');
if (empty($embody)) {
$times = date('Y-m-d H:i:s');
$this->InfoMetas_model->add($information->is_ic_id, 'meta_embody', $times);
//AMP更新和生成 beign
$auto_update_amp = $this->input->get_post('auto_update_amp');
if (!empty($auto_update_amp) && $auto_update_amp == 'true' && $this->input->post('ic_status') == 1) {
$amp_result=$this->amplib->auto_create($information->ic_id);
if (!empty($amp_result)) {
$amp_result = json_decode($amp_result);
if($amp_result->result=='ok'){
$amp_save_result= $this->amplib->edit_save($information->ic_id,$amp_result->data->amp,'1');
if(!empty($amp_save_result)){
$amp_save_result = json_decode($amp_save_result);
if($amp_save_result->name=='no'){
echo json_encode(array('name' => 'no', 'value' => 'AMP转换语法错误请重新进入AMP编辑器检查'));
return;
}
}
}
}
}
//AMP更新和生成 end
//为新闻添加默认发布时间
//if($information->ic_ht_area_type=='s' || $information->ic_type=='c_article')
//{
$meta_news_createdate = get_meta($information->ic_id, 'meta_news_createdate');
if (empty($meta_news_createdate)) {
add_meta($information->ic_id, 'meta_news_createdate', date('m/d/Y', time()));
}
//}
// if (is_series_site()) {
//如果URL有修改也删除静态文件
if ($this->input->post('ic_url') != $information->ic_url) {
$this->update_cache($information->ic_url, true);
@ -390,11 +427,12 @@ class Information extends CI_Controller {
$site_code = $this->config->item('site_code');
$ic_url = $this->input->post('ic_url');
$auto_update_cache = $this->input->get_post('auto_update_cache_checkbox');
if ($site_code == 'gm' && substr($ic_url, 0, 5) == '/faq/') {
if (strcasecmp($site_code, "gm") == 0 && !empty($auto_update_cache)) {
$update_info_log = $this->update_cache($ic_url, true);
} else if (strcasecmp($site_code, "cht") == 0 && !empty($auto_update_cache)) {
$update_info_log = $this->update_cache($ic_url);
} else if (strcasecmp($site_code, "cht") != 0) {//非cht站点
} else if (strcasecmp($site_code, "cht") != 0 && strcasecmp($site_code, "gm") != 0) {//非cht站点并且非GM
$update_info_log = $this->update_cache($ic_url);
}
@ -467,12 +505,20 @@ class Information extends CI_Controller {
switch ($this->config->item('site_code')) {
case 'cht':
$url = 'http://192.155.224.195:8080/guide-use.php/travelguide/guide/?static_html_url=' . $url;
if (strpos($url, '/festivals/') !== false || strpos($url, '/faq/') !== false) {//ch的部分控制器不是travelguide所以不能统一更新和生产缓存文件只能跳过统一控制器再回头取消这个限制
$url = 'http://www.chinahighlights.com/';
$search_list = $this->Information_model->search_url($url);
$amp_request = FALSE;
foreach ($search_list as $key => $req_url) {
$meta_amp_status = get_meta($req_url->ic_id, 'AMP_STATUS');
if ($meta_amp_status) {
$amp_request = TRUE;
}
}
if ($amp_request) {
$url = 'http://192.155.250.124:22224/ampreq' . $url;
} else {
$url = 'http://192.155.250.124:22224' . $url;
}
break;
case 'ah':
if ($delete_only === true) {
$url = 'https://www.asiahighlights.com/index.php/information/delete_cache_8X913mksJ/?static_html_url=' . $url;
@ -486,8 +532,8 @@ class Information extends CI_Controller {
if ($delete_only) {
$url = "http://144.76.185.44:8029/gm.php/information/delete_cache_23Xd913mddkgssODII?static_html_url=" . urlencode($url);
} else {
//先删除再生成,部分页面没有在信息平台中
GET_HTTP("http://144.76.185.44:8029/gm.php/information/delete_cache_23Xd913mddkgssODII?static_html_url=" . urlencode($url));
//先删除再生成,部分页面没有在信息平台中
GET_HTTP("http://144.76.185.44:8029/gm.php/information/delete_cache_23Xd913mddkgssODII?static_html_url=" . urlencode($url));
$url = "http://144.76.185.44:8029" . $url;
}
break;
@ -506,11 +552,11 @@ class Information extends CI_Controller {
//判断是否是更新信息
// 产品页面不能生成静态页面,比如/beijing/hotel/只是为了在导航显示一个链接,如果生成了静态页面,网前只会显示一个空白页面了
if (!empty($information->ic_content)) {
$url = $this->config->item('site_url') . '/index.php/information/detail/?static_html_url=' . $url;
} else {
//先尝试删除静态文件。
$try_del = $this->config->item('site_url') . '/index.php/welcome/update_cache/delete_only?static_html_url=' . $url;
file_get_contents($try_del);
$url = $this->config->item('site_url') . '/index.php/information/detail/?static_html_url=' . $url;
} else {
$url = $this->config->item('site_url') . '/index.php/welcome/update_cache/?static_html_url=' . $url;
}
if (isset($information->ic_type) && $information->ic_type == 'product') {
@ -530,36 +576,19 @@ class Information extends CI_Controller {
break;
}
//关闭错误提示防止file_get_contents请求特殊字符的时候会报错或者404、500,特殊字符需要用urlencode编码第一个/后面的url
//error_reporting(NULL);
//ini_set('display_errors', 'Off');
$content = GET_HTTP($url);
if ($content === false) {
$data[] = array('name' => 'no', 'value' => sprintf($this->lang->line('update_cache_failed'), $url));
} else {
//todo:如果请求正常则判断返回的json是否正常
//echo json_decode($content);
//CHT网站还需要更新前端服务器缓存
if ($this->config->item('site_code') == 'cht') {
$url = 'http://www.chinahighlights.com/api/community/updatecache.asp?gurl=http://www.chinahighlights.com' . $original_url . '&other=1&site=info';
$content = GET_HTTP($url);
if ($content === false) {
$data[] = array('name' => 'no', 'value' => sprintf($this->lang->line('update_vps_failed'), $url));
echo json_encode($data);
return false;
}
}
//手动更新的话接着更新CDN缓存
$msg = $this->lang->line('update_cache_success');
if ($this->input->post('updatecdn') == 1) {
$notice = $this->update_cdn();
if ($notice == 200) {
$msg.=$this->lang->line('update_cdn_success');
$msg .= $this->lang->line('update_cdn_success');
} else {
$msg.=$this->lang->line('update_cdn_failed') . '<br>' . $notice;
$msg .= $this->lang->line('update_cdn_failed') . '<br>' . $notice;
}
}
$data[] = array('name' => 'ok', 'value' => $msg, 'url' => $url);
@ -636,40 +665,6 @@ class Information extends CI_Controller {
$this->load->view('bootstrap/footer');
}
//增加新景点到景点概述下
//先找到当前城市的景点概述根节点,然后新增加
//$lsi_sn 翰特景点id
function add_landscape($area_id, $lsi_sn) {
//获取景点概述节点
$root_landscape = $this->Information_model->get_type_detail('c_attraction', 'c', $area_id);
if ($root_landscape == FALSE) {
$data[] = array('name' => 'no', 'value' => $this->lang->line('root_landscape_notfound'));
echo json_encode($data);
return false;
}
//获取景点详细内容
$Landscape = $this->Landscape_model->get_detail($lsi_sn);
if ($root_landscape == FALSE) {
$data[] = array('name' => 'no', 'value' => $this->lang->line('landscape_notfound'));
echo json_encode($data);
return false;
}
//添加空内容
$this->InfoContents_model->Add($Landscape->LSI2_Name, $Landscape->LSI2_Name, '', $Landscape->LSI2_Name, $Landscape->LSI2_ShortIntro, '', '', '', '', 0, 0, '', '', 0, 0, '', '', $area_id, 'c', $lsi_sn, 't', '');
if ($this->InfoStructures_model->Add($root_landscape->is_id, $this->InfoContents_model->insert_id)) {
$data[] = array('name' => 'ok', 'value' => site_url('information/edit/' . $this->InfoStructures_model->insert_id));
} else {
$data[] = array('name' => 'no', 'value' => $this->lang->line('form_info_error'));
}
echo json_encode($data);
$this->Logs_model->add($this->InfoStructures_model->insert_id);
return true;
}
//保存自定义配置
function save_meta() {
$im_ic_id = $this->input->post('im_ic_id');

@ -46,7 +46,6 @@ class Keyworlds extends CI_Controller {
//查询当前关键词的排名情况
$data['rank_json'] = '';
$data['current_keyworld'] = $this->Keywords_model->get_keyworld_bytreeid($kw_is_id);
//如果是根目录,则展示最新关键词排名变化情况
if ($root_key) {
$data['compare_rank'] = $this->Keywords_model->get_compare_rank($data['order']);
@ -95,8 +94,6 @@ class Keyworlds extends CI_Controller {
}
}
}
// print_r($data['wordcount']);
// print_r($rank_json);
// 拼接highcharts数据格式
$data['rank_json'] = '[';
foreach ($rank_json as &$ra) {
@ -104,15 +101,16 @@ class Keyworlds extends CI_Controller {
// 每条线
$data['rank_json'] .='{"name":"' . $ra[$data_time[0]]->kw_keyworlds . '","data":[';
// 每个点
$tmp_rank = "null";
foreach ($ra as $v) {
$kwr_rank = $v->kwr_rank;
if ($v->kwr_rank == '>150')
$tmp_rank = trim($v->kwr_rank)=="" ? $tmp_rank : $v->kwr_rank;
// $kwr_rank = intval(trim($v->kwr_rank))>0 ? $v->kwr_rank : "null";
$kwr_rank = ($v->kwr_rank==151) ? "null" : $tmp_rank;
// $kwr_rank = trim($kwr_rank)=="" ? "null" : $kwr_rank;
if ($v->kwr_rank == '>150') {
$kwr_rank = 100;
if (strtolower($this->config->item('site_code')) == 'gm') {
$data['rank_json'] .=-$kwr_rank . ',';
} else {
$data['rank_json'] .=$kwr_rank . ',';
}
$data['rank_json'] .=$kwr_rank . ',';
}
$data['rank_json'] = substr($data['rank_json'], 0, -1);
$data['rank_json'] .=']},';
@ -120,33 +118,31 @@ class Keyworlds extends CI_Controller {
if ($data['wordcount'] == 1) {
$data['rank_json'] .='{"name":"' . $ra[$data_time[0]]->kw_keyworlds . '(mobile)","data":[';
foreach ($ra as $v) {
$kwr_mobile_rank = $v->kwr_mobile_rank ? $v->kwr_mobile_rank : 'null' ;
if ($v->kwr_mobile_rank == '>150')
$kwr_mobile_rank = (intval($v->kwr_mobile_rank) > 0) ? $v->kwr_mobile_rank : "null" ;
$kwr_mobile_rank = ($v->kwr_mobile_rank==151) ? "null" : $v->kwr_mobile_rank;
$kwr_mobile_rank = trim($kwr_mobile_rank)=="" ? "null" : $kwr_mobile_rank;
if ($v->kwr_mobile_rank == '>150') {
$kwr_mobile_rank = 100;
if (strtolower($this->config->item('site_code')) == 'gm') {
$data['rank_json'] .=-$kwr_mobile_rank . ',';
} else {
$data['rank_json'] .=$kwr_mobile_rank . ',';
}
$data['rank_json'] .= $kwr_mobile_rank . ',';
}
$data['rank_json'] = substr($data['rank_json'], 0, -1);
$data['rank_json'] .=']},';
}
}
$data['rank_json'] = substr($data['rank_json'], 0, -1) . ']';
// print_r($data['rank_json']);
$data['data_time'] = json_encode($data_time);
$data['rank_info'] = '';
isset($rank_json[$data['current_keyworld']->kw_id]) && $data['rank_info'] = $rank_json[$data['current_keyworld']->kw_id];
if($data['wordcount'] == 1) {
arsort($data['rank_info']);
}
}
} else {
redirect(site_url("Keyworlds/index"));
}
// $data['analytics'] = $this->analytics_model->get_keyword_analytics($data['current_keyworld']->kw_keyworlds, 30);
$data['site_code'] = strtolower($this->config->item('site_code'));
// print_r($data['rank_info']);
// print_r($data["rank_json"]);
$this->load->view('bootstrap/header', $data);
$this->load->view('keyworlds/index');
$this->load->view('bootstrap/footer');
@ -285,26 +281,34 @@ class Keyworlds extends CI_Controller {
$data[] = array('name' => 'rank', 'value' => '查询过于频繁,请等待三分钟!');
echo json_encode($data);
return TRUE;
} else if (empty($last_rank[0]->kwr_mobile_rank) &&
intval($last_rank[0]->kwr_datetime) > intval($today)) {
}
if ((intval($last_rank[0]->kwr_mobile_rank) == 0 || !isset($last_rank[0]->kwr_mobile_rank)) &&
(intval($last_rank[0]->kwr_datetime) >= intval($today)) ) {
$client_flag = 'm';
$rank_flag = 'rank_m';
$source_flag = 'source_m';
}
$today_0 = strtotime(date('Ymd000000'));
$today_24 = strtotime(date('Ymd235959'));
$last_rank_today = $this->Keywordsrank_model->get_rank_list($kw_id,1,$today_0,$today_24);
// $last_rank_today = $last_rank;
$orignal = array();
//获取排名详细情况,排名超过150的停止搜索
for ($i = 1; $i <= 15; $i++) {
$j = $i;
$rank = $this->$method($client_flag, $keyworlds, $site_url, $j, $site_code);
$orignal[] = $rank['orignal'];
// 仅更新一个字段
if (intval($rank['rank']) == 0) {
$rank['rank'] = $last_rank[0]->kwr_rank;
$rank['source'] = $last_rank[0]->kwr_source;
if ($client_flag === 'm') {
$rank['rank'] = isset($last_rank_today[0]) ? $last_rank_today[0]->kwr_rank : null;
$rank['source'] = isset($last_rank_today[0]) ? $last_rank_today[0]->kwr_source : null;
} else {
$rank['rank_m'] = null;
$rank['source_m'] = null;
$rank['rank_m'] = isset($last_rank_today[0]) ? $last_rank_today[0]->kwr_mobile_rank : null;
$rank['source_m'] = isset($last_rank_today[0]) ? $last_rank_today[0]->kwr_mobile_source : null;
}
if ($rank[$rank_flag] != 0) {
if (intval($rank[$rank_flag]) != 0) {
if ($rank[$rank_flag] > 150)
$rank[$rank_flag] = '151';
break;
@ -315,46 +319,73 @@ class Keyworlds extends CI_Controller {
break;
}
}
$data[] = array(
'name' => 'rank',
'value' => ($rank['rank'] . " / " . $rank["rank_m"]),
'real' => $rank_flag . " : " . $rank[$rank_flag]
// ,'lastid' => $last_rank[0]->kwr_id . " / " . $last_rank_todaytmp[0]->kwr_id
// ,'tmp' => intval($last_rank[0]->kwr_datetime) . "-" . intval($today) . $client_flag
// ,'orignal' => $orignal
// ,"site" => $site_url
);
if ($rank[$rank_flag] < 0) {
echo json_encode($data);
return false;
}
//保存排名数据
if ($rank[$rank_flag] == '151') { //超过151的排名则不记录
$this->Keywords_model->update_time($kw_id);
} elseif (isset($last_rank[0]->kwr_datetime) and $last_rank[0]->kwr_datetime > strtotime(date('Y-m-d'))) {
if ($rank[$rank_flag] != -1 and $rank[$rank_flag] != -2 and $this->Keywordsrank_model->update_rank($last_rank[0]->kwr_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'])) {
$this->Keywords_model->update_time($kw_id);
}
if ( isset($last_rank_today[0]) && ! empty($last_rank_today[0])) {
$this->Keywordsrank_model->update_rank($last_rank_today[0]->kwr_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines']);
} else {
if ($rank[$rank_flag] != -1 and $rank[$rank_flag] != -2 and $this->Keywordsrank_model->add_rank($kw_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines'])) {
$this->Keywords_model->update_time($kw_id);
$add = $this->Keywordsrank_model->add_rank($kw_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines']);
}
// rank 变化
if ($client_flag === 'PC') {
$this->Keywords_model->update_time($kw_id);
$last_rank_pc = $this->Keywordsrank_model->get_last_pc_rank($kw_id, 2);
if (trim($last_rank_pc[1]->kwr_rank) != "") {
$this->load->model('InfoSMS_model');
$last_rank_pc = isset($last_rank_pc[1]) ? $last_rank_pc[1]->kwr_rank : $rank['rank'];
$this->InfoSMS_model->readed_for_info($kw_id, 'keywords_rank');
$this->InfoSMS_model->add('keywords_rank', $kw_id, $rank['rank'], $last_rank_pc, (string) ($rank['rank'] - $last_rank_pc));
}
}
$data[] = array('name' => 'rank', 'value' => ($rank['rank'] . " -- " . $rank["rank_m"]));
echo json_encode($data);
return TRUE;
}
//自动爬取排名
public function get_auto_rank($engines = '', $fix_site_code = '') {
public function get_auto_rank($engines = '', $fix_site_code = '', $client='PC') {
set_time_limit(60);
$rank = array();
$rank = array();
$orignal = array();
$worldsList = array();
$site_config = $this->config->item('site');
$engines = trim($engines);
$engines = trim($engines);
//取出需要更新排名的关键词
$worldsList = $this->Keywords_model->get_keyworld_list(1, $engines, $fix_site_code);
//如果没有需要更新的则返回
if (empty($worldsList)) {
echo 'all done';
return;
}
$today = strtotime(date('Y-m-d'));
$client_flag = "PC";
$rank_flag = 'rank';
$source_flag = 'source';
if (intval($worldsList[0]->kwr_datetime) >= intval($today) ) {
// 先取时间最久没更新的
$today = strtotime(date('Y-m-d'));
$client_flag = $client ? $client : "PC";
$rank_flag = 'rank';
$source_flag = 'source';
if ($client_flag == 'PC') {
$worldsList = $this->Keywords_model->get_keyworld_list_old(1, $engines, $fix_site_code);
}
if (empty($worldsList) || $client_flag === 'm') {
$worldsList = $this->Keywords_model->get_keyworld_list(1, $engines, $fix_site_code);
//如果没有需要更新的则返回
if (empty($worldsList)) {
echo 'all done';
return;
}
$client_flag = "m";
$rank_flag = 'rank_m';
$source_flag = 'source_m';
}
$last_rank = $this->Keywordsrank_model->get_rank_list($worldsList[0]->kw_id);
$today_0 = mktime(0,0,0,date("m"),(date("d")-$this->Keywords_model->catch_day), date("Y"));
$today_24 = strtotime(date('Ymd235959'));
$last_rank_today = $this->Keywordsrank_model->get_rank_list($worldsList[0]->kw_id,1,$today_0,$today_24);
// $last_rank_today = $last_rank_pc;
//获取排名并保存
foreach ($worldsList as $v) {
@ -368,35 +399,48 @@ class Keyworlds extends CI_Controller {
} else if ($engines == 'yandex') {//俄语站的yangdex
$rank = $this->get_search_content_by_yandex($client_flag,$v->kw_keyworlds, $site_url, $i - 1);
}
if (intval($rank['rank']) == 0) {
$rank['rank'] = $last_rank[0]->kwr_rank;
$rank['source'] = $last_rank[0]->kwr_source;
if ( $rank[$rank_flag] < 0 ) {
break;
}
$orignal[] = $rank['orignal'];
if ($client_flag === 'm') {
$rank['rank'] = isset($last_rank_today[0]) ? $last_rank_today[0]->kwr_rank : null;
$rank['source'] = isset($last_rank_today[0]) ? $last_rank_today[0]->kwr_source : null;
} else {
$rank['rank_m'] = null;
$rank['source_m'] = null;
$rank['rank_m'] = isset($last_rank_today[0]) ? $last_rank_today[0]->kwr_mobile_rank : null;
$rank['source_m'] = isset($last_rank_today[0]) ? $last_rank_today[0]->kwr_mobile_source : null;
}
if ($rank[$rank_flag] != 0) {
if ($rank[$rank_flag] > 150)
if (intval($rank[$rank_flag]) > 150)
$rank[$rank_flag] = '151';
break;
}elseif ($i == 15) {
$rank[$rank_flag] = '151';
break;
} elseif ($rank[$rank_flag] == -2) {
break;
}
}
if ($rank[$rank_flag] == '151') { //超过151的排名则不记录
$this->Keywords_model->update_time($v->kw_id);
}else if ($rank[$rank_flag] != -1 and $rank[$rank_flag] != -2 and $this->Keywordsrank_model->add_rank($v->kw_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines'])) {
$this->load->model('InfoSMS_model');
$last_rank = isset($last_rank[0]) ? $last_rank[0]->kwr_rank : $rank['rank'];
$this->InfoSMS_model->readed_for_info($v->kw_id, 'keywords_rank');
$this->InfoSMS_model->add('keywords_rank', $v->kw_id, $rank['rank'], $last_rank, (string) ($rank['rank'] - $last_rank));
if ($engines != 'yandex')
$this->Keywords_model->update_time($v->kw_id);
}
}
var_dump($worldsList[0]->kw_keyworlds, $rank);
if (isset($last_rank_today[0]) && ! empty($last_rank_today[0])) {
$this->Keywordsrank_model->update_rank($last_rank_today[0]->kwr_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines']);
} else {
$add = $this->Keywordsrank_model->add_rank($v->kw_id, $rank['rank'], $rank['rank_m'], $rank['source'], $rank['source_m'], $rank['engines']);
}
// rank 变化
if ($client_flag === 'PC') {
$this->Keywords_model->update_time($v->kw_id);
$last_rank_pc = $this->Keywordsrank_model->get_last_pc_rank($v->kw_id, 2);
if (trim($last_rank_pc[1]->kwr_rank) != "") {
$this->load->model('InfoSMS_model');
$last_rank_pc = isset($last_rank_pc[1]) ? $last_rank_pc[1]->kwr_rank : $rank['rank'];
$this->InfoSMS_model->readed_for_info($v->kw_id, 'keywords_rank');
$this->InfoSMS_model->add('keywords_rank', $v->kw_id, $rank['rank'], $last_rank_pc, (string) ($rank['rank'] - $last_rank_pc));
}
}
}
var_dump("rank $client_flag " . $rank[$rank_flag]);
unset($rank['orignal']);
var_dump($worldsList[0]->kw_keyworlds, $rank, $orignal);
}
//计算关键词在google搜索引擎的排名
@ -407,6 +451,7 @@ class Keyworlds extends CI_Controller {
$rank['rank_m'] = 0;
$rank['source_m'] = $site_url;
$rank['engines'] = 'google';
$rank["orignal"] = '';
if ($page > 3) {
$rank['rank'] = 151;
$rank['rank_m'] = 151;
@ -436,23 +481,26 @@ class Keyworlds extends CI_Controller {
//抓取google搜索结果
$url = "https://www.$google_url/search?q=$search_worlds&start=$start&num=50&hl=$language";
$match_fun = '/<h3 class="r">(.*)<\/h3>/smUi';
$match_fun = '/<h3 class=\"r\">(.*)<\/h3>/smUi';
$rank_flag = 'rank';
$source_flag = 'source';
if ($client_flag == 'm') {
$match_fun = '/<a class="_Olt _bCp"(.*)<div/smUi';
$match_fun = '/<a class=\"_Olt _bCp\"(.*)<div/smUi';
$rank_flag = 'rank_m';
$source_flag = 'source_m';
}
$response = $this->curl($url,$client_flag);
if ($response) {
//分析google搜索结果计算排名
if (false !== stripos($response, '<h1>302 Moved</h1>')) {
if (false !== stripos($response, '<h1>302 Moved</h1>') ||
false !== stripos($response, 'recaptcha') || false !== stripos($response, 'CAPTCHA')) {
$rank['rank'] = -2;
$rank["orignal"] = $response;
} elseif (false !== stripos($response, $site_url)) {
preg_match_all($match_fun, $response, $store);
foreach ($store[1] as $k => $v) {
$ismatch = stripos($v, $site_url);
$ismatch = $ismatch ? $ismatch : stripos($v, addcslashes(addslashes($site_url), "/"));
if (false !== $ismatch) {
//计算排名
$rank[$rank_flag] = $start + $k + 1;
@ -465,9 +513,11 @@ class Keyworlds extends CI_Controller {
}
}
} else {
$rank["orignal"] = $response;
// log_message('error','google search response not found CH');
}
} else {
$rank["orignal"] = $response;
$rank[$rank_flag] = -1;
}
return $rank;
@ -502,7 +552,7 @@ class Keyworlds extends CI_Controller {
$rank_flag = 'rank';
$source_flag = 'source';
if ($client_flag == 'm') {
$match_fun = '/<a class="link link_theme_normal organic__url i-bem"(.*)class=/smUi';
$match_fun = '/<a class=\"link link_theme_normal organic__url i-bem\"(.*)class=/smUi';
$rank_flag = 'rank_m';
$source_flag = 'source_m';
}
@ -516,6 +566,7 @@ class Keyworlds extends CI_Controller {
preg_match_all($match_fun, $response, $store);
foreach ($store[1] as $k => $v) {
$start_s = stripos($v, $site_url);
$start_s = $start_s ? $start_s : stripos($v, addcslashes(addslashes($site_url), "/"));
if (false !== $start_s) {
$rank[$rank_flag] = $startrank + $k + 1;
$end_s = stripos($v, '" ', $start_s);
@ -671,4 +722,41 @@ class Keyworlds extends CI_Controller {
return $reponse;
}
public function testrank($kw_is_id=0, $top=1)
{
$data['current_keyworld'] = $this->Keywords_model->get_keyworld_bytreeid($kw_is_id);
$is_id_string = $data['current_keyworld']->kw_id;
$rank_info = $this->Keywordsrank_model->get_rank_list($is_id_string, $top);
foreach ($rank_info as $key => &$value) {
$value['ddd'] = date('Y-m-d H:i:s', $value->kwr_datetime);
}
var_dump($rank_info);
}
public function testpc()
{
$last_rank_pc = $this->Keywordsrank_model->get_last_pc_rank('297');
var_dump($last_rank_pc);
var_dump($last_rank_pc[0]->kwr_rank);
var_dump(trim($last_rank_pc[0]->kwr_rank));
}
public function test_next($fix_site_code='', $client_flag = 'PC')
{
if ($client_flag == 'PC') {
$worldsList = $this->Keywords_model->get_keyworld_list_old(1, 'en', $fix_site_code);
}
if (empty($worldsList) || $client_flag === 'm') {
$worldsList = $this->Keywords_model->get_keyworld_list(1, 'en', $fix_site_code);
// 如果没有需要更新的则返回
if (empty($worldsList)) {
echo 'all done';
return;
}
$client_flag = "m";
}
var_dump($client_flag);
var_dump($worldsList);
}
}

@ -34,7 +34,9 @@ class Look_order extends CI_Controller {
//显示订单数量,如果大于阈值就显示错误
public function status() {
$data = array();
$data['tour_count'] = $this->Orders_model->tour_count();
$tour_count = $this->Orders_model->tour_count();
$biz_count = $this->Orders_model->biz_count();
$data['tour_count'] = $tour_count + $biz_count;
if ($data['tour_count'] >= 550) {
$this->output->set_status_header(500);
}

@ -16,8 +16,7 @@ class Payment extends CI_Controller
{
$data=array();
if ($this->input->post('price')) {
$data['payurl']='
<a href="https://www.chinahighlights.com/securepayment/?'.
$data['payurl'] = '<a href="https://www.chinahighlights.com/securepayment/?'.
'Site_Language=en_us&'.
'Site_CurrencyType=USD&'.
'Site_ACD=100-200-300&'.

@ -11,6 +11,7 @@ class Tools extends CI_Controller
$this->load->model('Area_model');
$this->load->model('InfoStructures_model');
$this->load->model('Information_model');
$this->load->model('InfoMetas_model');
$this->site_code = $this->config->item('site_code');
}
@ -52,6 +53,29 @@ class Tools extends CI_Controller
$this->load->view('tools/old', $data);
}
}
/**
*
* 公有函数AMP转化表格。
*
* 必要参数:
* @param String $site_code
*
*/
public function amp_check()
{
$data['amp'] = $this->input->get_post('amp');
if (!$data['amp']) $data['amp'] = 'yes';
//AMP转化列表
if ($data['amp'] == 'yes') {
$data['info'] = $this->InfoMetas_model->list_amp($this->site_code);
} else {
$data['info'] = $this->InfoMetas_model->list_no_amp($this->site_code);
}
//视图
$this->load->view('tools/amp_check', $data);
}
/**
* 导出CSV文件

@ -25,6 +25,10 @@ class Welcome extends CI_Controller {
$data['lastEditList'] = $this->Information_model->get_last_edit_list();
$data['last_city_list'] = $this->Area_model->get_last_edit_city();
if ($this->config->item('site_code') == 'pgr') {
$data['countryList'] = $this->Area_model->get_country_list_for_site("'589','645','632','517','31','28','609','630','9','708','709'");
}
$this->load->view('bootstrap/header', $data);
$this->load->view('bootstrap/welcome');
$this->load->view('bootstrap/footer');
@ -61,29 +65,24 @@ class Welcome extends CI_Controller {
$this->load->view('bootstrap/footer');
}
//获取所有信息+产品url
public function create_all_urls() {
//获取所有信息URL,用来批量静态化更新
public function create_all_urls($view=false) {
set_time_limit(0);
$this->output->enable_profiler(false);
$this->Information_model->topNum = false;
$data['all_information'] = $this->Information_model->GetList('ic_status,ic_url,ic_sitecode');
//系列站产品连接
$site_code = strtoupper($this->config->item('site_code'));
if (!empty($site_code)) {
$this->load->helper('file');
$path = APPPATH . '/views/product_urls/updateCache' . $site_code . '.txt';
if (file_exists($path)) {
$data['product_urls'] = read_file($path);
$domain = $this->config->item('site_url');
$data['product_urls'] = str_replace("\n", '<br/>', $data['product_urls']);
$data['product_urls'] = str_replace($domain, $domain . '/index.php/welcome/update_cache/?static_html_url=', $data['product_urls']);
}
$data['all_information'] = $this->Information_model->GetList('ic_status,ic_id,ic_url,ic_sitecode,is_id');
if ($view == 'amp') {
$this->load->view('bootstrap3/header', $data);
$this->load->view('bootstrap3/refresh_amp_urls');
$this->load->view('bootstrap3/footer');
} else {
$this->load->view('bootstrap/header', $data);
$this->load->view('bootstrap/cache_url', $data);
$this->load->view('bootstrap/footer');
}
$this->load->view('none_urls', $data);
}
//获取某个信息节点和子节点url
public function create_infomation_urls($is_parent_id) {
public function create_infomation_urls($is_parent_id, $view = false) {
$this->output->enable_profiler(FALSE);
$structure = $this->InfoStructures_model->Detail($is_parent_id);
if (empty($structure)) {
@ -91,9 +90,15 @@ class Welcome extends CI_Controller {
return false;
}
$data['all_information'] = $this->Information_model->get_list_by_path($structure->is_path);
$this->load->view('bootstrap/header', $data);
$this->load->view('bootstrap/cache_url', $data);
$this->load->view('bootstrap/footer');
if ($view == 'amp') {
$this->load->view('bootstrap3/header', $data);
$this->load->view('bootstrap3/refresh_amp_urls');
$this->load->view('bootstrap3/footer');
} else {
$this->load->view('bootstrap/header', $data);
$this->load->view('bootstrap/cache_url', $data);
$this->load->view('bootstrap/footer');
}
}
public function get_infomation_urls($is_parent_id) {
@ -114,37 +119,37 @@ class Welcome extends CI_Controller {
$last_backup = $this->Logs_model->get_last_backup($info_id);
if (empty($last_backup)) {
$this->echo_json(array(
'status' => 'error',
'logId' => 0,
'datetime' => 0,
'username' => 0
));
'status' => 'error',
'logId' => 0,
'datetime' => 0,
'username' => 0
));
} else {
$this->echo_json(array(
'status' => 'success',
'logId' => $last_backup->log_id,
'datetime' => $last_backup->log_datetime,
'username' => $last_backup->log_ht_username
));
'status' => 'success',
'logId' => $last_backup->log_id,
'datetime' => $last_backup->log_datetime,
'username' => $last_backup->log_ht_username
));
}
}
public function change_static_url($info_id) {
$information = $this->Information_model->Detail($info_id);
$htm_doc = new DOMDocument();
$htm_doc->encoding='UTF-8';
$htm_doc->encoding = 'UTF-8';
libxml_use_internal_errors(true);
$htm_doc->strictErrorChecking = false;
if (empty($information->ic_content)) {
$this->echo_json(array(
'status' => 'error',
'infoId' => $info_id,
'message' => 'info content is empty'
));
'status' => 'error',
'infoId' => $info_id,
'message' => 'info content is empty'
));
return;
}
$htm_doc->loadHTML(
mb_convert_encoding($information->ic_content, 'HTML-ENTITIES', 'UTF-8'));
mb_convert_encoding($information->ic_content, 'HTML-ENTITIES', 'UTF-8'));
$htm_doc->normalizeDocument();
$img_list = $htm_doc->getElementsByTagName('img');
foreach ($img_list as $img) {
@ -153,87 +158,166 @@ class Welcome extends CI_Controller {
$img->setAttribute('src', $img_src);
}
$information->ic_content = $htm_doc->saveHTML();
$this->InfoContents_model->Update(
$information->ic_id,
$information->ic_url,
$information->ic_url_title,
$information->ic_type,
$information->ic_title,
$information->ic_content,
$information->ic_summary,
$information->ic_seo_title,
$information->ic_seo_description,
$information->ic_seo_keywords,
$information->ic_show_bread_crumbs,
$information->ic_status,
$information->ic_template,
$information->ic_photo,
$information->ic_photo_width,
$information->ic_photo_height,
$information->ic_recommend_tours,
$information->ic_recommend_packages,
$information->ic_ht_area_id,
$information->ic_ht_area_type,
$information->ic_ht_product_id,
$information->ic_ht_product_type,
$information->ic_author);
$this->echo_json(array(
'status' => 'ok',
'infoId' => $info_id,
'message' => 'success',
'date' => date('Y-m-d h:i:s')
));
$anchor_list = $htm_doc->getElementsByTagName('a');
foreach ($anchor_list as $anchor) {
$a_href = $anchor->getAttribute('href');
echo 'a.href: ' . $a_href . '<br>';
$match_result = array();
preg_match('/^http:\/\/www.chinahighlights.com(.*)/', $a_href, $match_result);
$result_count = count($match_result);
if ($result_count == 2) {
$result = '//www.chinahighlights.com' . $match_result[1];
$anchor->setAttribute('href', $result);
echo $result . '<br>';
}
}
// $information->ic_content = $htm_doc->saveHTML();
// $this->InfoContents_model->Update(
// $information->ic_id,
// $information->ic_url,
// $information->ic_url_title,
// $information->ic_type,
// $information->ic_title,
// $information->ic_content,
// $information->ic_summary,
// $information->ic_seo_title,
// $information->ic_seo_description,
// $information->ic_seo_keywords,
// $information->ic_show_bread_crumbs,
// $information->ic_status,
// $information->ic_template,
// $information->ic_photo,
// $information->ic_photo_width,
// $information->ic_photo_height,
// $information->ic_recommend_tours,
// $information->ic_recommend_packages,
// $information->ic_ht_area_id,
// $information->ic_ht_area_type,
// $information->ic_ht_product_id,
// $information->ic_ht_product_type,
// $information->ic_author);
// $this->echo_json(array(
// 'status' => 'ok',
// 'infoId' => $info_id,
// 'message' => 'success',
// 'date' => date('Y-m-d h:i:s')
// ));
}
public function count_redirect_nofollow() {
$include_redirece_info = $this->Information_model->search_all_text('&t=78002', 2000);
echo 'redirect count: ' . count($include_redirece_info) . '<br/>';
$redirect_nofollow_list = array();
$htm_doc = new DOMDocument();
$htm_doc->encoding = 'UTF-8';
libxml_use_internal_errors(true);
$htm_doc->strictErrorChecking = false;
foreach ($include_redirece_info as $info) {
$htm_doc->loadHTML(
mb_convert_encoding($info->ic_content, 'HTML-ENTITIES', 'UTF-8'));
$htm_doc->normalizeDocument();
$anchor_list = $htm_doc->getElementsByTagName('a');
foreach ($anchor_list as $anchor) {
$a_href = $anchor->getAttribute('href');
$a_rel = $anchor->getAttribute('rel');
$match_result = array();
preg_match('/.*&t=78002$/', $a_href, $match_result);
$result_count = count($match_result);
if ($result_count > 0 && $a_rel != 'nofollow') {
echo $info->ic_url . ' | ' . '(' . $info->ic_id . ',' . $info->is_id . ')' . '<br/>';
echo 'a.href: ' . $a_href . '; rel: ' . $a_rel . '<br>';
$redirect_nofollow_list[] = $info;
}
}
}
echo 'nofollow_count: ' . count($redirect_nofollow_list) . '<br/>';
return $redirect_nofollow_list;
}
public function transform_redirect_nofollow() {
$redirect_nofollow_list = $this->count_redirect_nofollow();
$htm_doc = new DOMDocument();
$htm_doc->encoding = 'UTF-8';
libxml_use_internal_errors(true);
$htm_doc->strictErrorChecking = false;
foreach ($redirect_nofollow_list as $info) {
$htm_doc->loadHTML(
mb_convert_encoding($info->ic_content, 'HTML-ENTITIES', 'UTF-8'));
$htm_doc->normalizeDocument();
$anchor_list = $htm_doc->getElementsByTagName('a');
foreach ($anchor_list as $anchor) {
$a_rel = $anchor->getAttribute('rel');
$anchor->setAttribute('rel', 'nofollow');
$this->Logs_model->backup($info->is_id, $info->ic_content);
$info->ic_content = $htm_doc->saveHTML();
$this->InfoContents_model->Update(
$info->ic_id, $info->ic_url, $info->ic_url_title, $info->ic_type, $info->ic_title, $info->ic_content, $info->ic_summary, $info->ic_seo_title, $info->ic_seo_description, $info->ic_seo_keywords, $info->ic_show_bread_crumbs, $info->ic_status, $info->ic_template, $info->ic_photo, $info->ic_photo_width, $info->ic_photo_height, $info->ic_recommend_tours, $info->ic_recommend_packages, $info->ic_ht_area_id, $info->ic_ht_area_type, $info->ic_ht_product_id, $info->ic_ht_product_type, $info->ic_author);
}
}
echo 'update_nofollow_count: ' . count($redirect_nofollow_list) . '<br/>';
}
public function count_http_of_href() {
$data['all_information'] = $this->Information_model->search_all_text('http://www.chinahighlights.com/', 2000);
echo 'count: ' . count($data['all_information']) . '<br/>';
var_dump($data['all_information']);
}
public function transform_href_to_https() {
$http_host = 'http://www.chinahighlights.com/';
$https_host = 'https://www.chinahighlights.com/';
$data['all_information'] = $this->Information_model->search_all_text($http_host, 200);
echo 'count: ' . count($data['all_information']) . '<br/>';
if (empty($data['all_information'])) {
echo 'nothing transform to https';
} else {
foreach ($data['all_information'] as $item) {
if (empty($item->ic_url)) {
echo '<span style="color: red;">[' . $item->ic_title . '] [' . $item->ic_url . ']</span> <br/>';
continue;
} else {
echo $item->ic_url . ' | ' . $item->ic_title . '<br/>';
}
$this->Logs_model->backup($item->is_id, $item->ic_content);
$item->ic_content = str_replace($http_host, $https_host, $item->ic_content);
$this->InfoContents_model->Update(
$item->ic_id, $item->ic_url, $item->ic_url_title, $item->ic_type, $item->ic_title, $item->ic_content, $item->ic_summary, $item->ic_seo_title, $item->ic_seo_description, $item->ic_seo_keywords, $item->ic_show_bread_crumbs, $item->ic_status, $item->ic_template, $item->ic_photo, $item->ic_photo_width, $item->ic_photo_height, $item->ic_recommend_tours, $item->ic_recommend_packages, $item->ic_ht_area_id, $item->ic_ht_area_type, $item->ic_ht_product_id, $item->ic_ht_product_type, $item->ic_author
);
}
}
}
private function echo_json($obj) {
$this->output
->set_content_type('application/json')
->set_output(json_encode($obj));
->set_content_type('application/json')
->set_output(json_encode($obj));
}
//批量替换二级域名如图片或者data域名
function replace_hostname($topnum) {
$data = array();
$find_host = 'http://data.chinarundreisen.com/'; //http://bilder.chinarundreisen.com/
$new_host = '//data.chinarundreisen.com/';
$data['all_information'] = $this->Information_model->search_all_text($find_host, $topnum);
if ($data['all_information']) {
foreach ($data['all_information'] as $item) {
echo $item->ic_url . '<br/>';
$item->ic_content = str_replace($find_host, $new_host, $item->ic_content);
$this->InfoContents_model->Update(
$item->ic_id, $item->ic_url, $item->ic_url_title, $item->ic_type, $item->ic_title, $item->ic_content, $item->ic_summary, $item->ic_seo_title, $item->ic_seo_description, $item->ic_seo_keywords, $item->ic_show_bread_crumbs, $item->ic_status, $item->ic_template, $item->ic_photo, $item->ic_photo_width, $item->ic_photo_height, $item->ic_recommend_tours, $item->ic_recommend_packages, $item->ic_ht_area_id, $item->ic_ht_area_type, $item->ic_ht_product_id, $item->ic_ht_product_type, $item->ic_author
);
}
} else {
echo 'all done';
}
}
//批量替换二级域名如图片或者data域名
function replace_hostname($topnum){
$data=array();
$find_host='http://data.chinarundreisen.com/'; //http://bilder.chinarundreisen.com/
$new_host='//data.chinarundreisen.com/';
$data['all_information'] = $this->Information_model->search_all_text($find_host,$topnum);
if($data['all_information']){
foreach($data['all_information'] as $item){
echo $item->ic_url.'<br/>';
$item->ic_content=str_replace($find_host, $new_host,$item->ic_content);
$this->InfoContents_model->Update(
$item->ic_id,
$item->ic_url,
$item->ic_url_title,
$item->ic_type,
$item->ic_title,
$item->ic_content,
$item->ic_summary,
$item->ic_seo_title,
$item->ic_seo_description,
$item->ic_seo_keywords,
$item->ic_show_bread_crumbs,
$item->ic_status,
$item->ic_template,
$item->ic_photo,
$item->ic_photo_width,
$item->ic_photo_height,
$item->ic_recommend_tours,
$item->ic_recommend_packages,
$item->ic_ht_area_id,
$item->ic_ht_area_type,
$item->ic_ht_product_id,
$item->ic_ht_product_type,
$item->ic_author
);
}
}else{
echo 'all done';
}
}
private function check_url($subject) {
$result = $subject;
@ -257,7 +341,7 @@ class Welcome extends CI_Controller {
preg_match($pattern, $subject, $match_result);
$result_count = count($match_result);
if ($result_count == 2) {
$result = $replace.$match_result[1];
$result = $replace . $match_result[1];
}
return $result;
}
@ -278,7 +362,7 @@ class Welcome extends CI_Controller {
$parent_path = str_replace('-', ',', $parent_path);
$parent_path = trim($parent_path, ',');
if ($parent_path != '')
$parent_path.=',';
$parent_path .= ',';
$this->load->model('Import_model');
$this->Import_model->set_path($is_id, $parent_path);
echo 'ok';

@ -0,0 +1,42 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Zodiac extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->model('LunarNewYear_model');
}
public function index($z='rat')
{
$this->edit_zodiac(mb_strtolower($z));
}
public function edit_zodiac($z='rat')
{
$data['nav_active'] = $data["current_zodiac"] = mb_strtolower($z);
$data["zodiac_fortune"] = $this->LunarNewYear_model->get_zodiac($data["current_zodiac"]);
// 预览编辑的问题
if (substr($data["zodiac_fortune"]->TheYearFortune, 0, 4) !== '<div') {
$data["zodiac_fortune"]->TheYearFortune = "<div>" . $data["zodiac_fortune"]->TheYearFortune . "</div>";
}
$this->load->view('bootstrap/header', $data);
$this->load->view('bootstrap/zodiac/edit',$data);
}
public function fortune_save()
{
$this->LunarNewYear_model->LNY_SX = trim($this->input->post("sx"));
$this->LunarNewYear_model->LNY_LuckyNumber = trim($this->input->post("lucky_num"));
$this->LunarNewYear_model->LNY_LuckyColor = trim($this->input->post("lucky_color"));
$this->LunarNewYear_model->LNY_LuckyFlower = trim($this->input->post("lucky_flo"));
$this->LunarNewYear_model->TheYearFortune = trim($this->input->post("theyearfortune"));
$this->LunarNewYear_model->theyearfortune_save();
$ret = array("name"=>"ok");
$this->output->set_content_type('application/json')->set_output(json_encode($ret));
}
}

@ -312,6 +312,11 @@ function get_content_by_url($url) {
curl_setopt($curl, CURLOPT_HEADER, 0); // 显示返回的Header区域内容
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // 获取的信息以文件流的形式返回
$tmpInfo = curl_exec($curl); // 执行操作
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if($httpCode>=400){//页面状态如果大于400说明页面打不开
log_message('error', " curl {$httpCode} {$url} ");
return false;
}
$errno = curl_errno($curl);
if ($errno !== 0) {
return false;

@ -82,17 +82,17 @@ $lang['send_sms_success'] = '发送短消息成功!';
$lang['author_email_new_task_subject'] = 'New Task,%s';
$lang['author_email_new_task_body'] = 'You have a new task on the China Highlights Content Management System. Please log in at <a href="http://a.cdnch.com/author.php" target="_blank">http://a.cdnch.com/author.php</a>';
$lang['author_email_new_task_body2'] = 'There is a new task on the China Highlights Content Management System. Click “Accept” before someone else does if you want it! Please log in at <a href="http://a.cdnch.com/author.php" target="_blank">a.cdnch.com</a> (if the task is not in the Task Hall, someone else has already taken it).';
$lang['author_email_new_task_body'] = 'You have a new task on the China Highlights Content Management System. Please log in at <a href="http://author.mycht.cn/author.php" target="_blank">http://author.mycht.cn/author.php</a>';
$lang['author_email_new_task_body2'] = 'There is a new task on the China Highlights Content Management System. Click “Accept” before someone else does if you want it! Please log in at <a href="http://author.mycht.cn/author.php" target="_blank">author.mycht.cn</a> (if the task is not in the Task Hall, someone else has already taken it).';
$lang['author_email_review_task_failed_subject'] = 'Revision Required,%s';
$lang['author_email_review_task_failed_body'] = 'Your submission on the China Highlights Content Management System has been reviewed and requires revision. Please log in at <a href="http://a.cdnch.com/author.php" target="_blank">http://a.cdnch.com/author.php</a>';
$lang['author_email_review_task_failed_body'] = 'Your submission on the China Highlights Content Management System has been reviewed and requires revision. Please log in at <a href="http://author.mycht.cn/author.php" target="_blank">http://author.mycht.cn/author.php</a>';
$lang['author_email_review_task_success_subject'] = 'Submission Accepted,%s';
$lang['author_email_review_task_success_body'] = 'Your submission on the China Highlights Content Management System has been reviewed and accepted. See <a href="http://a.cdnch.com/author.php" target="_blank">http://a.cdnch.com/author.php</a>';
$lang['author_email_review_task_success_body'] = 'Your submission on the China Highlights Content Management System has been reviewed and accepted. See <a href="http://author.mycht.cn/author.php" target="_blank">http://author.mycht.cn/author.php</a>';
$lang['author_email_message_subject'] = 'Message,%s';
$lang['author_email_message_body'] = 'You have a new message on the China Highlights Content Management System. Please log in at <a href="http://a.cdnch.com/author.php" target="_blank">http://a.cdnch.com/author.php</a>';
$lang['author_email_message_body'] = 'You have a new message on the China Highlights Content Management System. Please log in at <a href="http://author.mycht.cn/author.php" target="_blank">http://author.mycht.cn/author.php</a>';
//关键词管理
$lang['form_keyworlds_success'] = '关键词编辑成功!';

@ -0,0 +1,122 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
/*
* AMP的相关方法
*/
class Amplib {
var $CI;
public function __construct() {
$this->CI = & get_instance();
$this->CI->load->model('Information_model');
$this->CI->load->model('InfoMetas_model');
}
public function edit($ic_id) {
$data = array();
$data['information'] = $this->CI->Information_model->detail_by_ic_id($ic_id);
if ($data['information'] == FALSE) {
show_404();
}
$this->CI->load->view('bootstrap3/header', $data);
$this->CI->load->view('amp_editor');
$this->CI->load->view('bootstrap3/footer');
}
public function auto_create($ic_id) {
$data = array();
$data['information'] = $this->CI->Information_model->detail_by_ic_id($ic_id);
if ($data['information'] == FALSE) {
return json_encode(array('result' => 'no', 'data' => '找不到这个页面'));
}
//144.76.185.44:8029
//根据站点不同,配置不同参数
$site_code = strtolower($this->CI->config->item('site_code'));
switch ($site_code) {
case 'ah':
//websitehost是表示资源下载的域名在网页代码中有/css/xxx.css之类的路径程序需要添加域名组成完整URL去下载文件一般是data域名或者www域名
$websitehost = 'https://data.asiahighlights.com';
$html_source_url = 'https://www.asiahighlights.com/index.php/information/detail/?no_cache=true&static_html_url=' . $data['information']->ic_url;
break;
case 'cht':
$websitehost = 'https://data.chinahighlights.com';
$html_source_url = 'http://192.155.224.195:2222' . $data['information']->ic_url;
break;
case 'gm':
$websitehost = 'https://data.chinarundreisen.com';
$html_source_url = 'http://144.76.185.44:8029' . $data['information']->ic_url;
break;
case 'ct':
$websitehost = 'https://data.chinatravel.com';
$html_source_url = 'http://158.85.210.78:2222' . $data['information']->ic_url;
break;
default:
$websitehost = $this->CI->config->item('site_url');
$html_source_url = $this->CI->config->item('site_url') . $data['information']->ic_url;
}
//获取网页当前源码,然后发送到信息平台
$html_source = GET_HTTP($html_source_url);
if (!empty($html_source)) {
$post_data = array('websitehost' => $websitehost, 'template_name' => $site_code, 'create_amp' => 'true', 'htmlsource' => $html_source);
return GET_HTTP(site_url('/apps/htmlcompressor/index/optimize'), $post_data, 'POST');
}
return json_encode(array('result' => 'no', 'data' => '不知道哪里错了,看代码'));
}
public function edit_save($ic_id = false, $textarea_htmlcode = false, $amp_status = false) {
$data = array();
if ($ic_id === false) {
$ic_id = $this->CI->input->post('ic_id');
}
if ($textarea_htmlcode === false) {
$textarea_htmlcode = $this->CI->input->post('textarea_htmlcode');
}
if ($amp_status === false) {
$amp_status = $this->CI->input->post('amp_status');
}
$data['information'] = $this->CI->Information_model->detail_by_ic_id($ic_id);
if ($data['information'] == FALSE) {
show_404();
}
//CH的页面没有canonical内容在这里帮补上
$textarea_htmlcode = str_replace('<!--@CANONICAL@-->', $this->CI->config->item('site_url') . $data['information']->ic_url, $textarea_htmlcode);
//AMP格式验证
if ($amp_status !== '0') {//只有发布的时候才需要验证
//把AMP网页内容到purifycss处理内置了AMP-Validator
$purifycss_server = 'http://184.172.113.216:33033/';
if ($this->CI->config->item('site_code' == 'gm')) {//德语站点使用自己的css处理服务器
$purifycss_server = 'http://158.177.67.52:33033/';
}
$validator_result = GET_HTTP($purifycss_server, 'amp_source=' . urlencode($textarea_htmlcode), 'POST');
$validator_result = json_decode($validator_result);
if ($validator_result->status == 'FAIL') {
return json_encode(array('name' => 'no', 'value' => $validator_result->errors));
}
}
$amp = $this->CI->InfoMetas_model->get($ic_id, 'AMP');
if ($amp === false) {
$this->CI->InfoMetas_model->add($ic_id, 'AMP', $textarea_htmlcode);
} else {
$this->CI->InfoMetas_model->update($ic_id, 'AMP', $textarea_htmlcode);
}
$amp_status_value = $this->CI->InfoMetas_model->get($ic_id, 'AMP_STATUS');
if ($amp_status_value === false) {
$this->CI->InfoMetas_model->add($ic_id, 'AMP_STATUS', $amp_status);
} else {
$this->CI->InfoMetas_model->update($ic_id, 'AMP_STATUS', $amp_status);
}
return json_encode(array('name' => 'ok', 'value' => $this->CI->lang->line('form_info_success')));
}
}

@ -0,0 +1,48 @@
<?php
class LunarNewYear_model extends CI_Model {
public $LNY_SX;
public $LNY_LuckyNumber;
public $LNY_LuckyColor;
public $LNY_LuckyFlower;
public $TheYearFortune;
function __construct() {
parent::__construct();
$this->HT = $this->load->database('HT', TRUE);
}
public function get_zodiac($zodiac = 'rat')
{
$sql = "SELECT TOP 1 LNY_SN ,
LNY_SX ,
LNY_LuckyNumber ,
LNY_LuckyColor ,
LNY_LuckyFlower ,
TheYearFortune
FROM LunarNewYear
WHERE LOWER(LNY_SX)='$zodiac'";
$query = $this->HT->query($sql);
return $query->row();
}
public function theyearfortune_save()
{
$sql = "UPDATE LunarNewYear
SET LNY_LuckyNumber = ?,
LNY_LuckyColor = ?,
LNY_LuckyFlower = ?,
TheYearFortune = ?
WHERE LOWER(LNY_SX) = ?";
$query = $this->HT->query($sql, array(
$this->LNY_LuckyNumber,
$this->LNY_LuckyColor,
$this->LNY_LuckyFlower,
$this->TheYearFortune,
$this->LNY_SX
));
return $query;
}
}

@ -37,7 +37,7 @@ class Area_model extends CI_Model
return FALSE;
}
}
function get_city_list($PRI_SN)
{
@ -58,7 +58,7 @@ class Area_model extends CI_Model
$query = $this->HT->query($sql, array($this->config->item('site_lgc'), $PRI_SN));
return $query->result();
}
//获取直辖市和特区列表
function get_municipalities_list()
{
@ -142,7 +142,18 @@ class Area_model extends CI_Model
. "FROM COuntryInfo ci \n"
. " INNER JOIN COuntryInfo2 ci2 ON ci2.COI2_COI_SN = ci.COI_SN \n"
. "WHERE ci2.COI2_LGC = ? \n"
. " AND ci.COI_SN in(1,19, 27, 28, 29, 30, 31, 35, 591)";
. " AND ci.COI_SN in(1, 19, 22, 24, 27, 28, 29, 30, 31, 35, 591)";
$query = $this->HT->query($sql, array($this->config->item('site_lgc')));
return $query->result();
}
function get_country_list_for_site($country_list)
{
$sql = "SELECT ci.COI_SN, \n"
. " ci2.COI2_Country \n"
. "FROM COuntryInfo ci \n"
. " INNER JOIN COuntryInfo2 ci2 ON ci2.COI2_COI_SN = ci.COI_SN \n"
. "WHERE ci2.COI2_LGC = ? \n"
. " AND ci.COI_SN in($country_list)";
$query = $this->HT->query($sql, array($this->config->item('site_lgc')));
return $query->result();
}
@ -169,13 +180,13 @@ class Area_model extends CI_Model
case 's'://大洲
break;
case 'z'://公民游
break;
break;
default:
break;
}
return false;
}
//获取最后编辑信息的50个城市
function get_last_edit_city()
{
@ -194,4 +205,4 @@ class Area_model extends CI_Model
return $query->result();
}
}
}

@ -124,6 +124,21 @@ class InfoContents_model extends CI_Model
}
}
public function get_ic_contents2($ic_id)
{
$sql="SELECT top 1 ic_id, ic_content, ic_title, ic_url, ic_photo, ic_sitecode, ic_seo_description from infoContents where ic_id=?";
$query=$this->HT->query($sql,array($ic_id));
if ($query->result())
{
$row = $query->row();
return $row;
}
else
{
return FALSE;
}
}
public function get_ic_contents_by_list($ic_id_list)
{
$ic_id_list=trim($ic_id_list);

@ -33,6 +33,101 @@ class InfoMetas_model extends CI_Model {
$query = $this->HT->query($sql, array($im_ic_id, $im_key));
return $query->result();
}
function get_list_by_key($im_key) {
$sql = "
SELECT im.im_id
,im.im_ic_id
,im.im_key
,im.im_value
FROM infoMetas im
WHERE im.im_ic_id = ?
AND im.im_key = ?
ORDER BY im.im_id ASC
";
$query = $this->HT->query($sql, array($im_ic_id, $im_key));
return $query->result();
}
//列表所有含AMPmeta的信息。
public function list_amp($site_code) {
$sql = "
SELECT im.im_id
,im.im_ic_id
,c.ic_url
,c.ic_id
FROM infoMetas im
INNER JOIN infoContents c
ON c.ic_id = im.im_ic_id
LEFT JOIN infoMetas im2
ON im2.im_ic_id = im.im_ic_id AND im2.im_key = 'AMP_STATUS'
LEFT JOIN infoMetas im3
ON im3.im_ic_id = im.im_ic_id AND im2.im_key = 'AMP_SCHEMA'
WHERE im.im_key = 'AMP_JSON'
AND c.ic_sitecode = ?
AND c.ic_status = 1
AND CONVERT(varchar, im2.im_value) = '1'
";
$query = $this->HT->query($sql, array($site_code));
return $query->result();
}
//列表所有不含AMPmeta的信息。
public function list_no_amp($site_code) {
$sql = "
SELECT c0.ic_id, c0.ic_url
FROM infoContents c0
WHERE c0.ic_id not in (
SELECT c.ic_id
FROM infoMetas im
LEFT JOIN infoContents c
ON c.ic_id = im.im_ic_id
LEFT JOIN infoMetas im2
ON im2.im_ic_id = im.im_ic_id AND im2.im_key = 'AMP_STATUS'
LEFT JOIN infoMetas im3
ON im3.im_ic_id = im.im_ic_id AND im2.im_key = 'AMP_SCHEMA'
WHERE im.im_key = 'AMP_JSON'
AND c.ic_sitecode = ?
AND c.ic_status = 1
AND CONVERT(varchar, im2.im_value) = '1'
)
AND c0.ic_sitecode = ?
AND c0.ic_status = 1
AND c0.ic_url <> ''
AND datalength(c0.ic_content) > 0
AND CHARINDEX('search', c0.ic_url) = 0
AND CHARINDEX('faq', c0.ic_url) = 0
AND CHARINDEX('feedback', c0.ic_url) = 0
AND CHARINDEX('test', c0.ic_url) = 0
";
$query = $this->HT->query($sql, array($site_code, $site_code));
return $query->result();
}
//按节点列表信息含meta数据
function list_info_by_path_with_meta($is_path, $site_code) {
$sql = "SELECT is1.is_id, \n"
. " is1.is_path, \n"
. " ic.ic_id, \n"
. " ic.ic_url, \n"
. " ic.ic_status, \n"
. " ic.ic_template, \n"
. " ic.ic_sitecode, \n"
. " ic.ic_content, \n"
. " ic.ic_photo, \n"
. " ic.ic_title, \n"
. " ic.ic_type, \n"
. " im.im_id \n"
. " FROM infoStructures is1 \n"
. " INNER JOIN infoContents ic ON ic.ic_id = is1.is_ic_id \n"
. " AND ic.ic_sitecode = is1.is_sitecode \n"
. " LEFT JOIN infoMetas im ON im.im_ic_id = ic.ic_id AND im.im_key=?"
. " WHERE is1.is_path LIKE '$is_path%' AND is_sitecode = ? AND ic_status = 1"
. " ORDER BY is1.is_level, is1.is_sort, is1.is_path";
$query = $this->HT->query($sql, array('AMP_JSON', $site_code));
//print_r($this->HT->queries);
return $query->result();
}
function get($im_ic_id, $im_key) {
$sql = "SELECT im.im_value \n"

@ -0,0 +1,122 @@
<?php
class InfoTags_model extends CI_Model
{
//信息标签表
var $it_title = '';
var $it_memo = '';
//信息标签关联表
var $ic_id = '';
var $it_id = '';
function __construct()
{
parent::__construct();
$this->HT = $this->load->database('HT', TRUE);
}
/**
* 增加标签
*/
function add_tag()
{
if ($this->it_title)
{
//查看是否已存在标签
$sql = "SELECT TOP 1 * from infoTags WHERE it_title = N?";
$check = $this->HT->query($sql, array($this->it_title));
//添加标签
if ($check->num_rows() === 0)
{
$sql = "INSERT INTO infoTags (it_title, it_memo) VALUES (N?, N?)";
$query = $this->HT->query($sql, array($this->it_title, $this->it_memo));
return $this->HT->insert_id();
}
else
{
$row = $check->row();
return $row->it_id;
}
}
return FALSE;
}
/**
* 删除标签
*/
function remove_tag()
{
if ($this->it_title)
{
$sql = "DELETE FROM infoTags WHERE it_title = N?";
$query = $this->HT->query($sql, array($this->it_title));
return 'success';
}
return 'fail';
}
/**
* 标签列表
*/
function list_tag()
{
if ($this->ic_id)
{
//展示信息的标签
$sql = "SELECT * FROM infoContentToTag INNER JOIN infoTags ON icit_it_id = it_id WHERE icit_ic_id = ?";
$query = $this->HT->query($sql, array($this->ic_id));
return $query->result();
}
else
{
//全部展示
$sql = "SELECT * FROM infoTags ORDER BY it_title ASC, it_date DESC";
$query = $this->HT->query($sql);
return $query->result();
}
return 'fail';
}
/**
* 添加信息与标签的关联
*/
function add_tag_to_content()
{
if ($this->ic_id && $this->it_id)
{
//查看是否已存在关联
$sql = "SELECT TOP 1 * from infoContentToTag WHERE icit_ic_id = ? AND icit_it_id = ?";
$check = $this->HT->query($sql, array($this->ic_id, $this->it_id));
//添加关联
if ($check->num_rows() === 0)
{
$sql = "INSERT INTO infoContentToTag (icit_ic_id, icit_it_id) VALUES (?, ?)";
$query = $this->HT->query($sql, array($this->ic_id, $this->it_id));
}
else
{
return 'exist';
}
return 'success';
}
return 'fail';
}
/**
* 解除信息与标签的关联
*/
function remove_tag_to_content()
{
if ($this->ic_id && $this->it_id)
{
$sql = "DELETE FROM infoContentToTag WHERE icit_ic_id = ? and icit_it_id = ?";
$query = $this->HT->query($sql, array($this->ic_id, $this->it_id));
return 'success';
}
return 'fail';
}
}

@ -0,0 +1,122 @@
<?php
class InfoTags_model extends CI_Model
{
//信息标签表
var $it_title = '';
var $it_memo = '';
//信息标签关联表
var $ic_id = '';
var $it_id = '';
function __construct()
{
parent::__construct();
$this->HT = $this->load->database('HT', TRUE);
}
/**
* 增加标签
*/
function add_tag()
{
if ($this->it_title)
{
//查看是否已存在标签
$sql = "SELECT TOP 1 * from infoTags WHERE it_title = N?";
$check = $this->HT->query($sql, array($this->it_title));
//添加标签
if ($check->num_rows() === 0)
{
$sql = "INSERT INTO infoTags (it_title, it_memo) VALUES (N?, N?)";
$query = $this->HT->query($sql, array($this->it_title, $this->it_memo));
return $this->HT->insert_id();
}
else
{
$row = $check->row();
return $row->it_id;
}
}
return FALSE;
}
/**
* 删除标签
*/
function remove_tag()
{
if ($this->it_title)
{
$sql = "DELETE FROM infoTags WHERE it_title = N?";
$query = $this->HT->query($sql, array($this->it_title));
return 'success';
}
return 'fail';
}
/**
* 标签列表
*/
function list_tag()
{
if ($this->ic_id)
{
//展示信息的标签
$sql = "SELECT * FROM infoContentToTag INNER JOIN infoTags ON icit_it_id = it_id WHERE icit_ic_id = ?";
$query = $this->HT->query($sql, array($this->ic_id));
return $query->result();
}
else
{
//全部展示
$sql = "SELECT * FROM infoTags ORDER BY it_title ASC, it_date DESC";
$query = $this->HT->query($sql);
return $query->result();
}
return 'fail';
}
/**
* 添加信息与标签的关联
*/
function add_tag_to_content()
{
if ($this->ic_id && $this->it_id)
{
//查看是否已存在关联
$sql = "SELECT TOP 1 * from infoContentToTag WHERE icit_ic_id = ? AND icit_it_id = ?";
$check = $this->HT->query($sql, array($this->ic_id, $this->it_id));
//添加关联
if ($check->num_rows() === 0)
{
$sql = "INSERT INTO infoContentToTag (icit_ic_id, icit_it_id) VALUES (?, ?)";
$query = $this->HT->query($sql, array($this->ic_id, $this->it_id));
}
else
{
return 'exist';
}
return 'success';
}
return 'fail';
}
/**
* 解除信息与标签的关联
*/
function remove_tag_to_content()
{
if ($this->ic_id && $this->it_id)
{
$sql = "DELETE FROM infoContentToTag WHERE icit_ic_id = ? and icit_it_id = ?";
$query = $this->HT->query($sql, array($this->ic_id, $this->it_id));
return 'success';
}
return 'fail';
}
}

@ -2,6 +2,7 @@
class infoKeywords_model extends CI_Model
{
public $catch_day = 2;
function __construct()
{
parent::__construct();
@ -12,7 +13,7 @@ class infoKeywords_model extends CI_Model
public function get_structure_list(){
$sql = "SELECT is1.is_id AS id,
is1.is_parent_id AS pId,
kw_keyworlds+'('+isnull((select top 1 kwr_rank from infoKeywordsrank where kwr_kw_id=kw_id order by kwr_id desc),'#')+')' as name,
kw_keyworlds+'('+isnull((select top 1 ISNULL(kwr_rank, kwr_mobile_rank) AS kwr_rank from infoKeywordsrank where kwr_kw_id=kw_id order by kwr_id desc),'#')+')' as name,
kw_status AS status,
kw_id
FROM infoKeywords
@ -64,11 +65,14 @@ class infoKeywords_model extends CI_Model
}
//获取关键词列表用于抓取排名
public function get_keyworld_list($top=1,$engines='',$site_code=false)
public function get_keyworld_list_old($top = 1, $engines='',$site_code=false)
{
$today = strtotime(date('Y-m-d'));
$today = mktime(0,0,0,date("m"),(date("d")-$this->catch_day), date("Y"));
//只查某个站点,原因是个事业部服务器分开,只需要查询本事业部站点即可
$map = " ";
if ($engines=='yandex') {
if(!empty($site_code)){
$map.=" AND kw_sitecode in ('$site_code') ";
}else if ($engines=='yandex') {
$map=" AND kw_sitecode='ru' ";
}elseif ($engines=='baidu') {
$map.=" AND kw_sitecode='wt' ";
@ -77,9 +81,36 @@ class infoKeywords_model extends CI_Model
}elseif ($engines=='eu') {
$map.=" AND kw_sitecode in ('gm','vc','vac','ru','it','jp') ";
}
$today0 = mktime(0,0,0,date("m"),(date("d")-2), date("Y"));
$sql = "SELECT TOP 1 kw_id,
kw_keyworlds,
kw_is_id,
kw_sitecode,
kw_datetime,
kw_status
FROM infoKeywords
WHERE kw_status=1 AND kw_datetime<($today0) $map
ORDER BY kw_datetime asc";
$query = $this->HT->query($sql);
$result = $query->result();
return $result;
}
public function get_keyworld_list($top=1,$engines='',$site_code=false)
{
$today0 = mktime(0,0,0,date("m"),(date("d")-$this->catch_day), date("Y"));
$map = " ";
//只查某个站点,原因是个事业部服务器分开,只需要查询本事业部站点即可
if(!empty($site_code)){
$map.=" AND kw_sitecode in ('$site_code') ";
}else if ($engines=='yandex') {
$map=" AND kw_sitecode='ru' ";
}elseif ($engines=='baidu') {
$map.=" AND kw_sitecode='wt' ";
}elseif ($engines=='en') {
$map.=" AND kw_sitecode in ('cht','ct','sht','tbt','yz','gl','mbj','dct','mct','bht','ah') ";
}elseif ($engines=='eu') {
$map.=" AND kw_sitecode in ('gm','vc','vac','ru','it','jp') ";
}
$sql = "SELECT TOP $top kw_id,
kw_keyworlds,
@ -92,11 +123,14 @@ class infoKeywords_model extends CI_Model
kwr_mobile_rank,
kwr_id
FROM infoKeywords INNER JOIN infoKeywordsrank ON kwr_kw_id=kw_id
AND kwr_id = ( SELECT MAX(kwr_id) FROM infoKeywordsrank WHERE kwr_kw_id=kw_id )
AND (kwr_datetime<'$today'
OR kwr_mobile_rank IS NULL)
WHERE kw_status=1 $map
ORDER BY newid()";
AND kwr_id = ( SELECT top 1 kwr_id FROM infoKeywordsrank WHERE kwr_kw_id=kw_id order by kwr_id desc )
WHERE kw_status=1 $map
AND (
(kw_datetime>$today0 and kwr_mobile_rank IS NULL)
or
(kw_datetime<$today0)
)
ORDER BY kw_datetime ASC ";
$query = $this->HT->query($sql);
//print_r($this->HT->queries);
$result = $query->result();

@ -58,7 +58,25 @@ class infoKeywordsrank_model extends CI_Model
kw_keyworlds
FROM infoKeywordsrank LEFT JOIN infoKeywords ON kw_id=kwr_kw_id
WHERE kwr_kw_id in ($kw_id_string) $map
ORDER BY kwr_datetime DESC";
ORDER BY kwr_id DESC";
$query = $this->HT->query($sql);
return $query->result();
}
public function get_last_pc_rank($kw_id_string, $top=1)
{
$sql = "SELECT top $top kwr_id,
kwr_kw_id,
kwr_rank,
kwr_mobile_rank,
kwr_source,
kwr_mobile_source,
kwr_engines,
kwr_datetime
FROM infoKeywordsrank
WHERE 1=1
and kwr_kw_id in ($kw_id_string)
and kwr_rank > 0
ORDER BY kwr_id DESC ";
$query = $this->HT->query($sql);
return $query->result();
}

@ -74,14 +74,14 @@ class Information_model extends CI_Model {
}
//根据根节点路径获取子节点列表
function get_list_by_path($path, $level = false) {
function get_list_by_path($path, $level = false, $site_code = false) {
$this->init();
if ($level !== false) {
$this->level = " AND is1.is_level= '$level' ";
}
$this->path = " AND is1.is_path LIKE '$path%' ";
$this->orderBy = ' ORDER BY is1.is_level ASC, is1.is_sort ASC,is1.is_path ASC ';
return $this->GetList();
return $this->GetList('', $site_code);
}
//根据路径获取某一级别节点详细页
@ -129,7 +129,7 @@ class Information_model extends CI_Model {
return $this->GetList();
}
function GetList($filed = "") {
function GetList($filed = "", $site_code = "") {
$this->topNum ? $sql = "SELECT TOP " . $this->topNum : $sql = "SELECT ";
if (empty($filed)) {
$sql .= " is1.is_id, \n"
@ -168,6 +168,8 @@ class Information_model extends CI_Model {
} else {
$sql.=" $filed ";
}
//添加查询AMP发布状态
$sql.=",isnull((select top 1 CONVERT(varchar, im_value) from infoMetas where im_ic_id=ic_id and im_key='AMP_STATUS'),0) as amp_status ";
$sql.="FROM infoStructures is1 \n"
. " INNER JOIN infoContents ic ON ic.ic_id = is1.is_ic_id \n"
. " AND ic.ic_sitecode = is1.is_sitecode \n"
@ -187,7 +189,7 @@ class Information_model extends CI_Model {
$this->orderBy ? $sql.=$this->orderBy : false;
$query = $this->HT->query($sql, array($this->config->item('site_code')));
$query = $this->HT->query($sql, array($site_code ? $site_code : $this->config->item('site_code')));
//print_r($this->HT->queries);
if ($this->topNum === 1) {
if ($query->num_rows() > 0) {

@ -59,6 +59,24 @@ class Orders_model extends CI_Model {
}
}
//获取当天商务订单
function biz_count() {
$date_start = date('Y-m-d', time() - 86400);//减一天
$date_end = date('Y-m-d', time() + 86400);//加一天
$sql = "
SELECT COUNT(1) AS CLI_COUNT
FROM BIZ_ConfirmLineInfo bcli
WHERE bcli.COLI_ApplyDate BETWEEN '$date_start 00:00:00' AND '$date_end 23:59:59'
";
$query = $this->HT->query($sql);
if ($query->num_rows() > 0) {
$row = $query->row();
return $row->CLI_COUNT;
} else {
return FALSE;
}
}
//获取当天商务订单
function get_biz_info($sitecode) {
$sql = "SELECT bcli.COLI_ID, n"

@ -6,7 +6,7 @@ if (!defined('BASEPATH'))
class Index extends CI_Controller
{
public function __construct()
public function __construct()
{
parent::__construct();
$this->permission->is_admin();
@ -55,6 +55,7 @@ class Index extends CI_Controller
$data['advertise']=$this->advertise_model->get_advertise_treeid($data['ad_is_id']);
$data['webpage_list']=$this->advertise_model->get_advertise_page($data['ad_is_id']);
$data['click_rate']=$this->advertise_model->get_click_rate($data['advertise']->ad_id);
$data['advertise']->ad_content = str_replace("url=//","url=https://",$data['advertise']->ad_content);
$this->load->view('bootstrap3/header', $data);
$this->load->view('advertise');
$this->load->view('bootstrap3/footer');
@ -167,4 +168,4 @@ class Index extends CI_Controller
echo $result;
}
}
}

@ -1,146 +1,330 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Index extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->library('simple_html_dom_lib');
}
public function index() {
$this->load->view('welcome');
}
public function optimize() {
$htmlsource = $this->input->post('htmlsource');
$websitehost = $this->input->post('websitehost');
if (empty($htmlsource) || empty($websitehost)) {
$this->output->set_status_header(500);
echo 'error:htmlsource or websitehost is empty!';
log_message('error', "htmlsource or websitehost is empty! " . $websitehost);
return false;
}
//域名后面不能有/
if (substr($websitehost, -1, 1) == '/') {
$websitehost = substr($websitehost, 0, -1);
}
$html_object = str_get_html($htmlsource);
if (!empty($html_object)) {
//提取和下载所有CSS样式包括链接文件和页面样式
$link_css_array = array();
$css_content = '';
foreach ($html_object->find('link') as $link_css) {
if ($link_css->rel == 'stylesheet' && !empty($link_css->href)) {
$link_css_array[] = $link_css->href;
$link_css->outertext = ''; //删除链接
}
}
//print_r($link_css_array);
foreach ($link_css_array as $item) {
$get_http_temp = GET_HTTP($this->format_url($item, $websitehost));
if ($get_http_temp == false) {
$this->output->set_status_header(404);
echo 'CSS文件下载错误';
log_message('error', "optimize CSS文件下载错误! " . $item);
return FALSE;
}
$css_content.=$get_http_temp;
}
foreach ($html_object->find('style') as $style_css) {
if ($style_css->type == "text/css") {
$css_content .= $style_css->innertext;
}
}
// echo $css_content;
// echo $html_object;die();
//
//提取和下载所有JS脚本包括链接文件和页面脚本
$link_js_array = array();
$js_inline_content = '';
$js_jquery_content = '';
foreach ($html_object->find('script') as $link_script) {
if (!empty($link_script->src)) {
if(empty($link_script->defer)){ //没有defer标记的才处理否则让js延后加载
$link_js_array[] = $link_script->src;
$link_script->outertext = ''; //删除链接,移动到页底
}
} else {
//网页内的js不需要提取
//$js_content.= $link_script->innertext;//js的内容
// $js_content.= $link_script;//js的内容包含<script>
//含有$表示调用了jquery的函数添加延迟加载defer
if (strpos($link_script, '$') !== FALSE) {
$js_jquery_content.= $link_script->innertext;
} else {
$js_inline_content.= $link_script; //js的内容包含<script>
}
$link_script->outertext = ''; //删除js移动到页底
}
}
$js_scr_content = '';
foreach ($link_js_array as $item) {
$get_http_temp = GET_HTTP($this->format_url($item, $websitehost));
if ($get_http_temp == false) {
$this->output->set_status_header(404);
echo 'JS文件下载错误';
log_message('error', "optimize js文件下载错误! " . $item);
return FALSE;
}
$js_scr_content.=$get_http_temp;
}
//echo $js_content;
//把网页内容和css提交到purifycss处理
$optimize_css = GET_HTTP('http://184.172.113.219:33033/', 'html_source=' . urlencode($htmlsource) . '&html_css=' . urlencode($css_content), 'POST');
if (empty($optimize_css)) {
$this->output->set_status_header(500);
echo 'css精简错误';
return FALSE;
}
//把精简的css添加到head前面
$html_object = str_replace('</head>', '<style type="text/css">' . $optimize_css . "</style></head>", $html_object);
//删除多余空格和换行符
$html_object = str_replace(array(" ", "\t", "\n", "\r"), " ", $html_object);
//循环n次把双空格替换为一个空格
for ($i = 0; $i <= 4; $i++) {
$html_object = str_replace(" ", " ", $html_object);
}
//在最后加载原始css文件和js文件
//把css移动到页面底部延迟加载
$lastload_js = '<noscript id="deferred-styles">';
foreach ($link_css_array as $item) {
$lastload_js.='<link rel="stylesheet" type="text/css" href="' . $item . '"/>';
}
$lastload_js.='</noscript><script>var loadDeferredStyles=function(){var addStylesNode=document.getElementById("deferred-styles");var replacement=document.createElement("div");replacement.innerHTML=addStylesNode.textContent;document.body.appendChild(replacement);addStylesNode.parentElement.removeChild(addStylesNode)};var raf=requestAnimationFrame||mozRequestAnimationFrame||webkitRequestAnimationFrame||msRequestAnimationFrame;if(raf){raf(function(){window.setTimeout(loadDeferredStyles,0)})}else{window.addEventListener("load",loadDeferredStyles)};</script>';
$js_content = $js_scr_content . $js_jquery_content;
//延迟加载js需要把返回的js代码保存到一个文件中然后替换占位符以便加载js文件
$lastload_js.='<script defer src="##DEFERSCRIPTDEFER##"></script>';
$lastload_js.=$js_inline_content;
$html_object = str_replace('</body>', $lastload_js . '</body>', $html_object);
}
echo json_encode(array('result' => 'ok', 'data' => array('html_object' => $html_object, 'js_content' => $js_content)));
}
//格式化url保证请求的URL有域名//更换为对应的域名路径
function format_url($url, $host = '') {
if (substr($url, 0, 8) == 'https://' || substr($url, 0, 7) == 'http://') {
return urldecode($url);
}
if (substr($url, 0, 2) == '//') { //https或http
return urldecode(str_replace('//', 'http://', $url));
}
return urldecode($host . $url);
}
}
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
class Index extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->library('simple_html_dom_lib');
}
public function index()
{
$this->load->view('welcome');
}
public function optimize()
{
$htmlsource = $this->input->post('htmlsource');
$websitehost = $this->input->post('websitehost');
$template_name = $this->input->post('template_name');
$create_amp = $this->input->post('create_amp');
$debug = $this->input->post('debug');
if (empty($htmlsource) || empty($websitehost)) {
$this->output->set_status_header(500);
echo 'error:htmlsource or websitehost is empty!';
log_message('error', "htmlsource or websitehost is empty! " . $websitehost);
return false;
}
//域名后面不能有/
if (substr($websitehost, -1, 1) == '/') {
$websitehost = substr($websitehost, 0, -1);
}
$html_object = str_get_html($htmlsource);
if (!empty($html_object)) {
//提取和下载所有CSS样式包括链接文件和页面样式
$link_css_array = array();
$css_content = '';
foreach ($html_object->find('link') as $link_css) {
if ($link_css->rel == 'stylesheet' && !empty($link_css->href)) {
$link_css_array[] = $link_css->href;
$link_css->outertext = ''; //删除链接
}
}
//print_r($link_css_array);
foreach ($link_css_array as $item) {
$get_http_temp = GET_HTTP($this->format_url($item, $websitehost));
if ($get_http_temp == false) {
$this->output->set_status_header(404);
echo 'CSS文件下载错误';
log_message('error', "optimize CSS文件下载错误! " . $item);
return FALSE;
}
$css_content .= $get_http_temp;
}
foreach ($html_object->find('style') as $style_css) {
if ($style_css->type == "text/css") {
$css_content .= $style_css->innertext;
}
}
// echo $css_content;
// echo $html_object;die();
//
//提取和下载所有JS脚本包括链接文件和页面脚本
$link_js_array = array();
$js_inline_content = '';
$js_jquery_content = '';
foreach ($html_object->find('script') as $link_script) {
if (!empty($link_script->src)) {
if (empty($link_script->defer) && empty($link_script->async)) { //没有defer标记的才处理否则让js延后加载
$link_js_array[] = $link_script->src;
$link_script->outertext = ''; //删除链接,移动到页底
}
} else {
//网页内的js不需要提取
//$js_content.= $link_script->innertext;//js的内容
// $js_content.= $link_script;//js的内容包含<script>
//含有$表示调用了jquery的函数添加延迟加载defer
if (strpos($link_script, '$') !== FALSE) {
$js_jquery_content .= $link_script->innertext;
} else {
$js_inline_content .= $link_script; //js的内容包含<script>
}
$link_script->outertext = ''; //删除js移动到页底
}
}
$js_scr_content = '';
foreach ($link_js_array as $item) {
$get_http_temp = GET_HTTP($this->format_url($item, $websitehost));
if ($get_http_temp == false) {
$this->output->set_status_header(404);
echo 'JS文件下载错误';
log_message('error', "optimize js文件下载错误! " . $item);
return FALSE;
}
$js_scr_content .= $get_http_temp;
}
//echo $js_content;
//把网页内容和css提交到purifycss处理
$purifycss_server = 'http://184.172.113.216:33033/';
if (strpos($websitehost, 'chinarundreisen.com') !== false) {//德语站点使用自己的css处理服务器
$purifycss_server = 'http://158.177.67.52:33033/';
}
$optimize_css = GET_HTTP($purifycss_server, 'html_source=' . urlencode($htmlsource) . '&html_css=' . urlencode($css_content), 'POST');
if (empty($optimize_css)) {
$this->output->set_status_header(500);
echo 'css精简错误';
return FALSE;
}
//把精简的css添加到head前面
$html_object = str_replace('</head>', '<style type="text/css">' . $optimize_css . "</style></head>", $html_object);
//删除多余空格和换行符
$html_object = str_replace(array(" ", "\t", "\n", "\r"), " ", $html_object);
//循环n次把双空格替换为一个空格
for ($i = 0; $i <= 4; $i++) {
$html_object = str_replace(" ", " ", $html_object);
}
//在最后加载原始css文件和js文件
//把css移动到页面底部延迟加载
$lastload_js = '<noscript id="deferred-styles">';
foreach ($link_css_array as $item) {
$lastload_js .= '<link rel="stylesheet" type="text/css" href="' . $item . '"/>';
}
$lastload_js .= '</noscript><script>var loadDeferredStyles=function(){var addStylesNode=document.getElementById("deferred-styles");var replacement=document.createElement("div");replacement.innerHTML=addStylesNode.textContent;document.body.appendChild(replacement);addStylesNode.parentElement.removeChild(addStylesNode)};var raf=requestAnimationFrame||mozRequestAnimationFrame||webkitRequestAnimationFrame||msRequestAnimationFrame;if(raf){raf(function(){window.setTimeout(loadDeferredStyles,0)})}else{window.addEventListener("load",loadDeferredStyles)};</script>';
$js_content = $js_scr_content . $js_jquery_content;
//延迟加载js需要把返回的js代码保存到一个文件中然后替换占位符以便加载js文件
$lastload_js .= '<script async src="##DEFERSCRIPTDEFER##"></script>';
$lastload_js .= $js_inline_content;
$html_object = str_replace('</body>', $lastload_js . '</body>', $html_object);
}
//只返回AMP代码
if (!empty($create_amp)) {
$amp = $this->create_amp($html_object, $template_name, $websitehost,$debug);
echo json_encode(array('result' => 'ok', 'data' => array('amp' => $amp)));
return;
}
echo json_encode(array('result' => 'ok', 'data' => array('html_object' => $html_object, 'js_content' => $js_content)));
}
//格式化url保证请求的URL有域名//更换为对应的域名路径
function format_url($url, $host = '')
{
if (substr($url, 0, 8) == 'https://' || substr($url, 0, 7) == 'http://') {
$url = str_replace('http://', 'https://', $url);//http要改为https
return urldecode($url);
}
if (substr($url, 0, 2) == '//') { //https或http
return urldecode(str_replace('//', 'https://', $url));
}
return urldecode($host . $url);
}
//生成AMP版本 用移动端版本生成
/*
1.加载站点AMP模板模板只有导航、头部、底部
2.删除全部js引用和内链代码
3.删除全部css引用内联css放入<style amp-custom>
4.图片全部替换成amp-img设置宽高设置layout="responsive"
5.去掉所有元素中的style
6.去掉样式表中的!important
7.替换读取源文件title description keywords canonical
8.todo:增加application/ld+json
要求: 图片文件必须带有域名,否则的获取尺寸会出错,如 https://data.asiahighlights.com/pic/abc.jpg
*/
//$htmlsource 移动端版本的HTML对象 $cache_path AMP文件保存路径
function create_amp($htmlsource, $site_code, $websitehost,$debug=false)
{
$html_object = str_get_html($htmlsource);
//读取站点的AMP模板
$amp_template = $this->load->view('amp-template/' . $site_code, null, true);
//生成移动版本,删除多余元素
foreach ($html_object->find('.hidden-xs') as $hidden_item) {
$hidden_item->outertext = '';
}
foreach ($html_object->find('title') as $title) {
$amp_template = str_replace('<!--@TITLE@-->', $title->innertext, $amp_template);
}
foreach ($html_object->find('meta') as $meta) {
if ($meta->name == 'description') {
$amp_template = str_replace('<!--@DESCRIPTION@-->', $meta->content, $amp_template);
}
if ($meta->name == 'keywords') {
$amp_template = str_replace('<!--@KEYWORDS@-->', $meta->content, $amp_template);
}
}
foreach ($html_object->find('script') as $script) {
$script->outertext = '';
}
foreach ($html_object->find('noscript') as $noscript) {
$noscript->outertext = '';
}
foreach ($html_object->find('link') as $link) {
if ($link->rel == 'stylesheet' && !empty($link->href)) {
$link->outertext = '';
}
if ($link->rel == 'canonical' && !empty($link->href)) {
$amp_template = str_replace('<!--@CANONICAL@-->', $link->href, $amp_template);
}
}
$style_content = '';
foreach ($html_object->find('style') as $style) {
$style_content .= $style->innertext;
$style->outertext = '';
}
$style_content = str_replace('!important', '', $style_content);
$style_content = str_replace('@charset "utf-8";', '', $style_content);
$amp_template = str_replace('/*@CUSTOM-CSS@*/', $style_content, $amp_template);
//获取图片尺寸AMP要求必须填写width和height
//格式化图片URL
foreach ($html_object->find('img') as $image) {
if (!empty($image->src)) {
$img_src_host = parse_url($image->src, PHP_URL_HOST);
if (empty($img_src_host)) {
$img_src_host = $websitehost;
}
$image->src = $this->format_url($image->src, $img_src_host);
}
if (!empty($image->originalsrc)) {
$img_src_host = parse_url($image->src, PHP_URL_HOST);
if (empty($img_src_host)) {
$img_src_host = $websitehost;
}
$image->originalsrc = $this->format_url($image->originalsrc, $img_src_host);
}
}
//拼接请求的图片url如 https://data.asiahighlights.com/imagesize.php?photo=/pic/logo-ah.png,/pic/ah-slide-logo.png
$request_size = array();
foreach ($html_object->find('img') as $image) {
$img_src = $image->src;
if (!empty($image->originalsrc)) {
$img_src = $image->originalsrc;
}
if (strpos($img_src, 'facebook.com') !== false || strpos($img_src, 'dmca.com') !== false) {//facebook dmca会添加一个跟踪代码需要删除掉否则获取图片尺寸会报错
$image->outertext = '';
continue;
}
$img_src_urls = parse_url($img_src);
$request_size[$img_src_urls['host']][] = $img_src_urls['path'];
}
if($debug){
print_r($request_size);
}
//请求图片尺寸
$image_sizes = array();
foreach ($request_size as $host => $path) {
$parse_url = "https://{$host}/imagesize.php?photo=" . implode(',', $path);
$size_data = GET_HTTP($parse_url);
if (!empty($size_data)) {
$size_data = json_decode($size_data);
foreach ($size_data as $size_item) {
$size_item->photo = "https://{$host}" . $size_item->photo;
$image_sizes[$size_item->photo] = $size_item;
}
}
}
if($debug){
print_r($image_sizes);
}
//获取图片尺寸 end
foreach ($html_object->find('img') as $image) {
$img_src = $image->src;
if (!empty($image->originalsrc)) {
$img_src = $image->originalsrc;
}
if(empty($image_sizes[$img_src])){
//如果尺寸不存在则跳过
continue;
}
$img_size = $image_sizes[$img_src];
$img_alt = $image->alt;
$img_class = $image->class;
if (!empty($img_size)) {
//添加webp图片支持
$img_src_webp='';
if(substr($img_src, -4) == '.jpg'){
$img_src_jpg=" <amp-img fallback layout=\"responsive\" class=\"{$img_class}\" alt=\"{$img_alt}\" src=\"{$img_src}\" width=\"{$img_size->width}\" height=\"{$img_size->height}\"></amp-img>";
$img_src_webp=substr($img_src, 0, strlen($img_src) - 4).'.webp';
$img_src_webp = " <amp-img layout=\"responsive\" class=\"{$img_class}\" alt=\"{$img_alt}\" src=\"{$img_src_webp}\" width=\"{$img_size->width}\" height=\"{$img_size->height}\">{$img_src_jpg}</amp-img>";
}
if(!empty($img_src_webp)){
$image->outertext =$img_src_webp;
}else{
$image->outertext = " <amp-img layout=\"responsive\" class=\"{$img_class}\" alt=\"{$img_alt}\" src=\"{$img_src}\" width=\"{$img_size->width}\" height=\"{$img_size->height}\"></amp-img>";
}
}
}
foreach ($html_object->find('#content_main') as $content_main) {
$amp_template = str_replace('<!--@CUSTOM-CONENT@-->', $content_main, $amp_template);
}
//替换掉写在组件上的样式
$amp_template = preg_replace('/style=.+?[\'|"]/i', '', $amp_template);
return $amp_template;
}
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,133 @@
<!doctype html>
<html amp lang="en">
<head>
<meta charset="utf-8">
<title><!--@TITLE@--></title>
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<meta name="description" content="<!--@DESCRIPTION@-->">
<link rel="shortcut icon" href="https://data.chinahighlights.com/favicon.ico" />
<link rel="canonical" href="<!--@CANONICAL@-->">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
<link rel="shortcut icon" href="https://data.asiahighlights.com/favicon.ico" />
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
<script custom-element="amp-sidebar" src="https://cdn.ampproject.org/v0/amp-sidebar-0.1.js" async></script>
<script async custom-element="amp-accordion" src="https://cdn.ampproject.org/v0/amp-accordion-0.1.js"></script>
<style amp-custom>
body{margin:0;font-family:'Open Sans',Arial,Helvetica,sans-serif;font-size:14px;color:#545454;background:#fff}sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;top:-5px}a{color:#545454}a:hover{text-decoration:none;color:#a31022}h1{font-size:25px;font-weight:400;margin:0 0 25px 0}h2{font-size:25px;font-weight:400;margin-bottom:15px;margin-top:50px}h3{font-size:20px;font-weight:normal}p{line-height:30px;margin-bottom:20px;font-size:18px}ul.drop1{display:block;padding-left:0;margin-left:0}ul.drop1 li{list-style:none;line-height:20px;margin-bottom:10px;font-size:16px;background:url(https://data.chinahighlights.com/pic/square.png) no-repeat left;padding-left:20px}footer{background:#444;color:#fff}footer a{color:#fff;text-decoration:none}@media(max-width:376px){.brand{width:54%;font-size:14px}}@media(min-width:400px){.brand{width:60%;font-size:16px}}.brand{display:inline-block;text-align:center;color:#fff;font-weight:300;text-transform:uppercase;margin-top:15px}.ampstart-headerbar .ampstart-navbar-trigger{background:#a31022;position:fixed;width:100%;z-index:9999;margin-top:-5px;height:60px}.customizeBtn{font-size:12px;border:1px solid #d1d1d1;border-radius:2px;padding:2px 8px;display:inline-block;height:25px;line-height:19px;float:right;margin:20px 15px 0 0}.customizeBtn a{color:#fff;text-decoration:none}#crumbNav{font-size:12px;color:#a31022;position:relative;margin:0 0 20px}#crumbNav a{text-decoration:none;padding:2px 8px 4px 0;color:#444}#crumbNav a:after{content:"";margin-left:5px;font-size:16px}#crumbNav a:hover{color:#a31022;text-decoration:none}@font-face{font-family:FontAwesome;src:url(https://data.chinahighlights.com/public/fonts/fontawesome-webfont.eot?v=4.7.0);src:url(https://data.chinahighlights.com/public/fonts/fontawesome-webfont.eot?#iefix&v=4.7.0) format('embedded-opentype'),url(https://data.chinahighlights.com/public/fonts/fontawesome-webfont.woff2?v=4.7.0) format('woff2'),url(https://data.chinahighlights.com/public/fonts/fontawesome-webfont.woff?v=4.7.0) format('woff'),url(https://data.chinahighlights.com/public/fonts/fontawesome-webfont.ttf?v=4.7.0) format('truetype'),url(https://data.chinahighlights.com/public/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular) format('svg');font-weight:400;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-facebook-square:before{content:"\f082"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-tripadvisor:before{content:"\f262"}.fa-500px:before{content:"\f26e"}.fa-angle-down:before{content:"\f107"}.fa-square-o:before{content:"\f096"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-facebook-square:before{content:"\f082"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-twitter:before{content:"\f099"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-tripadvisor:before{content:"\f262"}.fa-500px:before{content:"\f26e"}.fa-angle-down:before{content:"\f107"}.fa-square-o:before{content:"\f096"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9";color:#fff;margin:5px 0 0 15px;font-size:22px}
.fa-google-plus::before{content:"\f0d5"}.ampstart-headerbar{background-color:#fff;color:#000;z-index:999;box-shadow:0 0 5px 2px rgba(0,0,0,.1)}.ampstart-headerbar+:not(amp-sidebar),.ampstart-headerbar-nav .ampstart-nav-item{padding:0 1rem;background:transparent;opacity:.8}.ampstart-headerbar-nav{line-height:3.5rem}.ampstart-nav-item:active,.ampstart-nav-item:focus,.ampstart-nav-item:hover{opacity:1}.ampstart-navbar-trigger:focus{outline:0}.ampstart-nav a,.ampstart-navbar-trigger,.ampstart-sidebar-faq a{cursor:pointer;text-decoration:none}.ampstart-nav .ampstart-label{color:inherit;padding-left:0}.ampstart-navbar-trigger{line-height:3.5rem;font-size:2.2rem}.ampstart-headerbar-nav{-webkit-box-flex:1;-ms-flex:1;flex:1}.ampstart-nav-search{-webkit-box-flex:.5;-ms-flex-positive:.5;flex-grow:.5}.ampstart-headerbar .ampstart-nav-search:active,.ampstart-headerbar .ampstart-nav-search:focus,.ampstart-headerbar .ampstart-nav-search:hover{box-shadow:none}.ampstart-nav-dropdown{min-width:200px}.ampstart-nav-dropdown amp-accordion header{background-color:#fff;border:0}.ampstart-nav-dropdown amp-accordion ul{background-color:#fff}.ampstart-nav-dropdown .ampstart-dropdown-item,.ampstart-nav-dropdown .ampstart-dropdown>section>header{background-color:#fff;color:#000}.ampstart-nav-dropdown .ampstart-dropdown-item{color:#f88}.ampstart-sidebar{background-color:#555;color:#000;min-width:300px;width:300px}.ampstart-sidebar .ampstart-icon{fill:#f88}.ampstart-sidebar-header{line-height:3.5rem;min-height:3.5rem}.ampstart-sidebar .ampstart-dropdown-item,.ampstart-sidebar .ampstart-dropdown header,.ampstart-sidebar .ampstart-faq-item,.ampstart-sidebar .ampstart-nav-item,.ampstart-sidebar .ampstart-social-follow{margin:0 0 2rem}.ampstart-sidebar .ampstart-nav-dropdown{margin:0}.ampstart-sidebar .ampstart-navbar-trigger{line-height:inherit;text-align:right;margin-right:15px;color:#999}.ampstart-navbar-trigger svg{pointer-events:none;margin:15px 0 0 15px;color:#fff}.ampstart-headerbar{color:#f88;padding-right:1rem;background-color:#fff;height:3.5rem;box-shadow:none;border-bottom:1px solid #f3f3f3}.ampstart-headerbar .ampstart-navbar-trigger{color:#222;font-size:1.38rem;padding-right:0}.ampstart-navbar-trigger:focus{outline:5px auto -webkit-focus-ring-color}.ampstart-sidebar-nav-image{width:120px}.ampstart-icon,.ampstart-sidebar .ampstart-icon{fill:#222}.ampstart-sidebar-header{position:relative;z-index:1}.ampstart-nav{margin-bottom:2rem}.ampstart-nav-item{color:#222;border-bottom:1px solid #777;list-style:none;padding-bottom:8px}.ampstart-sidebar .ampstart-nav-item{margin-bottom:1rem;padding-left:30px}.ampstart-nav-link{font-size:16px;font-weight:400;line-height:normal;display:inline-block;margin-bottom:5px;position:relative;color:#fff;padding-bottom:3px}.ampstart-nav-link .fa{position:absolute;right:20px;top:3px}.amp-mode-mouse .ampstart-nav-link:after{left:0;position:absolute;-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transform-origin:left center;transform-origin:left center;-webkit-transition:-webkit-transform .3s cubic-bezier(.19,1,.22,1);transition:-webkit-transform .3s cubic-bezier(.19,1,.22,1);transition:transform .3s cubic-bezier(.19,1,.22,1);transition:transform .3s cubic-bezier(.19,1,.22,1),-webkit-transform .3s cubic-bezier(.19,1,.22,1);width:100%;bottom:0;height:2px;content:"";display:block}.ampstart-dropdown-items{padding-left:0}.ampstart-dropdown-items li{font-size:14px;text-transform:capitalize;line-height:35px;border-bottom:1px solid #777;margin-right:30px;padding-left:20px;padding-bottom:5px;list-style:none}.ampstart-dropdown-items li a{color:#fff}.ampstart-dropdown-items li:last-child{border-bottom:0}.ampstart-social-follow{-webkit-box-pack:initial;-ms-flex-pack:initial;justify-content:initial;display:inline-block}.ampstart-social-follow li{display:inline-block;margin-right:0}.footerLink{display:block;padding:20px 0 0;text-align:center}.footerLink a{margin:0 10px}.copyright{display:block;padding:20px 0;text-align:center}.socialLink{text-align:center;display:block;margin-top:50px}.socialLink a{text-decoration:none}.socialLink .fa{font-size:150%;margin:0 20px;color:#fff}.logo{text-align:center}.amphtml-accordion-header{background:0;border:0;margin-bottom:0}.clearfix{clear:both}.amp-tailor { display: block; margin:50px 15px 10px; background:#f1f1f1; padding:15px 15px 20px; font-size:18px; border-radius:4px; text-align:center;}.amp-tailor span { display: block; margin:15px auto 0; width:70%; text-align:center; background:#a31022; border-radius:4px;}.amp-tailor span a { text-decoration: none; color:#fff; padding:5px 10px; display: block; font-size:18px;}.amp-tailor span .fa { font-size:130%; margin-left:10px;}
/*@CUSTOM-CSS@*/
#contentHead{padding-top: 8px;}
</style>
</head>
<body>
<!-- Start Navbar -->
<header class="ampstart-headerbar flex justify-start items-center top-0 left-0 right-0 pl2 pr4 pt2 md-pt0">
<div role="button" aria-label="open sidebar" on="tap:header-sidebar.toggle" tabindex="0" class="ampstart-navbar-trigger pr2 absolute top-0 pr0 mr2 mt2">
<i class="fa fa-bars" aria-hidden="true"></i>
<span class="brand">China Highlights <sup>®</sup></span>
<span class="customizeBtn"><a href="/tour/create-my-trip.htm"> CUSTOMIZE </a></span>
</div>
</header>
<!-- Start Sidebar -->
<amp-sidebar id="header-sidebar" class="ampstart-sidebar px3 md-flex flex-column justify-content items-center justify-center" layout="nodisplay">
<div class="flex justify-start items-center ampstart-sidebar-header">
<div role="button" aria-label="close sidebar" on="tap:header-sidebar.toggle" tabindex="0" class="ampstart-navbar-trigger items-start"></div>
</div>
<nav class="ampstart-sidebar-nav ampstart-nav ">
<ul class="list-reset m0 p0 ampstart-label">
<li class="ampstart-nav-item"><a class="ampstart-nav-link" href="/">Home</a></li>
<li class="ampstart-nav-item "><a class="ampstart-nav-link" href="/tour/create-my-trip.htm">Create My Trip</a></li>
<li class="ampstart-nav-item">
<amp-accordion>
<section>
<h3 class="ampstart-nav-link amphtml-accordion-header"><a href="/tour/" class="ampstart-nav-link">China Tours</a> <i class="fa fa-angle-right" aria-hidden="true"></i></h3>
<ul class="ampstart-dropdown-items list-reset ">
<li><a href="/tour/top-china-tours/">Top 10 Tours</a> </li>
<li><a href="/tour/china-panda-tours/">Panda Tours</a></li>
<li><a href="/tour/family-tours/">Family Tours</a></li>
<li><a href="/tour/silk-road-tours/">Silk Road Tours</a></li>
<li><a href="/yangtzecruise/">Yangtze Cruise</a></li>
<li><a href="/tour/year.htm">China Tours 2019</a></li>
</ul>
</section>
</amp-accordion>
</li>
<li class="ampstart-nav-item">
<amp-accordion>
<section>
<h3 class="ampstart-nav-link amphtml-accordion-header"><a href="/citytour/" class="ampstart-nav-link">Destinations</a> <i class="fa fa-angle-right" aria-hidden="true"></i></h3>
<ul class="ampstart-dropdown-items list-reset">
<li><a href="/beijing/tours.htm">Beijing</a></li>
<li><a href="/shanghai/tours.htm">Shanghai</a></li>
<li><a href="/guilin/tours.htm">Guilin</a></li>
<li><a href="/chengdu/tours.htm">Chengdu</a></li>
<li><a href="/xian/tours.htm">Xi'an</a></li>
<li><a href="/tibet/tours.htm">Tibet</a></li>
<li><a href="/zhangjiajie/tours.htm">Zhangjiajie</a></li>
</ul>
</section>
</amp-accordion>
</li>
<li class="ampstart-nav-item">
<amp-accordion>
<section>
<h3 class="ampstart-nav-link amphtml-accordion-header"><a href="/travelguide/" class="ampstart-nav-link">Travel Guide</a> <i class="fa fa-angle-right" aria-hidden="true"></i></h3>
<ul class="ampstart-dropdown-items list-reset">
<li><a href="/travelguide/visa-application/">China Visas</a></li>
<li><a href="/beijing/">Beijing</a></li>
<li><a href="/greatwall/">The Great Wall of China</a></li>
<li><a href="/travelguide/china-top-10-attractions.htm">Chinas Top 10 Attractions</a></li>
<li><a href="/giant-panda/">Giant Pandas</a></li>
<li><a href="/xian/terracotta-army/">The Terracotta Army</a></li>
<li><a href="/travelguide/top-highlights-of-china.htm">Best of China</a></li>
</ul>
</section>
</amp-accordion>
</li>
<li class="ampstart-nav-item">
<amp-accordion>
<section>
<h3 class="ampstart-nav-link amphtml-accordion-header"><a href="/travelguide/culture/" class="ampstart-nav-link">Culture</a> <i class="fa fa-angle-right" aria-hidden="true"></i></h3>
<ul class="ampstart-dropdown-items list-reset">
<li><a href="/travelguide/chinese-zodiac/">Chinese Zodiac</a></li>
<li><a href="/travelguide/special-report/chinese-new-year/">Chinese New Year</a></li>
<li><a href="/festivals/mid-autumn-festival.htm">Mid-autumn Festival</a></li>
<li><a href="/festivals/china-public-holiday.htm">Public Holiday Schedule</a></li>
</ul>
</section>
</amp-accordion>
</li>
<li class="ampstart-nav-item "><a class="ampstart-nav-link" href="/china-trains/">Trains</a></li>
<li class="ampstart-nav-item "><a class="ampstart-nav-link" href="/daytrip/">Day Tours</a></li>
<li class="ampstart-nav-item "><a class="ampstart-nav-link" href="/contactus/">Contact Us</a></li>
</ul>
</nav>
<span class="socialLink"><a class="fb fa fa-facebook" title="Follow us on Facebook" rel="nofollow" href="https://www.facebook.com/chinahighlights"></a><a class="tw fa fa-twitter" title="Share us on Twitter" rel="nofollow" href="https://twitter.com/chinahighlights"></a> <a class="tw fa fa-google-plus" title="Share us on Google Plus" rel="nofollow" href="https://plus.google.com/115440226907925048044"></a> <a class="tw fa fa-instagram" title="Share us on Instagram" rel="nofollow" href="https://instagram.com/chinahighlights"></a></span>
</amp-sidebar>
<!-- End Sidebar -->
<!--@CUSTOM-CONENT@-->
<div class="amp-tailor">
Start planning your tailor-made China tour …
<span><a href="/tour/create-my-trip.htm">Create My Trip <i class="fa fa-angle-right"></i></a></span>
</div>
<footer>
<div class="footerLink"><a href="/contactus/" >Contact us</a> | <a href="/aboutus/" >About us</a></div>
<div class="copyright">© 1998-2018 China Highlights</div>
</footer>
<!-- Google Analytics -->
<amp-analytics type="googleanalytics">
<script type="application/json">
{"vars": {"account": "UA-31694-1"}, "triggers": {"default pageview": {"on": "visible", "request": "pageview", "vars": {"title": "<!--@TITLE@-->"}}}}
</script>
</amp-analytics>
<!-- Google Analytics -->
<!--AMP Builder-->
</body>
</html>

File diff suppressed because one or more lines are too long

@ -14,7 +14,23 @@
<h1>页面样式精简</h1>
<form name="form_htmlsource" id="form_htmlsource" action="<?php echo site_url('apps/htmlcompressor/index/optimize'); ?>" method="post">
<input type="text" name="websitehost" id="websitehost" style="width:200px;" placeholder="域名" /><br/><br/>
<textarea name="htmlsource" id="htmlsource" rows="22" style="width:800px;" placeholder="网页代码" ></textarea>
<textarea name="htmlsource" id="htmlsource" rows="22" style="width:800px;" placeholder="网页代码" ></textarea><br/><br/>
<label><input type="checkbox" value="true" name="create_amp">生成AMP页面</label>
<select name="template_name" id="template_name" class="form-control" onselect="">
<option selected="" value="none">模板选择生成AMP才需要</option>
<option value="ah">AH</option>
<option value="gm">GM</option>
<option value="cht">CHT</option>
<option value="ct">CT</option>
</select>
<select name="debug" id="debug" class="form-control" onselect="">
<option selected="" value="0">不调试</option>
<option value="1">开启调试</option>
</select>
<br/><br/>
<input type="submit"/>
</form>

@ -57,6 +57,11 @@ class Confirm extends CI_Controller {
$COLI_SN = $this->input->post('COLI_SN');
$visitor_link = $this->input->post('visitor_link');
$COLI_ID = $this->input->post('COLI_ID');
//航班信息
$MEI_ArrivalFlightNo = $this->input->post('MEI_ArrivalFlightNo');
$MEI_ArrivalTime = $this->input->post('MEI_ArrivalTime');
$MEI_DepartureFlightNo = $this->input->post('MEI_DepartureFlightNo');
$MEI_DepartureTime = $this->input->post('MEI_DepartureTime');
//已经确认过
@ -85,34 +90,21 @@ class Confirm extends CI_Controller {
$MEI_LastName = $name;
if ($this->input->post('arrive_flight')) {
$CUL_Memo = 'Arrival China Flight No : '
. $this->input->post('arrive_flight')
. ' & Arrival time : '
. $this->input->post('arrive_time')
. ' & Departure China Flight no : '
. $this->input->post('departure_flight')
. ' & Departure time : '
. $this->input->post('depart_time');
} else {
$CUL_Memo = '';
}
$CUL_Memo .= $this->input->post('insurance_information');
$CUL_Memo = $this->input->post('insurance_information');
$MEI_Memo = $this->input->post('special_request') . ' ' . $CUL_Memo;
//$birthday[$key] = date('Y-m-d H:i:s', strtotime($birthday[$key]));
$birthday_tmp = date('Y-m-d H:i:s', strtotime($birthday[$key]));
//$expiration_date[$key] = date('Y-m-d H:i:s', strtotime($expiration_date[$key]));
$expiration_date_tmp = date('Y-m-d H:i:s', strtotime($expiration_date[$key]));
$MEI_SN = $this->Order_model->add_customer_info($gender[$key], $nationality[$key], $MEI_FirstName, $MEI_LastName, $passport[$key], $expiration_date_tmp, $birthday_tmp, $MEI_Memo, $MEI_Street, '', $contact_phone, 0, $COLI_SN, $visitor_link);
$MEI_SN = $this->Order_model->add_customer_info($gender[$key], $nationality[$key], $MEI_FirstName, $MEI_LastName, $passport[$key], $expiration_date_tmp, $birthday_tmp, $MEI_Memo, $MEI_Street, '', $contact_phone, 0, $COLI_SN, $visitor_link,$MEI_ArrivalFlightNo,$MEI_ArrivalTime,$MEI_DepartureFlightNo,$MEI_DepartureTime);
}
}
if ($MEI_SN && $this->input->post('emergency_person_name') != '') {
$add_emergency_res = $this->Order_model->add_customer_info(
'', '', $this->input->post('emergency_person_name'), '', '', '', '', $this->input->post('emergency_relationship'), '', $this->input->post('emergency_email'), $this->input->post('emergency_telephone'), 1, $COLI_SN, $visitor_link
,$MEI_ArrivalFlightNo,$MEI_ArrivalTime,$MEI_DepartureFlightNo,$MEI_DepartureTime
);
}

@ -43,7 +43,7 @@ class Order_model extends CI_Model {
}
//添加客人信息
public function add_customer_info($MEI_Gender,$MEI_Nationality,$MEI_FirstName,$MEI_LastName,$MEI_PassportNo,$MEI_PassportValidDate,$MEI_Birthday,$MEI_Memo,$MEI_Street,$MEI_MailList='',$MEI_Phone='',$CUL_IsEmergency=0,$CUL_COLI_SN='',$visitor_link='')
public function add_customer_info($MEI_Gender,$MEI_Nationality,$MEI_FirstName,$MEI_LastName,$MEI_PassportNo,$MEI_PassportValidDate,$MEI_Birthday,$MEI_Memo,$MEI_Street,$MEI_MailList='',$MEI_Phone='',$CUL_IsEmergency=0,$CUL_COLI_SN='',$visitor_link='',$MEI_ArrivalFlightNo,$MEI_ArrivalTime,$MEI_DepartureFlightNo,$MEI_DepartureTime)
{
$createdate=date('Y-m-d H:i:s');
$sql="INSERT INTO MEmberInfoTmpCheck
@ -69,9 +69,13 @@ class Order_model extends CI_Model {
visitor_link,
CreateDate,
CUL_IsLinkMan,
copyState
) VALUES (?,?,?,?,?,?,?,?,?,?,?,102001,0,0,1,1,?,?,?,?,0,0) ";
$this->HT->query($sql, array($MEI_Gender,$MEI_Nationality,$MEI_FirstName,$MEI_LastName,$MEI_PassportNo,$MEI_PassportValidDate,$MEI_Birthday,$MEI_Memo,$MEI_Street,$MEI_MailList,$MEI_Phone,$CUL_IsEmergency,$CUL_COLI_SN,$visitor_link,$createdate));
copyState,
MEI_ArrivalFlightNo,
MEI_ArrivalTime,
MEI_DepartureFlightNo,
MEI_DepartureTime
) VALUES (?,?,?,?,?,?,?,?,?,?,?,102001,0,0,1,1,?,?,?,?,0,0,?,?,?,?) ";
$this->HT->query($sql, array($MEI_Gender,$MEI_Nationality,$MEI_FirstName,$MEI_LastName,$MEI_PassportNo,$MEI_PassportValidDate,$MEI_Birthday,$MEI_Memo,$MEI_Street,$MEI_MailList,$MEI_Phone,$CUL_IsEmergency,$CUL_COLI_SN,$visitor_link,$createdate,$MEI_ArrivalFlightNo,$MEI_ArrivalTime,$MEI_DepartureFlightNo,$MEI_DepartureTime));
$insertid = $this->HT->last_id('MEmberInfoTmpCheck');//$this->HT->insert_id();
return $insertid;
}

@ -7,14 +7,15 @@
<meta name="robots" content="noindex,nofollow" />
<title>China Highlights! Please complete and submit the information.</title>
<link href="https://www.chinahighlights.com/css/min.php?f=/image/customer_center_data/css/bootstrap.min.css,/image/customer_center_data/css/order.css,/image/customer_center_data/css/bootstrap-datetimepicker.min.css&v=20150506" rel="stylesheet">
<link href="https://data.chinahighlights.com/css/min.php?f=/image/customer_center_data/css/bootstrap.min.css,/image/customer_center_data/css/order.css,/image/customer_center_data/css/bootstrap-datetimepicker.min.css&v=20150506" rel="stylesheet">
<!--[if lte IE 9]>
<link href="https://www.chinahighlights.com/public/js/fixie/respond-proxy.html" id="respond-proxy" rel="respond-proxy" />
<link href="https://www.chinahighlights.com/public/js/fixie/respond.proxy.gif" id="respond-redirect" rel="respond-redirect" />
<script src="https://www.chinahighlights.com/js/min.php?f=/public/js/respond.min.js,/public/js/fixie/respond.proxy.js"></script>
<![endif]-->
<script src="https://www.chinahighlights.com/js/min.php?f=/image/customer_center_data/js/jquery.min.js,/image/customer_center_data/js/bootstrap.min.js,/image/customer_center_data/js/jquery-ui.min.js,/image/customer_center_data/js/jquery-ui-timepicker-addon.js&v=20150506"></script>
<script src="https://data.chinahighlights.com/js/min.php?f=/image/customer_center_data/js/jquery.min.js,/image/customer_center_data/js/bootstrap.min.js,/image/customer_center_data/js/jquery-ui.min.js,/image/customer_center_data/js/jquery-ui-timepicker-addon.js&v=20150506"></script>
<link rel="shortcut icon" href="https://www.chinahighlights.com/favicon.ico">
<style type="text/css">.popover{background-color:#f2f600;}</style>
</head>
<body>
@ -69,7 +70,10 @@
<div class="panel-body">
<div class="row panel-new-head">
<h4 class="text-red">Passenger Information <span class="text-muted" style="font-size:15px;">(we need passport info for all the group members)</span></h4>
<h4 class="text-red">Passenger Information <span class="text-muted" style="font-size:15px;">(we need passport info for all the group members)</span><br/>
<small class="text-muted" style="font-size:15px;">Please ensure the details you provide are <span class="text-red">correct, as stated in your passport.</span> We use this information to book all your hotels and transportation. If the name you provide are incorrect, you would not be able to board your flight or trains in China, and therefore reissuing of tickets would be at your expense! </small>
</h4>
</div>
<div class="col-xs-24 nopadding hidden-xs">
@ -460,25 +464,25 @@
<div class="col-xs-24 flight-info-box">
<div class="form-group col-sm-6 nopadding">
<label>Arrival China Flight No.</label>
<input type="text" class="form-control input-sm" name="arrive_flight" value="" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your Flight No.!">
<input type="text" class="form-control input-sm" name="MEI_ArrivalFlightNo" value="" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your Flight No.!">
</div>
<div class="form-group col-sm-6 nopadding-R">
<label>Arrival time</label>
<div class="input-groups date" >
<input class="form-control input-sm f_datepicker" type="text" name="arrive_time" value="" autocomplete="off" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your arrival time!" style="color:#333333 !important;">
<input class="form-control input-sm f_datepicker" type="text" name="MEI_ArrivalTime" value="" autocomplete="off" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your arrival time!" style="color:#333333 !important;">
</div>
</div>
<div class="form-group col-sm-6 nopadding-R">
<label>Departure China Flight no.</label>
<input type="text" class="form-control input-sm" name="departure_flight" value="" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your flight no.!">
<input type="text" class="form-control input-sm" name="MEI_DepartureFlightNo" value="" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your flight no.!">
</div>
<div class="form-group col-sm-6 nopadding-R">
<label>Departure time</label>
<div class="input-groups date ">
<input class="form-control input-sm f_datepicker" type="text" name="depart_time" value="" autocomplete="off" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your departure time!" style="color:#333333 !important;">
<input class="form-control input-sm f_datepicker" type="text" name="MEI_DepartureTime" value="" autocomplete="off" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your departure time!" style="color:#333333 !important;">
</div>
</div>
@ -505,6 +509,7 @@
Vegetarian food for
Different arrival/departure information for
Special Assistance/Disability Needs for Customers
Any surgery recently
"></textarea>
</div>
<div class="col-xs-24 btn-lg"></div>
@ -726,6 +731,8 @@
});
$("#btn-add-personinfo-box").click();
//日期初始化
$('.f_datepicker').datetimepicker({

@ -7,19 +7,20 @@
<meta name="robots" content="noindex,nofollow" />
<title>www.chinatravel.com</title>
<link href="/css/order/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="/css/order/order.css?v=201506052" rel="stylesheet" type="text/css"/>
<link href="/css/order/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>
<link href="//data.chinatravel.com/css/info/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="//data.chinatravel.com/css/info/order.css?v=201506052" rel="stylesheet" type="text/css"/>
<link href="//data.chinatravel.com/css/info/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>
<!--[if lt IE 9]>
<script src="/js/respond.min.js" type="text/javascript"></script>
<![endif]-->
<script src="/js/jquery.min.js" type="text/javascript"></script>
<script src="/js/bootstrap.min.js" type="text/javascript"></script>
<script src="/js/jquery-ui.min.js" type="text/javascript"></script>
<script src="/js/jquery-ui-timepicker-addon.js" type="text/javascript"></script>
<script src="//data.chinatravel.com/js/info/jquery.min.js" type="text/javascript"></script>
<script src="//data.chinatravel.com/js/info/bootstrap.min.js" type="text/javascript"></script>
<script src="//data.chinatravel.com/js/info/jquery-ui.min.js" type="text/javascript"></script>
<script src="//data.chinatravel.com/js/info/jquery-ui-timepicker-addon.js" type="text/javascript"></script>
<style type="text/css">
#header {background: #DF6536 !important;}
.text-red{color: #DF6536 !important;}
.popover{background-color:#f2f600;}
</style>
</head>
@ -32,7 +33,7 @@
<div class="row">
<div class="col-lg-3 col-sm-4 logobox hidden-xs" style="top:8px;">
<a href="javascript:void(0);">
<img src="http://www.chinatravel.com/images/chinatravel-logo.png" alt="logo">
<img src="//www.chinatravel.com/images/chinatravel-logo.png" alt="logo">
</a>
</div>
<div class="col-lg-15 col-sm-13 col-lg-offset-3 col-sm-offset-4">
@ -67,7 +68,7 @@
<h4 class="text-center text-red">Thanks for booking with China Travel! </h4>
<h4 class="text-center text-red">Please complete and submit the information below.</h4>
</div>
<form id="form-confirm-info" method="post" action="<?php echo site_url('apps/order/confirm/save_confirm_info'); ?>">
<form id="form-confirm-info" method="post" action="<?php echo '/info.php/apps/order/confirm/save_confirm_info'; ?>">
<div class="col-xs-24 personinfo-box">
<div class="panel panel-default">
<div class="panel-body">
@ -445,25 +446,25 @@
<div class="col-xs-24 flight-info-box">
<div class="form-group col-sm-6 nopadding">
<label>Arrival China Flight No.</label>
<input type="text" class="form-control input-sm" name="arrive_flight" value="" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your Flight No.!">
<input type="text" class="form-control input-sm" name="MEI_ArrivalFlightNo" value="" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your Flight No.!">
</div>
<div class="form-group col-sm-6 nopadding-R">
<label>Arrival time</label>
<div class="input-groups date" >
<input class="form-control input-sm f_datepicker" type="text" name="arrive_time" value="" autocomplete="off" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your arrival time!" style="color:#333333 !important;">
<input class="form-control input-sm f_datepicker" type="text" name="MEI_ArrivalTime" value="" autocomplete="off" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your arrival time!" style="color:#333333 !important;">
</div>
</div>
<div class="form-group col-sm-6 nopadding-R">
<label>Departure China Flight no.</label>
<input type="text" class="form-control input-sm" name="departure_flight" value="" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your flight no.!">
<input type="text" class="form-control input-sm" name="MEI_DepartureFlightNo" value="" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your flight no.!">
</div>
<div class="form-group col-sm-6 nopadding-R">
<label>Departure time</label>
<div class="input-groups date ">
<input class="form-control input-sm f_datepicker" type="text" name="depart_time" value="" autocomplete="off" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your departure time!" style="color:#333333 !important;">
<input class="form-control input-sm f_datepicker" type="text" name="MEI_DepartureTime" value="" autocomplete="off" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Please fill in your departure time!" style="color:#333333 !important;">
</div>
</div>
@ -642,7 +643,7 @@ $(document).ready(function(){
data: data,
success: function(json_data) {
if (json_data.status == 'ok') {
location.href='<?php echo site_url('apps/order/confirm/index/0/0/0/ct'); ?>';
location.href='<?php echo '/info.php/apps/order/confirm/index/0/0/0/ct'; ?>';
} else {
$btn.button('reset');
$('#myModal').modal('show');

@ -7,16 +7,16 @@
<meta name="robots" content="noindex,nofollow" />
<title>www.chinatravel.com</title>
<link href="/css/order/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="/css/order/order.css?v=201506052" rel="stylesheet" type="text/css"/>
<link href="/css/order/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>
<link href="//data.chinatravel.com/css/info/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="//data.chinatravel.com/css/info/order.css?v=201506052" rel="stylesheet" type="text/css"/>
<link href="//data.chinatravel.com/css/info/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>
<!--[if lt IE 9]>
<script src="/js/respond.min.js" type="text/javascript"></script>
<![endif]-->
<script src="/js/jquery.min.js" type="text/javascript"></script>
<script src="/js/bootstrap.min.js" type="text/javascript"></script>
<script src="/js/jquery-ui.min.js" type="text/javascript"></script>
<script src="/js/jquery-ui-timepicker-addon.js" type="text/javascript"></script>
<script src="//data.chinatravel.com/js/info/jquery.min.js" type="text/javascript"></script>
<script src="//data.chinatravel.com/js/info/bootstrap.min.js" type="text/javascript"></script>
<script src="//data.chinatravel.com/js/info/jquery-ui.min.js" type="text/javascript"></script>
<script src="//data.chinatravel.com/js/info/jquery-ui-timepicker-addon.js" type="text/javascript"></script>
<style type="text/css">
#header {background: #DF6536 !important;}
.text-red{color: #DF6536 !important;}

@ -0,0 +1,537 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>China Reisen und China Rundreisen individuell | Chinarundreisen.com</title>
<link href="https://data.chinarundreisen.com/information-view/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="https://data.chinarundreisen.com/information-view/information/css/order.css" rel="stylesheet" type="text/css"/>
<link href="https://data.chinarundreisen.com/information-view/information/css/bootstrap-datetimepicker.min.css?v=201506022" rel="stylesheet" type="text/css"/>
<!--[if lt IE 9]>
<script src="https://data.chinarundreisen.com/information-view/bootstrap/js/respond.min.js" type="text/javascript"></script>
<![endif]-->
<script src="https://data.chinarundreisen.com/information-view/information/js/jquery.min.js" type="text/javascript"></script>
<script src="https://data.chinarundreisen.com/information-view/bootstrap/js/bootstrap.js" type="text/javascript"></script>
<script src="https://data.chinarundreisen.com/information-view/information/js/jquery-ui.min.1-11-3.js" type="text/javascript"></script>
<script src="https://data.chinarundreisen.com/information-view/information/js/jquery-ui-timepicker-addon.js" type="text/javascript"></script>
<style type="text/css">.popover{background-color:#f2f600;}</style>
</head>
<body>
<div id="headerWrapper">
<div id="header">
<div id="mainnav" class="nav navbar" role="navigation">
<div class="container-fluid">
<div class="row">
<div class="col-lg-3 col-sm-4 logobox hidden-xs">
<a href="/">
<img width="135" src="http://data.chinarundreisen.com/public/pic/common/widget/header/pic/logo1_3d64397.jpg" alt="logo">
</a>
</div>
<div class="col-lg-14 col-sm-13 col-lg-offset-3 col-sm-offset-4">
<div class="navbar-header">
<div class="col-xs-24 btn-lg"></div>
<div class="col-xs-24 text-white"><?php if(!isset($dear)) $dear='Liebe/r'; echo $dear; ?> <?php echo $username; ?></div>
<div class="col-xs-24 text-white">Buchungsnummer: <?php echo $userinfo[0]->COLI_ID; ?></div>
</div>
</div>
<div class="col-lg-7 col-sm-7 hidden-xs pull-right nopadding">
<div class="tollfree pull-right" style="padding-top:10px;">
<div class="currentNo col-sm-24 nopadding"><span class="glyphicon glyphicon-earphone" style="font-size:12px;"></span> +86 773 <?php echo $userinfo[0]->OPI_Telephone; ?>(GMT+8)</div>
<div class="col-sm-24">
<div class="currentNo col-sm-24 nopadding"> 800-822-4462(gebührenfrei aus Deutschland)</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-xs-24 btn-lg"></div>
<div class="col-xs-24 welcome-text">
<h4 class="text-center text-red">Vielen Dank für die Buchung bei Chinarundreisen! </h4>
<h4 class="text-center text-red">Bitte füllen Sie das folgende Formular aus und schicken es zurück.</h4>
</div>
<form id="form-confirm-info" method="post" action="/secureinfoconfirm/confirm/save_confirm_info">
<div class="col-xs-24 personinfo-box">
<div class="panel panel-default">
<div class="panel-body">
<div class="row panel-new-head">
<h4 class="text-red">Kunden informationen</h4>
<p>Bitte prüfen Sie, ob Ihr Name richtig geschrieben ist (vollständiger Name wie im Reisepass) . Da wir die Folgekosten durch ein wegen falschem Namen stornierten Hotel oder Flugticket nicht tragen, ist die richtige Schreibweise Ihres Namens und Ihrer alle Daten unbedingt wichtig.</p>
</div>
<div class="col-xs-24 nopadding">
<div class="form-group col-sm-7 nopadding-R" style="margin-bottom:0px;">
<label style="width:100%;text-align:left !important;font-weight:normal">
<span class="col-xs-6 nopadding"></span>
<div class="col-xs-18 nopadding-L" style="height:15px;">
<div class="col-xs-11 nopadding text-right">Nachname</div>
<div class="col-xs-1 nopadding text-right" style="font-size:18px;width:10px;">/</div>
<div class="col-xs-11 nopadding" style="padding-left: 2px !important;">Name</div>
</div>
</label>
</div>
<div class="form-group col-sm-4 nopadding-R" style="margin-bottom:0px;">
<label class="" style="font-weight:normal">Geburtstag</label>
</div>
<div class="form-group col-sm-4 nopadding-R" style="margin-bottom:0px;">
<label class="" style="font-weight:normal">Passnr.</label>
</div>
<div class="form-group col-sm-5 nopadding-R" style="margin-bottom:0px;">
<label class="" style="font-weight:normal">Verfallsdatum des Reisepasses</label>
</div>
<div class="form-group col-sm-4" style="margin-bottom:0px;">
<label class="" style="font-weight:normal">Nationalität</label>
</div>
</div>
<div class="col-xs-24 nopadding personinfo-input-box">
<div class="form-group col-sm-7 nopadding-R">
<div class="row">
<div class="col-xs-6 nopadding-R">
<select class="form-control input-sm nopadding-L" name="gender[]">
<option value="100001">Herr</option>
<option value="100003">Frau</option>
</select>
</div>
<div class="col-xs-18 nopadding-L">
<div class="input-group">
<div class="form-control input-sm nopadding">
<div class="col-xs-11 nopadding">
<input name="sur_name[]" class="common_input form-control input-sm nopadding-R" placeholder="" style="border:none;height:28px;" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Bitte tragen Sie hier Ihren Nachname!">
</div>
<div class="col-xs-1 nopadding text-center" style="font-size:18px;width:10px;">/</div>
<div class="col-xs-11 col-sm-11 nopadding">
<input name="given_name[]" class="common_input form-control input-sm nopadding-R" placeholder="" style="border:none;height:28px;" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Bitte tragen Sie hier Ihren Name!">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="form-group col-sm-4 nopadding-R">
<div class="input-groups date " data-date="1970-05-20">
<input class="form-control input-sm common_input bd_datepicker" type="text" name="birthday[]" value="" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Bitte tragen Sie Ihr Geburtsdatum ein!" autocomplete="off" style="color:#333333 !important;">
</div>
</div>
<div class="form-group col-sm-4 nopadding-R">
<input type="text" class="form-control input-sm common_input" name="passport[]" value="" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Bitte tragen Sie Ihre Ausweisnummer ein!" autocomplete="off">
</div>
<div class="form-group col-sm-5 nopadding-R">
<div class="input-groups date">
<input class="form-control input-sm common_input datepicker" type="text" name="passport_expiration_date[]" value="" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Bitte tragen Sie das Datum ein, wann Ihr Personalausweis abläuft!" autocomplete="off" style="color:#333333 !important;">
</div>
</div>
<div class="form-group col-sm-4">
<div class="input-group">
<select class="form-control input-sm common_input" name="nationality[]">
<optgroup label="--Top Nationalitäten--">
<option value="6" selected="selected">
Deutschland
</option>
<option value="470">
Österreich
</option>
<option value="25">
die Schweiz
</option>
<option value="572">
Luxemburg
</option>
</optgroup>
<optgroup label="--Mehr Nationalitäten--">
<option value="5">
Kanada
</option>
<option value="8">
Frankreich
</option>
</optgroup>
</select>
<span class="input-group-addon" style="background:#fff;border:none;padding:2px 3px;">
<span class="glyphicon glyphicon-minuss text-danger"></span>
</span>
</div>
</div>
</div>
<div class="col-xs-24 add-personinfo-box">
<span class="text-red" id="btn-add-personinfo-box">
<span class="glyphicon glyphicon-plus"></span> Mitreisende hinzufügen
</span>
<div class="col-xs-24 btn-lg"></div>
</div>
<div class="form-group col-xs-24 Home-Address">
<div class="input-group">
<span class="input-group-addon">
Kontakttelefon:
</span>
<div class="form-control input-sm nopadding" style="border:none;-webkit-box-shadow: inset 0 0px 0px rgba(0,0,0,0.075);box-shadow: inset 0 0px 0px rgba(0,0,0,0.">
<div class="col-xs-11 nopadding">
<input type="text" name="landline" value="" class="common_input form-control input-sm" placeholder="land line" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Bitte tragen Sie Ihre Nummer an Land ein!">
</div>
<div class="col-xs-13 nopadding">
<input type="text" name="mobile" value="" class="common_input form-control input-sm" placeholder="Handy" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Bitte tragen Sie Ihre Handynummer ein!">
</div>
</div>
</div>
</div>
<?php if($userinfo[0]->COLI_CustomerType!=44003){ ?>
<div class="form-group col-xs-24 Home-Address">
<div class="input-group">
<span class="input-group-addon" style="min-width:120px;">
Anschrift:
</span>
<div class="form-control input-sm hidden-xs nopadding">
<div class="col-xs-7 nopadding">
<input name="address_street" class="input_home_address form-control input-sm" placeholder="Straße" style="border:none;height:28px;" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Bitte tragen Sie Ihre Heimatadresse ein!">
</div>
<div class="col-xs-1 nopadding" style="font-size:18px;width:10px;">,</div>
<div class="col-xs-7 nopadding">
<input name="address_city" class="input_home_address form-control input-sm nopadding" placeholder="Stadt" style="border:none;height:28px;" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Bitte tragen Sie Ihre Heimatadresse ein!">
</div>
<div class="col-xs-1 nopadding hidden" style="font-size:18px;width:10px;">,</div>
<div class="col-xs-5 nopadding hidden">
<input name="address_state" class="input_home_address form-control input-sm nopadding" placeholder="State" style="border:none;height:28px;" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Bitte tragen Sie Ihre Heimatadresse ein!">
</div>
<div class="col-xs-1 nopadding" style="font-size:18px;width:10px;">,</div>
<div class="col-xs-8 nopadding">
<input name="address_country" class="input_home_address form-control input-sm nopadding" placeholder="Land" style="border:none;height:28px;" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Bitte tragen Sie Ihre Heimatadresse ein!">
</div>
</div>
<input class="form-control input-sm visible-xs-block" name="home_address">
</div>
</div>
<?php } ?>
</div>
</div>
</div>
<div class="col-xs-24 flightinfo-box">
<div class="panel panel-default">
<div class="panel-body">
<div class="row panel-new-head">
<h4 class="text-red">Fluginformationen</h4>
</div>
<div class="col-xs-24 flight-info-box">
<div class="form-group col-sm-6 nopadding">
<label>Ankunftsflug in China </label>
<input type="text" class="form-control input-sm" name="MEI_ArrivalFlightNo" value="" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Bitte tragen Sie Ihre Flugnummer ein!">
</div>
<div class="form-group col-sm-6 nopadding-R">
<label>Ankunftszeit</label>
<div class="input-groups date" >
<input class="form-control input-sm f_datepicker" type="text" name="MEI_ArrivalTime" value="" autocomplete="off" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Bitte tragen Sie Ihre Ankunftszeit ein!" style="color:#333333 !important;">
</div>
</div>
<div class="form-group col-sm-6 nopadding-R">
<label>Abflugnummer von China</label>
<input type="text" class="form-control input-sm" name="MEI_DepartureFlightNo" value="" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Bitte tragen Sie Ihre Flugnummer ein!">
</div>
<div class="form-group col-sm-6 nopadding-R">
<label>Abflugzeit</label>
<div class="input-groups date ">
<input class="form-control input-sm f_datepicker" type="text" name="MEI_DepartureTime" value="" autocomplete="off" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Bitte tragen Sie Ihre Abfahrtszeit ein!" style="color:#333333 !important;">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-24">
<div class="panel panel-default">
<div class="panel-body">
<div class="row panel-new-head">
<h4 class="text-red">
Besondere Anforderungen
</h4>
</div>
<div class="col-xs-24 special_request_box">
<div class="form-group">
<div class="col-xs-24 nopadding">
<textarea class="form-control input-sm" rows="5" name="special_request" placeholder="Großes Bett für
Vegetarisches Essen für
Andere Abfahrts-/Ankunftszeit für
"></textarea>
</div>
<div class="col-xs-24 btn-lg"></div>
</div>
</div>
</div>
</div>
</div>
<?php if($userinfo[0]->COLI_CustomerType!=44003){ ?>
<div class="col-xs-24">
<div class="panel panel-default">
<div class="panel-body">
<div class="row panel-new-head">
<h4 class="text-red">
Kontaktinformationen für Notfälle
<span class="text-muted" style="font-size:15px;">(im Falle eines Notfalls während Ihrer Chinareise)</span>
</h4>
</div>
<div class="col-xs-24 new-form-horizontal emergencyx_box">
<div class="form-group col-sm-13">
<label class="col-sm-9 control-label nopadding-L">Kontaktsperson</label>
<div class="col-sm-13 nopadding">
<input type="text" class="form-control input-sm" name="emergency_person_name" value="" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Bitte tragen Sie Ihren Kontakt für Notfälle ein!">
</div>
</div>
<div class="form-group col-sm-11">
<label class="col-sm-7 control-label nopadding-L">Email Adresse</label>
<div class="col-sm-17 nopadding">
<input type="text" class="form-control input-sm" name="emergency_email" value="" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Bitte tragen Sie ihre E-Mail-Adresse ein!">
</div>
</div>
<div class="form-group col-sm-13">
<label class="col-sm-9 control-label nopadding-L">Beziehung mit ihm/ihr</label>
<div class="col-sm-13 nopadding">
<input type="text" class="form-control input-sm" name="emergency_relationship" placeholder="z.B.: Er ist der Vater von Sue." value="" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Bitte tragen Sie hier Ihren Beziehungsstatus ein!">
</div>
</div>
<div class="form-group col-sm-11">
<label class="col-sm-7 control-label nopadding-L">Telefon Nr. </label>
<div class="col-sm-17 nopadding">
<input type="text" class="form-control input-sm" name="emergency_telephone" placeholder="Länderkürzel + Postleitzahl (land line gibt es nicht in Deutschland)" value="" data-trigger="manual" data-container="body" data-toggle="popover" data-placement="top" data-content="Bitte tragen Sie hier Ihre Telefonnummer ein!">
</div>
</div>
<div class="col-xs-24 btn-lg"></div>
</div>
</div>
</div>
</div>
<?php } ?>
<div class="col-xs-24">
<input type="hidden" name="toname" value="<?php echo $userinfo[0]->OPI_FirstName; ?>">
<input type="hidden" name="tomail" value="<?php echo $userinfo[0]->OPI_Email; ?>">
<input type="hidden" name="COLI_ID" value="<?php echo $userinfo[0]->COLI_ID; ?>">
<input type="hidden" name="COLI_SN" value="<?php echo $userinfo[0]->COLI_SN; ?>">
<input type="hidden" name="visitor_link" value="<?php echo $visitor_link; ?>">
<div class="col-sm-15 col-xs-24 nopadding">
<button type="submit" id="btn-add-userinfo" class="btn btn-danger btn-lg col-sm-9 col-xs-24 pull-right" style="min-width:300px;font-size:24px;">Überprüfen & Absenden</button>
</div>
<div class="partner-text col-sm-9 col-xs-24 text-left">Danke! Mit besten Grüßen, <?php echo $userinfo[0]->OPI_FirstName; ?></div>
</div>
</form>
</div>
</div>
<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">Fehler!</h4>
</div>
<div class="modal-body" style="height:150px;">
<p class="text-danger lead" style="padding-top:10px;">Fehler: Bitte kontaktieren Sie Ihren Reisebegleiter.</p>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$(".common_input,textarea").each(function(){
if ($(this).val()=='' && $(this).attr('placeholder')!='') {
var valstr=$(this).val($(this).attr('placeholder'));
$(this).css("color","#999999");
}
});
$(".common_input,textarea").click(function(){
if ($(this).val()==$(this).attr('placeholder') || $(this).val()=='') {
$(this).val('');
$(this).css("color","#333333");
}
$(this).popover('hide');
});
$(".common_input,textarea").blur(function(){
if ($(this).val()=='' && $(this).attr('placeholder')!='') {
$(this).val($(this).attr('placeholder'));
$(this).css("color","#999999");
}
});
//提交信息
$("#form-confirm-info").submit(function(event){
event.preventDefault();
var $btn = $("#btn-add-userinfo").button('loading');
var flag=true;
$(".common_input").each(function(){
if ($(this).val()==$(this).attr('placeholder') || $(this).val()=='') {
$(this).popover('show');
flag = false;
$btn.button('reset');
return false;
};
});
if (!flag) {
$btn.button('reset');
return false;
};
$(".input_home_address").each(function()
{
if ($(this).val()==$(this).attr('placeholder')) {
$(this).val('');
}
});
if ($("textarea").val()==$("textarea").attr('placeholder')) {
$("textarea").val('');
};
var url=$(this).attr('action');
var data=$(this).serialize();
$.ajax({
type: "post",
url: url,
dataType: "json",
data: data,
success: function(json_data) {
if (json_data.status == 'ok') {
location.href='/secureinfoconfirm/confirm/index/0/0/0/gm';
} else {
$btn.button('reset');
$('#myModal').modal('show');
}
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
$btn.button('reset');
alert(errorThrown);
}
});
});
//移除一个客户信息
$('body').on('click','.glyphicon-minus',function(){
if(confirm("entfernen den Kunde?"))
{
$(this).parents('.personinfo-input-box').remove();
}
});
//添加一个客户信息
$("#btn-add-personinfo-box").click(function()
{
var html=$(".personinfo-input-box:first").clone();
$('.add-personinfo-box').before(html);
var num=$(".personinfo-input-box").length;
var $currentbox=$(".personinfo-input-box:last");
$currentbox.find('.glyphicon-minuss').addClass('glyphicon-minus').removeClass('glyphicon-minuss');
$currentbox.find('label').remove();
$currentbox.find('input').val('');
$currentbox.find('.datepicker').removeClass('hasDatepicker').attr('id','');
$currentbox.find('.bd_datepicker').removeClass('hasDatepicker').attr('id','');
$('.datepicker').datepicker({
controlType: 'select',
oneLine: true,
changeMonth: true,
changeYear: true,
yearRange: '2010:2025',
timeFormat: 'mm/dd/yy'
});
$('.bd_datepicker').datepicker({
controlType: 'select',
oneLine: true,
changeMonth: true,
changeYear: true,
defaultDate:'-45y',
yearRange: '1920:2015',
timeFormat: 'mm/dd/yy'
});
});
//日期初始化
$('.f_datepicker').datetimepicker({
controlType: 'select',
oneLine: true,
changeMonth: false,
changeYear: false,
timeFormat: 'H:mm'
});
$('.bd_datepicker').datepicker({
controlType: 'select',
oneLine: true,
changeMonth: true,
changeYear: true,
defaultDate:'-45y',
yearRange: '1920:2015',
timeFormat: 'mm/dd/yy'
});
$('.datepicker').datepicker({
controlType: 'select',
oneLine: true,
changeMonth: true,
changeYear: true,
yearRange: '2010:2025',
timeFormat: 'mm/dd/yy'
});
});
$(document).on('click','.common_input',function(){
$(this).popover('hide');
});
</script>
</body>
</html>

@ -0,0 +1,73 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex,nofollow" />
<title>China Reisen und China Rundreisen individuell | Chinarundreisen.com</title>
<link href="https://data.chinarundreisen.com/information-view/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="https://data.chinarundreisen.com/information-view/information/css/order.css" rel="stylesheet" type="text/css"/>
<!--[if lt IE 9]>
<script src="https://data.chinarundreisen.com/information-view/bootstrap/js/respond.min.js" type="text/javascript"></script>
<![endif]-->
<script src="https://data.chinarundreisen.com/information-view/information/js/jquery.min.js" type="text/javascript"></script>
<script src="https://data.chinarundreisen.com/information-view/bootstrap/js/bootstrap.js" type="text/javascript"></script>
</head>
<body class="modal-open">
<div id="headerWrapper">
<div id="header">
<div id="mainnav" class="nav navbar" role="navigation">
<div class="container-fluid">
<div class="row">
<div class="col-lg-3 col-sm-4 logobox hidden-xs">
<a href="/">
<img width="135" src="http://data.chinarundreisen.com/public/pic/common/widget/header/pic/logo1_3d64397.jpg" alt="logo">
</a>
</div>
<div class="col-lg-16 col-sm-13 col-lg-offset-3 col-sm-offset-4">
<div class="navbar-header">
<div class="col-xs-24 btn-lg"></div>
</div>
</div>
<div class="col-lg-5 col-sm-7 hidden-xs pull-right nopadding">
<div class="tollfree pull-right">
<div class="col-xs-24 btn-sm"></div>
<div class="currentNo col-sm-24 nopadding"><span class="glyphicon glyphicon-earphone" style="font-size:12px;"></span> 800-2682918 (USA/CA)</div>
<div class="col-sm-24">
<div class="currentNo col-sm-24 nopadding"> 1800-764678 (AU)</div>
<div class="currentNo col-sm-24 nopadding"> 0800-0327753 (UK)</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="bs-example bs-example-modal" data-example-id="static-modal">
<div class="modal" style="display:block;">
<div class="modal-dialog" style="margin-top:200px;">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title text-success" id="modal-title">Erfolg!<a class="anchorjs-link" href="#modal-title"><span class="anchorjs-icon"></span></a></h3>
</div>
<div class="modal-body" style="height:150px;">
<h4 style="padding-top:10px;">Für jeglichen Grund kontaktieren Sie bitte Ihren Reiseführer.</h4>
<p>----<a href="http://www.chinarundreisen.com" class="">www.chinarundreisen.com</a></p>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>
<div class="modal-backdrop fade in" style="bottom:0;"></div>
</body>
</html>

@ -30,15 +30,15 @@
<h4 class="text-red" style="box-sizing:border-box;font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:#AA2E2D;margin-top:10px;margin-bottom:15px;font-size:24px;padding:12px 0 12px 0;border-bottom:1px solid #dddddd;border-top:1px solid #dddddd;white-space:normal;background-color:#FFFFFF;">
Flight Information
</h4>
<p style="margin:0;">Arrival China Flight No.:<?php if (isset($postdata['arrive_flight'])) echo $postdata['arrive_flight']; ?></p>
<p style="margin:0;">Arrival China Flight No.:<?php if (isset($postdata['MEI_ArrivalFlightNo'])) echo $postdata['MEI_ArrivalFlightNo']; ?></p>
<p style="margin:0;">
Arrival time:<?php if (isset($postdata['arrive_time'])) echo $postdata['arrive_time']; ?>
Arrival time:<?php if (isset($postdata['MEI_ArrivalTime'])) echo $postdata['MEI_ArrivalTime']; ?>
</p>
<p style="margin:0;">
Departure China Flight no.:<?php if (isset($postdata['departure_flight'])) echo $postdata['departure_flight']; ?>
Departure China Flight no.:<?php if (isset($postdata['MEI_DepartureFlightNo'])) echo $postdata['MEI_DepartureFlightNo']; ?>
</p>
<p style="margin:0;">
Departure time:<?php if (isset($postdata['depart_time'])) echo $postdata['depart_time']; ?>
Departure time:<?php if (isset($postdata['MEI_DepartureTime'])) echo $postdata['MEI_DepartureTime']; ?>
</p>
<h4 class="text-red" style="box-sizing:border-box;font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-weight:500;line-height:1.1;color:#AA2E2D;margin-top:10px;margin-bottom:15px;font-size:24px;padding:12px 0 12px 0;border-bottom:1px solid #dddddd;border-top:1px solid #dddddd;white-space:normal;background-color:#FFFFFF;">
Special Request

@ -21,7 +21,7 @@ class PageSpeedData_model extends CI_Model {
public function detail($psd_URL, $psd_SiteCode) {
$this->init();
$this->topnum = 1;
$this->where = ' AND psd.psd_URL=' . $this->INFO->escape($psd_URL);
$this->where = ' AND psd.psd_URL=N' . $this->INFO->escape($psd_URL);
$this->where .= ' AND psd.psd_SiteCode=' . $this->INFO->escape($psd_SiteCode);
return $this->get_list();
}
@ -64,7 +64,7 @@ class PageSpeedData_model extends CI_Model {
$this->topnum = $topnum;
$this->where = ' AND psd.psd_SiteCode=' . $this->INFO->escape($psd_SiteCode);
$this->where .= ' AND ISNULL(psd.psd_Datetime,1999) < GETDATE()-1 ';
$this->where .= ' AND psd.psd_ErrorCount<=3 ';
$this->where .= ' AND psd.psd_ErrorCount<=3';
$this->orderby = ' ORDER BY psd_Datetime ASC ';
return $this->get_list();
}
@ -127,7 +127,7 @@ class PageSpeedData_model extends CI_Model {
public function search_score_list($start_score, $end_score, $psd_SiteCode, $device = 'moblie') {
$this->init();
$this->topnum = 50;
$this->topnum = 150;
$this->where = ' AND psd.psd_SiteCode=' . $this->INFO->escape($psd_SiteCode);
if ($device == 'moblie') {
$this->where .= " AND psd.psd_MobileScore BETWEEN $start_score AND $end_score ";

@ -5,108 +5,417 @@ if (!defined('BASEPATH'))
class search extends CI_Controller{
public function __construct(){
parent::__construct();
parent::__construct();
header('Access-Control-Allow-Origin:*');
header('Access-Control-Allow-Methods:POST, GET');
header('Access-Control-Max-Age:0');
header('Access-Control-Allow-Headers:x-requested-with, Content-Type');
header('Access-Control-Allow-Credentials:true');
$this->start_time = microtime(true);
$this->load->model("BIZ_train_model");//加载模型
$this->load->model("BIZ_intel_train_model");//国际火车模型
}
//查询聚合余票接口,对返回的数据进行处理
public function index($train_date=null,$fromStation=null,$toStation=null){
//定义一些变量
$flag = true;
$juheTrainInfo = '';
set_time_limit(0);
//判断数据是否合法
if(!$train_date || !$fromStation || !$toStation){
exit('传参错误!');
exit('传参不能为空!');
}else{
if(strlen($fromStation) != 3){
exit('fromStation:参数错误!');
}
if(strlen($toStation) != 3){
exit('toStation:参数错误!');
}
$api_start_time = microtime(true);
//调用查询模块
$search_return = $this->Searchtrain($train_date,$fromStation,$toStation);
$api_end_time = microtime(true);
//调用数据处理模块
$returnJson = $this->dataOperate($search_return,$fromStation,$toStation);
//调用拼接处理模块
$trainjson = $this->createTrainJson($returnJson);
$end_time = microtime(true);
//聚合接口相应时间
$api_responsive_time = $api_end_time - $api_start_time;
//我们的接口相应时间
$responsive_time = $end_time - $this->start_time;
log_message('error','TRAINSPEED|请求url:'.$this->url.'|聚合相应时间:'.$api_responsive_time.'s|接口运行时间:'.$responsive_time.'s|缓存:'.$this->cache.'|+7天:'.$this->seveth);
print_r($trainjson);
}
}
//搜索模块
function Searchtrain($train_date,$fromStation,$toStation){
$this->train_date = $train_date;
$now_time = time();
$this->differ_time = (strtotime($train_date) - $now_time) / 86400;
$this->seveth = 'no';
//屏蔽掉超过预售期的搜索,提高速度
if($this->differ_time > 29){
$train_date = date('Y-m-d',strtotime('+7day'));
$this->seveth = 'yes';
}
$this->url = JUHE_TRAIN_CX_API.'?key='.JUHE_TRAIN_API_KEY.'&train_date='.$train_date.'&from_station='.$fromStation.'&to_station='.$toStation;
$train_info = $this->get_http($this->url);
return $train_info;
}
//缓存处理模块(包含缓存处理)
function dataOperate($search_return,$fromStation,$toStation){
//首先判断聚合返回的数据是否为空
if(empty($search_return)){
$this->reason = '聚合接口没有响应';
$this->cache = 'yes';
}else{
$this->reason = json_decode($search_return)->reason;
$this->cache = 'no';
}
if(!empty(json_decode($search_return)->result)){
$this->BIZ_train_model->addOrUpdate($fromStation,$toStation,$search_return);
$operate_data = $search_return;
}else{
$url = 'http://op.juhe.cn/trainTickets/ticketsAvailable?key='.JUHE_TRAIN_API_KEY.'&train_date='.$train_date.'&from_station='.$fromStation.'&to_station='.$toStation;
$back_data = $this->get_http($url);
//print_r(json_decode($back_data));
//添加缓存调用时间判断
if($this->differ_time <= 5){
$cache_train_info = NULL;
}else{
$cache_train_info = $this->BIZ_train_model->get_train_cache($fromStation,$toStation);
}
//判断缓存是否为空
if(empty($cache_train_info)){
log_message('error','TRAIN 查询为空的链接:'.$this->url.'|出错的原因:'.$this->reason.'|缓存为空');
$operate_data = NULL;
}else{
$cache_time = $cache_train_info->tpc_datetime;
$now_time = time();
$cache_differ_time = ($now_time - strtotime($cache_time)) / 86400;
if($cache_differ_time >= 3){
$this->BIZ_train_model->delete_traincache($fromStation,$toStation);
log_message('error','TRAIN 查询为空的链接:'.$this->url.'|出错的原因:'.$this->reason.'|缓存超时,已经删除');
$operate_data = NULL;
}else{
$this->cache = 'yes';
$operate_data = $cache_train_info->tpc_content;
log_message('error','TRAIN 查询为空的链接:'.$this->url.'|出错的原因:'.$this->reason.'|调用缓存号:'.$cache_train_info->tpc_sn.'|缓存生成的时间:'.$cache_train_info->tpc_datetime);
}
}
}
return $operate_data;
}
//字符串拼接模块
function createTrainJson($returnjson){
$return_data = new stdClass();
$return_data->httpstatus = 200;
$return_data->data = new stdClass();
$return_data->httpstatus = 200;
$return_data->reason = $this->reason;
$return_data->cache = $this->cache;
$return_data->seveth = $this->seveth;
$return_data->data->result = array();
$return_data->data->map = new stdClass();
$obj = array();
$i = 0;
$pricestr = '';
if(!empty(json_decode($back_data)->result->list)){
foreach (json_decode($back_data)->result->list as $value){
$obj[$value->from_station_code] = $value->from_station_name;
$obj[$value->to_station_code] = $value->to_station_name;
$seat_type = '';
if(isset($value->gjrw_price)){
if($value->gjrw_price > 0){
$gjrwPrice = $value->gjrw_price * 10;
$seat_type .= '"6":"'.$gjrwPrice.'","A6":"¥'.$value->gjrw_price.'",';
if(!empty($returnjson)){
if(!empty(json_decode($returnjson)->result->list)){
foreach (json_decode($returnjson)->result->list as $value){
$obj[$value->from_station_code] = $value->from_station_name;
$obj[$value->to_station_code] = $value->to_station_name;
$seat_type = '';
if(isset($value->gjrw_price)){
if($value->gjrw_price > 0){
$gjrwPrice = $value->gjrw_price * 10;
$seat_type .= '"6":"'.$gjrwPrice.'","A6":"¥'.$value->gjrw_price.'",';
}
}
}
if(isset($value->qtxb_price)){
if($value->qtxb_price > 0){
$seat_type .= '"H":"¥'.$value->qtxb_price.'",';
if(isset($value->qtxb_price)){
if($value->qtxb_price > 0){
$seat_type .= '"H":"¥'.$value->qtxb_price.'",';
}
}
}
if(isset($value->rw_price)){
if($value->rw_price > 0){
$rwPrice = $value->rw_price * 10;
$seat_type .= '"4":"'.$rwPrice.'","A4":"¥'.$value->rw_price.'",';
if(isset($value->rw_price)){
if($value->rw_price > 0){
$rwPrice = $value->rw_price * 10;
$seat_type .= '"4":"'.$rwPrice.'","A4":"¥'.$value->rw_price.'",';
}
}
}
if(isset($value->rz_price)){
if($value->rz_price > 0){
$rzPrice = $value->rz_price * 10;
$seat_type .= '"2":"'.$rzPrice.'","A2":"¥'.$value->rz_price.'",';
if(isset($value->rz_price)){
if($value->rz_price > 0){
$rzPrice = $value->rz_price * 10;
$seat_type .= '"2":"'.$rzPrice.'","A2":"¥'.$value->rz_price.'",';
}
}
}
if(isset($value->tdz_price)){
if($value->tdz_price > 0){
$seat_type .= '"P":"¥'.$value->tdz_price.'",';
if(isset($value->tdz_price)){
if($value->tdz_price > 0){
$seat_type .= '"P":"¥'.$value->tdz_price.'",';
}
}
}
if(isset($value->wz_price)){
if($value->wz_price > 0){
$wzPrice = $value->wz_price * 10;
$seat_type .= '"WZ":"¥'.$value->wz_price.'",';
if(isset($value->wz_price)){
if($value->wz_price > 0){
$wzPrice = $value->wz_price * 10;
$seat_type .= '"WZ":"¥'.$value->wz_price.'",';
}
}
}
if(isset($value->yw_price)){
if($value->yw_price > 0){
$ywPrice = $value->yw_price * 10;
$seat_type .= '"3":"'.$ywPrice.'","A3":"¥'.$value->yw_price.'",';
if(isset($value->yw_price)){
if($value->yw_price > 0){
$ywPrice = $value->yw_price * 10;
$seat_type .= '"3":"'.$ywPrice.'","A3":"¥'.$value->yw_price.'",';
}
}
}
if(isset($value->yz_price)){
if($value->yz_price > 0){
$yzPrice = $value->yz_price * 10;
$seat_type .= '"1":"'.$yzPrice.'","A1":"¥'.$value->yz_price.'",';
if(isset($value->yz_price)){
if($value->yz_price > 0){
$yzPrice = $value->yz_price * 10;
$seat_type .= '"1":"'.$yzPrice.'","A1":"¥'.$value->yz_price.'",';
}
}
}
if(isset($value->edz_price)){
if($value->edz_price > 0){
$seat_type .= '"O":"¥'.$value->edz_price.'",';
if(isset($value->edz_price)){
if($value->edz_price > 0){
$seat_type .= '"O":"¥'.$value->edz_price.'",';
}
}
}
if(isset($value->ydz_price)){
if($value->ydz_price > 0){
$seat_type .= '"M":"¥'.$value->ydz_price.'",';
if(isset($value->ydz_price)){
if($value->ydz_price > 0){
$seat_type .= '"M":"¥'.$value->ydz_price.'",';
}
}
if(isset($value->swz_price)){
if($value->swz_price > 0){
$swzPrice = $value->swz_price * 10;
$seat_type .= '"9":"'.$swzPrice.'","A9":"¥'.$value->swz_price.'",';
}
}
if(isset($value->dw_price)){
if($value->dw_price > 0){
$seat_type .= '"F":"¥'.$value->dw_price.'",';
}
}
$pricestr = $seat_type.'"train_no":'.'"'.$value->train_no.'"';
//余票字符串
$this->can_buy_now = $value->can_buy_now;
$return_data->data->result[$i] = '|预定|'.$value->train_no.'|'.$value->train_code.'|'.$value->from_station_name.'|'.$value->to_station_name.'|'.$value->from_station_code.'|'.$value->to_station_code.'|'.$value->start_time.'|'.$value->arrive_time.'|'.$value->run_time.'|'.$value->can_buy_now.'||'.$this->train_date.'||||||||'.$this->ticket_exchange($value->gjrw_price,$value->gjrw_num).'|'.$this->ticket_exchange($value->qtxb_price,$value->qtxb_num).'|'.$this->ticket_exchange($value->rw_price,$value->rw_num).'|'.$this->ticket_exchange($value->rz_price,$value->rz_num).'|'.$this->ticket_exchange($value->tdz_price,$value->tdz_num).'|'.$this->ticket_exchange($value->wz_price,$value->wz_num).'||'.$this->ticket_exchange($value->yw_price,$value->yw_num).'|'.$this->ticket_exchange($value->yz_price,$value->yz_num).'|'.$this->ticket_exchange($value->edz_price,$value->edz_num).'|'.$this->ticket_exchange($value->ydz_price,$value->ydz_num).'|'.$this->ticket_exchange($value->swz_price,$value->swz_num).'|'.$this->ticket_exchange($value->dw_price,$value->dw_num).'||';
$data = '{"validateMessagesShowId":"_validatorMessage","status":true,"httpstatus":200,"data":{'.$pricestr.'},"messages":[],"validateMessages":{}}';
$return_data->data->price[$i] = $data;
$i++;
}
if(isset($value->swz_price)){
if($value->swz_price > 0){
$swzPrice = $value->swz_price * 10;
$seat_type .= '"9":"'.$swzPrice.'","A9":"¥'.$value->swz_price.'",';
}
}
$return_data->data->map = (object)$obj;
return json_encode($return_data);
}
//国际火车获取
public function search_international_train(){
$trainFrom = $this->input->get_post('trainFrom');
$trainTo = $this->input->get_post('trainTo');
$trainDate = $this->input->get_post('trainDate');
if(empty($trainFrom) || empty($trainTo)){
header("HTTP/1.1 404 Not Found");
exit('{"status":"201","reason":"车站查询失败","data":""}');
}
//根据传过来的城市名称获取城市代码
$trainFromCode = $this->BIZ_intel_train_model->get_code_by_name($trainFrom);
$trainToCode = $this->BIZ_intel_train_model->get_code_by_name($trainTo);
if(empty($trainFromCode) || empty($trainToCode)){
header("HTTP/1.1 404 Not Found");
exit('{"status":"202","reason":"站点名转换失败","data":""}');
}
//获取车次信息
$obj = $this->BIZ_intel_train_model->get_train_info($trainFromCode->s_code,$trainToCode->s_code);
//如果结果为空则直接返回为空的结果
if(empty($obj)){
header("HTTP/1.1 404 Not Found");
exit('{"status":"203","reason":"无车次信息!","data":""}');
}
//处理返回的字符串
$return_json = new StdClass();
$return_json->status = '200';
$return_json->reason = '成功的返回';
$return_json->rate = $this->GetCurrencyRate();
$return_json->mainland_deliver = 9;
$return_json->others_deliver = 12;
$return_json->data = array();
$return_json->endata = array();
//如果有结果则进行字符串处理
foreach($obj as $key=>$item){
//发车规则处理
$item->trainrule = array();
$item->trainrule['include'] = array();
$item->trainrule['exclusive'] = array();
foreach(json_decode($item->DateRule)->DateRule as $key_rule=>$rules){
if(!empty($rules)){
if($key_rule == 'include'){
$item->trainrule['include'] = $rules;
}else if($key_rule == 'exclusive'){
$item->trainrule['exclusive'] = $rules;
}
}
$pricestr = $seat_type.'"train_no":'.'"'.$value->train_no.'"';
//余票字符串
$return_data->data->result[$i] = '|预定|'.$value->train_no.'|'.$value->train_code.'|'.$value->from_station_name.'|'.$value->to_station_name.'|'.$value->from_station_code.'|'.$value->to_station_code.'|'.$value->start_time.'|'.$value->arrive_time.'|'.$value->run_time.'|'.$value->can_buy_now.'||'.$value->train_start_date.'||||||||'.$this->ticket_exchange($value->gjrw_num).'|'.$this->ticket_exchange($value->qtxb_num).'|'.$this->ticket_exchange($value->rw_num).'|'.$this->ticket_exchange($value->rz_num).'|'.$this->ticket_exchange($value->tdz_num).'|'.$this->ticket_exchange($value->wz_num).'||'.$this->ticket_exchange($value->yw_num).'|'.$this->ticket_exchange($value->yz_num).'|'.$this->ticket_exchange($value->edz_num).'|'.$this->ticket_exchange($value->ydz_num).'|'.$this->ticket_exchange($value->swz_num).'|'.$this->ticket_exchange($value->dw_num).'||';
$data = '{"validateMessagesShowId":"_validatorMessage","status":true,"httpstatus":200,"data":{'.$pricestr.'},"messages":[],"validateMessages":{}}';
$return_data->data->price[$i] = $data;
$this->BIZ_train_model->addOrUpdate($value->train_no,$value->train_code,$value->from_station_code,$value->to_station_code,json_encode($data));
}
//价格处理
$item->adult_seat = array();
$item->child_seat = array();
$price_arr = json_decode($item->seatPriceInfo2);
$audlt = $price_arr->price;
$child = $price_arr->cprice;
if(!empty($audlt)){
$i=0;
foreach($audlt as $key_adult=>$value){
$seat_name = $this->BIZ_intel_train_model->get_seatname($key_adult)->Seat_EName1;
$item->adult_seat[$i]['name'] = $seat_name;
$item->adult_seat[$i]['code'] = $key_adult;
$item->adult_seat[$i]['price'] = $value;
$item->adult_seat[$i]['pic'] = $this->BIZ_intel_train_model->get_seatname($key_adult)->Seat_Pic;
$i++;
}
}
if(!empty($child)){
$j=0;
foreach($child as $key_child=>$value){
$seat_name = $this->BIZ_intel_train_model->get_seatname($key_child)->Seat_EName1;
$item->child_seat[$j]['name'] = $seat_name;
$item->child_seat[$j]['code'] = $key_child;
$item->child_seat[$j]['price'] = $value;
$j++;
}
}
//最后进行当前日期判断,对数据进行分组
$flag = $this->checkDateRule($trainDate,$item->DateRule);
if(!$flag){
//将不符合发车日期的列车放入到另外一个数组中存储起来
array_push($return_json->endata,$obj[$key]);
}else{
array_push($return_json->data,$obj[$key]);
}
}
print_r(json_encode($return_json));
}
//获取某一条列车的信息
public function search_one_train($train_no){
$obj = $this->BIZ_intel_train_model->get_one_train($train_no);
$seat_code = json_decode($obj->seatPriceInfo2)->price;
$obj->seat_info = new stdClass();
foreach ($seat_code as $key=>$code){
$seat_info = $this->BIZ_intel_train_model->get_seat_info($key);
$obj->seat_info->$key = $seat_info;
}
print_r(json_encode($obj));
}
//查询某一趟列车的途径站
public function search_train_station($train_no){
if(!$train_no){
header("HTTP/1.1 404 Not Found");
exit('{"status":"404","reason":"列车编号为空"}');
}
$arr = $this->BIZ_intel_train_model->get_train_station($train_no);
if(!empty($arr)){
echo json_encode($arr);
}else{
header("HTTP/1.1 404 Not Found");
exit('{"status":"404","reason":"途径站为空"}');
}
}
//获取所有的列车信息
public function get_all_inteltrain(){
$obj = $this->BIZ_intel_train_model->get_allinteltrain();
print_r(json_encode($obj));
}
//获取国际火车出发规则
public function get_station_rules(){
//获取所有站点的列表
$return_json = array();
$return_json['TrainList'] = array();
$all_stations = $this->BIZ_intel_train_model->get_allstations();
$i = 0;
foreach($all_stations as $item){
$rule_arr = $this->BIZ_intel_train_model->get_train_rules($item->station_id);
if(!empty($rule_arr)){
$return_json['TrainList'][$i]['FromStation'] = $item->s_ename;
$return_json['TrainList'][$i]['FromCountry'] = $item->s_country;
$return_json['TrainList'][$i]['ToStations'] = array();
$j = 0;
foreach($rule_arr as $rule_info){
$return_json['TrainList'][$i]['ToStations'][$j]['Message'] = $rule_info->tsi_Message;
$return_json['TrainList'][$i]['ToStations'][$j]['Station'] = $rule_info->S_ename;
$return_json['TrainList'][$i]['ToStations'][$j]['StationCountry'] = $rule_info->s_country;
$j++;
}
$i++;
}
}
$return_data->data->map = (object)$obj;
print_r(json_encode($return_data));
//print_r($return_json);
header('Content-type: application/json');
print_r(json_encode($return_json));
}
//获取国际火车出发规则
public function ch_station_rules(){
//获取所有站点的列表
$return_json = array();
$return_json['TrainList'] = array();
$all_stations = $this->BIZ_intel_train_model->ch_allstations();
$i = 0;
foreach($all_stations as $item){
if($item->s_country == 'Vietnam'){
$rule_arr = $this->BIZ_intel_train_model->ch_train_rules($item->station_id,true);
}else{
$rule_arr = $this->BIZ_intel_train_model->ch_train_rules($item->station_id,false);
}
if(!empty($rule_arr)){
$return_json['TrainList'][$i]['FromStation'] = $item->s_ename;
$return_json['TrainList'][$i]['FromCountry'] = $item->s_country;
$return_json['TrainList'][$i]['ToStations'] = array();
$j = 0;
foreach($rule_arr as $rule_info){
$return_json['TrainList'][$i]['ToStations'][$j]['Message'] = $rule_info->tsi_Message;
$return_json['TrainList'][$i]['ToStations'][$j]['Station'] = $rule_info->S_ename;
$return_json['TrainList'][$i]['ToStations'][$j]['StationCountry'] = $rule_info->s_country;
$j++;
}
$i++;
}
}
//print_r($return_json);
header('Content-type: application/json');
print_r(json_encode($return_json));
}
//获取价格
//获取价格(废弃)
/*
fromStationCode出发站三字码
toStationCode:终点站三字码
@ -126,20 +435,182 @@ class search extends CI_Controller{
}
//余票转换
function ticket_exchange($num){
if(is_numeric($num)){
if($num == 0){
return '无';
}elseif($num >= 99){
return '有';
}else{
return $num;
function ticket_exchange($price,$num){
//echo $this->can_buy_now;
if($this->cache == 'yes' || $this->seveth == 'yes'){
if(isset($price)){
if($price > 0){
return '有';
}else{
return '';
}
}
return '';
}else{
if($num == '--'){
return '';
if(is_numeric($num)){
if($num == 0){
return '无';
}elseif($num >= 99){
return '有';
}else{
return $num;
}
}else{
if($num == '--'){
return '';
}
}
}
}
function checkDateRule($strDate, $jsonDate){
if (!strtotime($strDate)) {
return false;
}
$strDate_t = strtotime($strDate);
$strDate = date("Y-m-d", $strDate_t);
$dYear = date("Y", $strDate_t);
$dMonth = date("m", $strDate_t);
$dDay = date("d", $strDate_t);
$dWeek = date("w", $strDate_t); //星期的第几天数组0-6
//单双日
if ($dDay % 2 == 0) {
$dSingle = 2;
} else {
$dSingle = 1;
}
$jObject = json_decode($jsonDate);
$result = false;
//先判断排除规则有一条符合就返回false
if (isset($jObject->DateRule->exclusive) ) {
$jObject_exclusive = $jObject->DateRule->exclusive;
foreach ($jObject_exclusive as $key => $val) {
if ($val->dateType=="EveryDay" ) { //每天,这个基本不会出现,设置每天排除和关闭没区别
return false;
} elseif ($val->dateType=="WeekDay" ) { //按星期
//先判断是否在日期范围内,再判断星期是否对应
$bw_CheckRange = false; //是否需要判断星期几
if ($val->dateRange == "*") { //每天
$bw_CheckRange = true;
} else {
$dateRange = explode("|", $val->dateRange); //日期范围
if (count($dateRange) == 2) {
if ($strDate_t >= strtotime($dateRange[0]) and $strDate_t <= strtotime($dateRange[1])) {
$bw_CheckRange = true; //在范围内
}
}
}
if ($bw_CheckRange) {
if ($dWeek==0) {
$dWeek=7; //星期0为星期天我们保存的星期天是7
}
$weekArr = explode(",", $val->dateData); //星期数据1,2,3,4,5,6,7这种
foreach ($weekArr as $week) {
if ($week == $dWeek) {
return false;
}
}
}
} elseif ($val->dateType == "SelectDay") { //固定日期
if ($val->dateRange=="*") {
$SelectDayArr = explode(",", $val->dateData);
foreach ($SelectDayArr as $sDay) {
if (strtotime($sDay) == $strDate_t) {
return false;
}
}
}
} elseif ($val->dateType == "RangeDay") { //连续日期
if ($val->dateRange == "*") {
$RangeDateArr = explode("|", $val->dateData);
if (count($RangeDateArr)==2) {
if ($strDate_t >= strtotime($RangeDateArr[0]) and $strDate_t <= strtotime($RangeDateArr[1])) {
return false ; //在范围内
}
}
}
}
}
}
//再判断包含规则有一条符合就为true
if (isset($jObject->DateRule->include)) {
$jObject_include = $jObject->DateRule->include;
foreach ($jObject_include as $key => $val) {
if ($val->dateType == "EveryDay") { //每天
return true;
} elseif ($val->dateType == "WeekDay") { //按星期
//先判断是否在日期范围内,再判断星期是否对应
$bw_CheckRange = false; //是否需要判断星期几
if ($val->dateRange == "*") { //每天
$bw_CheckRange = true;
} else {
$dateRange = explode("|", $val->dateRange); //日期范围
if (count($dateRange) == 2) {
if ($strDate_t >= strtotime($dateRange[0]) and $strDate_t <= strtotime($dateRange[1])) {
$bw_CheckRange = true; //在范围内
}
}
}
if ($bw_CheckRange) {
if ($dWeek == 0) {
$dWeek = 7; //星期0为星期天我们保存的星期天是7
}
$weekArr = explode(",", $val->dateData); //星期数据1,2,3,4,5,6,7这种
foreach ($weekArr as $week) {
if ($week == $dWeek) {
return true;
}
}
}
} elseif ($val->dateType=="MonthDay") { //每月单双
if ($val->dateRange=="*") {
$MonthDayArr = explode(",", rtrim($val->dateData, ',')); //月单双数据m3:2,m4:1
foreach ($MonthDayArr as $MonthKey) {
$MonthArr = explode(":", $MonthKey);
$Month = str_pad(str_replace("m", "", $MonthArr[0]), 2, "0", STR_PAD_LEFT); //存储的月份补0好比较
if ($dMonth == $Month) { //月份相同比较
if ($dSingle == $MonthArr[1]) {
return true;
}
}
}
}
} elseif ($val->dateType == "SelectDay") { //固定日期
if ($val->dateRange=="*") {
$SelectDayArr = explode(",", $val->dateData);
foreach ($SelectDayArr as $sDay) {
if (strtotime($sDay) == $strDate_t) {
return true;
}
}
}
} elseif ($val->dateType == "RangeDay") { //连续日期
if ($val->dateRange == "*") {
$RangeDateArr = explode("|", $val->dateData);
if (count($RangeDateArr)==2) {
if ($strDate_t >= strtotime($RangeDateArr[0]) and $strDate_t <= strtotime($RangeDateArr[1])) {
return true ; //在范围内
}
}
}
}
}
}
}
return $result;
}
//发送请求
@ -148,7 +619,7 @@ class search extends CI_Controller{
curl_setopt($curl, CURLOPT_URL, $url); // 要访问的地址
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); // 对认证证书来源的检查
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); // 从证书中检查SSL加密算法是否存在
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); // 模拟用户使用的浏览器
//curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); // 模拟用户使用的浏览器
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); // 使用自动跳转
curl_setopt($curl, CURLOPT_AUTOREFERER, 1); // 自动设置Referer
if ($method == 'POST' && !empty($data)) {
@ -168,6 +639,33 @@ class search extends CI_Controller{
curl_close($curl); //关闭CURL会话
return $tmpInfo; //返回数据
}
function GetCurrencyRate() {
$this->HT = $this->load->database('HT', TRUE);
$sql = "SELECT CRI_BuyIn / 100.00 AS tmpExRate, \n"
. " CRI_Code \n"
. "FROM tourmanager.dbo.CurrencyRateInfo \n"
. "WHERE CRI_Code IN ('USD', 'EUR', 'RUB') \n"
. " AND GETDATE() BETWEEN CRI_Start AND CRI_Stop";
$query = $this->HT->query($sql);
foreach ($query->result() as $item) {
switch ($item->CRI_Code) {
case 'USD':
$this->USD_Rate = $item->tmpExRate;
break;
case 'EUR':
$this->EUR_Rate = $item->tmpExRate;
break;
case 'RUB':
$this->RUB_Rate = $item->tmpExRate;
break;
}
}
// echo $this->USD_Rate . '<br/>';
// echo $this->EUR_Rate . '<br/>';
// echo $this->RUB_Rate . '<br/>';
return $this->USD_Rate;
}
}

@ -0,0 +1,226 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class search extends CI_Controller{
public function __construct(){
parent::__construct();
$this->load->model("BIZ_train_model");//加载模型
}
//查询聚合余票接口,对返回的数据进行处理
public function index($train_date=null,$fromStation=null,$toStation=null){
set_time_limit(0);
if(!$train_date || !$fromStation || !$toStation){
exit('传参不能为空!');
}else{
if(strlen($fromStation) != 3){
exit('fromStation:参数错误!');
}
if(strlen($toStation) != 3){
exit('toStation:参数错误!');
}
$this->train_date = $train_date;
//$url = 'http://op.juhe.cn/trainTickets/ticketsAvailable?key='.JUHE_TRAIN_API_KEY.'&train_date='.$train_date.'&from_station='.$fromStation.'&to_station='.$toStation;
$url = 'http://139.129.246.118:12309/trainTickets/ticketsAvailable?key='.JUHE_TRAIN_API_KEY.'&train_date='.$train_date.'&from_station='.$fromStation.'&to_station='.$toStation;
$back_data = $this->get_http($url);
//特殊车次处理(贵阳 -- 重庆)
/*if(($fromStation == 'GIW') && ($toStation == 'CQW') && (strtotime($train_date) - strtotime('2018-01-16') >= 0)){
exit('{"httpstatus":200,"reason":"特殊车次不开车","data":{"result":""}}');
}*/
$firstdata = $back_data;
$return_data = new stdClass();
$cache = 'no';
if(empty($back_data) || empty(json_decode($back_data)->result)){
$obj = $this->BIZ_train_model->get_train_info($fromStation,$toStation);
if($obj){
$back_data = $obj->tpc_content;
$cache = 'yes';
$this->cache = true;
$reason = '接口数据为空,调用缓存';
log_message('error','查询为空的链接:'.$url.'|出错的原因:'.$firstdata.'|调用缓存号:'.$obj->tpc_sn.'|缓存生成的时间:'.$obj->tpc_datetime);
}else{
$reason = '接口数据为空,缓存也为空';
log_message('error','查询为空的链接:'.$url.'|出错的原因:'.$firstdata.'|缓存为空');
}
}else{
$reason = json_decode($back_data)->reason;
$this->BIZ_train_model->addOrUpdate($fromStation,$toStation,$back_data);
}
$return_data->httpstatus = 200;
$return_data->reason = $reason;
$return_data->cache = $cache;
$return_data->data = new stdClass();
$return_data->data->result = array();
$return_data->data->map = new stdClass();
$obj = array();
$i = 0;
$pricestr = '';
if(!empty(json_decode($back_data)->result->list)){
foreach (json_decode($back_data)->result->list as $value){
$obj[$value->from_station_code] = $value->from_station_name;
$obj[$value->to_station_code] = $value->to_station_name;
$seat_type = '';
if(isset($value->gjrw_price)){
if($value->gjrw_price > 0){
$gjrwPrice = $value->gjrw_price * 10;
$seat_type .= '"6":"'.$gjrwPrice.'","A6":"¥'.$value->gjrw_price.'",';
}
}
if(isset($value->qtxb_price)){
if($value->qtxb_price > 0){
$seat_type .= '"H":"¥'.$value->qtxb_price.'",';
}
}
if(isset($value->rw_price)){
if($value->rw_price > 0){
$rwPrice = $value->rw_price * 10;
$seat_type .= '"4":"'.$rwPrice.'","A4":"¥'.$value->rw_price.'",';
}
}
if(isset($value->rz_price)){
if($value->rz_price > 0){
$rzPrice = $value->rz_price * 10;
$seat_type .= '"2":"'.$rzPrice.'","A2":"¥'.$value->rz_price.'",';
}
}
if(isset($value->tdz_price)){
if($value->tdz_price > 0){
$seat_type .= '"P":"¥'.$value->tdz_price.'",';
}
}
if(isset($value->wz_price)){
if($value->wz_price > 0){
$wzPrice = $value->wz_price * 10;
$seat_type .= '"WZ":"¥'.$value->wz_price.'",';
}
}
if(isset($value->yw_price)){
if($value->yw_price > 0){
$ywPrice = $value->yw_price * 10;
$seat_type .= '"3":"'.$ywPrice.'","A3":"¥'.$value->yw_price.'",';
}
}
if(isset($value->yz_price)){
if($value->yz_price > 0){
$yzPrice = $value->yz_price * 10;
$seat_type .= '"1":"'.$yzPrice.'","A1":"¥'.$value->yz_price.'",';
}
}
if(isset($value->edz_price)){
if($value->edz_price > 0){
$seat_type .= '"O":"¥'.$value->edz_price.'",';
}
}
if(isset($value->ydz_price)){
if($value->ydz_price > 0){
$seat_type .= '"M":"¥'.$value->ydz_price.'",';
}
}
if(isset($value->swz_price)){
if($value->swz_price > 0){
$swzPrice = $value->swz_price * 10;
$seat_type .= '"9":"'.$swzPrice.'","A9":"¥'.$value->swz_price.'",';
}
}
if(isset($value->dw_price)){
if($value->dw_price > 0){
$seat_type .= '"F":"¥'.$value->dw_price.'",';
}
}
$pricestr = $seat_type.'"train_no":'.'"'.$value->train_no.'"';
//余票字符串
$return_data->data->result[$i] = '|预定|'.$value->train_no.'|'.$value->train_code.'|'.$value->from_station_name.'|'.$value->to_station_name.'|'.$value->from_station_code.'|'.$value->to_station_code.'|'.$value->start_time.'|'.$value->arrive_time.'|'.$value->run_time.'|'.$value->can_buy_now.'||'.$value->train_start_date.'||||||||'.$this->ticket_exchange($value->gjrw_num).'|'.$this->ticket_exchange($value->qtxb_num).'|'.$this->ticket_exchange($value->rw_num).'|'.$this->ticket_exchange($value->rz_num).'|'.$this->ticket_exchange($value->tdz_num).'|'.$this->ticket_exchange($value->wz_num).'||'.$this->ticket_exchange($value->yw_num).'|'.$this->ticket_exchange($value->yz_num).'|'.$this->ticket_exchange($value->edz_num).'|'.$this->ticket_exchange($value->ydz_num).'|'.$this->ticket_exchange($value->swz_num).'|'.$this->ticket_exchange($value->dw_num).'||';
$data = '{"validateMessagesShowId":"_validatorMessage","status":true,"httpstatus":200,"data":{'.$pricestr.'},"messages":[],"validateMessages":{}}';
$return_data->data->price[$i] = $data;
$i++;
}
}
$return_data->data->map = (object)$obj;
print_r(json_encode($return_data));
}
}
//获取价格
/*
fromStationCode出发站三字码
toStationCode:终点站三字码
trainCode:车次号
*/
public function get_price($fromStationCode=null,$toStationCode=null,$trainCode=null){
if(!$fromStationCode || !$toStationCode || !$trainCode){
exit('传参错误!');
}else{
$return_data = $this->BIZ_train_model->get_price($fromStationCode,$toStationCode,$trainCode);
if(!empty($return_data)){
print_r(json_decode($return_data->TPL_Price));
}else{
print_r('没有数据返回');
}
}
}
//余票转换
function ticket_exchange($num){
if(isset($this->cache)){
$time = strtotime($this->train_date) - time();
$day = $time / 86400;
if($day > 15){
return '有';
}else{
return $num;
}
}else{
if(is_numeric($num)){
if($num == 0){
return '无';
}elseif($num >= 99){
return '有';
}else{
return $num;
}
}else{
if($num == '--'){
return '';
}
}
}
}
//发送请求
function get_http($url, $data = '', $method = 'GET') {
$curl = curl_init(); // 启动一个CURL会话
curl_setopt($curl, CURLOPT_URL, $url); // 要访问的地址
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); // 对认证证书来源的检查
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); // 从证书中检查SSL加密算法是否存在
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); // 模拟用户使用的浏览器
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); // 使用自动跳转
curl_setopt($curl, CURLOPT_AUTOREFERER, 1); // 自动设置Referer
if ($method == 'POST' && !empty($data)) {
curl_setopt($curl, CURLOPT_POST, 1); // 发送一个常规的Post请求
curl_setopt($curl, CURLOPT_POSTFIELDS, $data); // Post提交的数据包
}
curl_setopt($curl, CURLOPT_TIMEOUT, 45); // 设置超时限制防止死循环
curl_setopt($curl, CURLOPT_HEADER, 0); // 显示返回的Header区域内容
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // 获取的信息以文件流的形式返回
$tmpInfo = curl_exec($curl); // 执行操作
$errno = curl_errno($curl);
if ($errno !== 0) {
return false;
$error_message = $errno . ' ' . curl_error($curl); //记录错误日志
log_message('error', "third_party/train_app/index/get_http curl {$error_message}");
}
curl_close($curl); //关闭CURL会话
return $tmpInfo; //返回数据
}
}
?>

@ -0,0 +1,175 @@
<?php
class BIZ_intel_train_model extends CI_Model {
function __construct() {
parent::__construct();
$this->HT = $this->load->database('HT', TRUE);
}
//查询火车列表信息
public function get_train_info($trainFromCode,$trainToCode){
if($trainFromCode == 'CHBJ'){
$add = "OR tl.trainFromCode = 'CHPW'";
}else{
$add = "";
}
$sql = "
SELECT
tl.trainNo,
tl.trainFrom,
tl.trainFromCode,
(select s_country from TrainStation_intel where s_code = tl.trainFromCode) as from_country,
tl.trainTo,
tl.trainToCode,
(select s_country from TrainStation_intel where s_code = tl.trainToCode) as to_country,
tl.trainType,
tl.train_no,
tl.trainUse,
tl.RunTime,
tl.departTime,
(select top 1 trainArrive from trainlistDetail where train_no = tl.train_no order by trainOrder desc) as arriveTime,
tl.UseDay,
tl.DateRule,
tl.TrainMessage,
tp.seatPriceInfo2
FROM
trainlist tl
left join
trainPrice tp
on
tl.train_no = tp.train_no
WHERE
tl.isGlobal = 1
AND
(tl.trainFromCode = '{$trainFromCode}' {$add})
AND
tl.trainToCode = '{$trainToCode}'
AND
tl.DateRule != ''
AND
tp.seatPriceInfo2 IS NOT NULL
order by departTime asc
";
$query = $this->HT->query($sql);
return $query->result();
}
public function get_code_by_name($name){
$sql = "select s_code from TrainStation_intel where s_ename = '{$name}'";
$query = $this->HT->query($sql);
return $query->row();
}
public function get_seatname($seat_code){
$sql = "select Seat_EName1,Seat_Pic from TrainSeat_Intel where Seat_code = '{$seat_code}'";
$query = $this->HT->query($sql);
return $query->row();
}
//获取一列指定火车数据
public function get_one_train($train_no){
$sql = "
SELECT
*,
(select s_country from TrainStation_intel where trainFromCode = s_code ) as From_country,
(select s_country from TrainStation_intel where trainToCode = s_code ) as To_country
FROM
trainlist tl
LEFT JOIN
trainPrice tp
ON
tl.train_no = tp.train_no
WHERE
tl.train_no = '{$train_no}'
AND
isGlobal = 1
";
$query = $this->HT->query($sql);
return $query->row();
}
public function get_allinteltrain(){
$sql = "
SELECT
*
FROM
TrainStation_intel
LEFT JOIN
trainlist
ON
s_code = trainFromCode
WHERE
trainFrom != 'NULL'
";
$query = $this->HT->query($sql);
return $query->result();
}
public function get_seat_info($seat_code){
$sql = "SELECT Seat_CName,Seat_EName1 FROM TrainSeat_Intel WHERE Seat_Code = '{$seat_code}'";
$query = $this->HT->query($sql);
return $query->row();
}
public function get_train_station($train_no){
$sql = "SELECT * FROM trainlistDetail WHERE train_no = '{$train_no}' order by trainOrder asc";
$query = $this->HT->query($sql);
return $query->result();
}
public function get_allstations(){
$sql = "SELECT * FROM TrainStation_intel";
$query = $this->HT->query($sql);
return $query->result();
}
public function ch_allstations(){
$sql = "SELECT * FROM TrainStation_intel where station_id != 10";
$query = $this->HT->query($sql);
return $query->result();
}
public function get_train_rules($station_id){
$sql = "SELECT
S_ename,s_country,tsi_Message
FROM
TrainSearch_intel
LEFT JOIN
TrainStation_intel
ON
tsi_ToStation = station_id
where
tsi_FromStation = '{$station_id}'";
$query = $this->HT->query($sql);
return $query->result();
}
public function ch_train_rules($station_id,$flag){
if($flag){
$and = "and s_country != 'Vietnam'";
}else{
$and = "";
}
if($station_id == 11){
$station = "or tsi_FromStation = 10";
}else{
$station = "";
}
$sql = "SELECT
S_ename,s_country,tsi_Message
FROM
TrainSearch_intel
LEFT JOIN
TrainStation_intel
ON
tsi_ToStation = station_id
where
tsi_FromStation = '{$station_id}'
";
$sql .= $and;
$sql .= $station;
$query = $this->HT->query($sql);
return $query->result();
}
}

@ -8,62 +8,70 @@ class BIZ_train_model extends CI_Model {
$this->INFO = $this->load->database('INFO', TRUE);
}
//新增或更新价格
public function addOrUpdate($TPL_Train_No,$TPL_Train_Code,$TPL_From_Station_Code,$TPL_To_Station_Code,$TPL_Price){
//新增或更新缓存
public function addOrUpdate($tpc_from_station,$tpc_to_station,$tpc_content){
$sql = "IF NOT EXISTS(
SELECT 1
FROM TrainPriceList
WHERE TPL_Train_Code = '$TPL_Train_Code'
AND TPL_From_Station_Code = '$TPL_From_Station_Code'
AND TPL_To_Station_Code = '$TPL_To_Station_Code'
FROM TrainPriceCache
WHERE
tpc_from_station = '$tpc_from_station'
AND tpc_to_station = '$tpc_to_station'
) BEGIN
INSERT INTO TrainPriceList
INSERT INTO TrainPriceCache
(
TPL_Train_No,
TPL_Train_Code,
TPL_From_Station_Code,
TPL_To_Station_Code,
TPL_Price,
TPL_Datetime,
TPL_Source
tpc_from_station,
tpc_to_station,
tpc_content,
tpc_datetime,
tpc_source
)
VALUES
(
'$TPL_Train_No','$TPL_Train_Code','$TPL_From_Station_Code','$TPL_To_Station_Code','$TPL_Price',GETDATE(),'juhe'
'$tpc_from_station','$tpc_to_station','$tpc_content',GETDATE(),'juhe'
)
END
ELSE
BEGIN
UPDATE TrainPriceList
SET TPL_Train_No = '$TPL_Train_No',
TPL_Price = '$TPL_Price',
TPL_Datetime = GETDATE(),
TPL_Source = 'juhe'
WHERE TPL_Train_Code = '$TPL_Train_Code'
AND TPL_From_Station_Code = '$TPL_From_Station_Code'
AND TPL_To_Station_Code = '$TPL_To_Station_Code'
UPDATE TrainPriceCache
SET tpc_from_station = '$tpc_from_station',
tpc_to_station = '$tpc_to_station',
tpc_content = '$tpc_content',
tpc_datetime = GETDATE(),
tpc_source = 'juhe'
WHERE
tpc_from_station = '$tpc_from_station'
AND tpc_to_station = '$tpc_to_station'
END
";
$query = $this->INFO->query($sql);
return $query;
}
//获取价格
public function get_price($fromStationCode,$toStationCode,$trainCode){
//获取缓存的火车信息
//如果读取到缓存是7天以前的数据就不返回任何数据并且将其删除。
public function get_train_cache($tpc_from_station,$tpc_to_station){
$sql = "SELECT
TPL_Price
*
FROM
TrainPriceList
TrainPriceCache
WHERE
TPL_Train_Code = '$trainCode'
AND
TPL_From_Station_Code = '$fromStationCode'
tpc_from_station = '$tpc_from_station'
AND
TPL_To_Station_Code = '$toStationCode'";
$query = $this->INFO->query($sql);
tpc_to_station = '$tpc_to_station'";
$query = $this->INFO->query($sql);
return $query->row();
}
//删除缓存操作
function delete_traincache($tpc_from_station,$tpc_to_station){
$sql = "DELETE FROM
TrainPriceCache
WHERE
tpc_from_station = '$tpc_from_station'
AND
tpc_to_station = '$tpc_to_station'";
$query = $this->INFO->query($sql);
}
function biz_order_detail($cold_sn) {
$sql = "

@ -37,7 +37,7 @@ class Index extends CI_Controller {
if($nation_item=='www.tripadvisor.com'){//分页代码,英文站点查询前三页,反过来查询,越早的越在后面
$page_mark = array('-or20-', '-or10-', '-');
//使用代理来请求,国内直接访问会很慢
$page_url=str_replace('https://www.tripadvisor.com', 'http://47.91.16.199:5052', $page_url);
$page_url=str_replace('https://www.tripadvisor.com', 'http://47.74.2.87:5052', $page_url);
}else{
$page_mark = array('-');
}

@ -36,108 +36,174 @@ class Tuniu_train extends CI_Controller{
//获取余票
public function search($date=null,$fromStation=null,$toStation=null){
set_time_limit(0);
if(!$date || !$fromStation || !$toStation){
exit('传参错误!');
}else{
//做超过预售期的处理查询
$isCache = false;
$iseven = false;
$now_time = time();
$differ = (strtotime($date) - $now_time) / 86400;
if($differ > 29){
$date = date('Y-m-d',strtotime('+7day'));
$iseven = true;
}
//途牛报文拼接
$sign = $this->create_sign();
$url = TUNIU_URL.'/train/search';
$time = date('Y-m-d H:i:s',time());
$post_data = '{
"apiKey": "'.TUNIU_KEY.'",
"sign": "'.$sign.'",
"timestamp": "'.$time.'",
"data": { "trainDate": "'.$date.'", "fromStation": "'.$fromStation.'", "toStation": "'.$toStation.'", "trainCode": "" }
}';
$back_data = post_tuniu($url,$post_data,$method = 'POST');
//print_r(json_decode($back_data));
$return_data = new stdClass();
$return_data->returnCode = json_decode($back_data)->returnCode;
//echo $return_data->returnCode;
$return_data->httpstatus = 200;
$return_data->data = new stdClass();
$return_data->data->result = array();
$return_data->data->map = new stdClass();
$obj = array();
$i = 0;
$pricestr = '';
if(!empty(json_decode($back_data)->data)){
foreach (json_decode($back_data)->data as $value){
$obj[$value->fromStationCode] = $value->fromStationName;
$obj[$value->toStationCode] = $value->toStationName;
$seat_type = '';
if(isset($value->gjrwPrice)){
if(is_numeric($value->gjrwPrice)){
$gjrwPrice = $value->gjrwPrice * 10;
$seat_type .= '"6":"'.$gjrwPrice.'","A6":"¥'.$value->gjrwPrice.'",';
}
$url = TUNIU_URL.'/train/search';
$time = date('Y-m-d H:i:s',time());
$post_data = '{
"apiKey": "'.TUNIU_KEY.'",
"sign": "'.$sign.'",
"timestamp": "'.$time.'",
"data": { "trainDate": "'.$date.'", "fromStation": "'.$fromStation.'", "toStation": "'.$toStation.'", "trainCode": "" }
}';
$back_data = post_tuniu($url,$post_data,$method = 'POST');
log_message('error','tuniutrain 原始数据:'.$back_data);
//print_r(json_decode($back_data));die();
//$log_info = '';
$tn_info = json_decode($back_data);
$retrun_code = $tn_info->returnCode;
$return_msg = $tn_info->errorMsg;
if(isset($tn_info->data)){
if(empty(json_decode($back_data)->data)){
$isCache = true;
//$log_info = 'tuniutrain data缺失|数据源:'.$fromStation.'|'.$toStation.'|'.$date.'|retrun_code:'.$retrun_code.'|return_msg:'.$return_msg;
}else{
$this->tuniuprice_model->addOrUpdate($fromStation,$toStation,$back_data);
}
if(isset($value->qtxbPrice)){
if(is_numeric($value->qtxbPrice)){
$seat_type .= '"H":"¥'.$value->qtxbPrice.'",';
}else{
$isCache = true;
//$log_info = 'tuniutrain 接口未响应|数据源:'.$fromStation.'|'.$toStation.'|'.$date.'|retrun_code:'.$retrun_code.'|return_msg:'.$return_msg;
}
if($isCache){
if($differ <= 5){
$back_data = null;
}else{
$trainCache = $this->tuniuprice_model->get_train_cache($fromStation,$toStation);
if(!empty($trainCache)){
$back_data = $trainCache->tpc_content;
$isCache = true;
//$log_info .= '|调用缓存';
//log_message('error',$log_info);
}else{
$back_data = null;
//$log_info .= '|缓存为空';
//log_message('error',$log_info);
}
}
if(isset($value->rwPrice)){
if(is_numeric($value->rwPrice)){
$rwPrice = $value->rwPrice * 10;
$seat_type .= '"4":"'.$rwPrice.'","A4":"¥'.$value->rwPrice.'",';
}
}
//途牛数据格式转换
$return_data = new stdClass();
$return_data->httpstatus = 200;
$return_data->data = new stdClass();
$return_data->data->seven = $iseven;
$return_data->data->cache = $isCache;
$return_data->data->result = array();
$return_data->data->map = new stdClass();
$obj = array();
$i = 0;
$pricestr = '';
if(!empty(json_decode($back_data)->data)){
foreach (json_decode($back_data)->data as $value){
$obj[$value->fromStationCode] = $value->fromStationName;
$obj[$value->toStationCode] = $value->toStationName;
$seat_type = '';
if(isset($value->gjrwXiaPrice)){
if(is_numeric($value->gjrwXiaPrice)){
$gjrwXiaPrice = $value->gjrwXiaPrice * 10;
$seat_type .= '"6":"'.$gjrwXiaPrice.'","A6":"¥'.$value->gjrwXiaPrice.'",';
}
}
}
if(isset($value->rzPrice)){
if(is_numeric($value->rzPrice)){
$rzPrice = $value->rzPrice * 10;
$seat_type .= '"2":"'.$rzPrice.'","A2":"¥'.$value->rzPrice.'",';
if(isset($value->qtxbPrice)){
if(is_numeric($value->qtxbPrice)){
$seat_type .= '"H":"¥'.$value->qtxbPrice.'",';
}
}
}
if(isset($value->tdzPrice)){
if(is_numeric($value->tdzPrice)){
$seat_type .= '"P":"¥'.$value->tdzPrice.'",';
if(isset($value->rwPrice)){
if(is_numeric($value->rwPrice)){
$rwPrice = $value->rwPrice * 10;
$seat_type .= '"4":"'.$rwPrice.'","A4":"¥'.$value->rwPrice.'",';
}
}
}
if(isset($value->wzPrice)){
if(is_numeric($value->wzPrice)){
$wzPrice = $value->wzPrice * 10;
$seat_type .= '"WZ":"¥'.$value->wzPrice.'",';
if(isset($value->rzPrice)){
if(is_numeric($value->rzPrice)){
$rzPrice = $value->rzPrice * 10;
$seat_type .= '"2":"'.$rzPrice.'","A2":"¥'.$value->rzPrice.'",';
}
}
}
if(isset($value->ywPrice)){
if(is_numeric($value->ywPrice)){
$ywPrice = $value->ywPrice * 10;
$seat_type .= '"3":"'.$ywPrice.'","A3":"¥'.$value->ywPrice.'",';
if(isset($value->tdzPrice)){
if(is_numeric($value->tdzPrice)){
$seat_type .= '"P":"¥'.$value->tdzPrice.'",';
}
}
}
if(isset($value->yzPrice)){
if(is_numeric($value->yzPrice)){
$yzPrice = $value->yzPrice * 10;
$seat_type .= '"1":"'.$yzPrice.'","A1":"¥'.$value->yzPrice.'",';
if(isset($value->wzPrice)){
if(is_numeric($value->wzPrice)){
$wzPrice = $value->wzPrice * 10;
$seat_type .= '"WZ":"¥'.$value->wzPrice.'",';
}
}
}
if(isset($value->edzPrice)){
if(is_numeric($value->edzPrice)){
$seat_type .= '"O":"¥'.$value->edzPrice.'",';
if(isset($value->ywPrice)){
if(is_numeric($value->ywPrice)){
$ywPrice = $value->ywPrice * 10;
$seat_type .= '"3":"'.$ywPrice.'","A3":"¥'.$value->ywPrice.'",';
}
}
}
if(isset($value->ydzPrice)){
if(is_numeric($value->ydzPrice)){
$seat_type .= '"M":"¥'.$value->ydzPrice.'",';
if(isset($value->yzPrice)){
if(is_numeric($value->yzPrice)){
$yzPrice = $value->yzPrice * 10;
$seat_type .= '"1":"'.$yzPrice.'","A1":"¥'.$value->yzPrice.'",';
}
}
}
if(isset($value->swzPrice)){
if(is_numeric($value->swzPrice)){
$swzPrice = $value->swzPrice * 10;
$seat_type .= '"9":"'.$swzPrice.'","A9":"¥'.$value->swzPrice.'",';
if(isset($value->edzPrice)){
if(is_numeric($value->edzPrice)){
$seat_type .= '"O":"¥'.$value->edzPrice.'",';
}
}
if(isset($value->ydzPrice)){
if(is_numeric($value->ydzPrice)){
$seat_type .= '"M":"¥'.$value->ydzPrice.'",';
}
}
if(isset($value->swzPrice)){
if(is_numeric($value->swzPrice)){
$swzPrice = $value->swzPrice * 10;
$seat_type .= '"9":"'.$swzPrice.'","A9":"¥'.$value->swzPrice.'",';
}
}
$pricestr = $seat_type.'"train_no":'.'"'.$value->trainNo.'"';
//对返回的数据进行容错处理
$value->gjrwNum = isset($value->gjrwNum) ? ticket_exchange($value->gjrwNum,$iseven) : '';
$value->rwNum = isset($value->rwNum) ? ticket_exchange($value->rwNum,$iseven) : '';
$value->rzNum = isset($value->rzNum)?ticket_exchange($value->rzNum,$iseven) : '';
$value->tdzNum = isset($value->tdzNum)?ticket_exchange($value->tdzNum,$iseven) : '';
$value->wzNum = isset($value->wzNum)?ticket_exchange($value->wzNum,$iseven) : '';
$value->ywNum = isset($value->ywNum)?ticket_exchange($value->ywNum,$iseven) : '';
$value->yzNum = isset($value->yzNum)?ticket_exchange($value->yzNum,$iseven) : '';
$value->edzNum = isset($value->edzNum)?ticket_exchange($value->edzNum,$iseven) : '';
$value->ydzNum = isset($value->ydzNum)?ticket_exchange($value->ydzNum,$iseven) : '';
$value->swzNum = isset($value->swzNum)?ticket_exchange($value->swzNum,$iseven) : '';
$value->dwNum = isset($value->dwNum)?ticket_exchange($value->dwNum,$iseven) : '';
$value->runTime = isset($value->runTime)?$value->runTime : '';
//余票字符串
$return_data->data->result[$i] = '|预定|'.$value->trainNo.'|'.$value->trainCode.'|'.$value->fromStationName.'|'.$value->toStationName.'|'.$value->fromStationCode.'|'.$value->toStationCode.'|'.$value->startTime.'|'.$value->arriveTime.'|'.$value->runTime.'|'.$value->canBuyNow.'||'.date('Ymd',strtotime($value->trainStartDate)).'||||||||'.$value->gjrwNum.'||'.$value->rwNum.'|'.$value->rzNum.'|'.$value->tdzNum.'|'.$value->wzNum.'||'.$value->ywNum.'|'.$value->yzNum.'|'.$value->edzNum.'|'.$value->ydzNum.'|'.$value->swzNum.'|'.$value->dwNum.'||';
$data = '{"validateMessagesShowId":"_validatorMessage","status":true,"httpstatus":200,"data":{'.$pricestr.'},"messages":[],"validateMessages":{}}';
$return_data->data->price[$i] = $data;
$i++;
}
$pricestr = $seat_type.'"train_no":'.'"'.$value->trainNo.'"';
//余票字符串
$return_data->data->result[$i] = '|预定|'.$value->trainNo.'|'.$value->trainCode.'|'.$value->fromStationName.'|'.$value->toStationName.'|'.$value->fromStationCode.'|'.$value->toStationCode.'|'.$value->startTime.'|'.$value->arriveTime.'|'.$value->runTime.'|'.$value->canBuyNow.'||'.date('Ymd',strtotime($value->trainStartDate)).'||||||||'.ticket_exchange($value->gjrwNum).'|'.ticket_exchange($value->qtxbNum).'|'.ticket_exchange($value->rwNum).'|'.ticket_exchange($value->rzNum).'|'.ticket_exchange($value->tdzNum).'|'.ticket_exchange($value->wzNum).'||'.ticket_exchange($value->ywNum).'|'.ticket_exchange($value->yzNum).'|'.ticket_exchange($value->edzNum).'|'.ticket_exchange($value->ydzNum).'|'.ticket_exchange($value->swzNum).'|'.ticket_exchange($value->dwNum).'||';
$data = '{"validateMessagesShowId":"_validatorMessage","status":true,"httpstatus":200,"data":{'.$pricestr.'},"messages":[],"validateMessages":{}}';
$return_data->data->price[$i] = $data;
$this->tuniuprice_model->addOrUpdate($value->trainNo,$value->trainCode,$value->fromStationCode,$value->toStationCode,json_encode($data));
$i++;
}
}
$return_data->data->map = (object)$obj;
print_r(json_encode($return_data));
$return_data->data->map = (object)$obj;
print_r(json_encode($return_data));
}
}

@ -14,16 +14,20 @@
}
//余票转换
function ticket_exchange($num){
if(is_numeric($num)){
if($num == 0){
return '无';
}elseif($num == 99){
return '有';
}else{
return $num;
}
}
function ticket_exchange($num,$iseven){
if($iseven){
return '有';
}else{
if(is_numeric($num)){
if($num == 0){
return '无';
}elseif($num >= 99){
return '有';
}else{
return $num;
}
}
}
}
//发送请求函数
@ -40,7 +44,8 @@
curl_setopt($curl, CURLOPT_POSTFIELDS, $data); // Post提交的数据包
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
}
curl_setopt($curl, CURLOPT_TIMEOUT, 45); // 设置超时限制防止死循环
curl_setopt($curl, CURLOPT_TIMEOUT, 25); // 设置超时限制防止死循环
curl_setopt($curl, CURLOPT_TIMEOUT_MS, 25000); // 设置超时限制防止死循环
curl_setopt($curl, CURLOPT_HEADER, 0); // 显示返回的Header区域内容
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // 获取的信息以文件流的形式返回
$tmpInfo = curl_exec($curl); // 执行操作

@ -6,47 +6,60 @@ class tuniuprice_model extends CI_Model {
$this->INFO = $this->load->database('INFO', TRUE);
}
//ÐÂÔö»ò¸üм۸ñ
public function addOrUpdate($TPL_Train_No,$TPL_Train_Code,$TPL_From_Station_Code,$TPL_To_Station_Code,$TPL_Price){
//新增或更新缓存
public function addOrUpdate($tpc_from_station,$tpc_to_station,$tpc_content){
$sql = "IF NOT EXISTS(
SELECT 1
FROM TrainPriceList
WHERE TPL_Train_Code = '$TPL_Train_Code'
AND TPL_From_Station_Code = '$TPL_From_Station_Code'
AND TPL_To_Station_Code = '$TPL_To_Station_Code'
FROM TrainPriceCache
WHERE
tpc_from_station = '$tpc_from_station'
AND tpc_to_station = '$tpc_to_station'
) BEGIN
INSERT INTO TrainPriceList
INSERT INTO TrainPriceCache
(
TPL_Train_No,
TPL_Train_Code,
TPL_From_Station_Code,
TPL_To_Station_Code,
TPL_Price,
TPL_Datetime,
TPL_Source
tpc_from_station,
tpc_to_station,
tpc_content,
tpc_datetime,
tpc_source
)
VALUES
(
'$TPL_Train_No','$TPL_Train_Code','$TPL_From_Station_Code','$TPL_To_Station_Code','$TPL_Price',GETDATE(),'tuniu'
'$tpc_from_station','$tpc_to_station','$tpc_content',GETDATE(),'tuniu'
)
END
ELSE
BEGIN
UPDATE TrainPriceList
SET
TPL_Train_No = '$TPL_Train_No',
TPL_Price = '$TPL_Price',
TPL_Datetime = GETDATE(),
TPL_Source = 'tuniu'
WHERE TPL_Train_Code = '$TPL_Train_Code'
AND TPL_From_Station_Code = '$TPL_From_Station_Code'
AND TPL_To_Station_Code = '$TPL_To_Station_Code'
UPDATE TrainPriceCache
SET tpc_from_station = '$tpc_from_station',
tpc_to_station = '$tpc_to_station',
tpc_content = '$tpc_content',
tpc_datetime = GETDATE(),
tpc_source = 'tuniu'
WHERE
tpc_from_station = '$tpc_from_station'
AND tpc_to_station = '$tpc_to_station'
END
";
$query = $this->INFO->query($sql);
return $query;
}
//获取缓存的火车信息
//如果读取到缓存是7天以前的数据就不返回任何数据并且将其删除。
public function get_train_cache($tpc_from_station,$tpc_to_station){
$sql = "SELECT
*
FROM
TrainPriceCache
WHERE
tpc_from_station = '$tpc_from_station'
AND
tpc_to_station = '$tpc_to_station'";
$query = $this->INFO->query($sql);
return $query->row();
}
//»ñÈ¡¼Û¸ñ
public function get_price($fromStationCode,$toStationCode,$trainCode){
$sql = "SELECT

@ -0,0 +1,172 @@
<style>
.preview_box {
float: left;
width: 375px;
height: 600px;
margin-top: 8px;
}
.code_editor {
overflow: hidden;
height: 600px;
margin-top: 8px;
}
</style>
<div class="container-fluid">
<div class="row">
<div class="preview_box" id="iframe_box"></div>
<div class="code_editor" id="editor"></div>
</div>
<hr/>
<form name="form_amp_code" id="form_amp_code" method="post" action="<?php echo site_url('amp/edit_save') ?>">
<textarea id="textarea_htmlcode" name="textarea_htmlcode" style="display: none;"></textarea>
<input type="hidden" name="ic_id" value="<?php echo $information->ic_id; ?>"/>
<div class="row">
<div class="col-sm-10">
<a href="http://ampvalidator.mycht.cn/" target="_blank">AMP代码验证</a>
|
<a href="https://uncss-online.com/" target="_blank">CSS精简</a>
|
<a href="http://tool.oschina.net/jscompress" target="_blank">CSS压缩</a>
|
<a href="http://tool.oschina.net/codeformat/css" target="_blank">CSS格式化</a>
|
<a href="<?php echo site_url('apps/htmlcompressor'); ?>" target="_blank">调试</a>
</div>
<div class="col-sm-3">
<button type="button" class="btn btn-info" onclick="auto_create_amp(this);">
自动转换
</button>
</div>
<div class="col-sm-3">
<select name="amp_status" id="amp_status" class="form-control">
<option value="0" <?php echo get_meta($information->ic_id, 'AMP_STATUS') === '0' ? 'selected' : FALSE; ?> >
不发布
</option>
<option value="1" <?php echo get_meta($information->ic_id, 'AMP_STATUS') === '1' ? 'selected' : FALSE; ?> >
发布
</option>
<option value="2" <?php echo get_meta($information->ic_id, 'AMP_STATUS') === '2' ? 'selected' : FALSE; ?> >
发布-手动管理
</option>
</select>
</div>
<div class="col-sm-4">
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="submit_amp_editor();">保存</button>
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu">
<li role="separator" class="divider"></li>
<li><a href="javascript(0);" onclick="meta('delete', '<?php echo $information->ic_id; ?>', 'AMP', ''); meta('delete', '<?php echo $information->ic_id; ?>', 'AMP_STATUS', '');">删除</a></li>
</ul>
</div>
<?php if ($this->config->item('site_code') == 'cht') { ?>
<a href="http://192.155.224.195:8080/guide-use.php/amp_loader/test/?info_url=<?php echo $information->ic_url ?>" class="btn btn-primary"
target="_blank">看看</a>
<?php } ?>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-primary" onclick="show_cache_refresh_modal('<?php echo $information->ic_url ?>');">更新静态页面</button>
</div>
</div>
</form>
<div id="amp_error">
</div>
<hr/>
</div>
<script type="text/x-template" id="amp_html">
<?php echo htmlentities(get_meta($information->ic_id, 'AMP')); ?>
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
var editor = ace.edit("editor");
editor.setTheme("ace/theme/eclipse");
editor.session.setMode("ace/mode/html");
editor.setOptions({
autoScrollEditorIntoView: true,
wrap: true
});
editor.getSession().on('change', function (e) {
update_preview();
});
var temp_div = document.createElement("div");
temp_div.innerHTML = $('#amp_html').html();
editor.session.setValue(temp_div.textContent);
function update_preview() {
//考虑做成异步操作,降低页面卡顿
var iframe = document.createElement('iframe');
iframe.setAttribute('frameBorder', '0');
iframe.setAttribute('id', 'previewIframe');
iframe.setAttribute('height', '100%');
iframe.setAttribute('width', '100%');
iframe.setAttribute('name', 'AMP Playground Output');
$('#iframe_box').html('');
$('#iframe_box').append(iframe);
var doc = iframe.contentDocument || iframe.document;
doc.open();
doc.write(editor.getValue());
doc.close();
}
function submit_amp_editor() {
$('#amp_error').html('');
$('#textarea_htmlcode').text(editor.getValue()).html();
$("#form_amp_code").ajaxSubmit({
success: function (responseText, statusText, xhr, form) {
if (responseText.name === 'no') {
error_msg='<h3>AMP validation FAIL</h3>';
$.each(responseText.value, function (index, element) {
error_msg=error_msg+'<p>line '+element.line+' col '+element.col+' :'+element.message+'</p>';
});
$.modaldialog.error('AMP语法错误请看下方错误详情');
$('#amp_error').html(error_msg);
} else {
$.modaldialog.success('保存成功!');
}
},
error: function (responseText, statusText, xhr, form) {
$.modaldialog.error("Action unsuccessful. Try again later.");
},
dataType: "json",
timeout: 30000
});
return false
}
function auto_create_amp(obj) {
$(obj).text('转换中...');
$(obj).enable(false);
$.getJSON("<?php echo site_url('amp/auto_create/' . $information->ic_id) ?>", function (result) {
$.each(result, function (i, field) {
if (i == 'data') {
editor.setValue(field.amp);
}
});
$(obj).text('转换完成!');
$(obj).enable(true);
});
}
</script>

@ -36,9 +36,9 @@ function batch_update_cache(url, index) {
}
}
}
$(document).ready(function() {
batch_update_cache($('#cache_url1').html(),1);
});
//$(document).ready(function() {
//batch_update_cache($('#cache_url1').html(),1);
//});
</script>
@ -77,7 +77,7 @@ function batch_update_cache(url, index) {
</div>
<div class="span1">
<a href="javascript:void(0);" class="btn btn-danger" onclick="batch_update_cache($('#cache_url1').html(),1);">开始更新</a>
</div>

@ -80,7 +80,11 @@
<li><a href="<?php echo site_url('thirdparty/advertise') ?>">广告管理</a></li>
<li><a href="<?php echo site_url('apps/tripadvisor_spider') ?>">TA评论采集</a></li>
<li><a href="<?php echo site_url('tools/old') ?>">老旧信息查询</a></li>
<li><a href="<?php echo site_url('tools/amp_check') ?>">AMP转化检查</a></li>
<li><a target="_blank" href="http://www.arachina.com/html-tag-quick-query.htm">Html基础知识</a></li>
<li><a target="_blank" href="https://docs.google.com/presentation/d/1YN9P8j837SCHenpK_UApHU04K6evV1-GLULhsdmdtWM/edit?usp=sharing">AMP知识</a></li>
<li><a target="_blank" href="https://docs.google.com/presentation/d/1E9dbrANxtvgsOTkJWWab-UNaBgRJyQwNYu9Tw5k5jUI/edit?usp=sharing">AMP操作SOP</a></li>
<li><a target="_blank" href="https://docs.google.com/presentation/d/1zPc7832vManRsCgkgO5XoMVKe6deIHC9zsmLPWihxrA/edit?usp=sharing">PS基础课件</a></li>
<li><a href="<?php echo site_url('setting') ?>">系统设置</a></li>
</ul>
</li>

@ -350,32 +350,6 @@
return true;
}
//添加绑定景点
function add_landscape(area_id, lsi_sn) {
var urlReQuery = "<?php echo site_url('information/add_landscape/'); ?>";
$.ajax({
type: "get",
url: urlReQuery + '/' + area_id + '/' + lsi_sn,
success: function(data, textStatus) {
var dataArray = $.parseJSON(data);//JSON.parse(data);
for (var key in dataArray) {
if (dataArray[key].name == 'ok') {
window.location.href = dataArray[key].value;
return true;
} else if (dataArray[key].name == 'no') {
$.modaldialog.error(dataArray[key].value);
return false;
}
}
},
error: function() {
$.modaldialog.error('发生错误请联系YCC');
return false;
}
});
}
//跳转到前台页面
function goto_page() {
var site_url = '<?php echo $this->config->item('site_url') ?>';
@ -1000,7 +974,7 @@
<div class="clearfix"></div>
<?php if (is_series_site()) { ?>
<label class="span12">系列站会自动更新静态页面</label>
<label class="span12">自动更新静态页面</label>
<?php } else { ?>
<label class="checkbox inline span12">
<input type="checkbox" name="auto_update_cache_checkbox" id="auto_update_cache_checkbox" onclick="get_update_cache_url();" value="<?php echo $information->ic_url; ?>" />静态更新
@ -1059,22 +1033,3 @@
</div>
<!-- Modal -->
<div id="myModal" class="modal hide fade" style="width:90%;left:25%;" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<div id="myModalLabel" style="line-height:30px;">
<h3 class="span5 pull-left">页面访问量明细表</h3>
<form style="margin-bottom:0px;" id="get-analytic-form" method="post" action="<?php echo site_url('keyworlds/get_analytics_by_date'); ?>">
<input class="span2 pull-left" style="margin-bottom:0;" size="16" id="startdate" name="startdate" type="text" value="开始时间">
<input class="span2 pull-left" style="margin-bottom:0;" size="16" id="enddate" name="enddate" type="text" placeholder="结束时间">
<input type="hidden" name="pagepath" value="<?php echo $information->ic_url; ?>">
<button type="button" class="btn" onClick="get_analytics_ajax('get-analytic-form', 'analytics-content', '0');">查询</button>
</form>
</div>
</div>
<div class="modal-body" id="analytics-content">
</div>
</div>

@ -10,6 +10,7 @@
<li class="divider"></li>
<li class="nav-header">信息模块</li>
<li><a href="<?php echo site_url('home') ?>">首页</a></li>
<li><a href="<?php echo site_url('special') ?>">专题管理</a></li>
<li><a href="<?php echo site_url('link') ?>">交换链接</a></li>
<li><a href="<?php echo site_url('airport') ?>">机场信息</a></li>
@ -40,6 +41,8 @@
<li><a href="<?php echo site_url('keyworlds/update_cdn') ?>" target="_blank">CDN定时更新</a> </li>
<li><a href="<?php echo site_url('sendmail') ?>" >订单邮件管理</a> </li>
<li><a href="http://share.chtcdn.com/info.php/infoshare/" target="_blank" >信息分享平台</a> </li>
<li><a href="<?php echo site_url('welcome/create_all_urls') ?>" target="_blank" >全站静态化更新</a> </li>
<li><a href="<?php echo site_url('welcome/create_all_urls/amp') ?>" target="_blank" >全站AMP更新</a> </li>
<li class="divider"></li>

@ -0,0 +1,175 @@
<script type="text/javascript" src="//unpkg.com/wangeditor/release/wangEditor.min.js"></script>
<style type="text/css">
.none{display: none;}
.form-control {width: 100%;}
.form-group {margin: 0 0 10px 0;}
#toolbar-container {border: 1px solid #ccc;background-color: #fff;}
#toolbar-container:after {display: table;content: '';clear: both;}
#editor-toolbar {background-color: #ccc;float: left;}
#btn-container {/*float: right;*//*text-align: right;*/}
#editor {border-top: 1px solid #ccc;height: 500px;background-color: #fff;}
#cover {display: none;position: fixed;z-index: 100;top: 50px;left: 50px;right: 50px;height: 500px;padding: 20px;background-color: #f1f1f1;}
#code-screen {
/*margin: 0;
width: 500px;*/
height: 500px;
border-top: 1px solid #ccc;
}
</style>
<div class="row-fluid">
<div class="span2">
<?php include 'nav.php'; ?>
</div>
<div class="span10 " style="padding-right:20px;">
<legend>编辑运势信息 - <?php echo $current_zodiac ?></legend>
<form action="<?php echo site_url('zodiac/fortune_save') ?>" method="POST" class="form-inline" role="form" name="zodiac_edit" id="zodiac_edit">
<input type="hidden" name="sx" value="<?php echo $current_zodiac ?>">
<div class="form-group">
<label class="sr-only" for="">幸运数字</label>
<input type="text" class="form-control" id="" name="lucky_num" placeholder="2, 3" value="<?php echo $zodiac_fortune->LNY_LuckyNumber ?>">
</div>
<div class="form-group">
<label class="sr-only" for="">幸运色</label>
<input type="text" class="form-control" id="" name="lucky_color" placeholder="blue, gold, green" value="<?php echo $zodiac_fortune->LNY_LuckyColor ?>">
</div>
<div class="form-group">
<label class="sr-only" for="">幸运花</label>
<input type="text" class="form-control" id="" name="lucky_flo" placeholder="tulip, sacred lily" value="<?php echo $zodiac_fortune->LNY_LuckyFlower ?>">
</div>
<div class="form-group">
<input type="hidden" name="theyearfortune" id="theyearfortune">
<label class="sr-only" for="">运势</label>
<div id="toolbar-container">
<!-- custom toolbar -->
<?php include 'editor_toolbar.php'; ?>
<!-- view screen -->
<div id="editor" style="z-index: 1;">
<!-- <div> -->
<?php echo $zodiac_fortune->TheYearFortune ?>
<!-- </div> -->
</div>
<!-- code screen -->
<div id="code-screen" class="none"></div>
</div>
</div>
<div class="form-group">
</div>
<div>
<input type="buttn" class="btn btn-primary" onclick="zodiac_sub()" value="提交">
</div>
</form>
</div>
</div>
<!-- 模态框Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">模态框Modal标题</h4>
</div>
<div class="modal-body">按下 ESC 按钮退出。</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary">提交更改</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<script src="/js/ace-editor-src/ace.js"></script>
<script src="/js/ace-editor-src/ext-language_tools.js"></script>
<script src="/js/ace-editor-src/ext-beautify.js"></script>
<script defer type="text/javascript">
var E = window.wangEditor
// E(菜单, 编辑区)
var editor = new E('#editor-toolbar', '#editor')
// 菜单配置
editor.customConfig.menus = [
'head',
'bold',
'italic',
'underline',
'link',
'list',
'image',
'undo',
'redo'
]
editor.create()
// turn code
function doCodeScreen() {
code_editor.setValue(editor.txt.html());
$(".w-e-menu").hide();
$(".code-menu").show();
$("#editor").hide();
$("#code-screen").show();
}
// turn screen
function unDoCodeScreen() {
editor.txt.html(code_editor.getValue())
$(".w-e-menu").show();
$("#editor").show();
$("#code-screen").hide();
}
// 是否是源码视图的标志
var isCodeScreen = false
// 点击事件
var codebtn = document.getElementById('code-btn');
codebtn.addEventListener('click', function () {
if (isCodeScreen) {
isCodeScreen = false
unDoCodeScreen()
} else {
isCodeScreen = true
doCodeScreen()
}
}, false)
function zodiac_sub() {
if (isCodeScreen == true) {
$("#theyearfortune").val(code_editor.getValue());
} else {
$("#theyearfortune").val(editor.txt.html());
}
$('#zodiac_edit').ajaxSubmit({
success:function() {
alert("提交成功")
},
error: function() {
alert("失败,请重试")
},
dataType: 'json',
timeout: 30000
});
return false;
}
// code >>
ace.require("ace/ext/language_tools");
var code_editor = ace.edit("code-screen");
code_editor.setOptions({
mode: "ace/mode/html"
,theme: "ace/theme/tomorrow_night_eighties"
// ,theme: "ace/theme/tomorrow"
,selectionStyle: "line"
,showInvisibles: true
,displayIndentGuides: true
,enableSnippets: true
,enableBasicAutocompletion: true
,enableLiveAutocompletion: true
,highlightActiveLine: true
,highlightSelectedWord: true
,scrollPastEnd: true
,autoScrollEditorIntoView: true
,wrap: 130
,tabSize: 4
,fontSize: 16
});
code_editor.setValue(editor.txt.html());
// var beautify = ace.require("ace/ext/beautify");
// beautify.beautify(code_editor.getSession());
</script>

@ -0,0 +1,5 @@
<div id="editor-toolbar">
<div id="code-btn" class="w-e-menu code-menu" data-i=1 style="z-index:10001;">
<i class="w-e-icon-terminal"><i></i></i>
</div>
</div>

@ -0,0 +1,17 @@
<ul class="nav nav-list" style="border-right:1px solid #ddd;min-height:1024px;">
<li class="nav-header">运势信息管理</li>
<li class="<?php echo $nav_active=='rat'?'active':false; ?>"><a href="<?php echo site_url('zodiac/index/rat'); ?>"></a></li>
<li class="<?php echo $nav_active=='ox'?'active':false; ?>"><a href="<?php echo site_url('zodiac/index/ox'); ?>"><?php if(isset($task_count['edit']) && $task_count['edit']>0){ ?> <span class="label"><?php echo $task_count['edit'];?></span><?php } ?></a></li>
<li class="<?php echo $nav_active=='tiger'?'active':false; ?>"><a href="<?php echo site_url('zodiac/index/tiger'); ?>"><?php if(isset($task_count['review'])){ ?> <span class="label"><?php echo $task_count['review'];?></span><?php } ?></a></li>
<li class="<?php echo $nav_active=='rabbit'?'active':false; ?>"><a href="<?php echo site_url('zodiac/index/rabbit'); ?>"><?php if(isset($task_count['wait'])){ ?> <span class="label"><?php echo $task_count['wait'];?></span><?php } ?></a></li>
<li class="<?php echo $nav_active=='dragon'?'active':false; ?>"><a href="<?php echo site_url('zodiac/index/dragon'); ?>"><?php if(isset($task_count['reviewed'])){ ?> <span class="label"><?php echo $task_count['reviewed'];?></span><?php } ?></a></li>
<li class="<?php echo $nav_active=='snake'?'active':false; ?>"><a href="<?php echo site_url('zodiac/index/snake'); ?>"></a></li>
<li class="<?php echo $nav_active=='horse'?'active':false; ?>"><a href="<?php echo site_url('zodiac/index/horse'); ?>"></a></li>
<li class="<?php echo $nav_active=='goat'?'active':false; ?>"><a href="<?php echo site_url('zodiac/index/goat'); ?>"></a></li>
<li class="<?php echo $nav_active=='monkey'?'active':false; ?>"><a href="<?php echo site_url('zodiac/index/monkey'); ?>"></a></li>
<li class="<?php echo $nav_active=='rooster'?'active':false; ?>"><a href="<?php echo site_url('zodiac/index/rooster'); ?>"></a></li>
<li class="<?php echo $nav_active=='dog'?'active':false; ?>"><a href="<?php echo site_url('zodiac/index/dog'); ?>"></a></li>
<li class="<?php echo $nav_active=='pig'?'active':false; ?>"><a href="<?php echo site_url('zodiac/index/pig'); ?>"></a></li>
<li class="divider"></li>
</ul>

@ -15,7 +15,7 @@
<div class="modal-content" >
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 style="margin:0;">静态化更新-系列站专用</h3>
<h3 style="margin:0;">静态化更新</h3>
</div>
<div class="modal-body">
<label>需要更新的页面</label>

@ -5,8 +5,8 @@
<meta charset="utf-8">
<title>信息平台</title>
<link rel="stylesheet" href="/css/information-system3.css?v=201508112" type="text/css" />
<script type="text/javascript" src="/min/?f=/js/information-system3.min.js,/js/common.js"></script>
<script type="text/javascript" src="/js/kindeditor/kindeditor.js?v=20160601"></script>
<script type="text/javascript" src="/min/?f=/js/information-system3.min.js,/js/common.js&v=2018022601"></script>
<script type="text/javascript" src="/js/kindeditor/kindeditor.js?v=20180730"></script>
<link rel="shortcut icon" href="/bootstrap/img/glyphicons_290_skull.png">
<script language="javascript">
@ -20,6 +20,9 @@
case 'ah':
echo "alert(url.replace('/kcfinder/upload/ah/','https://data.asiahighlights.com/'));";
break;
case 'gm':
echo "alert(url.replace('/kcfinder/upload/gm/','https://data.chinarundreisen.com/'));";
break;
default:echo 'alert(url);';
}
?>
@ -84,7 +87,11 @@
<li><a href="<?php echo site_url('thirdparty/advertise') ?>">广告管理</a></li>
<li><a href="<?php echo site_url('apps/tripadvisor_spider') ?>">TA评论采集</a></li>
<li><a href="<?php echo site_url('tools/old') ?>">老旧信息查询</a></li>
<li><a href="<?php echo site_url('tools/amp_check') ?>">AMP转化检查</a></li>
<li><a target="_blank" href="http://www.arachina.com/html-tag-quick-query.htm">Html基础知识</a></li>
<li><a target="_blank" href="https://docs.google.com/presentation/d/1YN9P8j837SCHenpK_UApHU04K6evV1-GLULhsdmdtWM/edit?usp=sharing">AMP知识</a></li>
<li><a target="_blank" href="https://docs.google.com/presentation/d/1E9dbrANxtvgsOTkJWWab-UNaBgRJyQwNYu9Tw5k5jUI/edit?usp=sharing">AMP操作SOP</a></li>
<li><a target="_blank" href="https://docs.google.com/presentation/d/1zPc7832vManRsCgkgO5XoMVKe6deIHC9zsmLPWihxrA/edit?usp=sharing">PS基础课件</a></li>
<li><a href="<?php echo site_url('setting') ?>">系统设置</a></li>
</ul>
</li>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,121 @@
<script language="javascript">
function batch_update_amp(index) {
var ic_id = $('#cache_ic_id_' + index).val();
var msg_obj = "#cache" + index;
var amp_code = '';
$(msg_obj).html("\u7a0d\u7b49...");
$.ajax({
type: "get",
dataType: "json",
url: "<?php echo site_url('amp/auto_create/') ?>/" + ic_id,
success: function (result, textStatus) {
$.each(result, function (i, field) {
if (i === 'data') {
amp_code = field.amp;
}
});
$(msg_obj).html("\u0041\u004d\u0050\u8f6c\u6362\u6210\u529f\u0021\u6b63\u5728\u4fdd\u5b58\u2026\u2026");
//保存转换的AMP代码 begin
$.ajax({
type: "post",
dataType: "json",
url: "<?php echo site_url('amp/edit_save/') ?>",
data: {
"ic_id": ic_id,
"textarea_htmlcode": amp_code,
"amp_status": 1
},
success: function (result, textStatus) {
if (result.name === 'no') {
error_msg='';
$.each(result.value, function (index, element) {
error_msg=error_msg+'line '+element.line+' col '+element.col+' :'+element.message+'&#10;';
});
$(msg_obj).html("保存失败AMP语法错误!"+'<i class="glyphicon glyphicon-education" title="'+error_msg+'"></i>');
}else{
$(msg_obj).html("\u0041\u004d\u0050\u66f4\u65b0\u6210\u529f\u0021");
}
create_amp_data(++index);
},
error: function () {
$(msg_obj).html("<a href='javascript:void(0);' onclick='create_amp_data(" + index + ");' >发生错误,请重试</a>");
create_amp_data(++index);
}
});
//保存转换的AMP代码 end
},
error: function () {
$(msg_obj).html("<a href='javascript:void(0);' onclick='create_amp_data(" + index + ");' >发生错误,请重试</a>");
create_amp_data(++index);
}
});
}
function create_amp_data(index) {
if ($('#cache_url' + index).length > 0) {
if ($('#cache' + index).html() !== '\u0041\u004d\u0050\u66f4\u65b0\u6210\u529f\u0021') {
if ($('#cache' + index).html() == '手动管理,不会自动更新') { //手动更新的项目跳过
create_amp_data(++index);
} else {
batch_update_amp(index);
}
}
}
}
</script>
<div class="container-fluid">
<div class="row">
<div class="col-sm-4">
</div>
<div class="col-sm-16">
<table class="table table-striped">
<thead>
<tr>
<th class="col-sm-2">#</th>
<th class="col-sm-2">发布</th>
<th class="col-sm-14">URL</th>
<th class="col-sm-6">更新进度</th>
</tr>
</thead>
<tbody>
<?php
$i = 0;
foreach ($all_information as $key => $info) {
if ($info->ic_status == 1 && !empty($info->ic_url)) {
$i++;
?>
<tr>
<td><a href="<?php echo site_url('amp/edit/'.$info->ic_id); ?>" target="_blank"><?php echo $i; ?></a></td>
<td>
<?php if($info->amp_status==='1'){echo '<i class="glyphicon glyphicon-flash"></i>'; } ?>
<?php if($info->amp_status==='2'){echo '<i class="glyphicon glyphicon-hand-up" title="手动管理,不会自动更新"></i>'; } ?>
</td>
<td id="cache_url<?php echo $i; ?>" name="cache_url<?php echo $i; ?>" class="cache_url"><a href="<?php echo site_url('information/edit/'.$info->is_id) ?>" target="_blank"><?php echo $info->ic_url; ?></a></td>
<td id="cache<?php echo $i; ?>" name="cache<?php echo $i; ?>"><?php if($info->amp_status==='2'){echo '手动管理,不会自动更新'; } ?></td>
<input type="hidden" id="cache_ic_id_<?php echo $i; ?>" value="<?php echo $info->ic_id; ?>" />
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
<div class="col-sm-4">
<a href="javascript:void(0);" class="btn btn-danger" onclick="create_amp_data(1);">开始更新</a>
</div>
</div>
</div>

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>更新静态页-v1.0</title>
<title>更新静态页-v1.0a</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link href="http://europe.chtcdn.com/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
<script type="text/javascript" src="http://europe.chtcdn.com/js/jquery.js"></script>

@ -43,6 +43,7 @@
<div id="zhexiantu" class="span12" style="height:<?php if($wordcount==1) {echo '620px';}else{echo '1000px;';} ?>;margin-left:0;padding-right: 15px;"></div>
<?php } if (!empty($rank_info)) { ?>
<legend>排名情况</legend>
<!-- update time 0316 -3day -->
<table class="table table-striped">
<thead>
<tr>
@ -62,8 +63,8 @@
<br>
<a target="_blank" href="<?php echo $rank->kwr_mobile_source; ?>"><?php echo $rank->kwr_mobile_source; ?></a>
</td>
<td><?php echo $rank->kwr_rank; ?>&nbsp;--&nbsp;
<?php $kwr_mobile_rank = $rank->kwr_mobile_rank ? $rank->kwr_mobile_rank : '未抓取'; echo $kwr_mobile_rank; ?></td>
<td><?php echo $rank->kwr_rank; ?>&nbsp;&nbsp;/&nbsp;&nbsp;
<?php $kwr_mobile_rank = $rank->kwr_mobile_rank ? $rank->kwr_mobile_rank : '--'; echo $kwr_mobile_rank; ?></td>
</tr>
<?php if($k+1==7) break; ?>
<?php } ?>
@ -346,22 +347,6 @@
},
series: <?php echo $rank_json; ?>
});
<?php if ($site_code=='gm') { ?>
$(".highcharts-data-labels>g").each(function(){
var tspan=$(this).find('tspan');
var olenum=tspan.text();
var nuewnum=0-(olenum);
tspan.text(nuewnum);
});
$(".highcharts-axis-labels>text>tspan").each(function(){
var olenum=$(this).text();
var nuewnum=olenum<0?0-(olenum):olenum;
if (!$(this).parent("text").attr("transform")) {
$(this).text(nuewnum);
}
});
<?php } ?>
});
</script>

@ -0,0 +1,130 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>AMP转化表-v1.0</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link href="http://europe.chtcdn.com/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
<script type="text/javascript" src="http://europe.chtcdn.com/js/jquery.js"></script>
<script type="text/javascript" src="http://europe.chtcdn.com/bootstrap/js/bootstrap.min.js"></script>
<style type="text/css">
.show-grid {padding: 15px; background: #efefef; border-radius: 5px;}
.mr10 {margin-right: 10px;}
.nav {margin-bottom: 5px;}
.pic {display: none;}
.msg {color: #07c;}
.mt12 {margin-top: 12px;}
.msg_wait {color: #999;}
.none {display: none;}
.form-search {display: inline-block;margin:0 0 0 5px !important;}
.input-medium.search-query {width: 250px;}
#search,#insert,#update {margin-top: 2px;float: right;}
@media (min-width: 1200px) {
.container.wd {
padding: 0 15px;
width: 1170px;
}
}
</style>
<script type="text/javascript">
$(function() {
//下拉选站点
$('a.sss').on('click', function() {
var site = $(this).html();
location.href = '/info.php/login/change_site/'+site+'/?url=/tools/amp_check';
});
});
</script>
</head>
<body>
<div class="container wd">
<div class="row show-grid">
<ul class="nav nav-pills">
<li class="active dropdown mr10">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
站点:<?php echo($this->config->item('site_code'));?>
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a class="sss">cht</a>
</li>
<li>
<a class="sss">jp</a>
</li>
<li>
<a class="sss">gm</a>
</li>
<li>
<a class="sss">vc</a>
</li>
<li>
<a class="sss">vac</a>
</li>
<li>
<a class="sss">ru</a>
</li>
<li>
<a class="sss">it</a>
</li>
<li>
<a class="sss">ct</a>
</li>
</ul>
</li>
<span class="label label-info">信息:<?php echo(count($info));?>个 (只显示前800个)</span>
<form class="form-search" id="path_search" action="#" method="post">
<span class="checkbox">
<label>
<input type="radio" name="amp" value="yes" <?php if($amp == 'yes') echo('checked'); ?>> 显示已转换AMP的信息
</label>
</span>
&nbsp;
<span class="checkbox">
<label>
<input type="radio" name="amp" value="no" <?php if($amp == 'no') echo('checked'); ?>> 显示未转换AMP的信息
</label>
</span>
&nbsp;
<button type="submit" class="btn">筛选</button>
</form>
</ul>
</div>
<div class="row">
<table class="table table-hover">
<thead>
<tr>
<th>#</th>
<th>文件名</th>
<th width="6%">AMP转化</th>
<th width="6%"></th>
</tr>
</thead>
<tbody class="data_group">
<?php foreach($info as $key=>$it) {
if ($key == 800) break;
?>
<tr class="data">
<td><?php echo($key+1);?></td>
<td title="<?php echo($it->ic_url);?>"><?php echo($it->ic_url);?></td>
<td>
<?php
if ($amp == 'yes')
echo('<span style="color:seagreen"></span>');
else
echo('<span style="color:#a12023"></span>');
?>
</td>
<td>
<a href="javascript:document.getElementById('keywords').value='<?php echo(urlencode($it->ic_url));?>';document.forms.goSearch.submit();" target="_blank">编辑</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<form action="/info.php/welcome/search" method="post" id="goSearch" target="_blank">
<input type="hidden" name="keywords" id="keywords" value="">
</form>
</body>
</html>

@ -5,7 +5,9 @@
<dl>
<dt>系统模块</dt>
<dd>
<a href="<?php echo site_url('home') ?>">站点首页</a>
</dd>
<dd>
<a href="<?php echo site_url('special') ?>">专题管理</a>
</dd>

@ -1,3 +1,5 @@
<?php
phpinfo();
?>

File diff suppressed because one or more lines are too long

@ -0,0 +1,5 @@
ace.define("ace/ext/beautify/php_rules",["require","exports","module","ace/token_iterator"],function(e,t,n){"use strict";var r=e("ace/token_iterator").TokenIterator;t.newLines=[{type:"support.php_tag",value:"<?php"},{type:"support.php_tag",value:"<?"},{type:"support.php_tag",value:"?>"},{type:"paren.lparen",value:"{",indent:!0},{type:"paren.rparen",breakBefore:!0,value:"}",indent:!1},{type:"paren.rparen",breakBefore:!0,value:"})",indent:!1,dontBreak:!0},{type:"comment"},{type:"text",value:";"},{type:"text",value:":",context:"php"},{type:"keyword",value:"case",indent:!0,dontBreak:!0},{type:"keyword",value:"default",indent:!0,dontBreak:!0},{type:"keyword",value:"break",indent:!1,dontBreak:!0},{type:"punctuation.doctype.end",value:">"},{type:"meta.tag.punctuation.end",value:">"},{type:"meta.tag.punctuation.begin",value:"<",blockTag:!0,indent:!0,dontBreak:!0},{type:"meta.tag.punctuation.begin",value:"</",indent:!1,breakBefore:!0,dontBreak:!0},{type:"punctuation.operator",value:";"}],t.spaces=[{type:"xml-pe",prepend:!0},{type:"entity.other.attribute-name",prepend:!0},{type:"storage.type",value:"var",append:!0},{type:"storage.type",value:"function",append:!0},{type:"keyword.operator",value:"="},{type:"keyword",value:"as",prepend:!0,append:!0},{type:"keyword",value:"function",append:!0},{type:"support.function",next:/[^\(]/,append:!0},{type:"keyword",value:"or",append:!0,prepend:!0},{type:"keyword",value:"and",append:!0,prepend:!0},{type:"keyword",value:"case",append:!0},{type:"keyword.operator",value:"||",append:!0,prepend:!0},{type:"keyword.operator",value:"&&",append:!0,prepend:!0}],t.singleTags=["!doctype","area","base","br","hr","input","img","link","meta"],t.transform=function(e,n,r){var i=e.getCurrentToken(),s=t.newLines,o=t.spaces,u=t.singleTags,a="",f=0,l=!1,c,h,p={},d,v={},m=!1,g="";while(i!==null){console.log(i);if(!i){i=e.stepForward();continue}i.type=="support.php_tag"&&i.value!="?>"?r="php":i.type=="support.php_tag"&&i.value=="?>"?r="html":i.type=="meta.tag.name.style"&&r!="css"?r="css":i.type=="meta.tag.name.style"&&r=="css"?r="html":i.type=="meta.tag.name.script"&&r!="js"?r="js":i.type=="meta.tag.name.script"&&r=="js"&&(r="html"),v=e.stepForward(),v&&v.type.indexOf("meta.tag.name")==0&&(d=v.value),p.type=="support.php_tag"&&p.value=="<?="&&(l=!0),i.type=="meta.tag.name"&&(i.value=i.value.toLowerCase()),i.type=="text"&&(i.value=i.value.trim());if(!i.value){i=v;continue}g=i.value;for(var y in o)i.type==o[y].type&&(!o[y].value||i.value==o[y].value)&&v&&(!o[y].next||o[y].next.test(v.value))&&(o[y].prepend&&(g=" "+i.value),o[y].append&&(g+=" "));i.type.indexOf("meta.tag.name")==0&&(c=i.value),m=!1;for(y in s)if(i.type==s[y].type&&(!s[y].value||i.value==s[y].value)&&(!s[y].blockTag||u.indexOf(d)===-1)&&(!s[y].context||s[y].context===r)){s[y].indent===!1&&f--;if(s[y].breakBefore&&(!s[y].prev||s[y].prev.test(p.value))){a+="\n",m=!0;for(y=0;y<f;y++)a+=" "}break}if(l===!1)for(y in s)if(p.type==s[y].type&&(!s[y].value||p.value==s[y].value)&&(!s[y].blockTag||u.indexOf(c)===-1)&&(!s[y].context||s[y].context===r)){s[y].indent===!0&&f++;if(!s[y].dontBreak&&!m){a+="\n";for(y=0;y<f;y++)a+=" "}break}a+=g,p.type=="support.php_tag"&&p.value=="?>"&&(l=!1),h=c,p=i,i=v;if(i===null)break}return a}}),ace.define("ace/ext/beautify",["require","exports","module","ace/token_iterator","ace/ext/beautify/php_rules"],function(e,t,n){"use strict";var r=e("ace/token_iterator").TokenIterator,i=e("./beautify/php_rules").transform;t.beautify=function(e){var t=new r(e,0,0),n=t.getCurrentToken(),s=e.$modeId.split("/").pop(),o=i(t,s);e.doc.setValue(o)},t.commands=[{name:"beautify",exec:function(e){t.beautify(e.session)},bindKey:"Ctrl-Shift-B"}]});
(function() {
ace.require(["ace/ext/beautify"], function() {});
})();

File diff suppressed because one or more lines are too long

@ -0,0 +1,5 @@
ace.define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"],function(e,t,n){"use strict";var r=function(e){this.$editor=e;var t=this,n=[],r=!1;this.onAfterExec=function(){r=!1,t.processRows(n),n=[]},this.onExec=function(){r=!0},this.onChange=function(e){r&&(n.indexOf(e.start.row)==-1&&n.push(e.start.row),e.end.row!=e.start.row&&n.push(e.end.row))}};(function(){this.processRows=function(e){this.$inChange=!0;var t=[];for(var n=0,r=e.length;n<r;n++){var i=e[n];if(t.indexOf(i)>-1)continue;var s=this.$findCellWidthsForBlock(i),o=this.$setBlockCellWidthsToMax(s.cellWidths),u=s.firstRow;for(var a=0,f=o.length;a<f;a++){var l=o[a];t.push(u),this.$adjustRow(u,l),u++}}this.$inChange=!1},this.$findCellWidthsForBlock=function(e){var t=[],n,r=e;while(r>=0){n=this.$cellWidthsForRow(r);if(n.length==0)break;t.unshift(n),r--}var i=r+1;r=e;var s=this.$editor.session.getLength();while(r<s-1){r++,n=this.$cellWidthsForRow(r);if(n.length==0)break;t.push(n)}return{cellWidths:t,firstRow:i}},this.$cellWidthsForRow=function(e){var t=this.$selectionColumnsForRow(e),n=[-1].concat(this.$tabsForRow(e)),r=n.map(function(e){return 0}).slice(1),i=this.$editor.session.getLine(e);for(var s=0,o=n.length-1;s<o;s++){var u=n[s]+1,a=n[s+1],f=this.$rightmostSelectionInCell(t,a),l=i.substring(u,a);r[s]=Math.max(l.replace(/\s+$/g,"").length,f-u)}return r},this.$selectionColumnsForRow=function(e){var t=[],n=this.$editor.getCursorPosition();return this.$editor.session.getSelection().isEmpty()&&e==n.row&&t.push(n.column),t},this.$setBlockCellWidthsToMax=function(e){var t=!0,n,r,i,s=this.$izip_longest(e);for(var o=0,u=s.length;o<u;o++){var a=s[o];if(!a.push){console.error(a);continue}a.push(NaN);for(var f=0,l=a.length;f<l;f++){var c=a[f];t&&(n=f,i=0,t=!1);if(isNaN(c)){r=f;for(var h=n;h<r;h++)e[h][o]=i;t=!0}i=Math.max(i,c)}}return e},this.$rightmostSelectionInCell=function(e,t){var n=0;if(e.length){var r=[];for(var i=0,s=e.length;i<s;i++)e[i]<=t?r.push(i):r.push(0);n=Math.max.apply(Math,r)}return n},this.$tabsForRow=function(e){var t=[],n=this.$editor.session.getLine(e),r=/\t/g,i;while((i=r.exec(n))!=null)t.push(i.index);return t},this.$adjustRow=function(e,t){var n=this.$tabsForRow(e);if(n.length==0)return;var r=0,i=-1,s=this.$izip(t,n);for(var o=0,u=s.length;o<u;o++){var a=s[o][0],f=s[o][1];i+=1+a,f+=r;var l=i-f;if(l==0)continue;var c=this.$editor.session.getLine(e).substr(0,f),h=c.replace(/\s*$/g,""),p=c.length-h.length;l>0&&(this.$editor.session.getDocument().insertInLine({row:e,column:f+1},Array(l+1).join(" ")+" "),this.$editor.session.getDocument().removeInLine(e,f,f+1),r+=l),l<0&&p>=-l&&(this.$editor.session.getDocument().removeInLine(e,f+l,f),r+=l)}},this.$izip_longest=function(e){if(!e[0])return[];var t=e[0].length,n=e.length;for(var r=1;r<n;r++){var i=e[r].length;i>t&&(t=i)}var s=[];for(var o=0;o<t;o++){var u=[];for(var r=0;r<n;r++)e[r][o]===""?u.push(NaN):u.push(e[r][o]);s.push(u)}return s},this.$izip=function(e,t){var n=e.length>=t.length?t.length:e.length,r=[];for(var i=0;i<n;i++){var s=[e[i],t[i]];r.push(s)}return r}}).call(r.prototype),t.ElasticTabstopsLite=r;var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{useElasticTabstops:{set:function(e){e?(this.elasticTabstops||(this.elasticTabstops=new r(this)),this.commands.on("afterExec",this.elasticTabstops.onAfterExec),this.commands.on("exec",this.elasticTabstops.onExec),this.on("change",this.elasticTabstops.onChange)):this.elasticTabstops&&(this.commands.removeListener("afterExec",this.elasticTabstops.onAfterExec),this.commands.removeListener("exec",this.elasticTabstops.onExec),this.removeListener("change",this.elasticTabstops.onChange))}}})});
(function() {
ace.require(["ace/ext/elastic_tabstops_lite"], function() {});
})();

File diff suppressed because one or more lines are too long

@ -0,0 +1,5 @@
;
(function() {
ace.require(["ace/ext/error_marker"], function() {});
})();

@ -0,0 +1,5 @@
ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../../lib/dom"),i="#ace_settingsmenu, #kbshortcutmenu {background-color: #F7F7F7;color: black;box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);padding: 1em 0.5em 2em 1em;overflow: auto;position: absolute;margin: 0;bottom: 0;right: 0;top: 0;z-index: 9991;cursor: default;}.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);background-color: rgba(255, 255, 255, 0.6);color: black;}.ace_optionsMenuEntry:hover {background-color: rgba(100, 100, 100, 0.1);-webkit-transition: all 0.5s;transition: all 0.3s}.ace_closeButton {background: rgba(245, 146, 146, 0.5);border: 1px solid #F48A8A;border-radius: 50%;padding: 7px;position: absolute;right: -8px;top: -8px;z-index: 1000;}.ace_closeButton{background: rgba(245, 146, 146, 0.9);}.ace_optionsMenuKey {color: darkslateblue;font-weight: bold;}.ace_optionsMenuCommand {color: darkcyan;font-weight: normal;}";r.importCssString(i),n.exports.overlayPage=function(t,n,i,s,o,u){function l(e){e.keyCode===27&&a.click()}i=i?"top: "+i+";":"",o=o?"bottom: "+o+";":"",s=s?"right: "+s+";":"",u=u?"left: "+u+";":"";var a=document.createElement("div"),f=document.createElement("div");a.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; background-color: rgba(0, 0, 0, 0.3);",a.addEventListener("click",function(){document.removeEventListener("keydown",l),a.parentNode.removeChild(a),t.focus(),a=null}),document.addEventListener("keydown",l),f.style.cssText=i+s+o+u,f.addEventListener("click",function(e){e.stopPropagation()});var c=r.createElement("div");c.style.position="relative";var h=r.createElement("div");h.className="ace_closeButton",h.addEventListener("click",function(){a.click()}),c.appendChild(h),f.appendChild(c),f.appendChild(n),a.appendChild(f),document.body.appendChild(a),t.blur()}}),ace.define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../../lib/keys");n.exports.getEditorKeybordShortcuts=function(e){var t=r.KEY_MODS,n=[],i={};return e.keyBinding.$handlers.forEach(function(e){var t=e.commandKeyBinding;for(var r in t){var s=r.replace(/(^|-)\w/g,function(e){return e.toUpperCase()}),o=t[r];Array.isArray(o)||(o=[o]),o.forEach(function(e){typeof e!="string"&&(e=e.name),i[e]?i[e].key+="|"+s:(i[e]={key:s,command:e},n.push(i[e]))})}}),n}}),ace.define("ace/ext/keybinding_menu",["require","exports","module","ace/editor","ace/ext/menu_tools/overlay_page","ace/ext/menu_tools/get_editor_keyboard_shortcuts"],function(e,t,n){"use strict";function i(t){if(!document.getElementById("kbshortcutmenu")){var n=e("./menu_tools/overlay_page").overlayPage,r=e("./menu_tools/get_editor_keyboard_shortcuts").getEditorKeybordShortcuts,i=r(t),s=document.createElement("div"),o=i.reduce(function(e,t){return e+'<div class="ace_optionsMenuEntry"><span class="ace_optionsMenuCommand">'+t.command+"</span> : "+'<span class="ace_optionsMenuKey">'+t.key+"</span></div>"},"");s.id="kbshortcutmenu",s.innerHTML="<h1>Keyboard Shortcuts</h1>"+o+"</div>",n(t,s,"0","0","0",null)}}var r=e("ace/editor").Editor;n.exports.init=function(e){r.prototype.showKeyboardShortcuts=function(){i(this)},e.commands.addCommands([{name:"showKeyboardShortcuts",bindKey:{win:"Ctrl-Alt-h",mac:"Command-Alt-h"},exec:function(e,t){e.showKeyboardShortcuts()}}])}});
(function() {
ace.require(["ace/ext/keybinding_menu"], function() {});
})();

File diff suppressed because one or more lines are too long

@ -0,0 +1,5 @@
ace.define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"],function(e,t,n){function i(e){var n=e.editor,r=e.getAccelKey();if(r){var n=e.editor,i=e.getDocumentPosition(),s=n.session,o=s.getTokenAt(i.row,i.column);t.previousLinkingHover&&t.previousLinkingHover!=o&&n._emit("linkHoverOut"),n._emit("linkHover",{position:i,token:o}),t.previousLinkingHover=o}else t.previousLinkingHover&&(n._emit("linkHoverOut"),t.previousLinkingHover=!1)}function s(e){var t=e.getAccelKey(),n=e.getButton();if(n==0&&t){var r=e.editor,i=e.getDocumentPosition(),s=r.session,o=s.getTokenAt(i.row,i.column);r._emit("linkClick",{position:i,token:o})}}var r=e("ace/editor").Editor;e("../config").defineOptions(r.prototype,"editor",{enableLinking:{set:function(e){e?(this.on("click",s),this.on("mousemove",i)):(this.off("click",s),this.off("mousemove",i))},value:!1}}),t.previousLinkingHover=!1});
(function() {
ace.require(["ace/ext/linking"], function() {});
})();

@ -0,0 +1,5 @@
ace.define("ace/ext/modelist",["require","exports","module"],function(e,t,n){"use strict";function i(e){var t=a.text,n=e.split(/[\/\\]/).pop();for(var i=0;i<r.length;i++)if(r[i].supportsFile(n)){t=r[i];break}return t}var r=[],s=function(e,t,n){this.name=e,this.caption=t,this.mode="ace/mode/"+e,this.extensions=n;var r;/\^/.test(n)?r=n.replace(/\|(\^)?/g,function(e,t){return"$|"+(t?"^":"^.*\\.")})+"$":r="^.*\\.("+n+")$",this.extRe=new RegExp(r,"gi")};s.prototype.supportsFile=function(e){return e.match(this.extRe)};var o={ABAP:["abap"],ABC:["abc"],ActionScript:["as"],ADA:["ada|adb"],Apache_Conf:["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],AsciiDoc:["asciidoc|adoc"],Assembly_x86:["asm|a"],AutoHotKey:["ahk"],BatchFile:["bat|cmd"],Bro:["bro"],C_Cpp:["cpp|c|cc|cxx|h|hh|hpp|ino"],C9Search:["c9search_results"],Cirru:["cirru|cr"],Clojure:["clj|cljs"],Cobol:["CBL|COB"],coffee:["coffee|cf|cson|^Cakefile"],ColdFusion:["cfm"],CSharp:["cs"],Csound_Document:["csd"],Csound_Orchestra:["orc"],Csound_Score:["sco"],CSS:["css"],Curly:["curly"],D:["d|di"],Dart:["dart"],Diff:["diff|patch"],Dockerfile:["^Dockerfile"],Dot:["dot"],Drools:["drl"],Dummy:["dummy"],DummySyntax:["dummy"],Eiffel:["e|ge"],EJS:["ejs"],Elixir:["ex|exs"],Elm:["elm"],Erlang:["erl|hrl"],Forth:["frt|fs|ldr|fth|4th"],Fortran:["f|f90"],FTL:["ftl"],Gcode:["gcode"],Gherkin:["feature"],Gitignore:["^.gitignore"],Glsl:["glsl|frag|vert"],Gobstones:["gbs"],golang:["go"],GraphQLSchema:["gql"],Groovy:["groovy"],HAML:["haml"],Handlebars:["hbs|handlebars|tpl|mustache"],Haskell:["hs"],Haskell_Cabal:["cabal"],haXe:["hx"],Hjson:["hjson"],HTML:["html|htm|xhtml|vue|we|wpy"],HTML_Elixir:["eex|html.eex"],HTML_Ruby:["erb|rhtml|html.erb"],INI:["ini|conf|cfg|prefs"],Io:["io"],Jack:["jack"],Jade:["jade|pug"],Java:["java"],JavaScript:["js|jsm|jsx"],JSON:["json"],JSONiq:["jq"],JSP:["jsp"],JSSM:["jssm|jssm_state"],JSX:["jsx"],Julia:["jl"],Kotlin:["kt|kts"],LaTeX:["tex|latex|ltx|bib"],LESS:["less"],Liquid:["liquid"],Lisp:["lisp"],LiveScript:["ls"],LogiQL:["logic|lql"],LSL:["lsl"],Lua:["lua"],LuaPage:["lp"],Lucene:["lucene"],Makefile:["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],Markdown:["md|markdown"],Mask:["mask"],MATLAB:["matlab"],Maze:["mz"],MEL:["mel"],MUSHCode:["mc|mush"],MySQL:["mysql"],Nix:["nix"],NSIS:["nsi|nsh"],ObjectiveC:["m|mm"],OCaml:["ml|mli"],Pascal:["pas|p"],Perl:["pl|pm"],pgSQL:["pgsql"],PHP:["php|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],Pig:["pig"],Powershell:["ps1"],Praat:["praat|praatscript|psc|proc"],Prolog:["plg|prolog"],Properties:["properties"],Protobuf:["proto"],Python:["py"],R:["r"],Razor:["cshtml|asp"],RDoc:["Rd"],Red:["red|reds"],RHTML:["Rhtml"],RST:["rst"],Ruby:["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],Rust:["rs"],SASS:["sass"],SCAD:["scad"],Scala:["scala"],Scheme:["scm|sm|rkt|oak|scheme"],SCSS:["scss"],SH:["sh|bash|^.bashrc"],SJS:["sjs"],Smarty:["smarty|tpl"],snippets:["snippets"],Soy_Template:["soy"],Space:["space"],SQL:["sql"],SQLServer:["sqlserver"],Stylus:["styl|stylus"],SVG:["svg"],Swift:["swift"],Tcl:["tcl"],Tex:["tex"],Text:["txt"],Textile:["textile"],Toml:["toml"],TSX:["tsx"],Twig:["twig|swig"],Typescript:["ts|typescript|str"],Vala:["vala"],VBScript:["vbs|vb"],Velocity:["vm"],Verilog:["v|vh|sv|svh"],VHDL:["vhd|vhdl"],Wollok:["wlk|wpgm|wtest"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],XQuery:["xq"],YAML:["yaml|yml"],Django:["html"]},u={ObjectiveC:"Objective-C",CSharp:"C#",golang:"Go",C_Cpp:"C and C++",Csound_Document:"Csound Document",Csound_Orchestra:"Csound",Csound_Score:"Csound Score",coffee:"CoffeeScript",HTML_Ruby:"HTML (Ruby)",HTML_Elixir:"HTML (Elixir)",FTL:"FreeMarker"},a={};for(var f in o){var l=o[f],c=(u[f]||f).replace(/_/g," "),h=f.toLowerCase(),p=new s(h,c,l[0]);a[h]=p,r.push(p)}n.exports={getModeForPath:i,modes:r,modesByName:a}});
(function() {
ace.require(["ace/ext/modelist"], function() {});
})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,5 @@
ace.define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"],function(e,t,n){"use strict";var r=e("../lib/event");t.contextMenuHandler=function(e){var t=e.target,n=t.textInput.getElement();if(!t.selection.isEmpty())return;var i=t.getCursorPosition(),s=t.session.getWordRange(i.row,i.column),o=t.session.getTextRange(s);t.session.tokenRe.lastIndex=0;if(!t.session.tokenRe.test(o))return;var u="",a=o+" "+u;n.value=a,n.setSelectionRange(o.length,o.length+1),n.setSelectionRange(0,0),n.setSelectionRange(0,o.length);var f=!1;r.addListener(n,"keydown",function l(){r.removeListener(n,"keydown",l),f=!0}),t.textInput.setInputHandler(function(e){console.log(e,a,n.selectionStart,n.selectionEnd);if(e==a)return"";if(e.lastIndexOf(a,0)===0)return e.slice(a.length);if(e.substr(n.selectionEnd)==a)return e.slice(0,-a.length);if(e.slice(-2)==u){var r=e.slice(0,-2);if(r.slice(-1)==" ")return f?r.substring(0,n.selectionEnd):(r=r.slice(0,-1),t.session.replace(s,r),"")}return e})};var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{spellcheck:{set:function(e){var n=this.textInput.getElement();n.spellcheck=!!e,e?this.on("nativecontextmenu",t.contextMenuHandler):this.removeListener("nativecontextmenu",t.contextMenuHandler)},value:!0}})});
(function() {
ace.require(["ace/ext/spellcheck"], function() {});
})();

@ -0,0 +1,5 @@
ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],function(e,t,n){"use strict";function l(e,t){this.$u=e,this.$doc=t}var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./editor").Editor,u=e("./virtual_renderer").VirtualRenderer,a=e("./edit_session").EditSession,f=function(e,t,n){this.BELOW=1,this.BESIDE=0,this.$container=e,this.$theme=t,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(n||1),this.$cEditor=this.$editors[0],this.on("focus",function(e){this.$cEditor=e}.bind(this))};(function(){r.implement(this,s),this.$createEditor=function(){var e=document.createElement("div");e.className=this.$editorCSS,e.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(e);var t=new o(new u(e,this.$theme));return t.on("focus",function(){this._emit("focus",t)}.bind(this)),this.$editors.push(t),t.setFontSize(this.$fontSize),t},this.setSplits=function(e){var t;if(e<1)throw"The number of splits have to be > 0!";if(e==this.$splits)return;if(e>this.$splits){while(this.$splits<this.$editors.length&&this.$splits<e)t=this.$editors[this.$splits],this.$container.appendChild(t.container),t.setFontSize(this.$fontSize),this.$splits++;while(this.$splits<e)this.$createEditor(),this.$splits++}else while(this.$splits>e)t=this.$editors[this.$splits-1],this.$container.removeChild(t.container),this.$splits--;this.resize()},this.getSplits=function(){return this.$splits},this.getEditor=function(e){return this.$editors[e]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(e){this.$editors.forEach(function(t){t.setTheme(e)})},this.setKeyboardHandler=function(e){this.$editors.forEach(function(t){t.setKeyboardHandler(e)})},this.forEach=function(e,t){this.$editors.forEach(e,t)},this.$fontSize="",this.setFontSize=function(e){this.$fontSize=e,this.forEach(function(t){t.setFontSize(e)})},this.$cloneSession=function(e){var t=new a(e.getDocument(),e.getMode()),n=e.getUndoManager();if(n){var r=new l(n,t);t.setUndoManager(r)}return t.$informUndoManager=i.delayedCall(function(){t.$deltas=[]}),t.setTabSize(e.getTabSize()),t.setUseSoftTabs(e.getUseSoftTabs()),t.setOverwrite(e.getOverwrite()),t.setBreakpoints(e.getBreakpoints()),t.setUseWrapMode(e.getUseWrapMode()),t.setUseWorker(e.getUseWorker()),t.setWrapLimitRange(e.$wrapLimitRange.min,e.$wrapLimitRange.max),t.$foldData=e.$cloneFoldData(),t},this.setSession=function(e,t){var n;t==null?n=this.$cEditor:n=this.$editors[t];var r=this.$editors.some(function(t){return t.session===e});return r&&(e=this.$cloneSession(e)),n.setSession(e),e},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(e){if(this.$orientation==e)return;this.$orientation=e,this.resize()},this.resize=function(){var e=this.$container.clientWidth,t=this.$container.clientHeight,n;if(this.$orientation==this.BESIDE){var r=e/this.$splits;for(var i=0;i<this.$splits;i++)n=this.$editors[i],n.container.style.width=r+"px",n.container.style.top="0px",n.container.style.left=i*r+"px",n.container.style.height=t+"px",n.resize()}else{var s=t/this.$splits;for(var i=0;i<this.$splits;i++)n=this.$editors[i],n.container.style.width=e+"px",n.container.style.top=i*s+"px",n.container.style.left="0px",n.container.style.height=s+"px",n.resize()}}}).call(f.prototype),function(){this.execute=function(e){this.$u.execute(e)},this.undo=function(){var e=this.$u.undo(!0);e&&this.$doc.selection.setSelectionRange(e)},this.redo=function(){var e=this.$u.redo(!0);e&&this.$doc.selection.setSelectionRange(e)},this.reset=function(){this.$u.reset()},this.hasUndo=function(){return this.$u.hasUndo()},this.hasRedo=function(){return this.$u.hasRedo()}}.call(l.prototype),t.Split=f}),ace.define("ace/ext/split",["require","exports","module","ace/split"],function(e,t,n){"use strict";n.exports=e("../split")});
(function() {
ace.require(["ace/ext/split"], function() {});
})();

@ -0,0 +1,5 @@
ace.define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/config","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../edit_session").EditSession,i=e("../layer/text").Text,s=".ace_static_highlight {font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;font-size: 12px;white-space: pre-wrap}.ace_static_highlight .ace_gutter {width: 2em;text-align: right;padding: 0 3px 0 0;margin-right: 3px;}.ace_static_highlight.ace_show_gutter .ace_line {padding-left: 2.6em;}.ace_static_highlight .ace_line { position: relative; }.ace_static_highlight .ace_gutter-cell {-moz-user-select: -moz-none;-khtml-user-select: none;-webkit-user-select: none;user-select: none;top: 0;bottom: 0;left: 0;position: absolute;}.ace_static_highlight .ace_gutter-cell:before {content: counter(ace_line, decimal);counter-increment: ace_line;}.ace_static_highlight {counter-reset: ace_line;}",o=e("../config"),u=e("../lib/dom"),a=function(){this.config={}};a.prototype=i.prototype;var f=function(e,t,n){var r=e.className.match(/lang-(\w+)/),i=t.mode||r&&"ace/mode/"+r[1];if(!i)return!1;var s=t.theme||"ace/theme/textmate",o="",a=[];if(e.firstElementChild){var l=0;for(var c=0;c<e.childNodes.length;c++){var h=e.childNodes[c];h.nodeType==3?(l+=h.data.length,o+=h.data):a.push(l,h)}}else o=u.getInnerText(e),t.trim&&(o=o.trim());f.render(o,i,s,t.firstLineNumber,!t.showGutter,function(t){u.importCssString(t.css,"ace_highlight"),e.innerHTML=t.html;var r=e.firstChild.firstChild;for(var i=0;i<a.length;i+=2){var s=t.session.doc.indexToPosition(a[i]),o=a[i+1],f=r.children[s.row];f&&f.appendChild(o)}n&&n()})};f.render=function(e,t,n,i,s,u){function h(){var r=f.renderSync(e,t,n,i,s);return u?u(r):r}var a=1,l=r.prototype.$modes;typeof n=="string"&&(a++,o.loadModule(["theme",n],function(e){n=e,--a||h()}));var c;return t&&typeof t=="object"&&!t.getTokenizer&&(c=t,t=c.path),typeof t=="string"&&(a++,o.loadModule(["mode",t],function(e){if(!l[t]||c)l[t]=new e.Mode(c);t=l[t],--a||h()})),--a||h()},f.renderSync=function(e,t,n,i,o){i=parseInt(i||1,10);var u=new r("");u.setUseWorker(!1),u.setMode(t);var f=new a;f.setSession(u),u.setValue(e);var l=[],c=u.getLength();for(var h=0;h<c;h++)l.push("<div class='ace_line'>"),o||l.push("<span class='ace_gutter ace_gutter-cell' unselectable='on'></span>"),f.$renderLine(l,h,!0,!1),l.push("\n</div>");var p="<div class='"+n.cssClass+"'>"+"<div class='ace_static_highlight"+(o?"":" ace_show_gutter")+"' style='counter-reset:ace_line "+(i-1)+"'>"+l.join("")+"</div>"+"</div>";return f.destroy(),{css:s+n.cssText,html:p,session:u}},n.exports=f,n.exports.highlight=f});
(function() {
ace.require(["ace/ext/static_highlight"], function() {});
})();

@ -0,0 +1,5 @@
ace.define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"],function(e,t,n){"use strict";var r=e("ace/lib/dom"),i=e("ace/lib/lang"),s=function(e,t){this.element=r.createElement("div"),this.element.className="ace_status-indicator",this.element.style.cssText="display: inline-block;",t.appendChild(this.element);var n=i.delayedCall(function(){this.updateStatus(e)}.bind(this)).schedule.bind(null,100);e.on("changeStatus",n),e.on("changeSelection",n),e.on("keyboardActivity",n)};(function(){this.updateStatus=function(e){function n(e,n){e&&t.push(e,n||"|")}var t=[];n(e.keyBinding.getStatusText(e)),e.commands.recording&&n("REC");var r=e.selection,i=r.lead;if(!r.isEmpty()){var s=e.getSelectionRange();n("("+(s.end.row-s.start.row)+":"+(s.end.column-s.start.column)+")"," ")}n(i.row+":"+i.column," "),r.rangeCount&&n("["+r.rangeCount+"]"," "),t.pop(),this.element.textContent=t.join("")}}).call(s.prototype),t.StatusBar=s});
(function() {
ace.require(["ace/ext/statusbar"], function() {});
})();

File diff suppressed because one or more lines are too long

@ -0,0 +1,5 @@
ace.define("ace/ext/themelist",["require","exports","module","ace/lib/fixoldbrowsers"],function(e,t,n){"use strict";e("ace/lib/fixoldbrowsers");var r=[["Chrome"],["Clouds"],["Crimson Editor"],["Dawn"],["Dreamweaver"],["Eclipse"],["GitHub"],["IPlastic"],["Solarized Light"],["TextMate"],["Tomorrow"],["XCode"],["Kuroir"],["KatzenMilch"],["SQL Server","sqlserver","light"],["Ambiance","ambiance","dark"],["Chaos","chaos","dark"],["Clouds Midnight","clouds_midnight","dark"],["Cobalt","cobalt","dark"],["Gruvbox","gruvbox","dark"],["Green on Black","gob","dark"],["idle Fingers","idle_fingers","dark"],["krTheme","kr_theme","dark"],["Merbivore","merbivore","dark"],["Merbivore Soft","merbivore_soft","dark"],["Mono Industrial","mono_industrial","dark"],["Monokai","monokai","dark"],["Pastel on dark","pastel_on_dark","dark"],["Solarized Dark","solarized_dark","dark"],["Terminal","terminal","dark"],["Tomorrow Night","tomorrow_night","dark"],["Tomorrow Night Blue","tomorrow_night_blue","dark"],["Tomorrow Night Bright","tomorrow_night_bright","dark"],["Tomorrow Night 80s","tomorrow_night_eighties","dark"],["Twilight","twilight","dark"],["Vibrant Ink","vibrant_ink","dark"]];t.themesByName={},t.themes=r.map(function(e){var n=e[1]||e[0].replace(/ /g,"_").toLowerCase(),r={caption:e[0],theme:"ace/theme/"+n,isDark:e[2]=="dark",name:n};return t.themesByName[n]=r,r})});
(function() {
ace.require(["ace/ext/themelist"], function() {});
})();

@ -0,0 +1,5 @@
ace.define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang");t.$detectIndentation=function(e,t){function c(e){var t=0;for(var r=e;r<n.length;r+=e)t+=n[r]||0;return t}var n=[],r=[],i=0,s=0,o=Math.min(e.length,1e3);for(var u=0;u<o;u++){var a=e[u];if(!/^\s*[^*+\-\s]/.test(a))continue;if(a[0]==" ")i++,s=-Number.MAX_VALUE;else{var f=a.match(/^ */)[0].length;if(f&&a[f]!=" "){var l=f-s;l>0&&!(s%l)&&!(f%l)&&(r[l]=(r[l]||0)+1),n[f]=(n[f]||0)+1}s=f}while(u<o&&a[a.length-1]=="\\")a=e[u++]}var h=r.reduce(function(e,t){return e+t},0),p={score:0,length:0},d=0;for(var u=1;u<12;u++){var v=c(u);u==1?(d=v,v=n[1]?.9:.8,n.length||(v=0)):v/=d,r[u]&&(v+=r[u]/h),v>p.score&&(p={score:v,length:u})}if(p.score&&p.score>1.4)var m=p.length;if(i>d+1){if(m==1||d<i/4||p.score<1.8)m=undefined;return{ch:" ",length:m}}if(d>i+1)return{ch:" ",length:m}},t.detectIndentation=function(e){var n=e.getLines(0,1e3),r=t.$detectIndentation(n)||{};return r.ch&&e.setUseSoftTabs(r.ch==" "),r.length&&e.setTabSize(r.length),r},t.trimTrailingSpace=function(e,t){var n=e.getDocument(),r=n.getAllLines(),i=t&&t.trimEmpty?-1:0,s=[],o=-1;t&&t.keepCursorPosition&&(e.selection.rangeCount?e.selection.rangeList.ranges.forEach(function(e,t,n){var r=n[t+1];if(r&&r.cursor.row==e.cursor.row)return;s.push(e.cursor)}):s.push(e.selection.getCursor()),o=0);var u=s[o]&&s[o].row;for(var a=0,f=r.length;a<f;a++){var l=r[a],c=l.search(/\s+$/);a==u&&(c<s[o].column&&c>i&&(c=s[o].column),o++,u=s[o]?s[o].row:-1),c>i&&n.removeInLine(a,c,l.length)}},t.convertIndentation=function(e,t,n){var i=e.getTabString()[0],s=e.getTabSize();n||(n=s),t||(t=i);var o=t==" "?t:r.stringRepeat(t,n),u=e.doc,a=u.getAllLines(),f={},l={};for(var c=0,h=a.length;c<h;c++){var p=a[c],d=p.match(/^\s*/)[0];if(d){var v=e.$getStringScreenWidth(d)[0],m=Math.floor(v/s),g=v%s,y=f[m]||(f[m]=r.stringRepeat(o,m));y+=l[g]||(l[g]=r.stringRepeat(" ",g)),y!=d&&(u.removeInLine(c,0,d.length),u.insertInLine({row:c,column:0},y))}}e.setTabSize(n),e.setUseSoftTabs(t==" ")},t.$parseStringArg=function(e){var t={};/t/.test(e)?t.ch=" ":/s/.test(e)&&(t.ch=" ");var n=e.match(/\d+/);return n&&(t.length=parseInt(n[0],10)),t},t.$parseArg=function(e){return e?typeof e=="string"?t.$parseStringArg(e):typeof e.text=="string"?t.$parseStringArg(e.text):e:{}},t.commands=[{name:"detectIndentation",exec:function(e){t.detectIndentation(e.session)}},{name:"trimTrailingSpace",exec:function(e){t.trimTrailingSpace(e.session)}},{name:"convertIndentation",exec:function(e,n){var r=t.$parseArg(n);t.convertIndentation(e.session,r.ch,r.length)}},{name:"setIndentation",exec:function(e,n){var r=t.$parseArg(n);r.length&&e.session.setTabSize(r.length),r.ch&&e.session.setUseSoftTabs(r.ch==" ")}}]});
(function() {
ace.require(["ace/ext/whitespace"], function() {});
})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
ace.define("ace/snippets/javascript",["require","exports","module"],function(e,t,n){"use strict";t.snippetText='# Prototype\nsnippet proto\n ${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) {\n ${4:// body...}\n };\n# Function\nsnippet fun\n function ${1?:function_name}(${2:argument}) {\n ${3:// body...}\n }\n# Anonymous Function\nregex /((=)\\s*|(:)\\s*|(\\()|\\b)/f/(\\))?/\nsnippet f\n function${M1?: ${1:functionName}}($2) {\n ${0:$TM_SELECTED_TEXT}\n }${M2?;}${M3?,}${M4?)}\n# Immediate function\ntrigger \\(?f\\(\nendTrigger \\)?\nsnippet f(\n (function(${1}) {\n ${0:${TM_SELECTED_TEXT:/* code */}}\n }(${1}));\n# if\nsnippet if\n if (${1:true}) {\n ${0}\n }\n# if ... else\nsnippet ife\n if (${1:true}) {\n ${2}\n } else {\n ${0}\n }\n# tertiary conditional\nsnippet ter\n ${1:/* condition */} ? ${2:a} : ${3:b}\n# switch\nsnippet switch\n switch (${1:expression}) {\n case \'${3:case}\':\n ${4:// code}\n break;\n ${5}\n default:\n ${2:// code}\n }\n# case\nsnippet case\n case \'${1:case}\':\n ${2:// code}\n break;\n ${3}\n\n# while (...) {...}\nsnippet wh\n while (${1:/* condition */}) {\n ${0:/* code */}\n }\n# try\nsnippet try\n try {\n ${0:/* code */}\n } catch (e) {}\n# do...while\nsnippet do\n do {\n ${2:/* code */}\n } while (${1:/* condition */});\n# Object Method\nsnippet :f\nregex /([,{[])|^\\s*/:f/\n ${1:method_name}: function(${2:attribute}) {\n ${0}\n }${3:,}\n# setTimeout function\nsnippet setTimeout\nregex /\\b/st|timeout|setTimeo?u?t?/\n setTimeout(function() {${3:$TM_SELECTED_TEXT}}, ${1:10});\n# Get Elements\nsnippet gett\n getElementsBy${1:TagName}(\'${2}\')${3}\n# Get Element\nsnippet get\n getElementBy${1:Id}(\'${2}\')${3}\n# console.log (Firebug)\nsnippet cl\n console.log(${1});\n# return\nsnippet ret\n return ${1:result}\n# for (property in object ) { ... }\nsnippet fori\n for (var ${1:prop} in ${2:Things}) {\n ${0:$2[$1]}\n }\n# hasOwnProperty\nsnippet has\n hasOwnProperty(${1})\n# docstring\nsnippet /**\n /**\n * ${1:description}\n *\n */\nsnippet @par\nregex /^\\s*\\*\\s*/@(para?m?)?/\n @param {${1:type}} ${2:name} ${3:description}\nsnippet @ret\n @return {${1:type}} ${2:description}\n# JSON.parse\nsnippet jsonp\n JSON.parse(${1:jstr});\n# JSON.stringify\nsnippet jsons\n JSON.stringify(${1:object});\n# self-defining function\nsnippet sdf\n var ${1:function_name} = function(${2:argument}) {\n ${3:// initial code ...}\n\n $1 = function($2) {\n ${4:// main code}\n };\n }\n# singleton\nsnippet sing\n function ${1:Singleton} (${2:argument}) {\n // the cached instance\n var instance;\n\n // rewrite the constructor\n $1 = function $1($2) {\n return instance;\n };\n \n // carry over the prototype properties\n $1.prototype = this;\n\n // the instance\n instance = new $1();\n\n // reset the constructor pointer\n instance.constructor = $1;\n\n ${3:// code ...}\n\n return instance;\n }\n# class\nsnippet class\nregex /^\\s*/clas{0,2}/\n var ${1:class} = function(${20}) {\n $40$0\n };\n \n (function() {\n ${60:this.prop = ""}\n }).call(${1:class}.prototype);\n \n exports.${1:class} = ${1:class};\n# \nsnippet for-\n for (var ${1:i} = ${2:Things}.length; ${1:i}--; ) {\n ${0:${2:Things}[${1:i}];}\n }\n# for (...) {...}\nsnippet for\n for (var ${1:i} = 0; $1 < ${2:Things}.length; $1++) {\n ${3:$2[$1]}$0\n }\n# for (...) {...} (Improved Native For-Loop)\nsnippet forr\n for (var ${1:i} = ${2:Things}.length - 1; $1 >= 0; $1--) {\n ${3:$2[$1]}$0\n }\n\n\n#modules\nsnippet def\n define(function(require, exports, module) {\n "use strict";\n var ${1/.*\\///} = require("${1}");\n \n $TM_SELECTED_TEXT\n });\nsnippet req\nguard ^\\s*\n var ${1/.*\\///} = require("${1}");\n $0\nsnippet requ\nguard ^\\s*\n var ${1/.*\\/(.)/\\u$1/} = require("${1}").${1/.*\\/(.)/\\u$1/};\n $0\n',t.scope="javascript"})

@ -0,0 +1 @@
ace.define("ace/snippets/json",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="json"})

@ -0,0 +1 @@
ace.define("ace/theme/dreamweaver",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-dreamweaver",t.cssText='.ace-dreamweaver .ace_gutter {background: #e8e8e8;color: #333;}.ace-dreamweaver .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-dreamweaver {background-color: #FFFFFF;color: black;}.ace-dreamweaver .ace_fold {background-color: #757AD8;}.ace-dreamweaver .ace_cursor {color: black;}.ace-dreamweaver .ace_invisible {color: rgb(191, 191, 191);}.ace-dreamweaver .ace_storage,.ace-dreamweaver .ace_keyword {color: blue;}.ace-dreamweaver .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-dreamweaver .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-dreamweaver .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-dreamweaver .ace_invalid {background-color: rgb(153, 0, 0);color: white;}.ace-dreamweaver .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-dreamweaver .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-dreamweaver .ace_support.ace_type,.ace-dreamweaver .ace_support.ace_class {color: #009;}.ace-dreamweaver .ace_support.ace_php_tag {color: #f00;}.ace-dreamweaver .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-dreamweaver .ace_string {color: #00F;}.ace-dreamweaver .ace_comment {color: rgb(76, 136, 107);}.ace-dreamweaver .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-dreamweaver .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-dreamweaver .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-dreamweaver .ace_variable {color: #06F}.ace-dreamweaver .ace_xml-pe {color: rgb(104, 104, 91);}.ace-dreamweaver .ace_entity.ace_name.ace_function {color: #00F;}.ace-dreamweaver .ace_heading {color: rgb(12, 7, 255);}.ace-dreamweaver .ace_list {color:rgb(185, 6, 144);}.ace-dreamweaver .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-dreamweaver .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-dreamweaver .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-dreamweaver .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-dreamweaver .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-dreamweaver .ace_gutter-active-line {background-color : #DCDCDC;}.ace-dreamweaver .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-dreamweaver .ace_meta.ace_tag {color:#009;}.ace-dreamweaver .ace_meta.ace_tag.ace_anchor {color:#060;}.ace-dreamweaver .ace_meta.ace_tag.ace_form {color:#F90;}.ace-dreamweaver .ace_meta.ace_tag.ace_image {color:#909;}.ace-dreamweaver .ace_meta.ace_tag.ace_script {color:#900;}.ace-dreamweaver .ace_meta.ace_tag.ace_style {color:#909;}.ace-dreamweaver .ace_meta.ace_tag.ace_table {color:#099;}.ace-dreamweaver .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-dreamweaver .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})

@ -0,0 +1 @@
ace.define("ace/theme/tomorrow",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-tomorrow",t.cssText=".ace-tomorrow .ace_gutter {background: #f6f6f6;color: #4D4D4C}.ace-tomorrow .ace_print-margin {width: 1px;background: #f6f6f6}.ace-tomorrow {background-color: #FFFFFF;color: #4D4D4C}.ace-tomorrow .ace_cursor {color: #AEAFAD}.ace-tomorrow .ace_marker-layer .ace_selection {background: #D6D6D6}.ace-tomorrow.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FFFFFF;}.ace-tomorrow .ace_marker-layer .ace_step {background: rgb(255, 255, 0)}.ace-tomorrow .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #D1D1D1}.ace-tomorrow .ace_marker-layer .ace_active-line {background: #EFEFEF}.ace-tomorrow .ace_gutter-active-line {background-color : #dcdcdc}.ace-tomorrow .ace_marker-layer .ace_selected-word {border: 1px solid #D6D6D6}.ace-tomorrow .ace_invisible {color: #D1D1D1}.ace-tomorrow .ace_keyword,.ace-tomorrow .ace_meta,.ace-tomorrow .ace_storage,.ace-tomorrow .ace_storage.ace_type,.ace-tomorrow .ace_support.ace_type {color: #8959A8}.ace-tomorrow .ace_keyword.ace_operator {color: #3E999F}.ace-tomorrow .ace_constant.ace_character,.ace-tomorrow .ace_constant.ace_language,.ace-tomorrow .ace_constant.ace_numeric,.ace-tomorrow .ace_keyword.ace_other.ace_unit,.ace-tomorrow .ace_support.ace_constant,.ace-tomorrow .ace_variable.ace_parameter {color: #F5871F}.ace-tomorrow .ace_constant.ace_other {color: #666969}.ace-tomorrow .ace_invalid {color: #FFFFFF;background-color: #C82829}.ace-tomorrow .ace_invalid.ace_deprecated {color: #FFFFFF;background-color: #8959A8}.ace-tomorrow .ace_fold {background-color: #4271AE;border-color: #4D4D4C}.ace-tomorrow .ace_entity.ace_name.ace_function,.ace-tomorrow .ace_support.ace_function,.ace-tomorrow .ace_variable {color: #4271AE}.ace-tomorrow .ace_support.ace_class,.ace-tomorrow .ace_support.ace_type {color: #C99E00}.ace-tomorrow .ace_heading,.ace-tomorrow .ace_markup.ace_heading,.ace-tomorrow .ace_string {color: #718C00}.ace-tomorrow .ace_entity.ace_name.ace_tag,.ace-tomorrow .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow .ace_meta.ace_tag,.ace-tomorrow .ace_string.ace_regexp,.ace-tomorrow .ace_variable {color: #C82829}.ace-tomorrow .ace_comment {color: #8E908C}.ace-tomorrow .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bdu3f/BwAlfgctduB85QAAAABJRU5ErkJggg==) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})

@ -0,0 +1 @@
ace.define("ace/theme/tomorrow_night_eighties",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-tomorrow-night-eighties",t.cssText=".ace-tomorrow-night-eighties .ace_gutter {background: #272727;color: #CCC}.ace-tomorrow-night-eighties .ace_print-margin {width: 1px;background: #272727}.ace-tomorrow-night-eighties {background-color: #2D2D2D;color: #CCCCCC}.ace-tomorrow-night-eighties .ace_constant.ace_other,.ace-tomorrow-night-eighties .ace_cursor {color: #CCCCCC}.ace-tomorrow-night-eighties .ace_marker-layer .ace_selection {background: #515151}.ace-tomorrow-night-eighties.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #2D2D2D;}.ace-tomorrow-night-eighties .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-tomorrow-night-eighties .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #6A6A6A}.ace-tomorrow-night-bright .ace_stack {background: rgb(66, 90, 44)}.ace-tomorrow-night-eighties .ace_marker-layer .ace_active-line {background: #393939}.ace-tomorrow-night-eighties .ace_gutter-active-line {background-color: #393939}.ace-tomorrow-night-eighties .ace_marker-layer .ace_selected-word {border: 1px solid #515151}.ace-tomorrow-night-eighties .ace_invisible {color: #6A6A6A}.ace-tomorrow-night-eighties .ace_keyword,.ace-tomorrow-night-eighties .ace_meta,.ace-tomorrow-night-eighties .ace_storage,.ace-tomorrow-night-eighties .ace_storage.ace_type,.ace-tomorrow-night-eighties .ace_support.ace_type {color: #CC99CC}.ace-tomorrow-night-eighties .ace_keyword.ace_operator {color: #66CCCC}.ace-tomorrow-night-eighties .ace_constant.ace_character,.ace-tomorrow-night-eighties .ace_constant.ace_language,.ace-tomorrow-night-eighties .ace_constant.ace_numeric,.ace-tomorrow-night-eighties .ace_keyword.ace_other.ace_unit,.ace-tomorrow-night-eighties .ace_support.ace_constant,.ace-tomorrow-night-eighties .ace_variable.ace_parameter {color: #F99157}.ace-tomorrow-night-eighties .ace_invalid {color: #CDCDCD;background-color: #F2777A}.ace-tomorrow-night-eighties .ace_invalid.ace_deprecated {color: #CDCDCD;background-color: #CC99CC}.ace-tomorrow-night-eighties .ace_fold {background-color: #6699CC;border-color: #CCCCCC}.ace-tomorrow-night-eighties .ace_entity.ace_name.ace_function,.ace-tomorrow-night-eighties .ace_support.ace_function,.ace-tomorrow-night-eighties .ace_variable {color: #6699CC}.ace-tomorrow-night-eighties .ace_support.ace_class,.ace-tomorrow-night-eighties .ace_support.ace_type {color: #FFCC66}.ace-tomorrow-night-eighties .ace_heading,.ace-tomorrow-night-eighties .ace_markup.ace_heading,.ace-tomorrow-night-eighties .ace_string {color: #99CC99}.ace-tomorrow-night-eighties .ace_comment {color: #999999}.ace-tomorrow-night-eighties .ace_entity.ace_name.ace_tag,.ace-tomorrow-night-eighties .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow-night-eighties .ace_meta.ace_tag,.ace-tomorrow-night-eighties .ace_variable {color: #F2777A}.ace-tomorrow-night-eighties .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ09NrYAgMjP4PAAtGAwchHMyAAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save