|
- <?php
- /*
- Author:XM
- Compeny:Spiders Travel
- */
- if(empty($_SERVER['APPLICATION_ENV']) || $_SERVER['APPLICATION_ENV']=='production') {
- defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'production');
- } else {
- defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'dev');
- }
- $getDbConfig = require dirname(dirname(__DIR__)).'/config/dbConfig/db.'.APPLICATION_ENV.'.config.php';
- $config = $getDbConfig['CST'];
- define("MYSQL_HOST", $config['host']);
- define("MYSQL_USER", $config['user']);
- define("MYSQL_PASSWORD", $config['pwd']);
- define("MYSQL_DB", $config['db']);
- define("MYSQL_PORT", $config['port']);
- define("ZIZAI_DISNEY_CODE", "DSNTEST" );
-
-
- $_ary_pay_type = array(
- "1" => "微信支付"
- );
-
- $_ary_tickets_type = array(
- "0" => "成人",
- "1" => "老人",
- "2" => "儿童"
- );
-
- $_ary_goods_type = array(
- "1" => "往返接驳票",
- "2" => "迪尼斯门票",
- "3" => "狮子王演出票",
- "4" => "千岛湖至上海",
- "5" => "上海至千岛湖"
- );
-
- $_ary_disney_price1 = array(499,375,375);
- $_ary_disney_price2 = array(950,710,710);
-
- $_ary_goods_price = array( "15" => 30 );
- $_ary_ticket_price1 = array( "0" => 50 );
- $_ary_ticket_price2 = array( "0" => 50 );
-
- //is phone or pc?
- function isMobile() {
- if (isset ($_SERVER['HTTP_X_WAP_PROFILE'])) { return true;}
- if (isset ($_SERVER['HTTP_VIA'])) {return stristr($_SERVER['HTTP_VIA'], "wap") ? true : false;}
- if (isset ($_SERVER['HTTP_USER_AGENT'])) {
- $clientkeywords = array ('nokia','sony','ericsson','mot','samsung','htc','sgh','lg','sharp','sie-','philips','panasonic','alcatel','lenovo','iphone','ipod','blackberry','meizu','android','netfront','symbian','ucweb','windowsce','palm','operamini','operamobi','openwave','nexusone','cldc','midp','wap','mobile');
- if (preg_match("/(" . implode('|', $clientkeywords) . ")/i", strtolower($_SERVER['HTTP_USER_AGENT']))){
- return true;
- }
- }
- if (isset ($_SERVER['HTTP_ACCEPT'])){
- if ((strpos($_SERVER['HTTP_ACCEPT'], 'vnd.wap.wml') !== false) && (strpos($_SERVER['HTTP_ACCEPT'], 'text/html') === false || (strpos($_SERVER['HTTP_ACCEPT'], 'vnd.wap.wml') < strpos($_SERVER['HTTP_ACCEPT'], 'text/html')))){
- return true;
- }
- }
- return false;
- }
-
- $user_agent = isset($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : "";
- $page_name = basename($_SERVER['PHP_SELF']);
- $ip = $_SERVER["REMOTE_ADDR"];
- $is_smartphone = isMobile();
- if( $is_smartphone == false ) {
- if( $page_name != "login.php" && $page_name != "logine.php" && $page_name != "org_list.php" && $page_name != "order_list.php" && $page_name != "order_list_ex.php" && $page_name != "update_order_comment.php"
- && $page_name != "order_details.php" && $page_name != "disney_pay_callback.php") {
- if (isset($_COOKIE["opera_user_id"]) && $_COOKIE["opera_user_id"] != "") {
- $opera_user_id = $_COOKIE["opera_user_id"];
- setcookie("opera_user_id", $opera_user_id, time() + 3600 * 24 * 365);
- $_COOKIE["opera_user_id"] = $opera_user_id;
- $cookie_cc = $_COOKIE["companycode"];
- setcookie("companycode", $cookie_cc, time() + 3600 * 24 * 365);
- $_COOKIE["companycode"] = $cookie_cc;
- } else {
- header("Location:http://wx.zhizhuchuxing.com/disneydetial2/login.php");
- }
- }
- } else {
- if ($page_name == "top.php" || $page_name == "list.php" || $page_name == "list_qdh.php") {
- if (isset($_GET["cc"])) {
- setcookie("companycode", $_GET["cc"], time() + 3600 * 24 * 365);
- $_COOKIE["companycode"] = $_GET["cc"];
- } else {
- $cookie_cc = $_COOKIE["companycode"];
- setcookie("companycode", $cookie_cc, time() + 3600 * 24 * 365);
- $_COOKIE["companycode"] = $cookie_cc;
- }
- } else {
- $cookie_cc = $_COOKIE["companycode"];
- setcookie("companycode", $cookie_cc, time() + 3600 * 24 * 365);
- $_COOKIE["companycode"] = $cookie_cc;
- }
- }
|