Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include_once "includes/db_connect.php";
- include_once "includes/functions.php";
- logincheck();
- $username=$_SESSION['username'];
- $query=mysql_query("SELECT * FROM users WHERE username='$username'");
- $fetch=mysql_fetch_object($query);
- ?>
- <html>
- <head>
- <link href="style.css" rel="stylesheet" type="text/css">
- </head>
- <body>
- <style type="text/css">
- .select {
- display: inline;
- padding: 5px 30px 5px 30px;
- }
- .selected {
- display: inline;
- padding: 5px 30px 5px 30px;
- }
- .row td {
- height: 20px;
- }
- .alt td {
- height: 20px;
- }
- .
- .button {
- margin-left: auto;
- margin-right: auto;
- }
- .unselected_link {background: url(images/subhead.png) repeat-x;
- padding: 5px 20px 5px 20px;
- border: 1px solid #000000;
- width: 120px; }
- .selected_link {background: url(images/selected_box.png) repeat-x;
- padding: 5px 20px 5px 20px;
- border: 1px solid #000000;
- width: 120px; }
- </style>
- <?
- if(strip_tags($_POST['deposit'])){
- $amount=intval(strip_tags($_POST['amount']));
- if ($amount > "0"){
- if ($amount == 0 || !$amount || ereg('[^0-9]',$amount)){
- print "<center>You cant deposit that amount!<br><br>";
- }elseif ($amount != 0 && $amount && !ereg('[^0-9]',$amount)){
- if ($amount > $fetch->money){
- echo "<center>You do not have that much money!<br><br>";
- }elseif ($amount <= $fetch->money){
- $user_loose = $fetch->money - $amount;
- $bank_add = $amount;
- mysql_query("UPDATE users SET money=money-$amount WHERE username='$username'");
- mysql_query("UPDATE users SET bankamount=bankamount+$amount WHERE username='$username'");
- echo "<center>You have deposited £".number_format($amount)." into your bank!<br><br>";
- }}}}
- if(strip_tags($_POST['withdraw'])){
- $amount = $_POST['amount'];
- if ($amount > "0"){
- if ($amount == 0 || !$amount || ereg('[^0-9]',$amount)){
- print "You cant withdraw that amount.";
- }elseif ($amount != 0 || $amount || !ereg('[^0-9]',$amount)){
- if ($amount > $fetch->bankamount){ echo "<center>You have not got that much money in your bank!<br><br>"; }elseif ($amount <= $fetch->bankamount){
- $user_loose = $fetch->money - $amount;
- $bank_add = $amount;
- mysql_query("UPDATE users SET money=money+$amount WHERE username='$username'");
- mysql_query("UPDATE users SET bankamount=bankamount-$amount WHERE username='$username'");
- echo "<center>You have withdrawn £".number_format($amount)." from your bank!<br><br>";
- }}}}
- ?>
- <table width="400" class="table" align="center" cellspacing="0" border="0" cellpadding="0">
- <tr class="header">
- <td colspan="2">Bank</td>
- </tr>
- <tr height="50px">
- <td align='center'><p>This shows you how much money is in your bank account and in your hand.</p>
- <p><i>Money in your bank account is safe from killers!</i></p></td>
- </tr>
- </table>
- <br />
- <form action="" method=POST>
- <table width="600" align="center">
- <tr>
- <td width="50%" align="left">
- <table width="90%" class="table" align="center" border=0 cellspacing="0"
- cellpadding="0">
- <tr class="header">
- <td>Actions</td>
- </tr>
- <tr>
- <td colspan="2" align="center" valign="bottom"><br />Amount: <input type="text" class="textbox" name="amount" id="amount" class="textinput"><br />
- <br />
- <input type="submit" name="deposit" id="deposit" class="button" value="Deposit" /> - <input type="submit" name="withdraw" class="button" value="Withdraw" /><br /><br />
- </td>
- </tr>
- </table>
- </td>
- <td width="50%" align="right" valign="top">
- <table width="90%" class="table" align="center" border=0 cellspacing="0" cellpadding=0>
- <tr class="header">
- <td colspan="2">Infomation</td>
- </tr>
- <tr>
- <td width="75" style="padding:8px;" align="right">Hand:</td>
- <td>£<?php echo "".number_format($fetch->money).""; ?></td>
- </td>
- </tr>
- <tr>
- <td style="padding:8px;" align="right">Bank:</td>
- <td>£<?php echo "".number_format($fetch->bankamount).""; ?></td>
- </tr>
- <tr>
- <td style="padding:8px;" align="right">Send Money</td>
- <td><a href=sendmoney.php>Click Here</a></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </form>
- <table width="650" align="center" colspan="4">
- <tr>
- <td valign="top" colspan="2">
- <table class="table" border=0 cellpadding=0 width="350" align="center" cellspacing="0">
- <tr><td colspan="3" class="header">Last 10 Sent</td></tr>
- <tr><td align="center" colspan="1" class='subhead'>To</td><td align="center" class='subhead'>Amount</td><td align="center" colspan="1" class='subhead'>Date</td></tr>
- <?
- $k=mysql_query("SELECT * FROM `transfers` WHERE `from`='$username' ORDER BY id DESC LIMIT 10");
- while($p=mysql_fetch_object($k)){
- echo "<tr>
- <td class=\"tableborder\" style='padding:10px' align=\"center\"><a href='profile.php?viewuser=$p->to'>$p->to</a></td>
- <td class=\"tableborder\" style='padding:10px' align=\"center\">£".number_format($p->amount)." $types</td>
- <td class=\"tableborder\" style='padding:10px' align=\"center\">$p->date</td>
- </tr>"; } ?></table></td><td valign='top' colspan='2'>
- <table class="table" border=0 cellpadding=0 width="350" align="center" cellspacing="0">
- <tr><td colspan="3" class="header">Last 10 Received</td></tr>
- <tr><td align="center" class='subhead'>From</td><td align="center" class='subhead'>Amount</td><td align="center" class='subhead'>Date</td></tr>
- <?
- $ka=mysql_query("SELECT * FROM `transfers` WHERE `to`='$username' ORDER BY id DESC LIMIT 10");
- while($pa=mysql_fetch_object($ka)){
- echo "<tr>
- <td class=\"tableborder\" style='padding:10px' align=\"center\"><a href='profile.php?viewuser=$pa->from'>$pa->from</a></td>
- <td class=\"tableborder\" style='padding:10px' align=\"center\">£".number_format($pa->amount)."</td>
- <td class=\"tableborder\" style='padding:10px' align=\"center\">$pa->date</td>
- </tr>"; } ?></table></td></tr></table>
- </body>
Add Comment
Please, Sign In to add comment