merge master
commit
47b2f0a7c7
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
if (!defined('BASEPATH')) {
|
||||
exit('No direct script access allowed');
|
||||
}
|
||||
|
||||
class CT_Amp_Loader extends CI_Controller {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->load->model('information_model');
|
||||
$this->load->model('InfoMetas_model');
|
||||
//$this->load->library('Tags_analysis');
|
||||
}
|
||||
|
||||
// http://localhost:8002/guide-use.php/amp_loader/test/?info_url=/yangtzecruise/
|
||||
/**
|
||||
* 加载已经发布的页面
|
||||
*/
|
||||
public function load() {
|
||||
$info_url = $this->input->get_post('info_url');
|
||||
$webcode = $this->input->get_post('webcode');
|
||||
if(!isset($webcode) ) {
|
||||
$webcode="ct";
|
||||
}
|
||||
// $info_url="/yangtzecruise/";
|
||||
// $webcode="cht";
|
||||
|
||||
$information_detail = $this->information_model->ct_get_by_url($info_url, $webcode);
|
||||
$ic_id = $information_detail->ic_id;
|
||||
$meta_amp_status = $this->InfoMetas_model->get($ic_id, 'AMP_STATUS');
|
||||
if ($meta_amp_status) {
|
||||
$meta_amp_html = $this->InfoMetas_model->get($ic_id, 'AMP');
|
||||
//$include_price_html = $this->tags_analysis->replace_price_tag($meta_amp_html);
|
||||
echo $meta_amp_html;
|
||||
} else {
|
||||
header('HTTP/1.1 404 Not Found');
|
||||
header("status: 404 Not Found");
|
||||
show_404();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// http://localhost:8002/guide-use.php/amp_loader/test/?info_url=/yangtzecruise/
|
||||
/**
|
||||
* 测试保存的页面
|
||||
*/
|
||||
public function test() {
|
||||
// $info_url = $this->input->get_post('info_url');
|
||||
$info_url = "/yangtzecruise/";
|
||||
$information_detail = $this->information_model->ct_get_by_url($info_url, "cht");
|
||||
if (empty($information_detail)) {
|
||||
echo $info_url.'没有信息类型';
|
||||
}
|
||||
$ic_id = $information_detail->ic_id;
|
||||
$meta_amp_html = $this->InfoMetas_model->get($ic_id, 'AMP');
|
||||
//$include_price_html = $this->tags_analysis->replace_price_tag($meta_amp_html);
|
||||
echo $meta_amp_html;
|
||||
}
|
||||
}
|
@ -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));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* ??MY_Composer
|
||||
*
|
||||
* @author lmr
|
||||
*/
|
||||
class MY_Composer
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
include("C:/VHD/icht-ga/vendor/autoload.php");
|
||||
}
|
||||
}
|
@ -0,0 +1,555 @@
|
||||
<?php
|
||||
//============================================================+
|
||||
// File name : class.wordphp.php
|
||||
// Begin : 2014-03-09
|
||||
// Last Update : 2018-06-22
|
||||
// Version : 1.1
|
||||
// License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright (C) 2014 Ricardo Pinto
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 2.1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Description : PHP class to read DOCX file into HTML format
|
||||
//
|
||||
// Author: Ricardo Pinto
|
||||
//
|
||||
// (c) Copyright:
|
||||
// Ricardo Pinto
|
||||
//============================================================+
|
||||
|
||||
class WordPHP
|
||||
{
|
||||
private $debug = false;
|
||||
private $file;
|
||||
private $rels_xml;
|
||||
private $doc_xml;
|
||||
private $doc_media = array();
|
||||
private $last = 'none';
|
||||
private $encoding = 'UTF-8';
|
||||
private $tmpDir = 'tmp';
|
||||
//图片目录和前缀
|
||||
public $img_dir = '';
|
||||
public $img_prex = '';
|
||||
|
||||
/**
|
||||
* CONSTRUCTOR
|
||||
*
|
||||
* @param Boolean $debug Debug mode or not
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($debug_=null, $encoding=null)
|
||||
{
|
||||
if($debug_ != null) {
|
||||
$this->debug = $debug_;
|
||||
}
|
||||
if ($encoding != null) {
|
||||
$this->encoding = $encoding;
|
||||
}
|
||||
$this->tmpDir = dirname(__FILE__);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the tmp directory where images will be stored
|
||||
*
|
||||
* @param string $tmp The location
|
||||
* @return void
|
||||
*/
|
||||
private function setTmpDir($tmp)
|
||||
{
|
||||
$this->tmpDir = $tmp;
|
||||
}
|
||||
|
||||
/**
|
||||
* READS The Document and Relationships into separated XML files
|
||||
*
|
||||
* @param var $object The class variable to set as DOMDocument
|
||||
* @param var $xml The xml file
|
||||
* @param string $encoding The encoding to be used
|
||||
* @return void
|
||||
*/
|
||||
private function setXmlParts(&$object, $xml, $encoding)
|
||||
{
|
||||
$object = new DOMDocument();
|
||||
$object->encoding = $encoding;
|
||||
$object->preserveWhiteSpace = false;
|
||||
$object->formatOutput = true;
|
||||
$object->loadXML($xml);
|
||||
$object->saveXML();
|
||||
}
|
||||
|
||||
/**
|
||||
* READS The Document and Relationships into separated XML files
|
||||
*
|
||||
* @param String $filename The filename
|
||||
* @return void
|
||||
*/
|
||||
private function readZipPart($filename)
|
||||
{
|
||||
$zip = new ZipArchive();
|
||||
$_xml = 'word/document.xml';
|
||||
$_xml_rels = 'word/_rels/document.xml.rels';
|
||||
|
||||
if (true === $zip->open($filename)) {
|
||||
if (($index = $zip->locateName($_xml)) !== false) {
|
||||
$xml = $zip->getFromIndex($index);
|
||||
}
|
||||
//Get the relationships
|
||||
if (($index = $zip->locateName($_xml_rels)) !== false) {
|
||||
$xml_rels = $zip->getFromIndex($index);
|
||||
}
|
||||
// load all images if they exist
|
||||
for ($i=0; $i<$zip->numFiles;$i++) {
|
||||
$zip_element = $zip->statIndex($i);
|
||||
if(preg_match("([^\s]+(\.(?i)(jpg|jpeg|png|gif|bmp))$)",$zip_element['name'])) {
|
||||
$this->doc_media[$zip_element['name']] = $zip_element['name'];
|
||||
}
|
||||
}
|
||||
$zip->close();
|
||||
} else die('non zip file');
|
||||
|
||||
$enc = mb_detect_encoding($xml);
|
||||
$this->setXmlParts($this->doc_xml, $xml, $enc);
|
||||
$this->setXmlParts($this->rels_xml, $xml_rels, $enc);
|
||||
|
||||
if($this->debug) {
|
||||
echo "<textarea style='width:100%; height: 200px;'>";
|
||||
echo $this->doc_xml->saveXML();
|
||||
echo "</textarea>";
|
||||
echo "<textarea style='width:100%; height: 200px;'>";
|
||||
echo $this->rels_xml->saveXML();
|
||||
echo "</textarea>";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* CHECKS THE FONT FORMATTING OF A GIVEN ELEMENT
|
||||
* Currently checks and formats: bold, italic, underline, background color and font family
|
||||
*
|
||||
* @param XML $xml The XML node
|
||||
* @return String HTML formatted code
|
||||
*/
|
||||
private function checkFormating(&$xml)
|
||||
{
|
||||
$node = trim($xml->readOuterXML());
|
||||
$t = '';
|
||||
// add <br> tags
|
||||
if (mb_strstr($node,'<w:br ')) $t = '<br>';
|
||||
// look for formatting tags
|
||||
$f = "<span style='";
|
||||
$reader = new XMLReader();
|
||||
$reader->XML($node);
|
||||
$img = null;
|
||||
|
||||
while ($reader->read()) {
|
||||
if($reader->name == "w:b") {
|
||||
$f .= "font-weight: bold,";
|
||||
}
|
||||
if($reader->name == "w:i") {
|
||||
$f .= "text-decoration: underline,";
|
||||
}
|
||||
if($reader->name == "w:color") {
|
||||
$f .="color: #".$reader->getAttribute("w:val").",";
|
||||
}
|
||||
if($reader->name == "w:rFont") {
|
||||
$f .="font-family: #".$reader->getAttribute("w:ascii").",";
|
||||
}
|
||||
if($reader->name == "w:shd" && $reader->getAttribute("w:val") != "clear" && $reader->getAttribute("w:fill") != "000000") {
|
||||
$f .="background-color: #".$reader->getAttribute("w:fill").",";
|
||||
}
|
||||
$temp_rx = $reader->readInnerXml();
|
||||
if($reader->name == 'w:drawing' && !empty($temp_rx)) {
|
||||
$r = $this->checkImageFormating($reader);
|
||||
$img = $r !== null ? "<image src='".$r."' />" : null;
|
||||
}
|
||||
}
|
||||
|
||||
$f = rtrim($f, ',');
|
||||
$f .= "'>";
|
||||
$t .= ($img !== null ? $img : htmlentities($xml->expand()->textContent));
|
||||
|
||||
return $f.$t."</span>";
|
||||
}
|
||||
|
||||
/**
|
||||
* CHECKS THE ELEMENT FOR UL ELEMENTS
|
||||
* Currently under development
|
||||
*
|
||||
* @param XML $xml The XML node
|
||||
* @return String HTML formatted code
|
||||
*/
|
||||
private function getListFormating(&$xml)
|
||||
{
|
||||
$node = trim($xml->readOuterXML());
|
||||
|
||||
$reader = new XMLReader();
|
||||
$reader->XML($node);
|
||||
$ret="";
|
||||
$close = "";
|
||||
while ($reader->read()){
|
||||
if($reader->name == "w:numPr" && $reader->nodeType == XMLReader::ELEMENT ) {
|
||||
|
||||
}
|
||||
if($reader->name == "w:numId" && $reader->hasAttributes) {
|
||||
switch($reader->getAttribute("w:val")) {
|
||||
case 1:
|
||||
$ret['open'] = "<ol><li>";
|
||||
$ret['close'] = "</li></ol>";
|
||||
break;
|
||||
case 2:
|
||||
$ret['open'] = "<ul><li>";
|
||||
$ret['close'] = "</li></ul>";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* CHECKS IF THERE IS AN IMAGE PRESENT
|
||||
* Currently under development
|
||||
*
|
||||
* @param XML $xml The XML node
|
||||
* @return String The location of the image
|
||||
*/
|
||||
private function checkImageFormating(&$xml)
|
||||
{
|
||||
$content = trim($xml->readInnerXml());
|
||||
|
||||
if (!empty($content)) {
|
||||
|
||||
$relId;
|
||||
$notfound = true;
|
||||
$reader = new XMLReader();
|
||||
$reader->XML($content);
|
||||
|
||||
while ($reader->read() && $notfound) {
|
||||
if ($reader->name == "a:blip") {
|
||||
$relId = $reader->getAttribute("r:embed");
|
||||
$notfound = false;
|
||||
}
|
||||
}
|
||||
|
||||
// image id found, get the image location
|
||||
if (!$notfound && $relId) {
|
||||
$reader = new XMLReader();
|
||||
$reader->XML($this->rels_xml->saveXML());
|
||||
|
||||
while ($reader->read()) {
|
||||
if ($reader->nodeType == XMLREADER::ELEMENT && $reader->name=='Relationship') {
|
||||
if($reader->getAttribute("Id") == $relId) {
|
||||
$link = "word/".$reader->getAttribute('Target');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$zip = new ZipArchive();
|
||||
$im = null;
|
||||
if (true === $zip->open($this->file)) {
|
||||
$im = $this->createImage($zip->getFromName($link), $relId, $link);
|
||||
}
|
||||
$zip->close();
|
||||
return $im;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an image in the filesystem
|
||||
*
|
||||
* @param objetc $image The image object
|
||||
* @param string $relId The image relationship Id
|
||||
* @param string $name The image name
|
||||
* @return Array With HTML open and closing tag definition
|
||||
*/
|
||||
private function createImage($image, $relId, $name)
|
||||
{
|
||||
$arr = explode('.', $name);
|
||||
$l = count($arr);
|
||||
$ext = mb_strtolower($arr[$l-1]);
|
||||
|
||||
$im = imagecreatefromstring($image);
|
||||
if (empty($this->img_dir)) {
|
||||
$fname = $this->tmpDir.'/tmp/'.$relId.'.'.$ext;
|
||||
} else {
|
||||
$ext = str_ireplace('jpeg', 'jpg', $ext);
|
||||
$fname = $this->img_dir.'/'.$this->img_prex.'_'.mb_strtolower($relId).'.'.$ext;
|
||||
}
|
||||
|
||||
|
||||
switch ($ext) {
|
||||
case 'png':
|
||||
imagepng($im, $fname);
|
||||
break;
|
||||
case 'bmp':
|
||||
imagebmp($im, $fname);
|
||||
break;
|
||||
case 'gif':
|
||||
imagegif($im, $fname);
|
||||
break;
|
||||
case 'jpeg':
|
||||
case 'jpg':
|
||||
imagejpeg($im, $fname);
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
return $fname;
|
||||
}
|
||||
|
||||
/**
|
||||
* CHECKS IF ELEMENT IS AN HYPERLINK
|
||||
*
|
||||
* @param XML $xml The XML node
|
||||
* @return Array With HTML open and closing tag definition
|
||||
*/
|
||||
private function getHyperlink(&$xml)
|
||||
{
|
||||
$ret = array('open'=>'<ul>','close'=>'</ul>');
|
||||
$link ='';
|
||||
if($xml->hasAttributes) {
|
||||
$attribute = "";
|
||||
while($xml->moveToNextAttribute()) {
|
||||
if($xml->name == "r:id")
|
||||
$attribute = $xml->value;
|
||||
}
|
||||
|
||||
if($attribute != "") {
|
||||
$reader = new XMLReader();
|
||||
$reader->XML($this->rels_xml->saveXML());
|
||||
|
||||
while ($reader->read()) {
|
||||
if ($reader->nodeType == XMLREADER::ELEMENT && $reader->name=='Relationship') {
|
||||
if($reader->getAttribute("Id") == $attribute) {
|
||||
$link = $reader->getAttribute('Target');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($link != "") {
|
||||
$ret['open'] = "<a href='".$link."' target='_blank'>";
|
||||
$ret['close'] = "</a>";
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PROCESS TABLE CONTENT
|
||||
*
|
||||
* @param XML $xml The XML node
|
||||
* @return THe HTML code of the table
|
||||
*/
|
||||
private function checkTableFormating(&$xml)
|
||||
{
|
||||
$table = "<table><tbody>";
|
||||
|
||||
while ($xml->read()) {
|
||||
if ($xml->nodeType == XMLREADER::ELEMENT && $xml->name === 'w:tr') { //table row
|
||||
$tc = $ts = "";
|
||||
|
||||
|
||||
$tr = new XMLReader;
|
||||
$tr->xml(trim($xml->readOuterXML()));
|
||||
|
||||
while ($tr->read()) {
|
||||
if ($tr->nodeType == XMLREADER::ELEMENT && $tr->name === 'w:tcPr') { //table element properties
|
||||
$ts = $this->processTableStyle(trim($tr->readOuterXML()));
|
||||
}
|
||||
if ($tr->nodeType == XMLREADER::ELEMENT && $tr->name === 'w:tc') { //table column
|
||||
$tc .= $this->processTableRow(trim($tr->readOuterXML()));
|
||||
}
|
||||
}
|
||||
$table .= '<tr style="'.$ts.'">'.$tc.'</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
$table .= "</tbody></table>";
|
||||
return $table;
|
||||
}
|
||||
|
||||
/**
|
||||
* PROCESS THE TABLE ROW STYLE
|
||||
*
|
||||
* @param string $content The XML node content
|
||||
* @return THe HTML code of the table
|
||||
*/
|
||||
private function processTableStyle($content)
|
||||
{
|
||||
/*border-collapse:collapse;
|
||||
border-bottom:4px dashed #0000FF;
|
||||
border-top:6px double #FF0000;
|
||||
border-left:5px solid #00FF00;
|
||||
border-right:5px solid #666666;*/
|
||||
|
||||
$tc = new XMLReader;
|
||||
$tc->xml($content);
|
||||
$style = "border-collapse:collapse;";
|
||||
|
||||
while ($tc->read()) {
|
||||
if ($tc->name === "w:tcBorders") {
|
||||
$tc2 = new SimpleXMLElement($tc->readOuterXML());
|
||||
|
||||
foreach ($tc2->children('w',true) as $ch) {
|
||||
if (in_array($ch->getName(), array('left','top','botom','right'))) {
|
||||
$line = $this->convertLine($ch['val']);
|
||||
$style .= " border-".$ch->getName().":".$ch['sz']."px $line #".$ch['color'].";";
|
||||
}
|
||||
}
|
||||
|
||||
$tc->next();
|
||||
}
|
||||
}
|
||||
return $style;
|
||||
}
|
||||
|
||||
private function convertLine($in)
|
||||
{
|
||||
if (in_array($in, array('dotted')))
|
||||
return "dashed";
|
||||
|
||||
if (in_array($in, array('dotDash','dotdotDash','dotted','dashDotStroked','dashed','dashSmallGap')))
|
||||
return "dashed";
|
||||
|
||||
if (in_array($in, array('double','triple','threeDEmboss','threeDEngrave','thick')))
|
||||
return "double";
|
||||
|
||||
if (in_array($in, array('nil','none')))
|
||||
return "none";
|
||||
|
||||
return "solid";
|
||||
}
|
||||
|
||||
/**
|
||||
* PROCESS THE TABLE ROW
|
||||
*
|
||||
* @param string $content The XML node content
|
||||
* @return THe HTML code of the table
|
||||
*/
|
||||
private function processTableRow($content)
|
||||
{
|
||||
$tc = new XMLReader;
|
||||
$tc->xml($content);
|
||||
$ct = "";
|
||||
|
||||
while ($tc->read()) {
|
||||
if ($tc->name === "w:r") {
|
||||
$ct .= "<td>".$this->checkFormating($tc)."</td>";
|
||||
$tc->next();
|
||||
}
|
||||
}
|
||||
return $ct;
|
||||
}
|
||||
|
||||
/**
|
||||
* READS THE GIVEN DOCX FILE INTO HTML FORMAT
|
||||
*
|
||||
* @param String $filename The DOCX file name
|
||||
* @return String With HTML code
|
||||
*/
|
||||
public function readDocument($filename)
|
||||
{
|
||||
$this->file = $filename;
|
||||
$this->readZipPart($filename);
|
||||
$reader = new XMLReader();
|
||||
$reader->XML($this->doc_xml->saveXML());
|
||||
|
||||
$text = ''; $list_format="";
|
||||
|
||||
$formatting['header'] = 0;
|
||||
// loop through docx xml dom
|
||||
while ($reader->read()) {
|
||||
// look for new paragraphs
|
||||
$paragraph = new XMLReader;
|
||||
$p = $reader->readOuterXML();
|
||||
//return $p;
|
||||
|
||||
if ($reader->nodeType == XMLREADER::ELEMENT && $reader->name === 'w:p') {
|
||||
// set up new instance of XMLReader for parsing paragraph independantly
|
||||
$paragraph->xml($p);
|
||||
|
||||
preg_match('/<w:pStyle w:val="(Heading.*?[1-6])"/',$p,$matches);
|
||||
if(isset($matches[1])) {
|
||||
switch($matches[1]){
|
||||
case 'Heading1': $formatting['header'] = 1; break;
|
||||
case 'Heading2': $formatting['header'] = 2; break;
|
||||
case 'Heading3': $formatting['header'] = 3; break;
|
||||
case 'Heading4': $formatting['header'] = 4; break;
|
||||
case 'Heading5': $formatting['header'] = 5; break;
|
||||
case 'Heading6': $formatting['header'] = 6; break;
|
||||
default: $formatting['header'] = 0; break;
|
||||
}
|
||||
}
|
||||
// open h-tag or paragraph
|
||||
$text .= ($formatting['header'] > 0) ? '<h'.$formatting['header'].'>' : '<p>';
|
||||
|
||||
// loop through paragraph dom
|
||||
while ($paragraph->read()) {
|
||||
// look for elements
|
||||
if ($paragraph->nodeType == XMLREADER::ELEMENT && $paragraph->name === 'w:r') {
|
||||
if($list_format == "")
|
||||
$text .= $this->checkFormating($paragraph);
|
||||
else {
|
||||
$text .= $list_format['open'];
|
||||
$text .= $this->checkFormating($paragraph);
|
||||
$text .= $list_format['close'];
|
||||
}
|
||||
$list_format ="";
|
||||
$paragraph->next();
|
||||
}
|
||||
else if($paragraph->nodeType == XMLREADER::ELEMENT && $paragraph->name === 'w:pPr') { //lists
|
||||
$list_format = $this->getListFormating($paragraph);
|
||||
$paragraph->next();
|
||||
}
|
||||
else if($paragraph->nodeType == XMLREADER::ELEMENT && $paragraph->name === 'w:drawing') { //images
|
||||
$text .= $this->checkImageFormating($paragraph);
|
||||
$paragraph->next();
|
||||
}
|
||||
else if ($paragraph->nodeType == XMLREADER::ELEMENT && $paragraph->name === 'w:hyperlink') {
|
||||
$hyperlink = $this->getHyperlink($paragraph);
|
||||
$text .= $hyperlink['open'];
|
||||
$text .= $this->checkFormating($paragraph);
|
||||
$text .= $hyperlink['close'];
|
||||
$paragraph->next();
|
||||
}
|
||||
}
|
||||
$text .= ($formatting['header'] > 0) ? '</h'.$formatting['header'].'>' : '</p>';
|
||||
}
|
||||
else if ($reader->nodeType == XMLREADER::ELEMENT && $reader->name === 'w:tbl') { //tables
|
||||
$paragraph->xml($p);
|
||||
$text .= $this->checkTableFormating($paragraph);
|
||||
$reader->next();
|
||||
}
|
||||
}
|
||||
$reader->close();
|
||||
if($this->debug) {
|
||||
echo "<div style='width:100%; height: 200px;'>";
|
||||
echo mb_convert_encoding($text, $this->encoding);
|
||||
echo "</div>";
|
||||
}
|
||||
return mb_convert_encoding($text, $this->encoding);
|
||||
}
|
||||
}
|
@ -0,0 +1,325 @@
|
||||
<?php
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
//数据接口
|
||||
define("DATAUSER","guilintravel");
|
||||
define("DATAKEY","0dbf1652763c2289533e27437a971854");
|
||||
|
||||
//订单接口
|
||||
define("ORDERUSER","guilintravel");
|
||||
define("ORDERKEY","07f811fe29f04008a8fcc86e81c012b9");
|
||||
|
||||
//数据返回格式地址
|
||||
define("JSONRETURN","http://m.ctrip.com/restapi/soa2/12976/json/");
|
||||
define("XMLRETURN","http://m.ctrip.com/restapi/soa2/12976/xml/");
|
||||
|
||||
|
||||
class ctrip_train extends CI_Controller{
|
||||
|
||||
public function __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->load->helper('ctrip');
|
||||
$this->load->model("ctrip_model");
|
||||
date_default_timezone_set('PRC');
|
||||
|
||||
}
|
||||
|
||||
public function index(){
|
||||
exit('hello ctrip');
|
||||
}
|
||||
|
||||
//查询车次余票
|
||||
public function search(){
|
||||
//接收参数
|
||||
$date = $this->input->get_post('date');
|
||||
$from = $this->input->get_post('from');
|
||||
$to = $this->input->get_post('to');
|
||||
$TrainNo = $this->input->get_post('TrainNo');
|
||||
|
||||
if(!$date || !$from || !$to){
|
||||
header("HTTP/1.1 404 Not Found");
|
||||
exit('{"httpstatus":404,"data":{"seven":false,"cache":false,"result":[],"map":{}}}');
|
||||
}else{
|
||||
$isCache = false;
|
||||
$iseven = false;
|
||||
$cachedata = false;
|
||||
$now_time = time();
|
||||
$differ = (strtotime($date) - $now_time) / 86400;
|
||||
if($differ > 29){
|
||||
$date = date('Y-m-d',strtotime('+7day'));
|
||||
$iseven = true;
|
||||
}
|
||||
|
||||
//转换三字码为中文
|
||||
$FromName = $this->ctrip_model->ReplaceCodeToName($from);
|
||||
$ToName = $this->ctrip_model->ReplaceCodeToName($to);
|
||||
|
||||
|
||||
if(!$FromName || !$ToName){
|
||||
header("HTTP/1.1 404 Not Found");
|
||||
exit('{"httpstatus":404,"data":{"seven":false,"cache":false,"result":[],"map":{}}}');
|
||||
}else{
|
||||
$from = $FromName->station_name;
|
||||
$to = $ToName->station_name;
|
||||
}
|
||||
|
||||
//生成请求链接
|
||||
$TimeStamp = time();
|
||||
$Sign = md5($TimeStamp.DATAKEY);
|
||||
|
||||
$url = JSONRETURN.'SearchS2S/?From='.urlencode($from).'&To='.urlencode($to).'&DepartDate='.$date.'&User='.DATAUSER.'&TimeStamp='.$TimeStamp.'&Sign='.$Sign;
|
||||
|
||||
$api_start_time = microtime(true);
|
||||
|
||||
//获取数据
|
||||
$ResponseJson = post_ctrip($url,'','GET');
|
||||
|
||||
$api_end_time = microtime(true);
|
||||
|
||||
$ResponseData = json_decode($ResponseJson);
|
||||
$api_responsive_time = $api_end_time - $api_start_time;
|
||||
//print_r($ResponseData);die();
|
||||
|
||||
if(empty($ResponseData->Trains)){
|
||||
log_message('error','ctrip_trian|status:trains is empty |相应时间:'.$api_responsive_time);
|
||||
}else{
|
||||
log_message('error','ctrip_trian|status:'.$ResponseData->ResponseStatus->Ack.'|相应时间:'.$api_responsive_time);
|
||||
}
|
||||
|
||||
//定义返回的json
|
||||
$ReturnData = new stdClass();
|
||||
$ReturnData->httpstatus = 200;
|
||||
$ReturnData->data = new stdClass();
|
||||
$ReturnData->data->seven = $iseven;
|
||||
$ReturnData->data->cache = $isCache;
|
||||
$ReturnData->data->result = array();
|
||||
$ReturnData->data->map = new stdClass();
|
||||
$obj = array();
|
||||
$i = 0;
|
||||
$PriceStr = '';
|
||||
//数据解析
|
||||
if(!empty($ResponseData->Trains)){
|
||||
foreach ($ResponseData->Trains as $TrainInfo){
|
||||
$obj[$TrainInfo->FromTelcode] = $TrainInfo->FromStationName;
|
||||
$obj[$TrainInfo->ToTelcode] = $TrainInfo->ToStationName;
|
||||
$SeaType = '';
|
||||
$gjrwNum = $rwNum = $rzNum = $tdzNum = $wzNum = $yzNum = $edzNum = $ydzNum = $swzNum = $ywNum = $dwNum = null;
|
||||
foreach($TrainInfo->Seats as $Seats){
|
||||
if($Seats->SeatName == '高级软卧下'){
|
||||
$gjrwXiaPrice = $Seats->Price * 10;
|
||||
$SeaType .= '"6":"'.$gjrwXiaPrice.'","A6":"¥'.$Seats->Price.'",';
|
||||
$gjrwNum = $Seats->TicketLeft;
|
||||
}
|
||||
|
||||
if($Seats->SeatName == '软卧下'){
|
||||
$rwPrice = $Seats->Price * 10;
|
||||
$SeaType .= '"4":"'.$rwPrice.'","A4":"¥'.$Seats->Price.'",';
|
||||
$rwNum = $Seats->TicketLeft;
|
||||
}
|
||||
|
||||
if($Seats->SeatName == '一等双软下'){
|
||||
$ydrwPrice = $Seats->Price * 10;
|
||||
$SeaType .= '"I":"'.$ydrwPrice.'","AI":"¥'.$Seats->Price.'",';
|
||||
$ydrwNum = $Seats->TicketLeft;
|
||||
}
|
||||
|
||||
if($Seats->SeatName == '软座'){
|
||||
$rzPrice = $Seats->Price * 10;
|
||||
$SeaType .= '"2":"'.$rzPrice.'","A2":"¥'.$Seats->Price.'",';
|
||||
$rzNum = $Seats->TicketLeft;
|
||||
}
|
||||
|
||||
if($Seats->SeatName == '特等座'){
|
||||
$SeaType .= '"P":"¥'.$Seats->Price.'",';
|
||||
$tdzNum = $Seats->TicketLeft;
|
||||
}
|
||||
|
||||
if($Seats->SeatName == '无座'){
|
||||
$SeaType .= '"WZ":"¥'.$Seats->Price.'",';
|
||||
$wzNum = $Seats->TicketLeft;
|
||||
}
|
||||
|
||||
if($Seats->SeatName == '硬座'){
|
||||
$yzPrice = $Seats->Price * 10;
|
||||
$SeaType .= '"1":"'.$yzPrice.'","A1":"¥'.$Seats->Price.'",';
|
||||
$yzNum = $Seats->TicketLeft;
|
||||
}
|
||||
|
||||
if($Seats->SeatName == '二等座'){
|
||||
$SeaType .= '"O":"¥'.$Seats->Price.'",';
|
||||
$edzNum = $Seats->TicketLeft;
|
||||
}
|
||||
|
||||
if($Seats->SeatName == '一等座'){
|
||||
$SeaType .= '"M":"¥'.$Seats->Price.'",';
|
||||
$ydzNum = $Seats->TicketLeft;
|
||||
}
|
||||
|
||||
if($Seats->SeatName == '商务座'){
|
||||
$swzPrice = $Seats->Price * 10;
|
||||
$SeaType .= '"9":"'.$swzPrice.'","A9":"¥'.$Seats->Price.'",';
|
||||
$swzNum = $Seats->TicketLeft;
|
||||
}
|
||||
|
||||
if($Seats->SeatName == '硬卧下'){
|
||||
$ywPrice = $Seats->Price * 10;
|
||||
$SeaType .= '"3":"'.$ywPrice.'","A3":"¥'.$Seats->Price.'",';
|
||||
$ywNum = $Seats->TicketLeft;
|
||||
}
|
||||
|
||||
if($Seats->SeatName == '二等双软下'){
|
||||
$errwPrice = $Seats->Price * 10;
|
||||
$SeaType .= '"J":"'.$errwPrice.'","AJ":"¥'.$Seats->Price.'",';
|
||||
$errwNum = $Seats->TicketLeft;
|
||||
}
|
||||
|
||||
if($Seats->SeatName == '动卧下'){
|
||||
$SeaType .= '"F":"¥'.$Seats->Price.'",';
|
||||
$dwNum = $Seats->TicketLeft;
|
||||
}
|
||||
|
||||
$PriceStr = $SeaType.'"train_no":'.'"'.$TrainInfo->TrainNo.'"';
|
||||
}
|
||||
|
||||
|
||||
//对返回的数据进行容错处理
|
||||
$gjrwNum = isset($gjrwNum) ? ticket_exchange($gjrwNum,$iseven) : '';
|
||||
$rwNum = isset($rwNum) ? ticket_exchange($rwNum,$iseven) : '';
|
||||
$rzNum = isset($rzNum) ? ticket_exchange($rzNum,$iseven) : '';
|
||||
$tdzNum = isset($tdzNum) ? ticket_exchange($tdzNum,$iseven) : '';
|
||||
$wzNum = isset($wzNum) ? ticket_exchange($wzNum,$iseven) : '';
|
||||
$ywNum = isset($ywNum) ? ticket_exchange($ywNum,$iseven) : '';
|
||||
$yzNum = isset($yzNum) ? ticket_exchange($yzNum,$iseven) : '';
|
||||
$edzNum = isset($edzNum) ? ticket_exchange($edzNum,$iseven) : '';
|
||||
$ydzNum = isset($ydzNum) ? ticket_exchange($ydzNum,$iseven) : '';
|
||||
$swzNum = isset($swzNum) ? ticket_exchange($swzNum,$iseven) : '';
|
||||
$dwNum = isset($dwNum) ? ticket_exchange($dwNum,$iseven) : '';
|
||||
$ydrwNum = isset($ydrwNum) ? ticket_exchange($ydrwNum,$iseven) : '';
|
||||
$errwNum = isset($errwNum) ? ticket_exchange($errwNum,$iseven) : '';
|
||||
|
||||
if($rwNum == '' && $ydrwNum != ''){
|
||||
$rwNum = $ydrwNum;
|
||||
}
|
||||
|
||||
if($ywNum == '' && $errwNum != ''){
|
||||
$ywNum = $errwNum;
|
||||
}
|
||||
|
||||
$runMin = $TrainInfo->DurationMinutes % 60;
|
||||
$runHour = ($TrainInfo->DurationMinutes - $runMin) / 60;
|
||||
|
||||
$ReturnData->data->result[$i] = '|预定|'.$TrainInfo->Train12306No.'|'.$TrainInfo->TrainNo.'|'.$TrainInfo->FromStationName.'|'.$TrainInfo->ToStationName.'|'.$TrainInfo->FromTelcode.'|'.$TrainInfo->ToTelcode.'|'.$TrainInfo->StartTime.'|'.$TrainInfo->ArriveTime.'|'.$runHour.':'.$runMin.'|'.$TrainInfo->CanWebBuy.'||'.date('Ymd',strtotime($date)).'||||||||'.$gjrwNum.'||'.$rwNum.'|'.$rzNum.'|'.$tdzNum.'|'.$wzNum.'||'.$ywNum.'|'.$yzNum.'|'.$edzNum.'|'.$ydzNum.'|'.$swzNum.'|'.$dwNum.'||';
|
||||
|
||||
$data = '{"validateMessagesShowId":"_validatorMessage","status":true,"httpstatus":200,"data":{'.$PriceStr.'},"messages":[],"validateMessages":{}}';
|
||||
$ReturnData->data->price[$i] = $data;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
//print_r($ResponseData);
|
||||
$ReturnData->data->map = (object)$obj;
|
||||
print_r(json_encode($ReturnData));
|
||||
}
|
||||
}
|
||||
|
||||
//查询经停站
|
||||
public function getstopstation(){
|
||||
//接收参数
|
||||
$DepartDate = $this->input->get_post('DepartDate');
|
||||
$TrainNo = $this->input->get_post('TrainNo');
|
||||
|
||||
if(!$DepartDate || !$TrainNo){
|
||||
exit('传参错误!');
|
||||
}else{
|
||||
//生成请求链接
|
||||
$TimeStamp = time();
|
||||
$Sign = md5($TimeStamp.DATAKEY);
|
||||
|
||||
$url = JSONRETURN.'GetStopStations/?DepartDate='.$DepartDate.'&TrainNo='.$TrainNo.'&User='.DATAUSER.'&TimeStamp='.$TimeStamp.'&Sign='.$Sign;
|
||||
|
||||
$ResponseJson = post_ctrip($url,'','GET');
|
||||
$ResponseData = json_decode($ResponseJson);
|
||||
|
||||
//构造12306格式
|
||||
$ReturnData = array();
|
||||
$ReturnData['validateMessagesShowId'] = '_validatorMessage';
|
||||
$ReturnData['status'] = true;
|
||||
$ReturnData['httpstatus'] = 200;
|
||||
$ReturnData['data'] = array();
|
||||
$i = 0;
|
||||
$Last_num = count($ResponseData->StopStations);
|
||||
foreach($ResponseData->StopStations as $items){
|
||||
if($i == 0){
|
||||
$ReturnData['data']['data'][$i]['start_station_name'] = $items->StationName;
|
||||
$ReturnData['data']['data'][$i]['station_train_code'] = $TrainNo;
|
||||
$ReturnData['data']['data'][$i]['end_station_name'] = $ResponseData->StopStations[$Last_num-1]->StationName;
|
||||
}
|
||||
$ReturnData['data']['data'][$i]['arrive_time'] = $items->ArrivalTime;
|
||||
$ReturnData['data']['data'][$i]['station_name'] = $items->StationName;
|
||||
$ReturnData['data']['data'][$i]['start_time'] = $items->StartTime;
|
||||
$ReturnData['data']['data'][$i]['stopover_time'] = $items->StopMinutes;
|
||||
$ReturnData['data']['data'][$i]['station_no'] = $items->StationNo;
|
||||
$ReturnData['data']['data'][$i]['isEnabled'] = true;
|
||||
$i++;
|
||||
}
|
||||
$ReturnData['messages'] = array();
|
||||
$ReturnData['validateMessages'] = new stdClass();
|
||||
print_r(json_encode($ReturnData));
|
||||
}
|
||||
}
|
||||
|
||||
//获取所有站点信息
|
||||
public function getallstation(){
|
||||
//生成请求参数
|
||||
$TimeStamp = time();
|
||||
$Sign = md5($TimeStamp.DATAKEY);
|
||||
|
||||
$url = JSONRETURN.'/GetAllStations/?&User='.DATAUSER.'&TimeStamp='.$TimeStamp.'&Sign='.$Sign;
|
||||
|
||||
$ResponseJson = post_ctrip($url,'','GET');
|
||||
|
||||
$ResponseData = json_decode($ResponseJson);
|
||||
|
||||
$data = array();
|
||||
foreach ($ResponseData->Stations as $items){
|
||||
$data['StationName'] = isset($items->StationName) ? checkNull($items->StationName) : '';
|
||||
$data['PinYin'] = isset($items->PinYin) ? checkNull($items->PinYin) : '';
|
||||
$data['Telecode'] = isset($items->Telecode) ? checkNull($items->Telecode) : '';
|
||||
$data['Address'] = isset($items->Address) ? checkNull($items->Address) : '';
|
||||
$data['Geography'] = isset($items->Geography) ? checkNull($items->Geography) : '';
|
||||
$this->ctrip_model->AddOrUpdate($data);
|
||||
}
|
||||
}
|
||||
|
||||
//查询中转方案
|
||||
public function gettraintrainsfer(){
|
||||
$FromCode = $this->input->get_post('FromCode');
|
||||
$ToCode = $this->input->get_post('ToCode');
|
||||
$DepartDate = $this->input->get_post('DepartDate');
|
||||
|
||||
if(!$FromCode || !$ToCode || !$DepartDate){
|
||||
exit('传参错误!');
|
||||
}else{
|
||||
$TimeStamp = time();
|
||||
$Sign = md5($TimeStamp.DATAKEY);
|
||||
|
||||
$FromName = $this->ctrip_model->ReplaceCodeToName($FromCode);
|
||||
$ToName = $this->ctrip_model->ReplaceCodeToName($ToCode);
|
||||
|
||||
$From = $FromName->station_name;
|
||||
$To = $ToName->station_name;
|
||||
|
||||
$url = JSONRETURN.'GetTrainTransfer?User='.DATAUSER.'&TimeStamp='.$TimeStamp.'&Sign='.$Sign.'&From='.urlencode($From).'&To='.urlencode($To).'&DepartDate='.$DepartDate;
|
||||
|
||||
|
||||
$ResponseJson = post_ctrip($url,'','GET');
|
||||
//$ResponseData = json_decode($ResponseJson);
|
||||
print_r($ResponseJson);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
//中文转换为座位简码
|
||||
/*
|
||||
硬座、软座、二等座、一等座、特等座、商务座、硬卧、软卧、高级软卧、棚车、包厢硬卧、一等软座、二等软座、高级动卧、混编硬座、混编硬卧、包厢软座、特等软座、动卧、二人软包、一人软包、一等双软、二等双软、混编软座、混编软卧、观光座、一等包座、无座、硬卧上、硬卧中、硬卧下、软卧上、软卧下、高级软卧上、高级软卧下、高级动卧上、高级动卧下、动卧上、动卧下
|
||||
*/
|
||||
function ReplaceToCode($SeatName){
|
||||
|
||||
}
|
||||
|
||||
//验证站点信息是否为空
|
||||
function checkNull($info){
|
||||
if(empty($info)){
|
||||
return '';
|
||||
}else{
|
||||
return $info;
|
||||
}
|
||||
}
|
||||
|
||||
//验证参数是否存在并且是否为数字
|
||||
function checkNum($num){
|
||||
if(isset($num)){
|
||||
if(is_numeric($num)){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//余票转换
|
||||
function ticket_exchange($num,$iseven){
|
||||
if($iseven){
|
||||
return '有';
|
||||
}else{
|
||||
if(is_numeric($num)){
|
||||
if($num == 0){
|
||||
return '无';
|
||||
}elseif($num >= 99){
|
||||
return '有';
|
||||
}else{
|
||||
return $num;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//发送请求函数
|
||||
function post_ctrip($url, $data = '', $method = 'GET') {
|
||||
$user_agent = "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1";
|
||||
if(isset($_SERVER['HTTP_USER_AGENT'])) {
|
||||
$user_agent = $_SERVER['HTTP_USER_AGENT'];
|
||||
}
|
||||
$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, $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_HTTPHEADER, array('Content-Type:application/json'));
|
||||
}
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, 40); // 设置超时限制防止死循环
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT_MS, 40000); // 设置超时限制防止死循环
|
||||
curl_setopt($curl, CURLOPT_HEADER, 0); // 显示返回的Header区域内容
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // 获取的信息以文件流的形式返回
|
||||
$tmpInfo = curl_exec($curl); // 执行操作
|
||||
$errno = curl_errno($curl);
|
||||
if ($errno !== 0) {
|
||||
log_message('error', 'ctripost'.$errno.curl_error($curl));
|
||||
}
|
||||
curl_close($curl); //关闭CURL会话
|
||||
return $tmpInfo; //返回数据
|
||||
}
|
||||
|
||||
?>
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,45 @@
|
||||
<!doctype html>
|
||||
<html amp lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title><!--@TITLE@--></title>
|
||||
<meta name="description" content="<!--@DESCRIPTION@-->">
|
||||
<meta name="keywords" content="<!--@KEYWORDS@-->">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
|
||||
<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://www.chinarundreisen.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>
|
||||
<script async custom-element="amp-position-observer" src="https://cdn.ampproject.org/v0/amp-position-observer-0.1.js"></script>
|
||||
<script async custom-element="amp-animation" src="https://cdn.ampproject.org/v0/amp-animation-0.1.js"></script>
|
||||
<script async custom-element="amp-addthis" src="https://cdn.ampproject.org/v0/amp-addthis-0.1.js"></script>
|
||||
<style amp-custom>
|
||||
/*@COMMON-CSS@*/
|
||||
/*@CUSTOM-CSS@*/
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<amp-analytics config="https://www.googletagmanager.com/amp.json?id=GTM-MLTZ9X8>m.url=SOURCE_URL" data-credentials="include">
|
||||
<script type="application/json">
|
||||
{
|
||||
"vars": {
|
||||
"gaTrackingId": "UA-2825055-2"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</amp-analytics>
|
||||
<div class="headerbottom" id="top-page"></div>
|
||||
@AMP-COMMON-HEADER@
|
||||
|
||||
<!--@CUSTOM-CONENT@-->
|
||||
|
||||
@AMP-COMMON-FOOTER@
|
||||
|
||||
<div class="fixed-addthis"><amp-addthis width="320" height="48" layout="responsive" data-pub-id="ra-58255ecaa2c44e0d" data-widget-id="mip1"></amp-addthis></div>
|
||||
<amp-animation id="showAnim"layout="nodisplay"><script type="application/json">{"duration":"200ms","fill":"both","iterations":"1","direction":"alternate","animations":[{"selector":"#scrollToTopButton","keyframes":[{"opacity":"1","visibility":"visible"}]}]}</script></amp-animation><amp-animation id="hideAnim"layout="nodisplay"><script type="application/json">{"duration":"200ms","fill":"both","iterations":"1","direction":"alternate","animations":[{"selector":"#scrollToTopButton","keyframes":[{"opacity":"0","visibility":"hidden"}]}]}</script></amp-animation><div id="marker"><amp-position-observer on="enter:hideAnim.start; exit:showAnim.start"layout="nodisplay"></amp-position-observer></div><a id="scrollToTopButton"on="tap:top-page.scrollTo(duration=200)"class="scrollToTop"></a>
|
||||
<!--AMP Builder-->
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,538 @@
|
||||
<!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>
|
||||
<option value="527">
|
||||
Finland
|
||||
</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">×</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>
|
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
//行程地图
|
||||
|
||||
class Index extends CI_Controller
|
||||
{
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('welcome');
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,176 @@
|
||||
<?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,
|
||||
(select top 1 trainArrive from trainlistDetail where train_no = tl.train_no order by trainOrder desc) as localarriveTime
|
||||
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();
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
|
||||
define("JUHE_API_KEY","123");
|
@ -0,0 +1,342 @@
|
||||
<?php
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class api extends CI_Controller{
|
||||
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$this->load->helper('train');
|
||||
$this->load->model("BIZ_train_model");
|
||||
$this->load->model("train_system_model");
|
||||
$this->load->model("Sendmail_model");
|
||||
}
|
||||
|
||||
public function index(){
|
||||
echo 'api manager';
|
||||
}
|
||||
|
||||
//获取订单出票状态
|
||||
public function isbooktickets(){
|
||||
$cold_sn = $this->input->get('cold_sn');
|
||||
|
||||
$tickets_info = $this->train_system_model->get_tickets_info($cold_sn);
|
||||
//print_r($tickets_info);
|
||||
if(!empty($tickets_info)){
|
||||
$return_data = array();
|
||||
$i = 0;
|
||||
foreach($tickets_info as $items){
|
||||
$return_data[$i]->cold_sn = (int) $items->ts_cold_sn;
|
||||
$return_data[$i]->ordernumber = $items->ts_ordernumber;
|
||||
$return_data[$i]->status = $items->tst_status;
|
||||
$return_data[$i]->passengersename = $items->tst_realname;
|
||||
$return_data[$i]->passportseno = $items->tst_numberid;
|
||||
$i++;
|
||||
}
|
||||
print_r(json_encode($return_data));
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//用于自动发送确认信
|
||||
public function send_confirmmail(){
|
||||
//log_message('error','auto sendmail');
|
||||
$mailarr = $this->BIZ_train_model->auto_sendmail();
|
||||
foreach($mailarr as $obj){
|
||||
$coli_id = $this->BIZ_train_model->cold_sn_get_coli_id($obj->ts_cold_sn);
|
||||
$coli_id = $coli_id[0]->COLI_ID;
|
||||
$juhe_order = $obj->ts_ordernumber;
|
||||
$this->send_mail_to_guest($coli_id,$juhe_order);
|
||||
}
|
||||
}
|
||||
|
||||
//发邮件给客人
|
||||
function send_mail_to_guest($coli_id,$jh_order){
|
||||
$info = $this->BIZ_train_model->get_user_info($jh_order);
|
||||
$guest = $this->BIZ_train_model->get_guest_info($coli_id);
|
||||
//print_r($guest);
|
||||
$operator_info = $this->BIZ_train_model->get_operatorInfo($coli_id);
|
||||
$fromName = $operator_info[0]->Name;
|
||||
$fromEmail = $operator_info[0]->OPI_Email;
|
||||
$toName = $guest[0]->GUT_LastName.$guest[0]->GUT_FirstName;
|
||||
$toEmail = $guest[0]->GUT_Email;//
|
||||
$data['coli_id'] = $coli_id;
|
||||
$data['toname'] = $toName;
|
||||
$data['adult'] = $info->COLD_PersonNum;
|
||||
$data['chlid'] = $info->COLD_ChildNum;
|
||||
$data['baby'] = $info->COLD_BabyNum;
|
||||
$data['price'] = $this->BIZ_train_model->get_paypal($coli_id);
|
||||
$data['allpeople'] = $this->BIZ_train_model->biz_people($info->COLD_SN);
|
||||
$data['train_info'] = $this->BIZ_train_model->get_biz_foi($info->COLD_SN);
|
||||
$differtime = (strtotime($data['train_info'][0]->DepartureTime) - time()) / 3600;
|
||||
$obj = $this->BIZ_train_model->get_biz_jol_info($info->COLD_SN,$jh_order);
|
||||
$data['ordernumber'] = $obj->ts_elecnumber;
|
||||
$status = $obj->ts_status;
|
||||
$data['operator'] = $operator_info;
|
||||
$data['emailarr'] = explode(';',$operator_info[0]->Email);
|
||||
|
||||
$data['seatinfo'] = $obj->ts_seatsinfo;
|
||||
|
||||
if($status == '4' && $differtime > 0){
|
||||
$subject = "Got payment and issued train ticket(s), Order No $coli_id";
|
||||
$body = $this->load->view('email',$data,true);
|
||||
$this->send_mail_to_wl("订单:{$coli_id} 出票成功","翰特订单号:{$coli_id};聚合订单号:{$jh_order}",$coli_id);
|
||||
//发送邮件给客人
|
||||
$flag = $this->Sendmail_model->SendMailToTable($fromName,$fromEmail,$toName,$toEmail,$subject,$body);
|
||||
$this->BIZ_train_model->update_biz_jol(array("ts_ordernumber"=>$jh_order),array("ts_sendmail"=>1,"ts_m_sn"=>$flag));
|
||||
}else if($status == '1' && $differtime < 18 && $differtime > 0){
|
||||
$subject = "The train ticket(s) will be issued manually, Order No $coli_id";
|
||||
$body = $this->load->view('email_fault',$data,true);
|
||||
$this->send_mail_to_wl("订单:{$coli_id} 出票失败","翰特订单号:{$coli_id};聚合订单号:{$jh_order}",$coli_id);
|
||||
//测试阶段,将失败邮件发送一份给操作外联。
|
||||
$flag = $this->Sendmail_model->SendMailToTable($fromName,$fromEmail,$fromName,$fromEmail,$subject,$body);
|
||||
//测试阶段,将失败邮件发送一份给操作外联。
|
||||
$this->Sendmail_model->SendMailToTable($fromName,$fromEmail,$toName,$toEmail,$subject,$body);
|
||||
$this->BIZ_train_model->update_biz_jol(array("ts_ordernumber"=>$jh_order),array("ts_sendmail"=>1,"ts_m_sn"=>$flag));
|
||||
}else{
|
||||
echo $jh_order.'不需要发邮件<br>';
|
||||
$this->BIZ_train_model->update_biz_jol(array("ts_ordernumber"=>$jh_order),array("ts_sendmail"=>2));
|
||||
$flag = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//发邮件给外联
|
||||
function send_mail_to_wl($subject,$body,$coli_id){
|
||||
$fromName = "cyc";
|
||||
$fromEmail = "cyc@hainatravel.com";
|
||||
//获取该订单的操作员的邮箱以及姓名
|
||||
$info = $this->BIZ_train_model->get_operatorInfo($coli_id);
|
||||
$toName = $info[0]->OPI_Name;
|
||||
$toEmail = $info[0]->OPI_Email;
|
||||
$this->Sendmail_model->SendMailToTable($fromName,$fromEmail,$toName,$toEmail,$subject,$body);
|
||||
}
|
||||
|
||||
//导出账单api
|
||||
public function export_excel(){
|
||||
set_time_limit(0);
|
||||
//创建跟踪号
|
||||
$trackcode = $this->BIZ_train_model->getTrackingCode();
|
||||
$from_date = $this->input->post("from_date");
|
||||
$to_date = $this->input->post("to_date");
|
||||
$examine = $this->input->post("examine");
|
||||
//$operator=$this->input->post("operator");
|
||||
|
||||
$reback=array();//返回的数据
|
||||
$reback["from_date"] = $from_date;
|
||||
$reback["to_date"] = $to_date;
|
||||
$reback["examine"] = $examine;
|
||||
$group = array();
|
||||
|
||||
if(!empty($from_date) && !empty($to_date)){
|
||||
$from_date = date("Y-m-d H:i",strtotime($from_date));
|
||||
$to_date = date("Y-m-d H:i",strtotime($to_date));
|
||||
$r = "";//聚合返回的数据
|
||||
$string_r = "";//输出
|
||||
$coli_id = "";
|
||||
$wl_name = "";
|
||||
$arr = array();//整合完成的数组,写进excel表的数据
|
||||
$url = JUHE_TRAIN_EXPORT_API;//请求的url
|
||||
$url .= "?key=".JUHE_TRAIN_API_KEY;
|
||||
$url .= "&since=".$from_date;
|
||||
$url .= "&before=".$to_date;
|
||||
$r = GetPost_http($url);
|
||||
$r = explode("\n",$r);
|
||||
//print_r($r);
|
||||
//die();
|
||||
for($i=1;$i<count($r)-1;$i++){
|
||||
$r_info=explode(",",$r[$i]);
|
||||
$juhe_order=substr($r_info[4], 1,strlen($r_info[4])-2);
|
||||
$obj = $this->BIZ_train_model->jh_order_get_coli_id($juhe_order);
|
||||
//print_r($obj);
|
||||
if(!empty($obj)){
|
||||
$coli_id = $obj[0]->COLI_ID;
|
||||
$coli_sn = $obj[0]->COLI_SN;
|
||||
}else{
|
||||
echo $juhe_order;
|
||||
}
|
||||
|
||||
$this->BIZ_train_model->linkTrackingCode($coli_sn,$trackcode);
|
||||
|
||||
/*if(empty($coli_sn) || empty($coli_sn)){
|
||||
print_r($juhe_order);
|
||||
}*/
|
||||
|
||||
|
||||
/*
|
||||
$flag = $this->BIZ_train_model->islink($coli_sn);
|
||||
if($flag){
|
||||
$this->BIZ_train_model->linkTrackingCode($coli_sn,$trackcode);
|
||||
}else{
|
||||
echo $coli_sn.'该订单还未关联财务表,不能导出账单。<br>';
|
||||
die();
|
||||
}
|
||||
*/
|
||||
//去掉数据两边的双引号
|
||||
$r_info[2]=substr($r_info[2], stripos($r_info[2],'"')+1,strrpos($r_info[2],'"')-1);
|
||||
$r_info[1]=substr($r_info[1], stripos($r_info[1],'"')+1,strrpos($r_info[1],'"')-1);
|
||||
$r_info[5]=substr($r_info[5], stripos($r_info[5],'"')+1,strrpos($r_info[5],'"')-1);
|
||||
$r_info[6]="";//储存团名
|
||||
$r_info[7] = "";//储存外联名
|
||||
$r_info[8] = "";//储存coli_id
|
||||
if($coli_id){
|
||||
$r_info[8] = $coli_id;
|
||||
$gri_no=$this->BIZ_train_model->get_gri_no($r_info[8]);//团名
|
||||
$wl_name = $this->BIZ_train_model->get_operatorInfo($r_info[8]);
|
||||
if($gri_no){
|
||||
$r_info[6] = $gri_no[0]->GRI_No;
|
||||
}
|
||||
if($wl_name){
|
||||
$r_info[7] = $wl_name[0]->OPI_Name;
|
||||
}
|
||||
}
|
||||
|
||||
//$r_info[3]=mb_convert_encoding($r_info[3],"utf-8","gbk");
|
||||
|
||||
if(is_numeric(mb_strpos($r_info[3],"充值"))){
|
||||
if(is_numeric(mb_strpos($r_info[3],"扣款"))){
|
||||
$r_info[3]="票款(有充值)";
|
||||
}
|
||||
if(is_numeric(mb_strpos($r_info[3],"扣手续费"))){
|
||||
$r_info[3]="手续费(有充值)";
|
||||
}
|
||||
if(is_numeric(mb_strpos($r_info[3],"线上退票成功"))){
|
||||
$r_info[3]="退票费(有充值)";
|
||||
}
|
||||
}
|
||||
if(is_numeric(mb_strpos($r_info[3],"扣款"))){
|
||||
$r_info[3]="票款";
|
||||
}
|
||||
if(is_numeric(mb_strpos($r_info[3],"扣手续费"))){
|
||||
$r_info[3]="手续费";
|
||||
}
|
||||
if(is_numeric(mb_strpos($r_info[3],"线上退票成功"))){
|
||||
$r_info[3]="退票费";
|
||||
}
|
||||
// $r_info[3]=mb_convert_encoding($r_info[3],"gbk","utf-8");
|
||||
$r_info['trackcode'] = $trackcode;
|
||||
$arr[]=$r_info;
|
||||
|
||||
/*
|
||||
//根据外联的名字创建数组来存储对应外联的订单信息
|
||||
if(!empty($r_info[7])){
|
||||
if(!isset($group[$r_info[7]])){
|
||||
$group[$r_info[7]] = array();
|
||||
}
|
||||
array_push($group[$r_info[7]],$r_info);
|
||||
}*/
|
||||
|
||||
}
|
||||
/*
|
||||
//将存储好的分组重新循环出来。
|
||||
foreach($group as $item){
|
||||
foreach ($item as $value){
|
||||
array_push($arr,$value);
|
||||
}
|
||||
}
|
||||
*/
|
||||
//die();
|
||||
if(empty($examine)){
|
||||
header("Content-type:application/vnd.ms-excel;charset=utf-8");
|
||||
header("Content-Disposition:attachment;filename=juhe_train.xls");
|
||||
$string_r= $this->load->view("train_transaction_excel",array("arr"=>$arr),TRUE);
|
||||
echo $string_r;die;
|
||||
}else{
|
||||
krsort($arr);//数组倒序
|
||||
$reback["data"]=$arr;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//登录验证
|
||||
public function check_login(){
|
||||
$code = $this->input->get('code');
|
||||
$signature = getDingSignature();
|
||||
$urlencode_signature = urlencode($signature);
|
||||
$personInfoUrl = 'https://oapi.dingtalk.com/sns/getuserinfo_bycode?signature='.$urlencode_signature.'×tamp='.time().'&accessKey=dingoaystremzlahfew1tb';
|
||||
$post_data = '{"tmp_auth_code":"'.$code.'"}';
|
||||
$returnJson = GetPost_http($personInfoUrl,$post_data,'json');
|
||||
$returnData = json_decode($returnJson);
|
||||
|
||||
if(!empty($returnData->user_info)){
|
||||
//创建session
|
||||
$this->session->set_userdata('dingname', $returnData->user_info->nick);
|
||||
$this->session->set_userdata('dingunionid', $returnData->user_info->unionid);
|
||||
redirect('http://www.mycht.cn/info.php/apps/trainsystem/pages/');
|
||||
}else{
|
||||
redirect('http://www.mycht.cn/info.php/apps/trainsystem/pages/login');
|
||||
}
|
||||
}
|
||||
|
||||
public function check_session(){
|
||||
print_r($this->session->userdata('dingunionid'));
|
||||
}
|
||||
|
||||
//订单同步到trainsystem
|
||||
public function sync_orders(){
|
||||
die();
|
||||
//获取聚合订单
|
||||
$juhe_orders = $this->train_system_model->getallorders();
|
||||
|
||||
$add_data = new stdClass();
|
||||
foreach ($juhe_orders as $items){
|
||||
$add_data->ordernumber = $items->JOL_JuheOrder;
|
||||
$add_data->cold_sn = $items->JOL_COLD_SN;
|
||||
$add_data->status = $items->JOL_Status;
|
||||
$add_data->returncode = '';
|
||||
$add_data->errormsg = $items->JOL_RebackMsg;
|
||||
$add_data->checi = $items->JOL_TrainCode;
|
||||
$add_data->fromstationame = $items->JOL_FromStation;
|
||||
$add_data->fromstationcode = $items->JOL_FromStationCode;
|
||||
$add_data->tostationame = $items->JOL_ToStation;
|
||||
$add_data->tostationcode = $items->JOL_ToStationCode;
|
||||
|
||||
$trains = json_decode($items->JOL_BackTxt);
|
||||
//print_r($trains->passengers);
|
||||
if(isset($trains->train_date)){
|
||||
$add_data->startdate = $trains->train_date;
|
||||
}else{
|
||||
$add_data->startdate = '';
|
||||
}
|
||||
|
||||
foreach ($trains->passengers as $passengers){
|
||||
//对订票乘客进行存储
|
||||
$data_passager->ordernumber = $items->JOL_JuheOrder;
|
||||
$data_passager->realname = $passengers->passengersename;
|
||||
$data_passager->identitytype = $passengers->passporttypeseidname;
|
||||
$data_passager->numberid = $passengers->passportseno;
|
||||
$data_passager->ticketype = $passengers->piaotypename;
|
||||
$data_passager->ticketprice = $passengers->price;
|
||||
$data_passager->seatype = $passengers->zwname;
|
||||
$data_passager->seatdetail = $passengers->cxin;
|
||||
$data_passager->status = $items->JOL_Status;
|
||||
//print_r($data_passager);
|
||||
$this->train_system_model->add_passagers($data_passager);
|
||||
}
|
||||
|
||||
$add_data->startime = '';
|
||||
$add_data->endtime = '';
|
||||
$add_data->runtime = '';
|
||||
|
||||
$add_data->channel = 'juhe';
|
||||
$add_data->isauto = $items->JOL_IsAuto;
|
||||
$this->train_system_model->add_orders($add_data);
|
||||
//print_r($add_data);
|
||||
}
|
||||
}
|
||||
|
||||
public function update_order(){
|
||||
$juhe_orders = $this->train_system_model->getallorders();
|
||||
foreach ($juhe_orders as $tickets_info){
|
||||
$ordernumber = $tickets_info->JOL_JuheOrder;
|
||||
$subtime = $tickets_info->JOL_SubTime;
|
||||
$price = $tickets_info->JOL_Price;
|
||||
$this->train_system_model->update_juheorder($ordernumber,$subtime,$price);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,320 @@
|
||||
<?php
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class callback extends CI_Controller{
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$this->load->helper('train');
|
||||
$this->load->model("train_system_model");
|
||||
$this->load->model("BIZ_train_model");
|
||||
}
|
||||
|
||||
public function juhecallback(){
|
||||
$data_post = $this->input->post();
|
||||
if(empty($data_post)){
|
||||
header("HTTP/1.1 404 Not Found");
|
||||
exit('{"reason":"empty infos","status":"404"}');
|
||||
}
|
||||
|
||||
//调试代码
|
||||
/*$test_post = '{"data":"{\"from_station_name\":\"\u6b66\u6c49\",\"from_station_code\":\"WHN\",\"to_station_name\":\"\u897f\u5b89\u5317\",\"to_station_code\":\"EAY\",\"train_date\":\"2019-04-13\",\"orderid\":\"JH155317715892154\",\"user_orderid\":\"488123754\",\"orderamount\":\"1363.50\",\"ordernumber\":\"E946949845\",\"checi\":\"G856\",\"msg\":\"\u51fa\u7968\u6210\u529f\",\"status\":\"4\",\"passengers\":[{\"passengerid\":1,\"passengersename\":\"VENOSLEONARDA\",\"piaotype\":\"1\",\"piaotypename\":\"\u6210\u4eba\u7968\",\"passporttypeseid\":\"B\",\"passporttypeseidname\":\"\u62a4\u7167\",\"passportseno\":\"086925694\",\"price\":\"454.5\",\"zwcode\":\"O\",\"zwname\":\"\u4e8c\u7b49\u5ea7\",\"ticket_no\":\"E946949845102006A\",\"cxin\":\"02\u8f66\u53a2,06A\u5ea7\",\"reason\":0},{\"passengerid\":2,\"passengersename\":\"WAGENSTALLERSANDRA\",\"piaotype\":\"1\",\"piaotypename\":\"\u6210\u4eba\u7968\",\"passporttypeseid\":\"B\",\"passporttypeseidname\":\"\u62a4\u7167\",\"passportseno\":\"CF7NR17M7\",\"price\":\"454.5\",\"zwcode\":\"O\",\"zwname\":\"\u4e8c\u7b49\u5ea7\",\"ticket_no\":\"E946949845102006B\",\"cxin\":\"02\u8f66\u53a2,06B\u5ea7\",\"reason\":0},{\"passengerid\":3,\"passengersename\":\"WALDMANNSOPHIE\",\"piaotype\":\"1\",\"piaotypename\":\"\u6210\u4eba\u7968\",\"passporttypeseid\":\"B\",\"passporttypeseidname\":\"\u62a4\u7167\",\"passportseno\":\"CF26Y6FVK\",\"price\":\"454.5\",\"zwcode\":\"O\",\"zwname\":\"\u4e8c\u7b49\u5ea7\",\"ticket_no\":\"E946949845102006C\",\"cxin\":\"02\u8f66\u53a2,06C\u5ea7\",\"reason\":0}],\"refund_money\":null,\"sign\":\"f74013fa24115eeb9a807aa237054920\"}"}';
|
||||
|
||||
$data_post["data"] = json_decode($test_post)->data;*/
|
||||
|
||||
log_message('error','聚合回调:'.json_encode($data_post));
|
||||
$data = json_decode($data_post["data"]);
|
||||
|
||||
$update_data = new StdClass();
|
||||
$update_data->OrderStatus = $data->status;
|
||||
$update_data->ordernumber = $data->orderid;
|
||||
$update_data->OrderTotleFee = $data->orderamount;
|
||||
$update_data->seatsinfo = '';
|
||||
$update_data->TicketCheck = '';
|
||||
$update_data->bookcallback = '';
|
||||
$update_data->confirmcallback = '';
|
||||
$update_data->returncallback = '';
|
||||
$update_data->ElectronicOrderNumber = $data->ordernumber;
|
||||
$update_data->reschedulecallback = '';
|
||||
$update_data->ErrorMsg = $data->msg;
|
||||
|
||||
//如果返回2则发送出票请求
|
||||
if($data->status == "1"){
|
||||
$update_data->bookcallback = $data_post["data"];
|
||||
}elseif($data->status == "2"){
|
||||
$coach = array();
|
||||
$seats = array();
|
||||
$string = '';
|
||||
$passagers = $data->passengers;
|
||||
foreach($passagers as $item){
|
||||
foreach(explode(',',$item->cxin) as $item_seat){
|
||||
if(strpos($item_seat,'车厢')){
|
||||
$item_seat = str_replace('车厢','',$item_seat);
|
||||
array_push($coach,$item_seat);
|
||||
}else{
|
||||
$find = array('座上铺','座中铺','座下铺','座');
|
||||
$replace = array(' upper',' middle',' lower','');
|
||||
$item_seat = str_replace($find,$replace,$item_seat);
|
||||
array_push($seats,$item_seat);
|
||||
}
|
||||
}
|
||||
|
||||
//对订票乘客进行存储
|
||||
$data_passager->ordernumber = $data->orderid;
|
||||
$data_passager->realname = $item->passengersename;
|
||||
$data_passager->identitytype = $item->passporttypeseidname;
|
||||
$data_passager->numberid = $item->passportseno;
|
||||
$data_passager->ticketype = $item->piaotypename;
|
||||
$data_passager->ticketprice = $item->price;
|
||||
$data_passager->seatype = $item->zwname;
|
||||
$data_passager->seatdetail = $item->cxin;
|
||||
$data_passager->status = '4';
|
||||
$this->train_system_model->add_passagers($data_passager);
|
||||
}
|
||||
|
||||
//判断车厢是否唯一,如果不唯一的话,分成两个车厢
|
||||
if(count(array_unique($coach)) == 1){
|
||||
$onlycoach = array_unique($coach);
|
||||
$string .= 'Coach '.$onlycoach[0].',';
|
||||
}else{
|
||||
foreach (array_unique($coach) as $item_coach){
|
||||
$string .= 'Coach '.$item_coach.',';
|
||||
}
|
||||
}
|
||||
|
||||
$string .= 'Seat ';
|
||||
foreach($seats as $item_seat){
|
||||
$string .= $item_seat.',';
|
||||
}
|
||||
|
||||
$seatinfo = substr($string,0,strlen($string)-1);
|
||||
$update_data->seatsinfo = $seatinfo;
|
||||
|
||||
$post_data = array(
|
||||
"key"=>JUHE_TRAIN_API_KEY,
|
||||
"orderid"=>$data->orderid
|
||||
);
|
||||
$back_json = GetPost_http(JUHE_TRAIN_PAY_API,$post_data);
|
||||
$update_data->bookcallback = $data_post["data"];
|
||||
}elseif($data->status == "4"){
|
||||
$add_train_order_data->TOC_Memo = $data->orderid." 聚合出票";
|
||||
$add_train_order_data->TOC_COLD_SN = $data->user_orderid;
|
||||
$add_train_order_data->TOC_TrainNumber = $data->checi;
|
||||
$add_train_order_data->TOC_DepartureDate = $data->train_date;
|
||||
$add_train_order_data->TOC_TicketCost = $data->orderamount;
|
||||
$add_train_order_data->poundage = (count($data->passengers)*2)."";//手续费,每人两块,转换成字符串
|
||||
$add_train_order_data->FOI_TrainNetOrderNo = $data->ordernumber;
|
||||
$this->BIZ_train_model->add_train_payment($add_train_order_data);
|
||||
|
||||
$update_data->confirmcallback = $data_post["data"];
|
||||
$this->BIZ_train_model->update_cold_planvei_sn($data->user_orderid);
|
||||
}elseif($data->status=="7"){
|
||||
//退票成功 写入TOC表
|
||||
$newtime = "";//记录最新操作时间
|
||||
$refund_passportseno = "";//退票人护照号
|
||||
$refund_money = "";//退票金额
|
||||
foreach ($data->passengers as $p) {
|
||||
if(isset($p->returntickets)){
|
||||
$refund_passportseno = $p->refundTimeline[count($p->refundTimeline)-1]->detail->passportseno;
|
||||
$refund_money = $p->refundTimeline[count($p->refundTimeline)-1]->detail->returnmoney;
|
||||
//退票时还需要单独对对每个乘客存储回调信息
|
||||
$passpager_info = new stdClass();
|
||||
$passpager_info->returncallback = $data_post["data"];
|
||||
$passpager_info->status = '7';
|
||||
$passpager_info->ordernumber = $data->orderid;
|
||||
$passpager_info->realname = $p->refundTimeline[count($p->refundTimeline)-1]->detail->passengername;
|
||||
$passpager_info->numberid = $refund_passportseno;
|
||||
print_r($passpager_info);
|
||||
$this->train_system_model->update_passpager_info($passpager_info);
|
||||
|
||||
//添加退款记录
|
||||
$add_train_order_data->TOC_COLD_SN = $data->user_orderid;
|
||||
$add_train_order_data->TOC_Memo = $data->orderid." ".$refund_passportseno;
|
||||
$add_train_order_data->ordernumber = $data->user_orderid;
|
||||
$add_train_order_data->TOC_TrainNumber = $data->checi;
|
||||
$add_train_order_data->TOC_DepartureDate = $data->train_date;
|
||||
$add_train_order_data->TOC_TicketCost = -$refund_money;
|
||||
$add_train_order_data->FOI_TrainNetOrderNo = null;//退票不用更新取票号,以此在模型里面判断是否为退票消息
|
||||
|
||||
$this->BIZ_train_model->add_train_payment($add_train_order_data);
|
||||
}else{
|
||||
//有可能提交了退票或者还没有退票
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$update_data->returncallback = $data_post["data"];
|
||||
}
|
||||
//print_r($update_data);die();
|
||||
//更新订单信息(出票系统)
|
||||
$this->train_system_model->update_orders($update_data);
|
||||
}
|
||||
|
||||
public function ctripcallback(){
|
||||
$back_json = file_get_contents('php://input');
|
||||
log_message('error','携程回调信息:'.$back_json);
|
||||
/*$back_json = '{"Authentication":{"ServiceName":"web.order.returnTicketNotice","PartnerName":"tieyou","TimeStamp":"2019-1-18 11:35:22","MessageIdentity":"93F2BA3253829E8FAD29B5DEB7646A59"},"TrainOrderService":{"contactName":{},"contactMobile":{},"OrderNumber":"guilintravel1547778269","refundTicket":{"childBillId":{},"orderId":"8360041214","eOrderNumber":"EB59937931","eOrderType":"1","seatNumber":"01D\u53f7","passport":"544712454","passportName":"YANGFRANCISCHENG","realName":"YANGFRANCISCHENG","status":"1","reason":"\u9000\u7968\u6210\u529f\uff0c\u9000\u6b3e\u91d1\u989d:218.50\u5143"}}}';*/
|
||||
$ctrip_backdata = json_decode($back_json);
|
||||
//print_r($ctrip_backdata);
|
||||
if(!empty($ctrip_backdata)){
|
||||
$update_data = new stdClass();
|
||||
$update_data->ServiceName = $ctrip_backdata->Authentication->ServiceName;
|
||||
$update_data->ordernumber = '';
|
||||
$update_data->seatsinfo = '';
|
||||
$update_data->TicketCheck = '';
|
||||
$update_data->bookcallback = '';
|
||||
$update_data->confirmcallback = '';
|
||||
$update_data->returncallback = '';
|
||||
$update_data->OrderTotleFee = 0;
|
||||
$update_data->ElectronicOrderNumber = '';
|
||||
$update_data->reschedulecallback = '';
|
||||
|
||||
if($update_data->ServiceName == 'web.order.notifyTicket'){
|
||||
$update_data->OrderStatus = '4';
|
||||
$update_data->ErrorMsg = '出票成功';
|
||||
$update_data->ordernumber = $ctrip_backdata->TrainOrderService->OrderInfo->OrderNumber;
|
||||
$update_data->OrderTotleFee = $ctrip_backdata->TrainOrderService->OrderInfo->OrderTotleFee;
|
||||
$update_data->ElectronicOrderNumber = $ctrip_backdata->TrainOrderService->OrderInfo->ElectronicOrderNumber;
|
||||
|
||||
//新添加检票口信息
|
||||
if(isset($ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->TicketCheck)){
|
||||
if(!is_object($ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->TicketCheck)){
|
||||
$update_data->TicketCheck = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->TicketCheck;
|
||||
}
|
||||
}
|
||||
|
||||
//获取总票数,由于携程接口单人和多人返回的数据结构不一致
|
||||
$person_num = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->TicketCount;
|
||||
|
||||
//存储座位信息 转换为英文
|
||||
$coach_arr = array();
|
||||
$seats_arr = array();
|
||||
$data_passager = new stdClass();
|
||||
$string = '';
|
||||
$i = 0;
|
||||
if($person_num > 1){
|
||||
foreach ($ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->DetailInfos->DetailInfo as $items){
|
||||
if(strpos($items->SeatNo,'车厢')){
|
||||
$coach = mb_substr($items->SeatNo,0,strpos($items->SeatNo,'车厢'));
|
||||
array_push($coach_arr,$coach);
|
||||
$seat = mb_substr($items->SeatNo,strpos($items->SeatNo,'车厢')+2,mb_strlen($items->SeatNo,'UTF8'));
|
||||
$find = array('号');
|
||||
$replace = array('');
|
||||
$seat = str_replace($find,$replace,$seat);
|
||||
array_push($seats_arr,$seat);
|
||||
}
|
||||
|
||||
//对订票乘客进行存储
|
||||
$data_passager->ordernumber = $ctrip_backdata->TrainOrderService->OrderInfo->OrderNumber;
|
||||
$data_passager->realname = $items->PassengerName;
|
||||
$data_passager->identitytype = $items->IdentityType;
|
||||
$data_passager->numberid = $items->NumberID;
|
||||
$data_passager->ticketype = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->TicketType;
|
||||
$data_passager->ticketprice = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->OrderTicketPrice;
|
||||
$data_passager->seatype = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->OrderTicketSeat;
|
||||
$data_passager->seatdetail = $items->SeatNo;
|
||||
$this->train_system_model->add_passagers($data_passager);
|
||||
$i++;
|
||||
}
|
||||
|
||||
}else{
|
||||
$seatinfo_html = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->DetailInfos->DetailInfo->SeatNo;
|
||||
if(strpos($seatinfo_html,'车厢')){
|
||||
$coach = mb_substr($seatinfo_html,0,strpos($seatinfo_html,'车厢'));
|
||||
array_push($coach_arr,$coach);
|
||||
$seat = mb_substr($seatinfo_html,strpos($seatinfo_html,'车厢')+2,mb_strlen($seatinfo_html,'UTF8'));
|
||||
$find = array('号');
|
||||
$replace = array('');
|
||||
$seat = str_replace($find,$replace,$seat);
|
||||
array_push($seats_arr,$seat);
|
||||
}
|
||||
|
||||
//对订票乘客进行存储
|
||||
$data_passager->ordernumber = $ctrip_backdata->TrainOrderService->OrderInfo->OrderNumber;
|
||||
$data_passager->realname = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->DetailInfos->DetailInfo->PassengerName;
|
||||
$data_passager->identitytype = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->DetailInfos->DetailInfo->IdentityType;
|
||||
$data_passager->numberid = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->DetailInfos->DetailInfo->NumberID;
|
||||
$data_passager->ticketype = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->TicketType;
|
||||
$data_passager->ticketprice = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->OrderTicketPrice;
|
||||
$data_passager->seatype = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->OrderTicketSeat;
|
||||
$data_passager->seatdetail = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfoFinal->Tickets->Ticket->DetailInfos->DetailInfo->SeatNo;
|
||||
$this->train_system_model->add_passagers($data_passager);
|
||||
}
|
||||
|
||||
if(count(array_unique($coach_arr)) == 1){
|
||||
$onlycoach = array_unique($coach_arr);
|
||||
$update_data->seatsinfo .= 'Coach '.$onlycoach[0].',';
|
||||
}else{
|
||||
foreach (array_unique($coach_arr) as $item_coach){
|
||||
$update_data->seatsinfo .= 'Coach '.$item_coach.',';
|
||||
}
|
||||
}
|
||||
|
||||
$update_data->seatsinfo .= 'Seat ';
|
||||
foreach($seats_arr as $item_seat){
|
||||
$update_data->seatsinfo .= $item_seat.',';
|
||||
}
|
||||
|
||||
$update_data->seatsinfo = substr($update_data->seatsinfo,0,strlen($update_data->seatsinfo)-1);
|
||||
|
||||
$update_data->bookcallback = $back_json;
|
||||
|
||||
//添加支付记录
|
||||
$add_train_payment_data->TOC_Memo = $update_data->ordernumber;
|
||||
//根据订单号获取cold_sn
|
||||
$order_info = $this->train_system_model->get_order_info($update_data->ordernumber);
|
||||
$cold_sn = $order_info->ts_cold_sn;
|
||||
$add_train_payment_data->TOC_COLD_SN = $cold_sn;
|
||||
$add_train_payment_data->TOC_TrainNumber = $ctrip_backdata->TrainOrderService->OrderInfo->TicketInfo->OrderTicketCheci;
|
||||
$add_train_payment_data->TOC_DepartureDate = date('Y-m-d',strtotime($ctrip_backdata->TrainOrderService->OrderInfo->TicketInfo->OrderTicketYMD));
|
||||
$add_train_payment_data->TOC_TicketCost = $update_data->OrderTotleFee;
|
||||
$add_train_payment_data->poundage = ($person_num*5)."";//手续费,每人五块,转换成字符串
|
||||
$add_train_payment_data->FOI_TrainNetOrderNo = $update_data->ElectronicOrderNumber;
|
||||
//print_r($add_train_order_data);die();
|
||||
$this->BIZ_train_model->add_train_payment($add_train_payment_data);
|
||||
//记录供应商(瀚特)
|
||||
$this->BIZ_train_model->update_cold_planvei_sn($cold_sn);
|
||||
}else if($update_data->ServiceName == 'web.order.notifyNoTicket'){
|
||||
$update_data->ordernumber = $ctrip_backdata->TrainOrderService->OrderInfo->OrderNumber;
|
||||
$update_data->OrderStatus = '1';
|
||||
$update_data->ErrorMsg = $ctrip_backdata->TrainOrderService->OrderInfo->NoTicketReasons;
|
||||
$update_data->confirmcallback = $back_json;
|
||||
}else if($update_data->ServiceName == 'web.order.returnTicketNotice'){
|
||||
$update_data->ordernumber = $ctrip_backdata->TrainOrderService->OrderNumber;
|
||||
$update_data->OrderStatus = '7';
|
||||
$update_data->ErrorMsg = $ctrip_backdata->TrainOrderService->refundTicket->reason;
|
||||
$update_data->returncallback = $back_json;
|
||||
|
||||
//退票时还需要单独对对每个乘客存储回调信息
|
||||
$passpager_info = new stdClass();
|
||||
$passpager_info->returncallback = $back_json;
|
||||
$passpager_info->status = '7';
|
||||
$passpager_info->ordernumber = $ctrip_backdata->TrainOrderService->OrderNumber;
|
||||
$passpager_info->realname = $ctrip_backdata->TrainOrderService->refundTicket->realName;
|
||||
$passpager_info->numberid = $ctrip_backdata->TrainOrderService->refundTicket->passport;
|
||||
$this->train_system_model->update_passpager_info($passpager_info);
|
||||
}else if($update_data->ServiceName == 'web.order.requestRefund'){
|
||||
$return_order = $ctrip_backdata->TrainOrderService->OrderInfo->OrderNumber;
|
||||
$return_money = $ctrip_backdata->TrainOrderService->TotalRefundAmount;
|
||||
|
||||
//根据订单号获取cold_sn
|
||||
$order_info = $this->train_system_model->get_order_info($return_order);
|
||||
$cold_sn = $order_info->ts_cold_sn;
|
||||
//print_r($order_info);
|
||||
|
||||
$add_train_payment_data->TOC_Memo = $return_order.'_'.$ctrip_backdata->TrainOrderService->OrderInfo->OrderTid;
|
||||
$add_train_payment_data->TOC_COLD_SN = $cold_sn;
|
||||
$add_train_payment_data->TOC_TrainNumber = $order_info->ts_checi;
|
||||
$add_train_payment_data->TOC_DepartureDate = $order_info->ts_startdate;
|
||||
$add_train_payment_data->TOC_TicketCost = -$ctrip_backdata->TrainOrderService->TotalRefundAmount;
|
||||
$add_train_payment_data->FOI_TrainNetOrderNo=null;
|
||||
//print_r($add_train_payment_data);die();
|
||||
$this->BIZ_train_model->add_train_payment($add_train_payment_data);
|
||||
return false;
|
||||
}
|
||||
|
||||
//更新订单信息(出票系统)
|
||||
$this->train_system_model->update_orders($update_data);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class orders extends CI_Controller{
|
||||
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
|
||||
}
|
||||
|
||||
public function index(){
|
||||
echo 'orders manager';
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,208 @@
|
||||
<?php
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class pages extends CI_Controller{
|
||||
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$this->load->model("train_system_model");
|
||||
$this->load->model("BIZ_train_model");
|
||||
$this->load->helper('train');
|
||||
$this->order_status_msg = $this->config->item('train_order_status_msg');
|
||||
}
|
||||
|
||||
public function index($coli_id = null){
|
||||
if($this->session->userdata('dingname') == '' && $this->session->userdata('dingunionid') == ''){
|
||||
dingLogin();
|
||||
}
|
||||
if($coli_id == null){
|
||||
$cols_id = $this->input->post("ht_order");
|
||||
}else{
|
||||
$cols_id = $coli_id;
|
||||
}
|
||||
|
||||
$list=new StdClass;
|
||||
if(!empty($cols_id)){
|
||||
$cold_sn = $this->BIZ_train_model->get_biz_cold($cols_id);
|
||||
$list->wl = $this->BIZ_train_model->get_operatorInfo($cols_id);
|
||||
$i=0;
|
||||
$list->info=array();
|
||||
foreach ($cold_sn as $v) {
|
||||
$list->info[$i] = new StdClass;
|
||||
$list->info[$i]->people = $this->BIZ_train_model->biz_people($v->COLD_SN);
|
||||
$list->info[$i]->train = $this->BIZ_train_model->get_biz_foi($v->COLD_SN);
|
||||
$list->info[$i]->status = $this->BIZ_train_model->get_biz_jol($v->COLD_SN);
|
||||
$i++;
|
||||
}
|
||||
$list->cols_id=$cols_id;
|
||||
}
|
||||
|
||||
//查询聚合余额
|
||||
$back_data = GetPost_http("http://op.juhe.cn/trainTickets/balance.php?key=79f03107b921ef31310bd40a1415c1cb");
|
||||
$back_data = json_decode($back_data);
|
||||
if(!empty($back_data->result)){
|
||||
$list->balance = $back_data->result;
|
||||
}else{
|
||||
$list->balance = "NULL";
|
||||
}
|
||||
//print_r($list);
|
||||
$this->load->view('common/header');
|
||||
$this->load->view('homepage',$list);
|
||||
$this->load->view('common/footer');
|
||||
}
|
||||
|
||||
//系统列表页面
|
||||
public function order_list(){
|
||||
if($this->session->userdata('dingname') == '' && $this->session->userdata('dingunionid') == ''){
|
||||
dingLogin();
|
||||
}
|
||||
$page_size = 10;
|
||||
$page = $this->input->get("page");
|
||||
$order = $this->input->get("order");
|
||||
$web_code = $this->input->get("web_code");
|
||||
$where = "1=1";//搜索条件
|
||||
$page_parameter = "";//返回的分页条件参数
|
||||
if(empty($page) or !is_numeric($page)){
|
||||
$page=0;
|
||||
}
|
||||
if(!empty($order)){
|
||||
$where = "BIZ_ConfirmLineInfo.COLI_ID='{$order}' OR InfoManager.dbo.trainsystem.ts_ordernumber='{$order}'";
|
||||
//$where2 = "where BIZ_ConfirmLineInfo.COLI_ID='{$order}' OR JOL_JuheOrder='{$order}'";
|
||||
$list["order"] = $order;
|
||||
$page_parameter = "order=".$order;
|
||||
}
|
||||
if(!empty($web_code)){
|
||||
$where = "BIZ_ConfirmLineInfo.COLI_WebCode='{$web_code}'";
|
||||
$page_parameter = "web_code=".$web_code;
|
||||
}
|
||||
|
||||
//获取订单数据
|
||||
$data = $this->train_system_model->get_order($page_size,$page,$where);
|
||||
//print_r($data);die();
|
||||
$list["data"]=$data->list;
|
||||
|
||||
$this->load->library('pagination');
|
||||
|
||||
$config['base_url'] = site_url("/apps/trainsystem/pages/order_list?{$page_parameter}");
|
||||
$config['total_rows'] = $data->count;
|
||||
$config['per_page'] = $page_size;
|
||||
$config['page_query_string']=TRUE;
|
||||
$config['query_string_segment']="page";
|
||||
$config['cur_tag_open'] = '<li class="active"><a href="#">';
|
||||
$config['cur_tag_close'] = '</a></li>';
|
||||
$config['first_tag_open']=$config['last_tag_open']=$config['next_tag_open']=$config['prev_tag_open']=$config['num_tag_open']="<li>";
|
||||
$config['first_tag_close']=$config['last_tag_close']=$config['next_tag_close']=$config['prev_tag_close']=$config['num_tag_close']="</li>";
|
||||
|
||||
$this->pagination->initialize($config);
|
||||
|
||||
$list["page_link"]=$this->pagination->create_links();
|
||||
|
||||
foreach ($list["data"] as $key => $value) {
|
||||
$value->info = $this->order_status_msg[$value->ts_status];//自定义说明信息;
|
||||
}
|
||||
|
||||
|
||||
$this->load->view('header');
|
||||
$this->load->view('order_list',$list);
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
||||
//订单详情页面
|
||||
public function order(){
|
||||
if($this->session->userdata('dingname') == '' && $this->session->userdata('dingunionid') == ''){
|
||||
dingLogin();
|
||||
}
|
||||
$ordernumber = $order=$this->input->get("order");
|
||||
|
||||
if(empty($ordernumber)){
|
||||
exit('参数错误');
|
||||
}
|
||||
|
||||
//根据订单号查询订单信息
|
||||
$data = array();
|
||||
$train_infos = $this->train_system_model->get_train_infos($ordernumber);
|
||||
$passpager_detail = $this->train_system_model->get_passager_details($ordernumber);
|
||||
|
||||
//构造详情数组
|
||||
$data['status'] = $train_infos->ts_status;
|
||||
$data['ordernumber'] = $train_infos->ts_ordernumber;
|
||||
$data['train_date'] = $train_infos->ts_startdate;
|
||||
$data['checi'] = $train_infos->ts_checi;
|
||||
$data['elecnumber'] = $train_infos->ts_elecnumber;
|
||||
$data['from_station_name'] = $train_infos->ts_fromstationame;
|
||||
$data['from_station_code'] = $train_infos->ts_fromstationcode;
|
||||
$data['to_station_name'] = $train_infos->ts_tostationame;
|
||||
$data['to_station_code'] = $train_infos->ts_tostationcode;
|
||||
$data['start_time'] = $train_infos->ts_startime;
|
||||
$data['arrive_time'] = $train_infos->ts_endtime;
|
||||
$data['channel'] = $train_infos->ts_channel;
|
||||
$data['msg'] = $train_infos->ts_errormsg;
|
||||
$data['passengers'] = $passpager_detail;
|
||||
|
||||
//聚合订单可以查询实时数据
|
||||
if($train_infos->ts_channel == 'juhe'){
|
||||
$post_data=array(
|
||||
"key"=>"79f03107b921ef31310bd40a1415c1cb",
|
||||
"orderid"=>$train_infos->ts_ordernumber
|
||||
);
|
||||
$back_data = GetPost_http("http://op.juhe.cn/trainTickets/orderStatus",$post_data);
|
||||
$data['train_date'] = '';
|
||||
$data['start_time'] = json_decode($back_data)->result->start_time;
|
||||
$data['arrive_time'] = json_decode($back_data)->result->arrive_time;
|
||||
}
|
||||
|
||||
$this->load->view('bootstrap3/header');
|
||||
$this->load->view('order',$data);
|
||||
$this->load->view('bootstrap3/footer');
|
||||
}
|
||||
|
||||
//退票页面
|
||||
public function refund(){
|
||||
if($this->session->userdata('dingname') == '' && $this->session->userdata('dingunionid') == ''){
|
||||
dingLogin();
|
||||
}
|
||||
$ordernumber = $order=$this->input->get("order");
|
||||
|
||||
if(empty($ordernumber)){
|
||||
exit('参数错误');
|
||||
}
|
||||
|
||||
//根据订单号查询订单信息
|
||||
$data = array();
|
||||
$train_infos = $this->train_system_model->get_train_infos($ordernumber);
|
||||
$passpager_detail = $this->train_system_model->get_passager_details($ordernumber);
|
||||
|
||||
//构造详情数组
|
||||
$data['ordernumber'] = $train_infos->ts_ordernumber;
|
||||
$data['cold_sn'] = $train_infos->ts_cold_sn;
|
||||
$data['train_date'] = $train_infos->ts_startdate;
|
||||
$data['checi'] = $train_infos->ts_checi;
|
||||
$data['elecnumber'] = $train_infos->ts_elecnumber;
|
||||
$data['from_station_name'] = $train_infos->ts_fromstationame;
|
||||
$data['from_station_code'] = $train_infos->ts_fromstationcode;
|
||||
$data['to_station_name'] = $train_infos->ts_tostationame;
|
||||
$data['to_station_code'] = $train_infos->ts_tostationcode;
|
||||
$data['start_time'] = $train_infos->ts_startime;
|
||||
$data['arrive_time'] = $train_infos->ts_endtime;
|
||||
$data['channel'] = $train_infos->ts_channel;
|
||||
$data['msg'] = $train_infos->ts_errormsg;
|
||||
$data['return_json'] = $train_infos->ts_returncallback;
|
||||
$data['passengers'] = $passpager_detail;
|
||||
|
||||
//print_r($data);
|
||||
$this->load->view('header');
|
||||
$this->load->view('refund',$data);
|
||||
$this->load->view('footer');
|
||||
|
||||
}
|
||||
|
||||
public function export(){
|
||||
if($this->session->userdata('dingname') == '' && $this->session->userdata('dingunionid') == ''){
|
||||
dingLogin();
|
||||
}
|
||||
$this->load->view('header');
|
||||
$this->load->view('export');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
@ -0,0 +1,153 @@
|
||||
<?php
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class returnorders extends CI_Controller{
|
||||
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$this->load->helper('train');
|
||||
$this->load->model("train_system_model");
|
||||
$this->load->model("Sendmail_model");
|
||||
$this->load->model('BIZ_train_model');
|
||||
}
|
||||
|
||||
public function index(){
|
||||
echo 'return tickets';
|
||||
}
|
||||
|
||||
public function returntickets(){
|
||||
//第三方订单号(为了避免一个子订单乘客分开出票而产生错误)
|
||||
$ordernumber = $this->input->get_post('ordernumber');
|
||||
//护照姓名
|
||||
$passportname = $this->input->get_post('passportname');
|
||||
//护照号
|
||||
$passportno = $this->input->get_post('passportno');
|
||||
|
||||
if(!$ordernumber || !$passportname || !$passportno){
|
||||
header("HTTP/1.1 404 Not Found");
|
||||
exit('{"reason":"传参错误","status":"404"}');
|
||||
}
|
||||
|
||||
//网前提交的姓名没有做处理
|
||||
$passportname = chk_sp_name($passportname);
|
||||
|
||||
$ticket_data = $this->train_system_model->ticketfrom($ordernumber);
|
||||
$passenger_data = $this->train_system_model->get_passenger_info($ordernumber,$passportname,$passportno);
|
||||
|
||||
$channel = $ticket_data->ts_channel;
|
||||
|
||||
if(empty($passenger_data)){
|
||||
exit('乘客信息为空无法退票');
|
||||
}
|
||||
|
||||
switch ($channel){
|
||||
case 'juhe':
|
||||
$this->juheModel($ticket_data,$passenger_data);
|
||||
break;
|
||||
case 'ctrip':
|
||||
$this->ctripModel($ticket_data,$passenger_data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function juheModel($ticket_data,$data){
|
||||
$post_data = array(
|
||||
"key"=>JUHE_TRAIN_API_KEY,
|
||||
"orderid"=>$ticket_data->ts_ordernumber
|
||||
);
|
||||
$back_json = GetPost_http(JUHE_TRAIN_STATUS_API,$post_data);
|
||||
$back_detail_data = json_decode($back_json);
|
||||
//print_r($back_data);die();
|
||||
foreach($back_detail_data->result->passengers as $items){
|
||||
if($items->passengersename == $data->tst_realname && $items->passportseno == $data->tst_numberid){
|
||||
$ticket_no = $items->ticket_no;
|
||||
}
|
||||
}
|
||||
|
||||
//发起退票
|
||||
$post_data1 = array(
|
||||
"key"=>JUHE_TRAIN_API_KEY,
|
||||
"orderid"=>$ticket_data->ts_ordernumber,
|
||||
"tickets"=>'[{"ticket_no":"'.$ticket_no.'","passengername":"'.$data->tst_realname.'","passporttypeseid":"'.strexchangeid($data->tst_ticketype).'","passportseno":"'.$data->tst_numberid.'"}]',
|
||||
);
|
||||
//print_r($post_data1);die();
|
||||
$back_json = GetPost_http(JUHE_TRAIN_REFUND_API,$post_data1);
|
||||
//print_r($post_data1);
|
||||
|
||||
log_message('error','聚合退票:'.$ticket_data->ts_ordernumber.'|'.$back_json);
|
||||
$back_data = json_decode($back_json);
|
||||
|
||||
if($back_data->error_code == '0'){
|
||||
//退票成功后发送一封邮件
|
||||
$fromName = 'trainsystem';
|
||||
$fromEmail = 'cyc@hainatravel.com';
|
||||
$coli_id = $this->BIZ_train_model->cold_sn_get_coli_id($ticket_data->ts_cold_sn);
|
||||
$coli_id = $coli_id['0']->COLI_ID;
|
||||
$info = $this->BIZ_train_model->get_operatorInfo($coli_id);
|
||||
$toName = $info[0]->OPI_Name;
|
||||
$toEmail = $info[0]->OPI_Email;
|
||||
$subject = '退票请求';
|
||||
$body = $back_detail_data->result->ordernumber.' 提出退票,乘客:'.$data->tst_realname.', '.$back_detail_data->result->start_time.' '.$back_detail_data->result->checi;
|
||||
$this->Sendmail_model->SendMailToTable($fromName,$fromEmail,$toName,$toEmail,$subject,$body);
|
||||
echo '{"reason":"退票成功","status":"200"}';
|
||||
}else{
|
||||
header("HTTP/1.1 404 Not Found");
|
||||
echo '{"reason":"退票失败","status":"404"}';
|
||||
}
|
||||
}
|
||||
|
||||
function ctripModel($ticket_data,$passenger_data){
|
||||
$PostData = array();
|
||||
$TimeStamp = time();
|
||||
$time = date('Y-m-d H:i:s',$TimeStamp);
|
||||
$PostData['Authentication']->TimeStamp = $time;
|
||||
$PostData['Authentication']->ServiceName = 'order.ticketReturn';
|
||||
$PostData['Authentication']->PartnerName = ORDERUSER;
|
||||
$MessageIdentity = md5($time.'order.ticketReturn'.ORDERKEY);
|
||||
$PostData['Authentication']->MessageIdentity = $MessageIdentity;
|
||||
|
||||
$PostData['TrainOrderService']->contactName = '陈宇超';
|
||||
$PostData['TrainOrderService']->contactMobile = '18877381547';
|
||||
$PostData['TrainOrderService']->OrderNumber = $ticket_data->ts_ordernumber;
|
||||
$PostData['TrainOrderService']->OperatorType = '0';
|
||||
$PostData['TrainOrderService']->TicketInfo = '';
|
||||
$PostData['TrainOrderService']->TicketInfo = array();
|
||||
|
||||
$i = 0;
|
||||
$PostData['TrainOrderService']->TicketInfo[$i]['eOrderNumber'] = $passenger_data->ts_elecnumber;
|
||||
if($passenger_data->tst_ticketype == '儿童票'){
|
||||
$PostData['TrainOrderService']->TicketInfo[$i]['eOrderType'] = '2';
|
||||
}else{
|
||||
$PostData['TrainOrderService']->TicketInfo[$i]['eOrderType'] = '1';
|
||||
}
|
||||
$PostData['TrainOrderService']->TicketInfo[$i]['seatNumber'] = $passenger_data->tst_seatdetail;
|
||||
$PostData['TrainOrderService']->TicketInfo[$i]['passportName'] = $passenger_data->tst_realname;
|
||||
$PostData['TrainOrderService']->TicketInfo[$i]['passport'] = $passenger_data->tst_numberid;
|
||||
$PostData['TrainOrderService']->TicketInfo[$i]['realName'] = $passenger_data->tst_realname;
|
||||
|
||||
//发起退票请求
|
||||
$Url = 'http://m.ctrip.com/restapi/soa2/11009/json/PartnerReturnTicket';
|
||||
$ResponseJson = GetPost_http($Url,json_encode($PostData),'POST');
|
||||
$ResponseData = json_decode($ResponseJson);
|
||||
|
||||
if($ResponseData->Status == 'SUCCESS'){
|
||||
$fromName = 'trainsystem';
|
||||
$fromEmail = 'cyc@hainatravel.com';
|
||||
$coli_id = $this->BIZ_train_model->cold_sn_get_coli_id($ticket_data->ts_cold_sn);
|
||||
$coli_id = $coli_id['0']->COLI_ID;
|
||||
$info = $this->BIZ_train_model->get_operatorInfo($coli_id);
|
||||
$toName = $info[0]->OPI_Name;
|
||||
$toEmail = $info[0]->OPI_Email;
|
||||
$subject = '退票请求';
|
||||
$body = '乘客:'.$data->tst_realname.' 对订单:'.$data->ts_ordernumber.'发起退票请求!!!';
|
||||
$this->Sendmail_model->SendMailToTable($fromName,$fromEmail,$toName,$toEmail,$subject,$body);
|
||||
echo '{"reason":"退票成功","status":"200"}';
|
||||
}else{
|
||||
header("HTTP/1.1 404 Not Found");
|
||||
echo '{"reason":"退票失败","status":"404"}';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
//途牛接口创建请求签名
|
||||
function create_sign(){
|
||||
$time = date('Y-m-d H:i:s',time());
|
||||
$secretKey = 'qvHMJVywEQqsd4EneHQl';
|
||||
$id = 'retailId25';
|
||||
$timeStamp = 'timestamp'.$time;
|
||||
$sign = $secretKey.$id.'apiKey'.TUNIU_KEY.$timeStamp.$secretKey;
|
||||
return strtoupper(md5($sign));
|
||||
}
|
||||
|
||||
//证件名称转id
|
||||
function strexchangeid($name){
|
||||
if($name != ''){
|
||||
switch ($name){
|
||||
case '二代身份证':
|
||||
return '1';
|
||||
break;
|
||||
case '护照':
|
||||
return 'B';
|
||||
break;
|
||||
case '台湾通行证':
|
||||
return 'G';
|
||||
break;
|
||||
case '港澳通行证':
|
||||
return 'C';
|
||||
break;
|
||||
default :
|
||||
return 'B';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//特殊字符转换
|
||||
function chk_sp_name($name){
|
||||
$name = str_replace(
|
||||
array('á', 'é', 'è', 'í', 'ó', 'ú', '?', 'á', 'é', 'í', 'ó', 'ú', '?',' ','/',' ',','),
|
||||
array('a', 'e', 'e', 'i', 'o', 'u', 'n', 'A', 'E', 'I', 'O', 'U', 'N','','','',''),
|
||||
$name
|
||||
);
|
||||
return substr(strtoupper($name),0,30);
|
||||
}
|
||||
|
||||
//发送请求函数
|
||||
function GetPost_http($url, $data = '',$format='') {
|
||||
if(!isset($_SERVER['HTTP_USER_AGENT'])){
|
||||
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.104 Safari/537.36 Core/1.53.2372.400 QQBrowser/9.5.10548.400';
|
||||
}
|
||||
$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 (!empty($data)) {
|
||||
curl_setopt($curl, CURLOPT_POST, 1); // 发送一个常规的Post请求
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $data); // Post提交的数据包
|
||||
if($format == 'json'){
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
|
||||
}
|
||||
}
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, 40); // 设置超时限制防止死循环
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT_MS, 40000); // 设置超时限制防止死循环
|
||||
curl_setopt($curl, CURLOPT_HEADER, 0); // 显示返回的Header区域内容
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // 获取的信息以文件流的形式返回
|
||||
$tmpInfo = curl_exec($curl); // 执行操作
|
||||
$errno = curl_errno($curl);
|
||||
if ($errno !== 0) {
|
||||
log_message('error', 'ctripost'.$errno.curl_error($curl));
|
||||
}
|
||||
curl_close($curl); //关闭CURL会话
|
||||
return $tmpInfo; //返回数据
|
||||
}
|
||||
|
||||
function getDingSignature(){
|
||||
$timestamp = time();
|
||||
$signature = hash_hmac('sha256',$timestamp,'emCK5vYFJc-HtMNNgbyGpmbYaNyPkNXn_ayoFd6q2m6rpljhxBn2JQEx9gy8H6DQ',true);
|
||||
$signature = base64_encode($signature);
|
||||
return $signature;
|
||||
}
|
||||
|
||||
function dingLogin(){
|
||||
redirect('https://oapi.dingtalk.com/connect/oauth2/sns_authorize?appid=dingoaystremzlahfew1tb&response_type=code&scope=snsapi_login&state=STATE&redirect_uri=http://www.mycht.cn/info.php/apps/trainsystem/api/check_login');
|
||||
}
|
||||
|
||||
|
||||
?>
|
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
class Des
|
||||
{
|
||||
|
||||
function encrypt($string,$key)
|
||||
{
|
||||
$size = mcrypt_get_block_size('des','ecb');
|
||||
//$string = mb_convert_encoding($string, 'GBK', 'UTF-8');
|
||||
$string = $this->pkcs5_pad($string, $size);
|
||||
$td = mcrypt_module_open('des', '', 'ecb', '');
|
||||
$iv = @mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
|
||||
@mcrypt_generic_init($td, $key, $iv);
|
||||
$data = mcrypt_generic($td, $string);
|
||||
mcrypt_generic_deinit($td);
|
||||
mcrypt_module_close($td);
|
||||
$data = base64_encode($data);
|
||||
return $data;
|
||||
}
|
||||
|
||||
function decrypt($string,$key)
|
||||
{
|
||||
$string = base64_decode($string);
|
||||
$td = mcrypt_module_open('des', '', 'ecb', '');
|
||||
//使用MCRYPT_DES算法,cbc模式
|
||||
$iv = @mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
|
||||
$ks = mcrypt_enc_get_key_size($td);
|
||||
@mcrypt_generic_init($td, $key, $iv);
|
||||
//初始处理
|
||||
$decrypted = mdecrypt_generic($td, $string);
|
||||
//解密
|
||||
mcrypt_generic_deinit($td);
|
||||
//结束
|
||||
mcrypt_module_close($td);
|
||||
|
||||
$result = $this->pkcs5_unpad($decrypted);
|
||||
//$result = mb_convert_encoding($result, 'UTF-8', 'GBK');
|
||||
return $result;
|
||||
}
|
||||
|
||||
function pkcs5_pad($text, $blocksize)
|
||||
{
|
||||
$pad = $blocksize - (strlen($text) % $blocksize);
|
||||
return $text . str_repeat(chr($pad), $pad);
|
||||
}
|
||||
|
||||
function pkcs5_unpad($text)
|
||||
{
|
||||
$pad = ord($text{strlen($text) - 1});
|
||||
if ($pad > strlen($text)) {
|
||||
return false;
|
||||
}
|
||||
if (strspn($text, chr($pad), strlen($text) - $pad) != $pad) {
|
||||
return false;
|
||||
}
|
||||
return substr($text, 0, -1 * $pad);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -0,0 +1,157 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Sendmail_model extends CI_Model {
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->HT = $this->load->database('HT', TRUE);
|
||||
}
|
||||
|
||||
function SendMailToTable($fromName,$fromEmail,$toName,$toEmail,$subject,$body)
|
||||
{
|
||||
$time = date('Y-m-d H:i:s',time());
|
||||
if($this->validEmail($toEmail))
|
||||
{
|
||||
$data = array(
|
||||
"M_ReplyToName" => $fromName, //回复人
|
||||
"M_ReplyToEmail" => $fromEmail, //回复地址
|
||||
"M_ToName" => $toName, //收件人名
|
||||
"M_ToEmail" => $toEmail, //收件邮件地址
|
||||
"M_Title" => $subject, //主题
|
||||
"M_Body" => $body, //邮件正文
|
||||
"M_Web" => "CHT", //所属站点
|
||||
"M_FromName" => "Chinahighlights.com", //站点名称
|
||||
"M_State" => 0,
|
||||
"M_AddTime" => $time
|
||||
);
|
||||
$this->HT->insert('Email_AutomaticSend',$data);
|
||||
$m_sn = $this->HT->insert_id('Email_AutomaticSend');
|
||||
return $m_sn;
|
||||
}else{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
function SendMailToTabletest($fromName,$fromEmail,$toName,$toEmail,$subject,$body)
|
||||
{
|
||||
$time = date('Y-m-d H:i:s',time());
|
||||
if($this->validEmail($toEmail))
|
||||
{
|
||||
$data = array(
|
||||
"M_ReplyToName" => $fromName, //回复人
|
||||
"M_ReplyToEmail" => $fromEmail, //回复地址
|
||||
"M_ToName" => $toName, //收件人名
|
||||
"M_ToEmail" => $toEmail, //收件邮件地址
|
||||
"M_Title" => $subject, //主题
|
||||
"M_Body" => $body, //邮件正文
|
||||
"M_Web" => "CHT", //所属站点
|
||||
"M_FromName" => "Chinahighlights.com", //站点名称
|
||||
"M_State" => 0,
|
||||
"M_AddTime" => $time,
|
||||
);
|
||||
$this->HT->insert('Email_AutomaticSend',$data);
|
||||
$m_sn = $this->HT->insert_id('Email_AutomaticSend');
|
||||
return $m_sn;
|
||||
}else{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function validEmail($email){
|
||||
$isValid = true;
|
||||
$atIndex = strrpos($email, "@");
|
||||
if (is_bool($atIndex) && !$atIndex){
|
||||
$isValid = false;
|
||||
}else{
|
||||
$domain = substr($email, $atIndex+1);
|
||||
$local = substr($email, 0, $atIndex);
|
||||
$localLen = strlen($local);
|
||||
$domainLen = strlen($domain);
|
||||
$domain = str_replace(' ','',$domain);
|
||||
if ($localLen < 1 || $localLen > 64){
|
||||
// local part length exceeded
|
||||
$isValid = false;
|
||||
}else if ($domainLen < 1 || $domainLen > 255){
|
||||
// domain part length exceeded
|
||||
$isValid = false;
|
||||
}else if ($local[0] == '.' || $local[$localLen-1] == '.'){
|
||||
// local part starts or ends with '.'
|
||||
$isValid = false;
|
||||
}else if (preg_match('/\\.\\./', $local)){
|
||||
// local part has two consecutive dots
|
||||
$isValid = false;
|
||||
}else if (!preg_match('/^[A-Za-z0-9\\-\\.]+$/', $domain)){
|
||||
// character not valid in domain part
|
||||
$isValid = false;
|
||||
}else if (preg_match('/\\.\\./', $domain)){
|
||||
// domain part has two consecutive dots
|
||||
$isValid = false;
|
||||
}else if(!preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/',str_replace("\\\\","",$local))){
|
||||
// character not valid in local part unless
|
||||
// local part is quoted
|
||||
if (!preg_match('/^"(\\\\"|[^"])+"$/',str_replace("\\\\","",$local))){
|
||||
$isValid = false;
|
||||
}
|
||||
}
|
||||
/*
|
||||
不检查是否有DNS解析
|
||||
if ($isValid && !(checkdnsrr($domain,"MX") || checkdnsrr($domain,"A"))){
|
||||
// domain not found in DNS
|
||||
$isValid = false;
|
||||
}
|
||||
*/
|
||||
}
|
||||
return $isValid;
|
||||
}
|
||||
|
||||
public function validEmailtest($email){
|
||||
$isValid = true;
|
||||
$atIndex = strrpos($email, "@");
|
||||
if (is_bool($atIndex) && !$atIndex){
|
||||
$isValid = false;
|
||||
}else{
|
||||
$domain = substr($email, $atIndex+1);
|
||||
$local = substr($email, 0, $atIndex);
|
||||
$localLen = strlen($local);
|
||||
$domainLen = strlen($domain);
|
||||
$domain = str_replace(' ','',$domain);
|
||||
print_r(preg_match('/^[A-Za-z0-9\\-\\.]+$/', $domain));
|
||||
if ($localLen < 1 || $localLen > 64){
|
||||
// local part length exceeded
|
||||
$isValid = false;
|
||||
}else if ($domainLen < 1 || $domainLen > 255){
|
||||
// domain part length exceeded
|
||||
$isValid = false;
|
||||
}else if ($local[0] == '.' || $local[$localLen-1] == '.'){
|
||||
// local part starts or ends with '.'
|
||||
$isValid = false;
|
||||
}else if (preg_match('/\\.\\./', $local)){
|
||||
// local part has two consecutive dots
|
||||
$isValid = false;
|
||||
}else if (!preg_match('/^[A-Za-z0-9\\-\\.]+$/', $domain)){
|
||||
// character not valid in domain part
|
||||
$isValid = false;
|
||||
}else if (preg_match('/\\.\\./', $domain)){
|
||||
// domain part has two consecutive dots
|
||||
$isValid = false;
|
||||
}else if(!preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/',str_replace("\\\\","",$local))){
|
||||
// character not valid in local part unless
|
||||
// local part is quoted
|
||||
if (!preg_match('/^"(\\\\"|[^"])+"$/',str_replace("\\\\","",$local))){
|
||||
$isValid = false;
|
||||
}
|
||||
}
|
||||
/*
|
||||
不检查是否有DNS解析
|
||||
if ($isValid && !(checkdnsrr($domain,"MX") || checkdnsrr($domain,"A"))){
|
||||
// domain not found in DNS
|
||||
$isValid = false;
|
||||
}
|
||||
*/
|
||||
}
|
||||
return $isValid;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,267 @@
|
||||
<?php
|
||||
|
||||
class train_system_model extends CI_Model {
|
||||
private $order="";//订单号
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->HT = $this->load->database('HT', TRUE);
|
||||
$this->INFO = $this->load->database('INFO', TRUE);
|
||||
}
|
||||
|
||||
public function get_order($pagesize=2,$page=0,$where="1=1"){
|
||||
$data=new StdClass();
|
||||
//获取总条数
|
||||
$sql="SELECT COUNT(*) AS count FROM InfoManager.dbo.trainsystem
|
||||
LEFT JOIN
|
||||
BIZ_ConfirmLineInfo
|
||||
ON
|
||||
BIZ_ConfirmLineInfo.COLI_SN=(SELECT COLD_COLI_SN FROM BIZ_ConfirmLineDetail WHERE COLD_SN = InfoManager.dbo.trainsystem.ts_cold_sn)
|
||||
WHERE
|
||||
{$where}
|
||||
";
|
||||
$query = $this->HT->query($sql);
|
||||
$count=$query->result();
|
||||
$data->count=$count[0]->count;
|
||||
|
||||
$sql="SELECT TOP {$pagesize} InfoManager.dbo.trainsystem.ts_subtime,
|
||||
InfoManager.dbo.trainsystem.ts_cold_sn,
|
||||
InfoManager.dbo.trainsystem.ts_ordernumber,
|
||||
InfoManager.dbo.trainsystem.ts_status,
|
||||
InfoManager.dbo.trainsystem.ts_errormsg,
|
||||
InfoManager.dbo.trainsystem.ts_fromstationame,
|
||||
InfoManager.dbo.trainsystem.ts_tostationame,
|
||||
InfoManager.dbo.trainsystem.ts_checi,
|
||||
InfoManager.dbo.trainsystem.ts_orderamount,
|
||||
InfoManager.dbo.trainsystem.ts_isauto,
|
||||
InfoManager.dbo.trainsystem.ts_sendmail,
|
||||
InfoManager.dbo.trainsystem.ts_m_sn,
|
||||
InfoManager.dbo.trainsystem.ts_channel,
|
||||
BIZ_ConfirmLineInfo.COLI_ID,
|
||||
BIZ_ConfirmLineInfo.COLI_WebCode
|
||||
FROM
|
||||
InfoManager.dbo.trainsystem
|
||||
LEFT JOIN
|
||||
BIZ_ConfirmLineInfo
|
||||
ON
|
||||
BIZ_ConfirmLineInfo.COLI_SN=(SELECT COLD_COLI_SN FROM BIZ_ConfirmLineDetail WHERE COLD_SN = InfoManager.dbo.trainsystem.ts_cold_sn)
|
||||
WHERE
|
||||
InfoManager.dbo.trainsystem.ts_id NOT IN(
|
||||
SELECT
|
||||
TOP {$page} ts_id
|
||||
FROM
|
||||
InfoManager.dbo.trainsystem
|
||||
LEFT JOIN
|
||||
BIZ_ConfirmLineInfo
|
||||
ON
|
||||
BIZ_ConfirmLineInfo.COLI_SN=(SELECT COLD_COLI_SN FROM BIZ_ConfirmLineDetail WHERE COLD_SN = InfoManager.dbo.trainsystem.ts_cold_sn)
|
||||
where {$where}
|
||||
ORDER BY ts_subtime DESC)
|
||||
AND
|
||||
{$where}
|
||||
ORDER BY InfoManager.dbo.trainsystem.ts_subtime DESC";
|
||||
|
||||
$query = $this->HT->query($sql);
|
||||
$data->list=$query->result();
|
||||
return $data;
|
||||
|
||||
}
|
||||
|
||||
//获取指定订单信息
|
||||
public function get_passager_details($ordernumber){
|
||||
$sql = "select * from trainsystem_tickets where tst_ordernumber = '{$ordernumber}'";
|
||||
$query = $this->INFO->query($sql);
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
//获取火车信息
|
||||
public function get_train_infos($ordernumber){
|
||||
$sql = "select * from trainsystem where ts_ordernumber = '{$ordernumber}'";
|
||||
$query = $this->INFO->query($sql);
|
||||
return $query->row();
|
||||
}
|
||||
|
||||
public function update_passpager_status($status,$passagerid){
|
||||
$sql = "update trainsystem_tickets set tst_status = '{$status}' where tst_id = '{$passagerid}'";
|
||||
$query = $this->INFO->query($sql);
|
||||
}
|
||||
|
||||
//添加订单
|
||||
function add_orders($data){
|
||||
$sql="
|
||||
INSERT INTO trainsystem(
|
||||
ts_cold_sn,
|
||||
ts_ordernumber,
|
||||
ts_subtime,
|
||||
ts_returncode,
|
||||
ts_status,
|
||||
ts_errormsg,
|
||||
ts_fromstationame,
|
||||
ts_fromstationcode,
|
||||
ts_tostationame,
|
||||
ts_tostationcode,
|
||||
ts_startdate,
|
||||
ts_startime,
|
||||
ts_endtime,
|
||||
ts_runtime,
|
||||
ts_checi,
|
||||
ts_channel,
|
||||
ts_isauto
|
||||
)
|
||||
VALUES(
|
||||
'{$data->cold_sn}',
|
||||
'{$data->ordernumber}',
|
||||
getdate(),
|
||||
'{$data->returncode}',
|
||||
'{$data->status}',
|
||||
'{$data->errormsg}',
|
||||
'{$data->fromstationame}',
|
||||
'{$data->fromstationcode}',
|
||||
'{$data->tostationame}',
|
||||
'{$data->tostationcode}',
|
||||
'{$data->startdate}',
|
||||
'{$data->startime}',
|
||||
'{$data->endtime}',
|
||||
'{$data->runtime}',
|
||||
'{$data->checi}',
|
||||
'{$data->channel}',
|
||||
'{$data->isauto}'
|
||||
)
|
||||
";
|
||||
//echo $sql;
|
||||
$query = $this->INFO->query($sql);
|
||||
}
|
||||
|
||||
public function ticketfrom($ts_ordernumber){
|
||||
$sql = "select ts_channel,ts_cold_sn,ts_ordernumber from trainsystem where ts_ordernumber = ?";
|
||||
$query = $this->INFO->query($sql,array($ts_ordernumber));
|
||||
return $query->row();
|
||||
}
|
||||
|
||||
public function get_passenger_info($ordernumber,$passportname,$passportno){
|
||||
$sql = "select * from trainsystem_tickets left join trainsystem on tst_ordernumber = ts_ordernumber where tst_realname = ? and tst_numberid = ? and tst_ordernumber = ?";
|
||||
$query = $this->INFO->query($sql,array($passportname,$passportno,$ordernumber));
|
||||
return $query->row();
|
||||
}
|
||||
|
||||
function add_passagers($data){
|
||||
$sql = "IF EXISTS (select * from trainsystem_tickets where tst_ordernumber = '{$data->ordernumber}' and tst_numberid = '{$data->numberid}')
|
||||
update
|
||||
trainsystem_tickets
|
||||
set
|
||||
tst_identitytype = '{$data->identitytype}',
|
||||
tst_numberid = '{$data->numberid}',
|
||||
tst_ticketype = '{$data->ticketype}',
|
||||
tst_ticketprice = '{$data->ticketprice}',
|
||||
tst_seatstype = '{$data->seatype}',
|
||||
tst_seatdetail = '{$data->seatdetail}',
|
||||
tst_status = '{$data->status}'
|
||||
where
|
||||
tst_ordernumber = '{$data->ordernumber}'
|
||||
and
|
||||
tst_numberid = '{$data->numberid}'
|
||||
else
|
||||
INSERT INTO trainsystem_tickets (
|
||||
tst_ordernumber,
|
||||
tst_status,
|
||||
tst_realname,
|
||||
tst_identitytype,
|
||||
tst_numberid,
|
||||
tst_ticketype,
|
||||
tst_ticketprice,
|
||||
tst_seatstype,
|
||||
tst_seatdetail
|
||||
)VALUES(
|
||||
'{$data->ordernumber}',
|
||||
'{$data->status}',
|
||||
'{$data->realname}',
|
||||
'{$data->identitytype}',
|
||||
'{$data->numberid}',
|
||||
'{$data->ticketype}',
|
||||
'{$data->ticketprice}',
|
||||
'{$data->seatype}',
|
||||
'{$data->seatdetail}'
|
||||
)
|
||||
";
|
||||
$query =$this->INFO->query($sql);
|
||||
}
|
||||
|
||||
public function update_orders($data){
|
||||
$where = '';
|
||||
if(!empty($data->bookcallback)){
|
||||
$where .= "
|
||||
ts_seatsinfo = '{$data->seatsinfo}',
|
||||
ts_checkdoor = '{$data->TicketCheck}',
|
||||
ts_elecnumber = '{$data->ElectronicOrderNumber}',
|
||||
ts_orderamount = '{$data->OrderTotleFee}',
|
||||
ts_bookcallback = '{$data->bookcallback}',";
|
||||
}else if(!empty($data->confirmcallback)){
|
||||
$where .= "ts_confirmcallback = '{$data->confirmcallback}',";
|
||||
}else if(!empty($data->returncallback)){
|
||||
$where .= "ts_returncallback = '{$data->returncallback}',";
|
||||
}else if(!empty($data->reschedulecallback)){
|
||||
$where .= "ts_reschedulecallback = '{$data->reschedulecallback}',";
|
||||
}
|
||||
$sql ="
|
||||
update trainsystem
|
||||
set
|
||||
ts_status = '{$data->OrderStatus}',
|
||||
ts_errormsg = '{$data->ErrorMsg}',
|
||||
".substr($where,0,strlen($where)-1)."
|
||||
where
|
||||
ts_ordernumber = '{$data->ordernumber}'
|
||||
";
|
||||
//echo $sql;die();
|
||||
$query = $this->INFO->query($sql);
|
||||
}
|
||||
|
||||
//更新乘客表信息
|
||||
public function update_passpager_info($data){
|
||||
$sql = "update
|
||||
trainsystem_tickets
|
||||
set
|
||||
tst_status = '{$data->status}',
|
||||
tst_returncallback = '{$data->returncallback}',
|
||||
tst_lasteditdate = getdate()
|
||||
where
|
||||
tst_ordernumber = '{$data->ordernumber}'
|
||||
and
|
||||
tst_realname = '{$data->realname}'
|
||||
and
|
||||
tst_numberid = '{$data->numberid}'
|
||||
";
|
||||
$query = $this->INFO->query($sql);
|
||||
}
|
||||
|
||||
public function get_tickets_info($cold_sn){
|
||||
$sql = "select ts_cold_sn,ts_ordernumber,tst_realname,tst_numberid,tst_status from trainsystem left join trainsystem_tickets on ts_ordernumber = tst_ordernumber where ts_cold_sn = ? and ts_status = '4'";
|
||||
$query = $this->INFO->query($sql,array($cold_sn));
|
||||
//$sql = "select * from BIZ_JuheOrderList where JOL_COLD_SN = ? and jol_status = '4'";
|
||||
//$query = $this->HT->query($sql,array($cold_sn));
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
public function getallorders(){
|
||||
$sql = "select * from Tourmanager.dbo.BIZ_JuheOrderList where JOL_SubTime > '2019-03-01' and (JOL_Status = '4' or JOL_Status = '7')";
|
||||
$query = $this->HT->query($sql);
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
public function update_juheorder($ordernumber,$subtime,$price){
|
||||
$sql = "update trainsystem set ts_subtime = ? , ts_orderamount = ? where ts_ordernumber = ?";
|
||||
$query = $this->INFO->query($sql,array($subtime,$price,$ordernumber));
|
||||
}
|
||||
|
||||
//根据cold_sn 获取出票情况
|
||||
public function get_ticketinfos($cold_sn){
|
||||
$sql = "select * from trainsystem where ts_cold_sn = ? and ts_status = '4'";
|
||||
$query = $this->INFO->query($sql,array($cold_sn));
|
||||
return $query->row();
|
||||
}
|
||||
|
||||
|
||||
public function test(){
|
||||
$sql = "delete from trainsystem where ts_cold_sn = '488121613_1552637689'";
|
||||
$query = $this->INFO->query($sql);
|
||||
}
|
||||
}
|
@ -0,0 +1,131 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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>
|
||||
<link rel="shortcut icon" href="/bootstrap/img/glyphicons_290_skull.png">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<nav class="navbar navbar-inverse">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-9" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/"><span class="glyphicon glyphicon-home text-white"></span></a>
|
||||
</div>
|
||||
|
||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-9">
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="<?php echo site_url(''); ?>">信息管理</a></li>
|
||||
<li><a href="<?php echo site_url('product') ?>">产品管理</a></li>
|
||||
<li><a href="<?php echo site_url('author'); ?>">作者平台</a></li>
|
||||
<li><a href="<?php echo site_url('keyworlds') ?>">关键词</a></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
更多<b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="<?php echo site_url('seo') ?>">SEO管理</a></li>
|
||||
<li> <a href="<?php echo site_url('thirdparty/public/infopayauthor') ?>">打赏统计</a></li>
|
||||
<li> <a href="<?php echo site_url('thirdparty/form') ?>">表单管理</a></li>
|
||||
<li><a href="<?php echo site_url('thirdparty/advertise') ?>">广告管理</a></li>
|
||||
<li><a href="<?php echo site_url('setting') ?>">系统设置</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<form id="form_information_search" name="form_information_search" method="post" action="<?php echo $this->router->class == 'infoshare' ? site_url('infoshare/search/') : site_url('welcome/search/'); ?>" class="navbar-form navbar-left" >
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">
|
||||
<input type="checkbox" title="全文搜索" name="all_text_search" id="all_text_search" value="true" >
|
||||
</span>
|
||||
<input type="text" class="form-control input-sm" name="keywords" id="keywords" value="<?php echo isset($keywords) ? $keywords : false; ?>" style="min-width:450px;">
|
||||
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default btn-sm" type="submit">搜索</button>
|
||||
<a href="#" onclick="openKCFinder_fast();" class="btn btn-default btn-sm" title="快速上传图片" ><span class="glyphicon glyphicon-picture"></span></a>
|
||||
<a href="#" title="静态化更新" class="btn btn-default btn-sm" data-toggle="modal" data-target="#cache_refresh_modal" ><span class="glyphicon glyphicon-repeat"></span></a>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<?php
|
||||
$all_unread_sms = get_all_unread_sms();
|
||||
$info_unread_sms = get_all_unread_sms('info');
|
||||
if (isset($information->ic_id))
|
||||
$current_msg = $information->ic_id;
|
||||
if (isset($task->t_id))
|
||||
$current_msg = $task->t_id;
|
||||
$total_count = $all_unread_sms['sms_count'] + $info_unread_sms['sms_count']; //计算未读消息总数
|
||||
$unread_sms_ic_id = 0; //用于设置所有收录消息为已读
|
||||
if ($total_count != 0) {
|
||||
?>
|
||||
<!-- 如果当前页面存在未读消息,则消息数减一 -->
|
||||
<?php
|
||||
if (isset($current_msg) && isset($all_unread_sms['sms'][$current_msg])) {
|
||||
$total_count = $total_count - count($all_unread_sms['sms'][$current_msg]);
|
||||
unset($all_unread_sms['sms'][$current_msg]);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (isset($current_msg) && isset($info_unread_sms['sms'][$current_msg])) {
|
||||
$total_count = $total_count - count($info_unread_sms['sms'][$current_msg]);
|
||||
unset($info_unread_sms['sms'][$current_msg]);
|
||||
}
|
||||
?>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="icon-envelope icon-white pull-left" style="margin-top:3px;"></i> <span class="badge badge-important pull-right"><?php echo $total_count; ?></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<!-- 信息平台的消息 -->
|
||||
<?php if (isset($info_unread_sms['sms']) && !empty($info_unread_sms['sms'])) { ?>
|
||||
<a style="padding-left:20px;" href="javascript:void(0);" onclick="set_allmsg_to_read($('#unreadinfomsg').val());">标记全部收录信息为已读</a>
|
||||
<li class="divider"></li>
|
||||
<?php foreach ($info_unread_sms['sms'] as $m) { ?>
|
||||
<li><a href="<?php echo site_url('information/edit/' . $m[0]->is_id); ?>"><?php
|
||||
$t_title = get_text_short($m[0]->t_title, 15);
|
||||
echo '[' . $m[0]->ic_sitecode . '] ' . $t_title['content'] . ' (' . $m[0]->m_content . ')';
|
||||
?></a></li>
|
||||
<?php $unread_sms_ic_id.=',' . $m[0]->m_object_id; ?>
|
||||
<?php } ?>
|
||||
<li class="divider"></li>
|
||||
<input type="hidden" name="unreadinfomsg" id="unreadinfomsg" value="<?php echo $unread_sms_ic_id; ?>">
|
||||
<?php } ?>
|
||||
<!--作者平台的消息-->
|
||||
<?php foreach ($all_unread_sms['sms'] as $am) { ?>
|
||||
<li><a href="<?php echo site_url('author/edit_task/' . $am[0]->m_object_id); ?>"><?php
|
||||
$t_title = get_text_short($am[0]->t_title, 15);
|
||||
echo $t_title['content'] . ' (' . count($am) . ')';
|
||||
?></a></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<?php
|
||||
echo $this->config->item('site_code');
|
||||
echo ' -';
|
||||
$admin_info = $this->session->userdata('session_admin');
|
||||
echo $admin_info['OPI_Name'];
|
||||
?>
|
||||
<b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<?php foreach ($this->config->item('site') as $site_item) { ?>
|
||||
<li> <a href="<?php echo site_url('login/change_site/' . $site_item['site_code']); ?>" ><?php echo $site_item['site_code'] ?></a></li>
|
||||
<?php } ?>
|
||||
<li><a href="<?php echo site_url('login/out'); ?>" >退出</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title></title></head><body><p style="font-family:Verdana, Geneva, sans-serif; font-size:14px; line-height:24px; margin-bottom:12px;">Dear <?php echo $toname?>,</p><p style="font-family:Verdana, Geneva, sans-serif; font-size:14px; line-height:24px; margin-bottom:12px;"> Thank you for your booking (order number <?php echo $coli_id?>), we have received your payment of USD<?php echo $price->GAI_SQJE?>. </p><p style="font-family:Verdana, Geneva, sans-serif; font-size:14px; line-height:24px; margin-bottom:12px;"> Due to the heavy traffic flow of data, the system failed to automatically issue your ticket(s).</p><p style="font-family:Verdana, Geneva, sans-serif; font-size:14px; line-height:24px; margin-bottom:12px;">Your travel advisor will purchase your train ticket(s) manually. You will receive an email within half a working day (Our time now: <strong><?php echo date('H:i').' '.date('a');?></strong>, <?php echo date('D');?>,<?php echo date('F').' '.date('d').','.date('Y');?> GMT+8).Should you have any questions or concerns with regards to your train booking, please do not hesitate to contact me at <a href="mailto:<?php echo $emailarr[0]?>"><?php echo $emailarr[0]?></a>;<a href="mailto:<?php echo $emailarr[1]?>"><?php echo $emailarr[1]?></a> or telephone <?php echo $operator[0]->tel;?>. </p>
|
||||
<?php foreach($train_info as $item){
|
||||
echo '<table border="0" cellspacing="0" cellpadding="0" width="60%">';
|
||||
echo '<tr><th width="17%" style="font-family:Verdana, Geneva, sans-serif;font-size:14px; color:#a31022; background:#e6e6e6; text-align:left; padding:10px;">Train No. </th>';
|
||||
echo '<td width="83%" style="font-family:Verdana, Geneva, sans-serif;font-size:14px; text-align:left; padding:10px; border-bottom:1px solid #d1d1d1;">'.$item->FlightsNo.'</td></tr>';
|
||||
echo '<tr><th style="font-family:Verdana, Geneva, sans-serif; font-size:14px; color:#a31022; background:#e6e6e6; text-align:left; padding:10px;">Departure </th>';
|
||||
echo '<td style="font-family:Verdana, Geneva, sans-serif; font-size:14px; text-align:left; padding:10px; border-bottom:1px solid #d1d1d1;">'.$item->DepartureTime.', '.$item->DepartureCity.' Station(in Chinese '.$item->DepartAirport_cn.'火车站) </td></tr>';
|
||||
echo '<tr><th style="font-family:Verdana, Geneva, sans-serif; font-size:14px; color:#a31022; background:#e6e6e6; text-align:left; padding:10px;">Arrival </th><td style="font-family:Verdana, Geneva, sans-serif; font-size:14px; text-align:left; padding:10px; border-bottom:1px solid #d1d1d1;">'.$item->ArrivalTime.', '.$item->ArrivalCity.'(in Chinese'. $item->ArrivalAirport_cn.'火车站) </td></tr>';
|
||||
echo '<tr><th style="font-family:Verdana, Geneva, sans-serif; font-size:14px; color:#a31022; background:#e6e6e6; text-align:left; padding:10px;">Class </th><td style="font-family:Verdana, Geneva, sans-serif; font-size:14px; text-align:left; padding:10px; border-bottom:1px solid #d1d1d1;">'.$item->Cabin.'</td></tr>';
|
||||
echo '<tr><th style="font-family:Verdana, Geneva, sans-serif; font-size:14px; color:#a31022; background:#e6e6e6; text-align:left; padding:10px;">Passenger(s) </th>';
|
||||
echo '<td style="font-family:Verdana, Geneva, sans-serif; font-size:14px; text-align:left; padding:10px; border-bottom:1px solid #d1d1d1;">';
|
||||
if($adult>0){echo $adult.' adult(s)<br/> ';}
|
||||
if($chlid>0){echo $chlid.' chlid(s)<br/> ';}
|
||||
if($baby>0){echo $baby.' baby(s)<br/> ';}
|
||||
$i=0;
|
||||
foreach($allpeople as $item){
|
||||
echo ++$i.'.'.$item->BPE_FirstName.$item->BPE_MiddleName.$item->BPE_LastName.' , passport number '.$item->BPE_Passport.'<br>';
|
||||
}
|
||||
echo '</tr></table>';
|
||||
echo '<p style="font-family:Verdana, Geneva, sans-serif; font-size:14px; line-height:24px; margin-bottom:12px;">Regards <br />';
|
||||
echo $operator[0]->Name.'<br/>Travel Advisor<br/>';
|
||||
echo 'Telephone: (Office)'.$operator[0]->tel.', M: '.$operator[0]->Mobile.',';
|
||||
echo 'Email: <a href="mailto:'.$emailarr[0].'">'.$emailarr[0].'</a>;<a href="mailto:'.$emailarr[1].'">'.$emailarr[1].'</a>; </p>';
|
||||
}?>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,156 @@
|
||||
<?php // 代码各服务器已经同步 2016.06.01 ycc ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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>
|
||||
<link rel="shortcut icon" href="/bootstrap/img/glyphicons_290_skull.png">
|
||||
<script language="javascript">
|
||||
//快速图片上传
|
||||
function openKCFinder_fast() {
|
||||
window.CallBack = oopenKCFinder_fast_callback;
|
||||
window.open('/media/popselectpicture.php?site_code=<?php echo $this->config->item('site_code'); ?>&site_lgc=<?php echo $this->config->item('site_lgc'); ?>', 'kcfinder_textbox', 'status=0, toolbar=0, location=0, menubar=0, directories=0,resizable=1, scrollbars=0, width=800, height=600');
|
||||
}
|
||||
|
||||
function oopenKCFinder_fast_callback(result) {
|
||||
var site_image_url = '<?php echo $this->config->item('site_image_url') ?>';
|
||||
if (result != null && result.Pinfo[0]) {
|
||||
$.modaldialog.success("图片地址:<br/>" + site_image_url + result.Pinfo[0].PUrl);
|
||||
}
|
||||
}
|
||||
//标识所有信息未已读
|
||||
function set_allmsg_to_read(ic_ids) {
|
||||
var url = '<?php echo site_url("author/set_msg_to_read"); ?>';
|
||||
$.post(url, {'msg_ids': ic_ids}, function(result) {
|
||||
window.location.href = window.location.href;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
<nav class="navbar navbar-inverse">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-9" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/"><span class="glyphicon glyphicon-home text-white"></span></a>
|
||||
</div>
|
||||
|
||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-9">
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="<?php echo site_url(''); ?>">信息管理</a></li>
|
||||
<li><a href="<?php echo site_url('product') ?>">产品管理</a></li>
|
||||
<li><a href="<?php echo site_url('author'); ?>">作者平台</a></li>
|
||||
<li><a href="<?php echo site_url('keyworlds') ?>">关键词</a></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
更多<b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="<?php echo site_url('seo') ?>">SEO管理</a></li>
|
||||
<li> <a href="<?php echo site_url('thirdparty/public/infopayauthor') ?>">打赏统计</a></li>
|
||||
<li> <a href="<?php echo site_url('thirdparty/form') ?>">表单管理</a></li>
|
||||
<li><a href="<?php echo site_url('thirdparty/advertise') ?>">广告管理</a></li>
|
||||
<li><a href="<?php echo site_url('setting') ?>">系统设置</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<form id="form_information_search" name="form_information_search" method="post" action="<?php echo $this->router->class == 'infoshare' ? site_url('infoshare/search/') : site_url('welcome/search/'); ?>" class="navbar-form navbar-left" >
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">
|
||||
<input type="checkbox" title="全文搜索" name="all_text_search" id="all_text_search" value="true" >
|
||||
</span>
|
||||
<input type="text" class="form-control input-sm" name="keywords" id="keywords" value="<?php echo isset($keywords) ? $keywords : false; ?>" style="min-width:450px;">
|
||||
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default btn-sm" type="submit">搜索</button>
|
||||
<a href="#" onclick="openKCFinder_fast();" class="btn btn-default btn-sm" title="快速上传图片" ><span class="glyphicon glyphicon-picture"></span></a>
|
||||
<a href="#" title="静态化更新" class="btn btn-default btn-sm" data-toggle="modal" data-target="#cache_refresh_modal" ><span class="glyphicon glyphicon-repeat"></span></a>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<?php
|
||||
$all_unread_sms = get_all_unread_sms();
|
||||
$info_unread_sms = get_all_unread_sms('info');
|
||||
if (isset($information->ic_id))
|
||||
$current_msg = $information->ic_id;
|
||||
if (isset($task->t_id))
|
||||
$current_msg = $task->t_id;
|
||||
$total_count = $all_unread_sms['sms_count'] + $info_unread_sms['sms_count']; //计算未读消息总数
|
||||
$unread_sms_ic_id = 0; //用于设置所有收录消息为已读
|
||||
if ($total_count != 0) {
|
||||
?>
|
||||
<!-- 如果当前页面存在未读消息,则消息数减一 -->
|
||||
<?php
|
||||
if (isset($current_msg) && isset($all_unread_sms['sms'][$current_msg])) {
|
||||
$total_count = $total_count - count($all_unread_sms['sms'][$current_msg]);
|
||||
unset($all_unread_sms['sms'][$current_msg]);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (isset($current_msg) && isset($info_unread_sms['sms'][$current_msg])) {
|
||||
$total_count = $total_count - count($info_unread_sms['sms'][$current_msg]);
|
||||
unset($info_unread_sms['sms'][$current_msg]);
|
||||
}
|
||||
?>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="icon-envelope icon-white pull-left" style="margin-top:3px;"></i> <span class="badge badge-important pull-right"><?php echo $total_count; ?></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<!-- 信息平台的消息 -->
|
||||
<?php if (isset($info_unread_sms['sms']) && !empty($info_unread_sms['sms'])) { ?>
|
||||
<a style="padding-left:20px;" href="javascript:void(0);" onclick="set_allmsg_to_read($('#unreadinfomsg').val());">标记全部收录信息为已读</a>
|
||||
<li class="divider"></li>
|
||||
<?php foreach ($info_unread_sms['sms'] as $m) { ?>
|
||||
<li><a href="<?php echo site_url('information/edit/' . $m[0]->is_id); ?>"><?php
|
||||
$t_title = get_text_short($m[0]->t_title, 15);
|
||||
echo '[' . $m[0]->ic_sitecode . '] ' . $t_title['content'] . ' (' . $m[0]->m_content . ')';
|
||||
?></a></li>
|
||||
<?php $unread_sms_ic_id.=',' . $m[0]->m_object_id; ?>
|
||||
<?php } ?>
|
||||
<li class="divider"></li>
|
||||
<input type="hidden" name="unreadinfomsg" id="unreadinfomsg" value="<?php echo $unread_sms_ic_id; ?>">
|
||||
<?php } ?>
|
||||
<!--作者平台的消息-->
|
||||
<?php foreach ($all_unread_sms['sms'] as $am) { ?>
|
||||
<li><a href="<?php echo site_url('author/edit_task/' . $am[0]->m_object_id); ?>"><?php
|
||||
$t_title = get_text_short($am[0]->t_title, 15);
|
||||
echo $t_title['content'] . ' (' . count($am) . ')';
|
||||
?></a></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<?php
|
||||
echo $this->config->item('site_code');
|
||||
echo ' -';
|
||||
$admin_info = $this->session->userdata('session_admin');
|
||||
echo $admin_info['OPI_Name'];
|
||||
?>
|
||||
<b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<?php foreach ($this->config->item('site') as $site_item) { ?>
|
||||
<li> <a href="<?php echo site_url('login/change_site/' . $site_item['site_code']); ?>" ><?php echo $site_item['site_code'] ?></a></li>
|
||||
<?php } ?>
|
||||
<li><a href="<?php echo site_url('login/out'); ?>" >退出</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
@ -0,0 +1,64 @@
|
||||
<script type="text/javascript" src="https://data.chinahighlights.com/js/train/StationInfo.js"></script>
|
||||
<div style="width:90%;margin:30px auto;">
|
||||
<div class="panel panel-primary" style="width:60%;margin:0 auto;">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><?php echo $train_date;?> <?php echo $checi;?> <?php echo isset($elecnumber)?$elecnumber:"";?></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php if((int)$status>1):?>
|
||||
<p style="display:inline-block"><?php echo $from_station_name;?><span class="from_station_en"> </span><br><span class="start_time"></span></p><span class="glyphicon glyphicon-arrow-right"> </span><p style="display:inline-block"> <?php echo $to_station_name;?><span class="to_station_en"> </span><br><span class="arrive_time"></span></p>
|
||||
<?php foreach ($passengers as $v):?>
|
||||
<p style="border-top:1px dashed #000; height:1px;margin-top:10px;" ></p>
|
||||
<p><?php echo @$v->tst_realname."({$v->tst_identitytype}) {$v->tst_seatstype} {$v->tst_seatdetail} 票价:¥{$v->tst_ticketprice}";?></p>
|
||||
<?php endforeach;?>
|
||||
<?php if((int)$status === 4):?>
|
||||
<p style="border-top:1px dashed #000; height:1px;margin-top:10px;" ></p>
|
||||
<p>出票成功</p>
|
||||
<p style="border-top:1px dashed #000; height:1px;margin-top:10px;" ></p>
|
||||
<p style="text-align:center;"><a href="refund?order=<?php echo $ordernumber?>" style="padding:5px 15px;" class="btn btn-warning btn-sm">前往退票 <span class="glyphicon glyphicon-forward"></span></a></p>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if((int)$status === 6):?>
|
||||
<p style="border-top:1px dashed #000; height:1px;margin-top:10px;" ></p>
|
||||
<p>正在处理退票</p>
|
||||
<p style="text-align:center;"><a href="refund?order=<?php echo $ordernumber?>" style="padding:5px 15px;" class="btn btn-warning btn-sm">查看详情 <span class="glyphicon glyphicon-forward"></span></a></p>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if((int)$status === 7):?>
|
||||
<p style="border-top:1px dashed #000; height:1px;margin-top:10px;" ></p>
|
||||
<p><?php echo $msg;?></p>
|
||||
<p style="text-align:center;"><a href="refund?order=<?php echo $ordernumber?>" style="padding:5px 15px;" class="btn btn-warning btn-sm">查看详情 <span class="glyphicon glyphicon-forward"></span></a></p>
|
||||
<?php endif;?>
|
||||
<?php else:?>
|
||||
<p><?php echo $msg;?></p>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var StationInfoArr = StationInfo.split("@");
|
||||
var StationNameArr = new Array();
|
||||
var code_name = new Array();
|
||||
var station_cn_en = new Array();
|
||||
var form_data = {};
|
||||
for (var i = 0; i < StationInfoArr.length; ++i) {
|
||||
StationNameArr.push(StationInfoArr[i].split("|"));
|
||||
code_name[StationNameArr[i][1]] = [StationNameArr[i][2]];
|
||||
station_cn_en[StationNameArr[i][3]] = StationNameArr[i][2];
|
||||
}
|
||||
console.log(station_cn_en);
|
||||
$(function(){
|
||||
var from_station_en = code_name['<?php echo $from_station_code?>'];
|
||||
var to_station_en = code_name['<?php echo $to_station_code?>'];
|
||||
var start_date = '<?php echo $train_date?>';
|
||||
var start_time = '<?php echo $start_time?>';
|
||||
var arrive_time = '<?php echo $arrive_time?>';
|
||||
|
||||
//console.log(code_name);
|
||||
$('.from_station_en').html('('+from_station_en+') ');
|
||||
$('.to_station_en').html('('+to_station_en+')');
|
||||
$('.start_time').html('('+start_date+' '+start_time+')');
|
||||
$('.arrive_time').html('('+start_date+' '+arrive_time+')');
|
||||
});
|
||||
</script>
|
||||
|
@ -0,0 +1,101 @@
|
||||
<div style="width:90%;margin:30px auto;">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">订单搜索</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<form style="" action="" method="get">
|
||||
<div class="col-md-6">
|
||||
<input class="form-control" type="text" placeholder="汉特订单号或聚合订单号" name="order" value="<?php echo !empty($order)?"$order":"";?>" autocomplete="off">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<select class="form-control" name="web_code">
|
||||
<option value ="分站点查询,默认商旅" disabled="disabled" selected>分站点查询,默认全站</option>
|
||||
<option value ="CHT">商旅</option>
|
||||
<option value ="jp">日本</option>
|
||||
<option value="train_vac">西班牙</option>
|
||||
<option value="train_it">意大利</option>
|
||||
<option value="train_ru">俄罗斯</option>
|
||||
<option value="train_vc">法国</option>
|
||||
</select>
|
||||
</div>
|
||||
<!--<div class="col-md-5">
|
||||
<input type="text" name="from_date" class="date" value="" class="">
|
||||
至
|
||||
<input type="text" name="to_date" class="date" value="">
|
||||
</div>-->
|
||||
<div class="col-md-5">
|
||||
<button type="submit" id="sub" class="btn btn-success btn-sm"><span class="glyphicon glyphicon-search"></span> 搜索</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">订单列表</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<table class="table table-striped" style="text-align:center;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align:center;">序号</th>
|
||||
<th style="text-align:center;">汉特订单号(商家订单号)</th>
|
||||
<th style="text-align:center;">聚合订单号</th>
|
||||
<th style="text-align:center;">车次</th>
|
||||
<th style="text-align:center;">出发</th>
|
||||
<th style="text-align:center;">到达</th>
|
||||
<th style="text-align:center;">状态</th>
|
||||
<th style="text-align:center;">价格</th>
|
||||
<th style="text-align:center;">提交时间</th>
|
||||
<th style="text-align:center;">所属部门</th>
|
||||
<th style="text-align:center;">渠道</th>
|
||||
<th style="text-align:center;">出票方式</th>
|
||||
<th style="text-align:center;">是否发送邮件</th>
|
||||
<th style="text-align:center;">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $num=0; foreach($data as $v):?>
|
||||
<tr>
|
||||
<td><?php echo ++$num;?></td>
|
||||
<td><?php echo $v->COLI_ID.'('.$v->ts_cold_sn.')';?></td>
|
||||
<td><?php echo $v->ts_ordernumber;?></td>
|
||||
<td><?php echo $v->ts_checi;?></td>
|
||||
<td><?php echo $v->ts_fromstationame;?></td>
|
||||
<td><?php echo $v->ts_tostationame;?></td>
|
||||
<td><?php echo $v->info;?></td>
|
||||
<td><?php echo $v->ts_orderamount;?></td>
|
||||
<td><?php echo $v->ts_subtime;?></td>
|
||||
<td><?php echo $v->COLI_WebCode;?></td>
|
||||
<td><?php echo $v->ts_channel;?></td>
|
||||
<?php
|
||||
if($v->ts_isauto == 1){
|
||||
echo '<td>自动</td>';
|
||||
}elseif($v->ts_isauto == 0){
|
||||
echo '<td>手动</td>';
|
||||
}elseif($v->ts_isauto == 3){
|
||||
echo '<td>抢票</td>';
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if($v->ts_sendmail == 1){
|
||||
if($v->ts_m_sn){
|
||||
echo '<td><a target="_blank" href="http://www.mycht.cn/info.php/apps/train/index/get_mailinfo/'.$v->ts_m_sn.'">是</a></td>';
|
||||
}else{
|
||||
echo '<td>是</td>';
|
||||
}
|
||||
}else{
|
||||
echo '<td>否</td>';
|
||||
}
|
||||
?>
|
||||
<td><a target="_blank" href="order?order=<?php echo $v->ts_ordernumber;?>">详情</a></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div style="text-align:right;"><ul class="pagination"><?php echo $page_link;?></ul></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,48 @@
|
||||
<div style="width:90%;margin:30px auto;">
|
||||
<div class="panel panel-primary" style="width:60%;margin:0 auto;">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><?php echo $train_date;?> <?php echo $checi;?> <?php echo isset($elecnumber)?$elecnumber:"";?></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php
|
||||
foreach ($passengers as $items){
|
||||
echo '<p>'.$from_station_name.'<span class="glyphicon glyphicon-arrow-right"></span>'.$to_station_name.'</p>';
|
||||
echo '<p style="border-top:1px dashed #000; height:1px;margin-top:10px;" ></p>';
|
||||
echo '<p>'.$items->tst_realname.'('.$items->tst_ticketype.') '.$items->tst_seatstype.' '.$items->tst_seatdetail.' 票价:¥'.$items->tst_ticketprice.'</p>';
|
||||
if((int)$items->tst_status != 7){
|
||||
echo '<p>';
|
||||
echo '<a href="###" style="padding:5px 15px;" class="btn btn-warning btn-sm returnticket" name="'.$items->tst_realname.'" passid="'.$items->tst_numberid.'"><span class="glyphicon glyphicon-remove"></span>退票</a>';
|
||||
echo '</p>';
|
||||
}else{
|
||||
$info = json_decode($items->tst_returncallback);
|
||||
echo '<p><table class="table table-bordered table-hover" style="text-align:center;"><tr><th colspan="2" style="text-align:center;">退票处理</th></tr>';
|
||||
echo '<tr><td>'.$items->tst_lasteditdate.'</td>';
|
||||
echo '<tr><td>'.$msg.'</td></tr></table></p>';
|
||||
}
|
||||
}?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function(){
|
||||
$('.returnticket').click(function(){
|
||||
var url = <?php echo "'http://www.mycht.cn/info.php/apps/trainsystem/returnorders/returntickets?ordernumber=$ordernumber'"?>;
|
||||
var return_ticket = $(this);
|
||||
name = $(this).attr('name');
|
||||
passid = $(this).attr('passid');
|
||||
url += '&passportname='+name+'&passportno='+passid;
|
||||
//console.log(url);return false;
|
||||
$.ajax({
|
||||
url:url,
|
||||
success:function(json){
|
||||
alert('请求成功,正在处理退票...');
|
||||
return_ticket.html('退票成功');
|
||||
},
|
||||
error:function(json){
|
||||
alert('请求失败,请重新请求...');
|
||||
return_ticket.html('退票失败');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
File diff suppressed because it is too large
Load Diff
@ -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>
|
||||
|
||||
<span class="checkbox">
|
||||
<label>
|
||||
<input type="radio" name="amp" value="no" <?php if($amp == 'no') echo('checked'); ?>> 显示未转换AMP的信息
|
||||
</label>
|
||||
</span>
|
||||
|
||||
<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>
|
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue