You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

98 lines
3.9 KiB

  1. <?php
  2. /*
  3. Author:XM
  4. Compeny:Spiders Travel
  5. */
  6. if(empty($_SERVER['APPLICATION_ENV']) || $_SERVER['APPLICATION_ENV']=='production') {
  7. defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'production');
  8. } else {
  9. defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'dev');
  10. }
  11. $getDbConfig = require dirname(dirname(__DIR__)).'/config/dbConfig/db.'.APPLICATION_ENV.'.config.php';
  12. $config = $getDbConfig['CST'];
  13. define("MYSQL_HOST", $config['host']);
  14. define("MYSQL_USER", $config['user']);
  15. define("MYSQL_PASSWORD", $config['pwd']);
  16. define("MYSQL_DB", $config['db']);
  17. define("MYSQL_PORT", $config['port']);
  18. define("ZIZAI_DISNEY_CODE", "DSNTEST" );
  19. $_ary_pay_type = array(
  20. "1" => "微信支付"
  21. );
  22. $_ary_tickets_type = array(
  23. "0" => "成人",
  24. "1" => "老人",
  25. "2" => "儿童"
  26. );
  27. $_ary_goods_type = array(
  28. "1" => "往返接驳票",
  29. "2" => "迪尼斯门票",
  30. "3" => "狮子王演出票",
  31. "4" => "千岛湖至上海",
  32. "5" => "上海至千岛湖"
  33. );
  34. $_ary_disney_price1 = array(499,375,375);
  35. $_ary_disney_price2 = array(950,710,710);
  36. $_ary_goods_price = array( "15" => 30 );
  37. $_ary_ticket_price1 = array( "0" => 50 );
  38. $_ary_ticket_price2 = array( "0" => 50 );
  39. //is phone or pc?
  40. function isMobile() {
  41. if (isset ($_SERVER['HTTP_X_WAP_PROFILE'])) { return true;}
  42. if (isset ($_SERVER['HTTP_VIA'])) {return stristr($_SERVER['HTTP_VIA'], "wap") ? true : false;}
  43. if (isset ($_SERVER['HTTP_USER_AGENT'])) {
  44. $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');
  45. if (preg_match("/(" . implode('|', $clientkeywords) . ")/i", strtolower($_SERVER['HTTP_USER_AGENT']))){
  46. return true;
  47. }
  48. }
  49. if (isset ($_SERVER['HTTP_ACCEPT'])){
  50. 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')))){
  51. return true;
  52. }
  53. }
  54. return false;
  55. }
  56. $user_agent = isset($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : "";
  57. $page_name = basename($_SERVER['PHP_SELF']);
  58. $ip = $_SERVER["REMOTE_ADDR"];
  59. $is_smartphone = isMobile();
  60. if( $is_smartphone == false ) {
  61. 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"
  62. && $page_name != "order_details.php" && $page_name != "disney_pay_callback.php") {
  63. if (isset($_COOKIE["opera_user_id"]) && $_COOKIE["opera_user_id"] != "") {
  64. $opera_user_id = $_COOKIE["opera_user_id"];
  65. setcookie("opera_user_id", $opera_user_id, time() + 3600 * 24 * 365);
  66. $_COOKIE["opera_user_id"] = $opera_user_id;
  67. $cookie_cc = $_COOKIE["companycode"];
  68. setcookie("companycode", $cookie_cc, time() + 3600 * 24 * 365);
  69. $_COOKIE["companycode"] = $cookie_cc;
  70. } else {
  71. header("Location:http://wx.zhizhuchuxing.com/disneydetial2/login.php");
  72. }
  73. }
  74. } else {
  75. if ($page_name == "top.php" || $page_name == "list.php" || $page_name == "list_qdh.php") {
  76. if (isset($_GET["cc"])) {
  77. setcookie("companycode", $_GET["cc"], time() + 3600 * 24 * 365);
  78. $_COOKIE["companycode"] = $_GET["cc"];
  79. } else {
  80. $cookie_cc = $_COOKIE["companycode"];
  81. setcookie("companycode", $cookie_cc, time() + 3600 * 24 * 365);
  82. $_COOKIE["companycode"] = $cookie_cc;
  83. }
  84. } else {
  85. $cookie_cc = $_COOKIE["companycode"];
  86. setcookie("companycode", $cookie_cc, time() + 3600 * 24 * 365);
  87. $_COOKIE["companycode"] = $cookie_cc;
  88. }
  89. }