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.
 
 
 
 
 

94 lines
3.6 KiB

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