-
Notifications
You must be signed in to change notification settings - Fork 116
/
fundsbtc.php
157 lines (157 loc) · 6.49 KB
/
fundsbtc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?php
session_start();
error_reporting(0);
require_once'jsonRPCClient.php';
require_once'auth.php';
if($Logged_In!==7) {
header("Location: index.php");
}
$withdraw_withdraw = security($_POST['action']);
$withdraw_amount = security($_POST['amount']);
$withdraw_address = security($_POST['address']);
if($withdraw_withdraw=="withdraw") {
if($withdraw_address) {
if($withdraw_amount) {
$withdraw_amount = satoshitize($withdraw_amount);
if($withdraw_amount<=$Bitcoind_Balance) {
$set_withdraw_amount = $withdraw_amount - 0.01; // minus the fee
$true_withdraw_amount = satoshitize($set_withdraw_amount);
$Bitcoind_Withdraw_From = $Bitcoind->sendtoaddress($withdraw_address,(float)$true_withdraw_amount);
if($Bitcoind_Withdraw_From) {
$result = minusfunds($user_session,"BTC",$withdraw_amount);
$result = plusfunds($FEEBEE,"BTC","0.01"); // add fee to feebee account
$Bitcoind_Balance = userbalance($user_session,"BTC");
$withdraw_message = '<a href="http://blockexplorer.com/tx/'.$Bitcoind_Withdraw_From.'" target="_blank" style="color: #0B2161;">Withdraw was sent! Click here for more details.</a>';
if(!mysql_query("INSERT INTO transactions (id,date,username,action,coin,address,txid,amount) VALUES ('','$date','$user_session','withdraw','BTC','$withdraw_address','$Bitcoind_Withdraw_From','$withdraw_amount')")){
$eereturn_error = "System error.";
} else {
$eereturn_error = "Logged in.";
}
}
} else {
$withdraw_message = 'You do not have enough Bitcoins!';
}
} else {
$withdraw_message = 'No amount to withdraw was entered!';
}
} else {
$withdraw_message = 'No Bitcoin address was entered!';
}
}
?>
<html>
<head>
<title><?php echo $script_title; ?></title>
<link rel="shortcut icon" href="image/favicon.ico">
<?php echo $CSS_Stylesheet; ?>
<script src="js/jquery-1.9.1.js"></script>
<script type="text/javascript">
$(document).ready(function () {
setInterval(function () {
$("#balances").load("ajax.php?id=balances");
$("#pending-deposits").load("ajax.php?id=pending-deposits");
}, 30000);
setInterval(function () {
$(".count").load("online.php");
$("#stats").load("ajax.php?id=stats");
}, 60000);
});
</script>
</head>
<body title="[zelles]">
<center>
<div align="center" class="headdiv">
<div align="center" class="balancesdiv"><span id="stats"><?php require'ajax/stats.php'; ?></span></div>
<table style="width: 100%; height: 50px;">
<tr>
<td align="left" style="width: 30px;" nowrap>
<a href="http://<?php echo $server_url; ?>"><img src="image/logob.png" title="<?php echo $script_title; ?>" alt="Logo" border="0"></a>
</td>
<td align="left" style="font-size: 18px; font-weight: bold;" nowrap>
<a href="http://<?php echo $server_url; ?>"><img src="image/logo.png" title="<?php echo $script_title; ?>" alt="[zelles]" border="0"></a>
</td>
<td align="right" valign="top" nowrap>
<table>
<tr>
<td><a href="home.php">Home</a></td>
<td style="padding-left: 5px;"><a href="account.php">Account</a></td>
<td style="padding-left: 5px;"><a href="logout.php">Logout</a></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<p></p>
<?php if($withdraw_message) { echo '<div align="center" class="error-msg" nowrap>'.$withdraw_message.'</div><p></p>'; } ?>
<table class="right-panel-table">
<tr>
<td valign="top" align="left" class="right-panel-left">
<div align="center" class="bodydiv">
<table style="width: 650px;">
<tr>
<td align="center" valign="top" style="padding: 5px;" nowrap>
<form action="fundsbte.php" method="POST">
<input type="hidden" name="action" value="withdraw">
<table>
<tr>
<td colspan="2" align="left" nowrap>
<b>Withdraw:</b>
</td>
</tr><tr>
<td align="right" nowrap><b>Amount</b></td>
<td align="left" nowrap><input type="text" name="amount" style="width: 100px;"></td>
</tr><tr>
<td align="right" nowrap><b>Address</b></td>
<td align="right" nowrap><input type="text" name="address" style="width: 180px;"></td>
</tr><tr>
<td colspan="2" align="right" nowrap><input type="submit" class="button" name="submit" value="Withdraw"></td>
</tr>
</table>
</form>
</td>
<td align="center" valign="top" style="padding: 5px;" nowrap>
<table>
<tr>
<td align="left" style="padding: 3px;" nowrap>
<b>Deposit:</b>
</td>
</tr><tr>
<td align="center" style="padding: 2px; font-weight: bold; color: #666666;" nowrap><?php echo $Bitcoind_Account_Address; ?></td>
<tr><tr>
<td align="left" style="padding: 2px; padding-left: 20px;">Deposits must have 6 confirmations to become active. There is a fee of 0.01 Bitcoin to make a withraw.</td>
</tr>
</table>
</center>
</td>
</tr><tr>
<td colspan="2" align="right" valign="top" style="font-weight: bold; padding: 5px;" nowrap><a href="transactions.php">Transactions</a></td>
</tr>
</table>
</div>
</td>
<td style="width: 6px;">
</td>
<td valign="top" align="left" class="right-panel-right">
<span id="pending-deposits"><?php require'ajax/pending-deposits.php'; ?></span>
<div align="left" class="right-panel">
<span id="balances"><?php require'ajax/balances.php'; ?></span>
</div>
<p></p>
<div align="left" class="right-panel">
<?php require'ajax/menu.php'; ?>
</div>
<p></p>
<div align="left" class="right-panel"><b>Online:</b><p></p><span class="count"><?php require"online.php"; ?></span></div>
</td>
</tr>
</table>
<p></p>
<?php require'ajax/footer.php'; ?>
<p></p>
</center>
</body>
</html>
<?php
mysql_close($db_handle);
?>