EDITEDShow Users Info and Pending Payments (balance >= $cashout) on Admin Panel (Primitive Way)
templates/admin.php @ line 28
<li><a data-target="#users" data-toggle="tab">Users</a></li>
<li><a data-target="#payments" data-toggle="tab">Payments</a></li>
templates/admin.php @ line 65
<div class="tab-pane" id="users">
<h4>Users</h4>
<div class="span6">
<table class="well table table-striped">
<caption>Users</caption>
<thead>
<tr>
<th>ID</th>
<th>Address</th>
<th>Balance</th>
<th>Referrals</th>
<th>Referred by</th>
</tr>
</thead>
<tbody>
<?php
while ($users = fetch_assoc($getUsersData_query)):
$userReferrals_query = sql_query("SELECT COUNT(*) AS referrals FROM balances WHERE referredby = '".$users['id']."'");
$referrals = fetch_assoc($userReferrals_query); ?>
<tr>
<td><span id="summary-user-id"><?php echo $users["id"]; ?></span></td>
<td><span id="summary-user-address"><?php echo $users["email"]; ?></span></td>
<td><span id="summary-user-balance"><?php echo $users["balance"]; ?></span></td>
<td><span id="summary-user-referrals"><?php echo $referrals["referrals"]; ?></span></td>
<td><span id="summary-user-referred"><?php echo $users["referredby"]; ?></span></td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>
<div class="tab-pane" id="payments">
<h4>Payments</h4>
<div class="span6">
<table class="well table table-striped">
<caption>Payments Pending</caption>
<tbody>
<tr>
<td>Number of addresses</td>
<td><span id="summary-addresses"><?php echo $paymentAddresses["num_addresses"]; ?></span></td>
</tr>
<?php while ($usersPayment = fetch_assoc($usersPaymentData_query)): ?>
<tr>
<td>ID </td>
<td><span id="summary-user-id"><?php echo $usersPayment["id"]; ?></span></td>
<td>Address </td>
<td><span id="summary-user-address"><?php echo $usersPayment["email"]; ?></span></td>
<td>Balance </td>
<td><span id="summary-user-balance"><?php echo $usersPayment["balance"]; ?></span></td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>
</div>
index.php @ line 147
$sql = "SELECT * FROM balances WHERE email <> 'SERVERBALANCE' ORDER BY balance DESC";
$getUsersData_query = sql_query($sql);
$app->view()->setData('getUsersData_query', $getUsersData_query);
$sql = "SELECT COUNT(*) AS num_addresses FROM balances WHERE email <> 'SERVERBALANCE' AND balance >= '10000'";
$paymentAddresses_query = sql_query($sql);
$paymentAddresses = fetch_assoc($paymentAddresses_query);
$app->view()->setData('paymentAddresses', $paymentAddresses);
$sql = "SELECT * FROM balances WHERE email <> 'SERVERBALANCE' AND balance >= '10000'";
$usersPaymentData_query = sql_query($sql);
$app->view()->setData('usersPaymentData_query', $usersPaymentData_query);
Still somethings to do... In index.php the $cashout isn't accepted, meanwhile I changed to the actual value.
EDITtemplates/faucet @line 35 (?)
<script>
var secsLeft = <?php echo $forcewait; ?>;
setInterval(function(){
secsLeft--;
if(secsLeft > 0){
$("#claimbtn").attr("disabled", true);
$('#claimbtn').val('Wait ' + secsLeft + 's');
} else if(secsLeft == 0){
$("#claimbtn").attr("disabled", false);
$('#claimbtn').removeClass('disabled');
$('#claimbtn').val('Claim');
}
}, 1000);
</script>
When timer was set, the button was clickable even with the time counting. $("#claimbtn").attr("disabled", true); will manage disable attribute for the input button.