Advertisement
rezaaksaw

home.php

Jan 5th, 2019
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 14.81 KB | None | 0 0
  1. <?
  2. #Decode by Reza Aksa
  3. session_start();
  4. include("config.php");
  5. include("configInfo.php");
  6. error_reporting(~E_NOTICE);
  7. $result = pg_query("select * from accounts where login='$_SESSION[login_true]'") or die ("Err Can not to result");
  8. $dbarr =pg_fetch_array($result);
  9.  
  10.  
  11. ?>
  12. <?php
  13. include_once('connect.php');
  14.  
  15. $cPlayer = $connec->prepare('SELECT player_id FROM accounts');
  16. $cPlayer->execute();
  17. $countPlayer = $cPlayer->rowCount();
  18.  
  19. $cPlayer1 = $connec->prepare('SELECT player_id FROM accounts');
  20. $cPlayer1->execute();
  21. $countPlayer1 = $cPlayer1->rowCount();
  22.  
  23. $cPlayerOnline = $connec->prepare('SELECT player_id FROM accounts WHERE online = true');
  24. $cPlayerOnline->execute();
  25. $countPlayerOnline = $cPlayerOnline->rowCount();
  26.  
  27.  
  28.  
  29. ?>
  30.  
  31. <?php
  32. include('config.php');
  33.  
  34. error_reporting(~E_NOTICE);
  35. $user_login = addslashes(trim($_POST['user_login']));
  36. $pwd_login = addslashes(trim($_POST['pwd_login']));
  37. $hashpass = hash_hmac('md5', $pwd_login, '/x!a@r-$r%an¨.&e&+f*f(f(a)');
  38.  
  39. if(isset($_POST['user_login']) and isset($_POST['pwd_login'])) {
  40. ?>
  41. <?php
  42. if(isset($_POST["button"]))
  43. if ($_POST["button"] == "เข้าสู่ระบบ") {
  44. if(trim($_POST["user_login"] && ($_POST["pwd_login"])) == "" )
  45. {
  46. ?>
  47. <script type="text/javascript">
  48. localStorage.setItem("swal",
  49. swal(
  50.   'Do not leave empty!',
  51.   'ห้ามเว้นว่าง',
  52.   'error'
  53. )
  54. </script>
  55. <?php
  56. echo "<meta http-equiv='refresh' content='1 ;url=./?page=home'>";
  57. }
  58. ?>
  59.  
  60. <?php
  61. $result = pg_query("select login,password from accounts where login='$user_login' and password='$hashpass' ");
  62. $num = pg_num_rows($result) ;
  63. ?>
  64.  
  65. <?php
  66. if($num <=0 )
  67. {
  68. ?>
  69. <script type="text/javascript">
  70. swal(
  71.   'Username or Password Invalid!',
  72.   'อีเมล์หรือรหัสผ่านไม่ถูกต้อง',
  73.   'error'
  74. )
  75. </script>
  76. <?php
  77. echo "<meta http-equiv='refresh' content='1 ;url=./?page=home'>";
  78. }else{
  79. $_SESSION['login_true'] = $_POST['user_login'];
  80. ?>
  81. <script type="text/javascript">
  82. swal(
  83.   'Success!',
  84.   'เข้าสู่ระบบสำเร็จ!',
  85.   'success'
  86. )
  87. </script>
  88. <?php
  89. echo "<meta http-equiv='refresh' content='1 ;url=./?page=home'>";
  90. }}}
  91. ?>
  92. <?php
  93. if(isset($_POST["button"]))
  94. {  
  95. if ($_POST["button"] == "เเก้ไอดีค้าง")
  96. {
  97.     pg_query("UPDATE accounts SET online = false WHERE login = '".$_SESSION['login_true']."'");
  98. ?>
  99. <script type="text/javascript">
  100. swal(
  101.   'Success!',
  102.   'เเก้ไขไอดีค้างสำเร็จ!',
  103.   'success'
  104. )
  105. </script>
  106. <?php
  107. echo "<meta http-equiv='refresh' content='1 ;url=./?page=home'>";
  108. }}
  109. ?> 
  110. &nbsp;
  111.  
  112.             <?php
  113.             if (!isset($_SESSION['login_true'])) { ?>
  114.                
  115.                
  116.                
  117.               <form class="form-horizontal" method="post">
  118. <div class="row">
  119.   <!-- col-md-3 -->
  120.  
  121.     <div class="col-md-3">
  122.     <div class="card text-white bg-dark" align="left" style="margin-top: 10px;">
  123.     <div class="card-header" style="padding: 10px;">
  124.     <b><i class="fa fa-sign-in"></i> LOGIN</b> <small></small>
  125.     </div>
  126.     <div class="card-body">
  127.  
  128.   <form class="form-horizontal" method="post">
  129.     <div class="form-group">
  130.       <label class="control-label col-sm-2 text-light" for="user_login"><i class="  fa fa-user-circle-o text-info" style="font-size:25px"></i></label>
  131.       <div class="col-sm-10">
  132.         <input type="txt" class="form-control hvr-grow-shadow" id="user_login" placeholder="Enter Username" name="user_login" style="font-size:20px">
  133.       </div>
  134.     </div>
  135.     <div class="form-group">
  136.       <label class="control-label col-sm-2 text-light" for="user_login"><i class="fa fa-key text-info" style="font-size:25px"></i></label>
  137.       <div class="col-sm-10">          
  138.         <input type="password" class="form-control hvr-grow-shadow" id="pwd_login" placeholder="Enter password" name="pwd_login" style="font-size:20px">
  139.       </div>
  140.     </div>
  141.   </form>
  142.   <center>
  143.         <button type="submit" name="button" class="btn btn-success"   value="เข้าสู่ระบบ" style="font-size:15px">LOGIN | เข้าสู่ระบบ</button>
  144.   </center>
  145.     <!-- <a href="./?page=register"><input type="button" class="btn btn-info" value="REG | สมัครสมาชิก"></a> -->
  146. </div>
  147.  
  148.  
  149.     <!--div class="card-body">
  150.         <div class="row">
  151.             <div class="col-md-6 offset-md-3">
  152.                 <form id="login-form">
  153.                     <input type="hidden" name="action" value="login">
  154.                     <div class="form-group">
  155.                         <label for="username"><i class="fa fa-user"></i> Username :</label>
  156.                         <input class="form-control hvr-grow-shadow" type="text" name="username" id="username" placeholder="ชื่อสมาชิก" autofocus>
  157.                     </div>
  158.                     <div class="form-group">
  159.                         <label for="password"><i class="fa fa-lock"></i> Password :</label>
  160.                         <input class="form-control hvr-grow-shadow" type="password" name="password" id="password" placeholder="รหัสผ่านบัญชี">
  161.                     </div>
  162.                 </form>
  163.                  <button type="submit" name="button" class="btn btn-success btn-block hvr-icon-wobble-horizontal"  value="เข้าสู่ระบบ"><i class="fa fa-sign-in hvr-icon"></i>เข้าสู่ระบบ</button>
  164.                 <a class="btn btn-danger btn-block hvr-icon-wobble-horizontal" href="./?page=register"><i class="fa fa-user-plus hvr-icon"></i> สมัครสมาชิก</a>
  165.             </div>
  166.         </div>
  167.     </div-->
  168.  
  169.                            
  170.         </div>
  171.                 <?php  
  172.         } else {
  173.         ?>
  174. <!-- ล็อกอินเเล้ว -->
  175. <div class="row">
  176.  
  177.   <!-- col-md-3 -->
  178.     <div class="col-md-3">
  179.     <div class="card text-white bg-dark" align="left" style="margin-top: 10px;">
  180.     <div class="card-header" style="padding: 10px;">
  181.     <b><i class="fa fa-address-card"></i> ข้อมูลผู้เล่น</b> <small></small>
  182.     </div>
  183.     <div class="card-body">
  184.   <form class="form-horizontal" method="post">
  185.  
  186.   </form>
  187.  <div class="text-light">
  188.     <i class="fa fa-user"></i> ไอดีผู้ใช้ :  <?php echo $dbarr['login']; ?>
  189.     <br>
  190.     <i class="far fa-address-card"></i> ชื่อในเกมส์ :  <?php echo $dbarr['player_name']; ?>
  191.         <br>
  192.     <i class="far fa-address-book"></i> ยศ :  <img src="img_rank/<?php echo $dbarr['rank']; ?>.png" width="20" height="20">
  193.     <br>
  194.     <i class="fa fa-pie-chart"></i> EXP : <?php echo $dbarr['exp']; ?>
  195.     <br>
  196.     <i class="fa fa-money"></i> Point : <?php echo $dbarr['gp']; ?>
  197.     <br>
  198.     <i class="fa fa-money"></i> Cash : <?php echo $dbarr['money']; ?>
  199.     <br>
  200.     <i class="fa fa-btc"></i> <?php echo $CoinWeb; ?> :  <?php echo $dbarr['coinweb']; ?>
  201.     </div>
  202.     &nbsp;
  203.   <form class="form-horizontal" method="post">
  204.   <center>
  205.  
  206.         <button type="submit" name="button" class="btn btn-info" value="เเก้ไอดีค้าง" style="font-size:18px">เเก้ไอดีค้างในเกม</button><hr>
  207.  
  208.         <a href="./?page=logout"><button type="button" class="btn btn-danger btn-block" style="font-size:18px">ออกจากระบบ</button></a>
  209. </center>
  210. </div>
  211. </form>
  212.                            
  213.         </div>
  214.                      <?php }?>
  215. &nbsp;
  216.  
  217.            
  218.     <div class="card text-white bg-dark" align="left" style="margin-top: 20px;">
  219.     <div class="card-header" style="padding: 5px;">
  220.     <b><i class="fa fa-d"></i> ดาวน์โหลด</b> <small></small>
  221.     </div>
  222.     <div class="card-body">
  223.         <div class="row">      
  224.                     <div class="col-md-12">
  225.                     <center>
  226.                     <a target="_blank" href="<?php echo $DonwloadClient ;?>"><button type="button" class="btn btn-success"style="font-size:14px">Download | ดาวน์โหลดตัวเกม</button></a>
  227.                     <hr><a target="_blank" href="<?php echo $Fix ;?>"><button type="button" class="btn btn-danger" style="font-size:14px">Download | เเก้ไข Launcher Error</button></a>
  228.                     <hr><a target="_blank" href="<?php echo $FixCat ;?>"><button type="button" class="btn btn-danger" style="font-size:14px">Download | เเก้ไข เด้งแมว</button></a>
  229.                     </center>
  230.                     </div>
  231.                    
  232.  
  233.         </div>
  234.      
  235.      
  236.     </div>
  237.   </div>
  238.  
  239. &nbsp;
  240.  
  241.  
  242.     <div class="card text-white bg-dark" align="left" style="margin-top: 10px;">
  243.     <div class="card-header" style="padding: 10px;">
  244.     <b><i "fa fa-facebook-official" aria-hidden="true"></i> แฟนเพจ</b> <small></small>
  245.     </div>
  246.     <div class="card-body">
  247.  
  248. <div class="fb-page" data-href="<?php echo $page ;?>" data-tabs="timeline" data-width="300" data-height="70" data-small-header="true" data-adapt-container-width="true" data-hide-cover="true" data-show-facepile="true"><blockquote cite="<?php echo $page ;?>" class="fb-xfbml-parse-ignore"><a href="<?php echo $page ;?>"><?php echo $namepage ;?></a></blockquote></div>
  249.       </div>
  250.     </div>
  251.  
  252.     </div>
  253.    
  254.    
  255.     <!--end col-md-3 -->
  256.  
  257.     <!-- col-md-6 -->
  258.     <div class="col-md-6">
  259.  
  260.     <div class="card text-white bg-dark" align="left" style="margin-top: 10px;">
  261.     <div class="card-header" style="padding: 10px;">
  262.     <b><i "fa fa-facebook-official" aria-hidden="true"></i> <?php echo $NameNotes ;?></b> <small></small>
  263.     </div>
  264.     <div class="card-body">
  265.    
  266.     <div id="newscarousel" class="carousel slide carousel-fade" data-ride="carousel" style="height: 400px !important">
  267.                     <ol class="carousel-indicators">
  268.  
  269.                     </ol>
  270.                     <div class="carousel-inner">
  271.                         <div class="carousel-item active"><img src="promote.jpg" class="d-block w-100" style="height: 400px !important"></div>             
  272.                     </div>
  273.  
  274.     </div>
  275.    
  276.       </div>
  277. </div>
  278.  
  279. &nbsp;
  280. <div class="card text-white bg-dark" align="left" style="margin-bottom: 10px;">
  281.     <div class="card-header" style="padding: 5px;">
  282.         <b><i class="fa fa-newspaper-o"></i> NEWS & UPDATE</b> <small></small>
  283.     </div>
  284.     <div class="card-body">
  285.         <p><a href="#" style="color: #FFF;text-decoration: none;"><span class="badge badge-success">ข่าวสาร</span> <b><?php echo $NewUpdate1; ?></b> - <?php echo $NewUpdate11; ?></a></p>
  286.         <p><a href="#" style="color: #FFF;text-decoration: none;"><span class="badge badge-success">ข่าวสาร</span> <b><?php echo $NewUpdate2; ?></b> - <?php echo $NewUpdate22; ?></a></p>
  287.         <p><a href="#" style="color: #FFF;text-decoration: none;"><span class="badge badge-success">ข่าวสาร</span> <b><?php echo $NewUpdate3; ?></b> - <?php echo $NewUpdate33; ?></a></p></div>
  288.  
  289.         </div>
  290.  
  291. &nbsp;
  292.  
  293.     <div class="card text-white bg-dark" align="left" style="margin-top: 10px;">
  294.     <div class="card-header" style="padding: 10px;">
  295.     <b><i "fa fa-facebook-official" aria-hidden="true"></i> ตารางยศ</b> <small></small>
  296.     </div>
  297.     <div class="card-body">
  298.  
  299. <img src="rank.jpg" width="100%" height="100%">
  300.       </div>
  301. </div>
  302.  
  303.  
  304.  
  305.            
  306.     </div>
  307.    
  308.     <div class="col-md-3">
  309.     <div class="card text-white bg-dark" align="left" style="margin-top: 10px;">
  310.     <div class="card-header" style="padding: 5px;">
  311.     <b><i class="fa fa-signal"></i> SERVER STATUS</b> <small></small>
  312.     </div>
  313.     <div class="card-body">
  314.         <center><p><img src="dist/images/star.png" width="25" height="25;"> EXP Boosted : <span class="badge badge-info"><?php echo $expboot; ?> %</span></p>
  315.         <p><img src="dist/images/star.png" width="25" height="25;"> Money Boosted : <span class="badge badge-info"><?php echo $pointboot; ?> %</span></p></center><hr>
  316.         <ul class="list-unstyled">
  317.             <li class="media" style="border-bottom: 1px dashed rgba(255,255,255,0.4)">
  318.                 <img class="mr-3" src="dist/images/sv.svg" width="48">
  319.                 <div class="media-body">
  320.                     <h4 class="mt-0" style="font-size:20px">Server Status</h4>
  321.                     <span class='text-success'><b><i class='fa fa-check'></i> ออนไลน์</b></span>              </div>
  322.             </li>
  323.             <li class="media" style="border-bottom: 1px dashed rgba(255,255,255,0.4)">
  324.                 <img class="mr-3" src="dist/images/account.svg" width="48">
  325.                 <div class="media-body">
  326.                     <h4 class="mt-0" style="font-size:20px">Account ID</h4>
  327.                     <i class="fa fa-users text-info"></i> <?php echo pg_escape_string($countPlayer1); ?> บัญชี
  328.                 </div>
  329.             </li>
  330.             <li class="media">
  331.                 <img class="mr-3" src="dist/images/player.svg" width="48">
  332.                 <div class="media-body">
  333.                     <h4 class="mt-0" style="font-size:20px">Online</h4>
  334.                     <i class="fa fa-circle-o-notch fa-spin text-success"></i> <?php echo pg_escape_string($countPlayerOnline); ?> คน
  335.                 </div>
  336.             </li>
  337.         </ul>
  338.   </div>
  339. </div>
  340.  
  341.  
  342.  
  343.  
  344. <br>
  345.     <div class="card text-white bg-dark" align="left" style="margin-top: 10px;">
  346.     <div class="card-header" style="padding: 5px;">
  347.     <b><i class="fa fa-user-o"></i> Top 5 ผู้เล่น</b> <small></small>
  348.     </div>
  349.     <div class="card-body">
  350.         <table id="myTable" class="table text-light" style="color: #FFF;text-decoration: none;">
  351.         <thead>
  352.           <tr>
  353.             <th>อันดับ</th>
  354.             <th>ยศ</th>
  355.             <th>ชื่อ</th>
  356.  
  357.           </tr>
  358.         </thead>
  359.         <tbody>
  360.  
  361.                       <?php
  362. //include('config.php');
  363. error_reporting(~E_NOTICE);
  364. $strRank = "SELECT * FROM accounts order by exp desc limit 5 ";
  365. $qrRank = pg_query($strRank);
  366. $num = 0;
  367.  
  368. while ($rsRank = pg_fetch_array($qrRank)) {                                                
  369. ?>
  370.   <tr>
  371.    
  372.  
  373.     <td>1</td>
  374.     <td><p><img src="img_rank/<?php echo $rsRank['rank']; ?>.png" width="20" height="20"><p></td>
  375.     <td><?php echo $rsRank['player_name'];?></td>
  376.   </tr>
  377.  
  378. <?php } ?>
  379.                           </tbody>
  380.       </table>
  381.     </div>
  382. </div>
  383. <br>
  384.     <div class="card text-white bg-dark" align="left" style="margin-top: 10px;">
  385.     <div class="card-header" style="padding: 5px;">
  386.     <b><i class="fa fa-asterisk"></i> Top 5 แคลน</b> <small></small>
  387.     </div>
  388.     <div class="card-body">
  389.         <table id="myTable" class="table text-light" style="color: #FFF;text-decoration: none;">
  390.           <thead>
  391.           <tr>
  392.             <th>อันดับ</th>
  393.             <th>รูปแคลน</th>
  394.             <th>ชื่อ</th>
  395.  
  396.           </tr>
  397.         </thead>
  398.          <?php
  399. //include('config.php');
  400. error_reporting(~E_NOTICE);
  401. $strRank = "SELECT * FROM clan_data order by clan_exp desc limit 5 ";
  402. $qrRank = pg_query($strRank);
  403. $num = 0;
  404.  
  405.  
  406. while ($rsRank = pg_fetch_array($qrRank)) {
  407. $huaclan = "SELECT * FROM accounts where player_id = '".$rsRank['owner_id']."'";
  408. $qrhuaclan = pg_query($huaclan);
  409. $srhuaclan = pg_fetch_array($qrhuaclan);                                               
  410. ?>
  411.   <tr>
  412.     <td><?php echo $srhuaclan['player_name'];?></td>
  413.     <td><?php echo $rsRank['clan_rank'];?></td>
  414.     <td><?php echo $rsRank['clan_name'];?></td>
  415.    
  416.   </tr>
  417.  
  418. <?php } ?>
  419.       </table>
  420.  
  421.     </div>
  422.  
  423.     </div>
  424.  </div> </div>
  425.     <div id="fb-root"></div>
  426.  
  427.  
  428. <script>(function(d, s, id) {
  429.   var js, fjs = d.getElementsByTagName(s)[0];
  430.   if (d.getElementById(id)) return;
  431.   js = d.createElement(s); js.id = id;
  432.   js.src = 'https://connect.facebook.net/th_TH/sdk.js#xfbml=1&version=v3.2&appId=2539916342900591&autoLogAppEvents=1';
  433.   fjs.parentNode.insertBefore(js, fjs);
  434. }(document, 'script', 'facebook-jssdk'));</script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement