admin.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?php
  2. include 'user/config.php';
  3. //ini_set('date.timezone','Asia/Shanghai');
  4. //date_default_timezone_set ( 'PRC' );//时区
  5. //header("Content-type:text/html;charset=utf-8");
  6. //session_start();
  7. if(isset($_POST['sub'])) {
  8. $quid=trim($_POST['qu']);
  9. $uid=$_POST['name'];
  10. $upass=trim($_POST['pwd']);
  11. if($quid==''){
  12. echo "<script>alert('区号错误 ');history.go(-1)</script>";exit;
  13. }
  14. if ($uid == '') {
  15. echo "<script>alert('".$xname."错误');history.go(-1)</script>";exit;
  16. }
  17. if ($upass == '') {
  18. echo "<script>alert('请输入后台密码');history.go(-1)</script>";exit;
  19. }
  20. $vipfile='user/vip_'.$quid.'.json';
  21. $fp = fopen($vipfile, "a+");
  22. if (filesize($vipfile) > 0) {
  23. $str = fread($fp, filesize($vipfile));
  24. fclose($fp);
  25. $vipjson = json_decode($str, true);
  26. if ($vipjson == null) {
  27. $vipjson = array();
  28. }
  29. } else {
  30. $vipjson = array();
  31. }
  32. if (!$vipjson[$uid]) {
  33. echo "<script>alert('你还不是授权客户');history.go(-1)</script>";exit;
  34. } elseif ($vipjson[$uid]['pwd'] != mima($uid,$upass)) {
  35. echo "<script>alert('用户密码不匹配');history.go(-1)</script>";exit;
  36. }
  37. if ($vipjson[$uid]['qu'] != $quid)
  38. {echo "<script>alert('授权用户与当前选择大区不匹配');history.go(-1)</script>";exit;
  39. }
  40. $viplevel=intval($vipjson[$uid]['level']);
  41. $_SESSION["vip"] = $viplevel;
  42. $_SESSION["quid"] = $quid;
  43. $_SESSION["uid"] = $uid;
  44. $_SESSION["upass"] = $upass;
  45. $_SESSION['expiretime'] = time();
  46. header("Location:player.php");
  47. exit;
  48. }
  49. ?>
  50. <!DOCTYPE html>
  51. <html lang="zh-CN">
  52. <head>
  53. <meta charset="UTF-8">
  54. <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1"
  55. />
  56. <title><?php echo $gmbt; ?>-玩家后台</title>
  57. <meta name="keywords" content="<?php echo $gmbt; ?>玩家后台" />
  58. <meta name="description" content="<?php echo $gmbt; ?>玩家后台" />
  59. <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
  60. <link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
  61. <link rel="stylesheet" type="text/css" href="css/material-design-iconic-font.min.css">
  62. <link rel="stylesheet" type="text/css" href="css/util.css">
  63. <link rel="stylesheet" type="text/css" href="css/main.css">
  64. </head>
  65. <body>
  66. <div class="limiter">
  67. <div class="bg container-login100">
  68. <div class="wrap-login100">
  69. <span class="login100-form-title"><?php echo $gmbt; ?>-玩家后台</span>
  70. <div class="modal-body">
  71. <div class="form-group">
  72. <form id="form" name="form" method="post" action="">
  73. <div class="form-group">
  74. <div class="form-group">
  75. <div class="alert alert-danger">
  76. <strong style="color:red">温馨提示:</strong><br>
  77. 注意是游戏角色名登陆<br>
  78. </div>
  79. <select id="qu" name="qu" class="form-control selectpicker" title="请选择区服">
  80. <?php
  81. foreach($quarr as $key=>$value){
  82. if($value['hidde']!=true){
  83. echo '<option value="'.$key.'">'.$value['name'].'</option>';
  84. }
  85. }
  86. ?>
  87. </select>
  88. </div>
  89. </div>
  90. <hr/>
  91. <div>
  92. <input type='text' value='' name="name" id='uid' class="form-control" placeholder='请输入<?php echo $xname; ?>!'>
  93. <input type='text' value='' name="pwd" id='upass' class="form-control" placeholder='请输入后台密码'>
  94. <hr/>
  95. <div>
  96. <input type='submit'class="btn btn-danger btn-block" value='登陆后台' name="sub" id='chargebtn'>
  97. </form>
  98. </div>
  99. <hr/>
  100. </div>
  101. <div class="txt1 text-center">
  102. <span><?php echo $gmbt; ?> By:星辰大海</span>
  103. </div>
  104. <script>
  105. window.onload=function(){
  106. document.onkeydown=function(){
  107. var e=window.event||arguments[0];
  108. if(e.keyCode==123){
  109. return false;
  110. }else if((e.ctrlKey)&&(e.shiftKey)&&(e.keyCode==73)){
  111. return false;
  112. }
  113. };
  114. document.oncontextmenu=function(){
  115. return false;
  116. }
  117. }
  118. </script>
  119. </body>
  120. </html>