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.
 
 
 
 
 
 

158 lines
6.2 KiB

  1. <?php
  2. /*
  3. require_once './php_include/Config.php';
  4. require_once './php_include/class.db.inc';
  5. require_once './php_include/disney.inc';
  6. */
  7. date_default_timezone_set('PRC');
  8. //DB
  9. if(empty($_SERVER['APPLICATION_ENV']) || $_SERVER['APPLICATION_ENV']=='production') {
  10. defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'production');
  11. } else {
  12. defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'dev');
  13. }
  14. $getDbConfig = require './config/dbConfig/db.'.APPLICATION_ENV.'.config.php';
  15. $config = $getDbConfig['disney'];
  16. define("MYSQL_HOST", $config['host']);
  17. define("MYSQL_USER", $config['user']);
  18. define("MYSQL_PASSWORD", $config['pwd']);
  19. define("MYSQL_DB", $config['db']);
  20. define("MYSQL_PORT", $config['port']);
  21. define("ZIZAI_DISNEY_CODE", "DSNTEST" );
  22. header("Content-type:text/html;charset=utf-8");
  23. function conn(){
  24. $port=defined('MYSQL_PORT')?MYSQL_PORT:3306;
  25. try {
  26. $pdo=new PDO("mysql:host=".MYSQL_HOST.";port=".$port.";dbname=".MYSQL_DB, MYSQL_USER, MYSQL_PASSWORD,array(PDO::MYSQL_ATTR_INIT_COMMAND => "set names utf8"));
  27. return $pdo;
  28. }catch (PDOException $e){
  29. //write_log('ctsdata_test new PDO failed:'.$e->getMessage());
  30. }
  31. }
  32. $pdo=conn();
  33. $sqlWhere = " SELECT * FROM base_org WHERE org_code='{$_GET["cc"]}' ";
  34. $result=$pdo->query($sqlWhere);
  35. $result_array=$result->fetchAll();
  36. $result->closeCursor();
  37. $base_org_info = $result_array[0];
  38. //$base_org_info = $objDisney->getBaseOrgInfoFromCode( $_GET["cc"] );
  39. $current_date = date("Y-m-d");
  40. if( $current_date >= "2016-09-01" ) {
  41. $_ary_old_new = array(
  42. "1" => array( "base_user_id" => 79, "base_org_id" => 51 ),
  43. "2" => false,
  44. "3" => false,
  45. "4" => array( "base_user_id" => 84, "base_org_id" => 62 ),
  46. "5" => array( "base_user_id" => 83, "base_org_id" => 61 ),
  47. "6" => array( "base_user_id" => 82, "base_org_id" => 60 ),
  48. "7" => array( "base_user_id" => 104, "base_org_id" => 52 ),
  49. "8" => array( "base_user_id" => 68, "base_org_id" => 116 ),
  50. "9" => array( "base_user_id" => 125, "base_org_id" => 53 ),
  51. "10" => false,
  52. "11" => array( "base_user_id" => 65, "base_org_id" => 55 ),
  53. "12" => false,
  54. "13" => array( "base_user_id" => 76, "base_org_id" => 98 ),
  55. "14" => false,
  56. "15" => array( "base_user_id" => 77, "base_org_id" => 114 ),
  57. "16" => array( "base_user_id" => 78, "base_org_id" => 45 ),
  58. "17" => array( "base_user_id" => 80, "base_org_id" => 46 ),
  59. "18" => array( "base_user_id" => 81, "base_org_id" => 47 ),
  60. "19" => array( "base_user_id" => 119, "base_org_id" => 56 ),
  61. "20" => array( "base_user_id" => 100, "base_org_id" => 57 ),
  62. "21" => false,
  63. "22" => array( "base_user_id" => 102, "base_org_id" => 84 ),
  64. "23" => false,
  65. "24" => array( "base_user_id" => 85, "base_org_id" => 64 ),
  66. "25" => array( "base_user_id" => 86, "base_org_id" => 65 ) /*array( "base_user_id" => 96, "base_org_id" => 113 )*/,
  67. "26" => array( "base_user_id" => 87, "base_org_id" => 66 ),
  68. "27" => array( "base_user_id" => 90, "base_org_id" => 118 ),
  69. "28" => array( "base_user_id" => 89, "base_org_id" => 67 ),
  70. "29" => array( "base_user_id" => 72, "base_org_id" => 81 ),
  71. "30" => array( "base_user_id" => 73, "base_org_id" => 68 ),
  72. "32" => array( "base_user_id" => 93, "base_org_id" => 73 ),
  73. "33" => array( "base_user_id" => 95, "base_org_id" => 112 ),
  74. "34" => array( "base_user_id" => 86, "base_org_id" => 65 ),
  75. "35" => false,
  76. "36" => array( "base_user_id" => 103, "base_org_id" => 102 ),
  77. "37" => array( "base_user_id" => 108, "base_org_id" => 78 ),
  78. "38" => array( "base_user_id" => 113, "base_org_id" => 124 ),
  79. "39" => false,
  80. "40" => array( "base_user_id" => 71, "base_org_id" => 69 ),
  81. "41" => array( "base_user_id" => 92, "base_org_id" => 58 ),
  82. "42" => false,
  83. "44" => array( "base_user_id" => 105, "base_org_id" => 49 ),
  84. "45" => array( "base_user_id" => 109, "base_org_id" => 48 ),
  85. "46" => false,
  86. "47" => array( "base_user_id" => 110, "base_org_id" => 111 ),
  87. "48" => false,
  88. "49" => false,
  89. "50" => false,
  90. "51" => false,
  91. "52" => array( "base_user_id" => 111, "base_org_id" => 87 ),
  92. "53" => false,
  93. "54" => array( "base_user_id" => 112, "base_org_id" => 89 ),
  94. "55" => array( "base_user_id" => 70, "base_org_id" => 54 ),
  95. "56" => array( "base_user_id" => 94, "base_org_id" => 92 ),
  96. "57" => array( "base_user_id" => 74, "base_org_id" => 117 ),
  97. "58" => array( "base_user_id" => 88, "base_org_id" => 99 ),
  98. "59" => false,
  99. "60" => false,
  100. "61" => false,
  101. "62" => false,
  102. "63" => false,
  103. "64" => false,
  104. "65" => false,
  105. "66" => false,
  106. "67" => false,
  107. "68" => array( "base_user_id" => 66, "base_org_id" => 38 ),
  108. "69" => array( "base_user_id" => 67, "base_org_id" => 70 ),
  109. "70" => false,
  110. "71" => false,
  111. "72" => false,
  112. "73" => false,
  113. "74" => false,
  114. "75" => false,
  115. "76" => false,
  116. "77" => false,
  117. "78" => false,
  118. "79" => array( "base_user_id" => 69, "base_org_id" => 90 ),
  119. "80" => array( "base_user_id" => 75, "base_org_id" => 96 ),
  120. "81" => array( "base_user_id" => 97, "base_org_id" => 107 ),
  121. "82" => array( "base_user_id" => 98, "base_org_id" => 108 ),
  122. "83" => false
  123. );
  124. $cs1_info = isset($_ary_old_new[$base_org_info["org_id"]]) ? $_ary_old_new[$base_org_info["org_id"]] : false;
  125. if( false == $cs1_info ) {
  126. echo "";exit();
  127. $user_id = 46;
  128. $top_org_id = 39;
  129. } else {
  130. $user_id = $cs1_info["base_user_id"];
  131. $top_org_id = $cs1_info["base_org_id"];
  132. }
  133. $base_url = "http://sfx.zhizhuchuxing.com/wchat_fx/login2.html?user_id={$user_id}&top_org_id={$top_org_id}&login_type=1";
  134. echo $base_url."<hr />";
  135. header("Location:".$base_url);
  136. exit();
  137. }
  138. if( $base_org_info["org_id"] == 43 ) {
  139. echo "";
  140. exit();
  141. }
  142. if( $base_org_info["sell_type"] == 0 ) {
  143. header("Location:./disneydetial2/list.php?cc=".$_GET["cc"]);exit();
  144. } else {
  145. header("Location:./disneydetial2/list_qdh.php?cc=".$_GET["cc"]);exit();
  146. }
  147. exit();
  148. ?>