-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.php
228 lines (195 loc) · 6.75 KB
/
index.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<?php
ini_set('max_execution_time', 20);
require_once 'classes/jsonRPCClient.php';
require_once 'classes/recaptcha.php';
require_once 'config.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><?php echo $faucetTitle; ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="images/favicon.ico">
<link rel="icon" type="image/icon" href="images/favicon.ico" >
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<script>var isAdBlockActive=true;</script>
<script src="js/advertisement.js"></script>
<script>
if (isAdBlockActive) {
window.location = "./adblocker.php"
}
</script>
<script>
<!-- PLACE GOOGLE ANALYTICS HERE -->
</script>
</head>
<body>
<div class="container">
<div id="login-form">
<h3><a href="./"><img src="<?php echo $logo; ?>" height="256"></a><br /><br /> <?php echo $faucetSubtitle; ?></h3>
<fieldset>
<!-- ADS ADS ADS ADS ADS ADS ADS ADS ADS -->
<!-- ADS ADS ADS ADS ADS ADS ADS ADS ADS -->
<br />
<?php
$parsec = new jsonRPCClient($jsonrpc_server);
$balance = $parsec->getbalance();
$balanceDisponible = $balance['available_balance'];
$lockedBalance = $balance['locked_amount'];
//$dividirEntre = 1000000000000; // moved to config.php
$totalPARS = ($balanceDisponible+$lockedBalance)/$dividirEntre;
$recaptcha = new Recaptcha($keys);
//Available Balance
$balanceDisponibleFaucet = number_format(round($balanceDisponible/$dividirEntre,12),12,'.', '');
?>
<form action="request.php" method="POST">
<?php
if(isset($_GET['msg'])){
$mensaje = $_GET['msg'];
if($mensaje == "captcha"){
?>
<div id="alert" class="alert alert-error radius">
Invalid Captcha, enter correct.
</div>
<?php
} else
if($mensaje == "wallet"){
?>
<div id="alert" class="alert alert-error radius">
Enter the correct Parsec wallet address
</div>
<?php
}else
if($mensaje == "success"){
?>
<div class="alert alert-success radius">
You Received <?php echo $_GET['amount']; ?> PARS.<br/><br/>
You Will Receive <?php echo $_GET['amount']-($transactionFee/$dividirEntre); ?> PARS. (Network Commission) <?php echo $transactionFee/$dividirEntre ?>)<br/>
<a target="_blank" href="http://parsecnodes.com/?hash=<?php echo $_GET['txid']; ?>#blockchain_transaction">Check the Blockchain</a>
</div>
<?php } else
if($mensaje == "paymentID"){
?>
<div id="alert" class="alert alert-error radius">
Check your payment ID. <br>It must consist of 64 characters without special characters.
</div>
<?php } else
if($mensaje == "notYet"){
?>
<div id="alert" class="alert alert-warning radius">
Parsec (PARS) Issued Every 12 Hours. Come Back Later.
</div>
<?php }
}
?>
<div class="alert alert-info radius">
BALANCE: <?php echo $balanceDisponibleFaucet ?> PARS.<br>
<?php
$link = mysqli_connect($hostDB, $userDB, $passwordDB, $database);
$query = "SELECT SUM(payout_amount) FROM `payouts`;";
$result = mysqli_query($link, $query);
$dato = mysqli_fetch_array($result);
$query2 = "SELECT COUNT(*) FROM `payouts`;";
$result2 = mysqli_query($link, $query2);
$dato2 = mysqli_fetch_array($result2);
mysqli_close($link);
?>
Handed Out: <?php echo $dato[0]/$dividirEntre; ?> PARS. for <?php echo $dato2[0];?> VIP(s).
</div>
<?php
if($balanceDisponibleFaucet<1.0){
?>
<div class="alert alert-warning radius">
The tap is empty or the balance is less than the receiving amount. <br> Come back later – to see if tap has been replenished.
</div>
<?php
} elseif (!$link) {
// $link = mysqli_connect($hostDB, $userDB, $passwordDB, $database);
die('Connection error ' . mysql_error());
} else {
?>
<input type="text" name="wallet" required placeholder="Parsec Address">
<input type="text" name="paymentid" placeholder="Payment ID (Not necessary)" >
<br/>
<!-- ADS ADS ADS ADS ADS ADS ADS ADS ADS -->
<!-- ADS ADS ADS ADS ADS ADS ADS ADS ADS -->
<br/>
<?php
echo $recaptcha->render();
?>
<center><input type="submit" value="Get Free Parsec!"></center>
<br>
<!-- ADS ADS ADS ADS ADS ADS ADS ADS ADS -->
<!-- ADS ADS ADS ADS ADS ADS ADS ADS ADS -->
<?php
}
?>
<br>
<?php /*
<div class="table-responsive">
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th><h6><b>Cleared Sites</b><br> <small>Sites that have their wallets allowed to request more than 1 time but only with a different payment id.</small></h6></th>
</tr>
</thead>
<tbody>
<?php foreach ($clearedAddresses as $key => $item) {
echo "<tr>
<th>".$key."</th>
</tr>";
}?>
</tbody>
</table>
</div>*/
?>
<div class="table-responsive">
<h6><b>Last 6 replenishments</b></h6>
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th>Date</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<?php
$deposits = ($parsec->get_transfers());
$transfers = array_reverse(($deposits["transfers"]),true);
$contador = 0;
foreach($transfers as $deposit){
if($deposit["output"] == ""){
if($contador < 6){
$time = $deposit["time"];
echo "<tr>";
echo "<th>".gmdate("Y-m-d H:i:s", $time)."</th>";
echo "<th>".round($deposit["amount"]/$dividirEntre,8)."</th>";
echo "</tr>";
$contador++;
}
}
}
?>
</tbody>
</table>
</div>
<p style="font-size:10px;">Donate Parsec to Tap:. <br>Address: <?php echo $faucetAddress; ?><br>© 2022 Faucet by <a href="https://github.com/parsecnode/Parsec-Faucet" target="_blank">Lightyear</a><br/></p></center>
<footer class="clearfix">
</footer>
</form>
</fieldset>
</div> <!-- end login-form -->
</div>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<?php if(isset($_GET['msg'])) { ?>
<script>
setTimeout( function(){
$( "#alert" ).fadeOut(3000, function() {
});
} , 10000 );
</script>
<?php } ?>
</body>
</html>