Sahitya-K

withdraw

Apr 1st, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.53 KB | None | 0 0
  1. <?php
  2.  session_start();
  3. ?>
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7.   <title>RUS GOLD Faucet</title>
  8.   <link rel="icon" href="favicon.ico">
  9.   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  10.   <style>
  11.   .nav {float: right; margin: 30px; margin-right: 45px;}
  12.   .nav a { font-size: 25px;text-decoration:none;color: #000; font-family: Lucida Sans Unicode; font-weight: normal;}  .nav a:hover {opacity:.5;}
  13.     .logo {float: left;}
  14.     button{background-color:#5E0000;color:white;padding:14px 20px;margin:8px 0;border:0;cursor:pointer;width:20%;opacity:.9}
  15.     button:hover{opacity:1}
  16.     .profile {width: 35%; height: 400px; float: left; margin-left: 20px;}
  17.     .profile h2 {font-family:arial; margin-top: 15px; font-size: 35px; text-align: center;}
  18.     .auto {width: 50%; height: 400px; float: right; margin-right: 20px;}
  19.     .auto h2 {font-family:arial; margin-top: 15px; font-size: 35px; text-align: center;}
  20.    .auto input {float:right; padding: 15px; margin-right: 100px; border: none;border-bottom: 1px solid #ccc; width: 60%;}
  21.   </style>
  22. </head>
  23. <body>
  24.   <?php
  25. if ( isset($_GET['success']) && $_GET['success'] == 1 )
  26. {
  27.   echo ("<script LANGUAGE='JavaScript'>
  28.    window.alert('You Are Successfully Registered. Now Please Login');
  29.    window.location.href='faucet.php';
  30.    exit();
  31.    </script>");
  32. }
  33.  
  34.   ?>
  35.   <div class="logo">
  36.   <img style="height: 80px;" src="rus_logo.png">
  37.   <p style="margin-top: -15px; margin-left: 60px; opacity: 0.7;">beta</p>
  38. </div><div class="nav"><a href="index.php">Claim RUS GOLD</a></div><br><br>
  39. </div><br><br><br><br><br><br><br><br><br>
  40. <div class="profile">
  41. <h2>Profile</h2><hr style="width: 80%;"></center><br><br>
  42. <h3 style="float: left; margin-left: 80px;font-family:Lucida Sans Unicode;font-weight: normal;">UserName: <?php  echo   $_SESSION['username'] ?></h3>
  43. <?php
  44. $servername = "localhost";
  45. $username = "root";
  46. $password = "";
  47. $dbname = "izaya";
  48.  
  49. // Create connection
  50. $conn = new mysqli($servername, $username, $password, $dbname);
  51. $user =  $_SESSION['username'];
  52. $hi = mysqli_query($conn, "SELECT sum(points) from points WHERE username='$user'");
  53. $ji = mysqli_fetch_array($hi);
  54. ?>
  55. <h3 style="float: left; margin-left: 80px;font-family:Lucida Sans Unicode;font-weight: normal;">Earned RUS GOLD Tokens: <?php echo $ji[0]; ?></h3><br>
  56. </div>
  57. <div class="auto">
  58.   <h2>RUS GOLD Withdrawal</h2><hr style="width: 80%;"></center><br><br>
  59. <form method="POST">
  60.       <input type="text" name="id" placeholder="Enter Waves Wallet Id..." required><br><br><br><br><br>
  61.       <input type="number" min="100" name="amount" placeholder="Enter Withdrawal RUS GOLD Amount..." required><br><br><br><br><br>
  62.       <button name="submit" style="background-color:#4CAF50;color:white;padding:14px 20px;border:0;cursor:pointer;width:30%;opacity:.9;float:right; margin-right: 100px;">Withdraw RUS GOLD</button>
  63.       <?php
  64.        if (isset($_POST['submit'])) {
  65.         $user = $_SESSION['username'];
  66.       $id = $_POST['id'];
  67.       $with = $_POST['amount'];
  68. $servername = "localhost";
  69. $username = "root";
  70. $password = "";
  71. $dbname = "izaya";
  72.  
  73. // Create connection
  74. $conn = new mysqli($servername, $username, $password, $dbname);
  75. $user =  $_SESSION['username'];
  76. $hi = mysqli_query($conn, "SELECT sum(points) from points WHERE username='$user'");
  77. $ji = mysqli_fetch_array($hi);
  78. if ($ji[0] > $with) {
  79. include 'test4.php';
  80.       }
  81.         else { ?>
  82.          <script>alert("Insufficent Balance");</script>
  83.            <?php
  84.         }
  85.        }
  86.       ?>
  87.     </form>
  88. </div>
  89. </body>
  90. </html>
Add Comment
Please, Sign In to add comment