Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@ function(data){
$('#unpaid').html(parseFloat(data['unpaid']).toFixed(<?php echo $config['precision'] ?>) + ' <?php echo $config['val'] ?>');
$('#received').html(parseFloat(data['received']).toFixed(<?php echo $config['precision'] ?>) + ' <?php echo $config['val'] ?>');

$('#collecting').html("Collecting " + (parseFloat(data['received']) - parseFloat(data['paid'])).toFixed(<?php echo $config['precision'] ?>) + " / " + parseFloat(data['actual']['topay']).toFixed(<?php echo $config['precision'] ?>) + " for " + data['actual']['tx'].substring(0,32) + "...");
var tmp20140808 = "error";
if (data['actual']['tx'] === undefined) { // nothing
} else {
tmp20140808 = data['actual']['tx'].substring(0,32);
}

$('#collecting').html("Collecting " + (parseFloat(data['received']) - parseFloat(data['paid'])).toFixed(<?php echo $config['precision'] ?>) + " / " + parseFloat(data['actual']['topay']).toFixed(<?php echo $config['precision'] ?>) + " for " + tmp20140808 + "...");

$('#trans').html('');
for(var i in data['transactions'])
Expand Down Expand Up @@ -148,4 +154,4 @@ function(data){
update();
</script>

<?php include('footer.php'); ?>
<?php include('footer.php'); ?>
8 changes: 4 additions & 4 deletions script.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ function getAddress($trans)
}
}

$query = mysql_query("SELECT SUM(amount) FROM `transactions`;");
$query = mysql_query("SELECT SUM(amount) FROM `transactions` where `state` < 3;");
$query = mysql_fetch_row($query);
$money = $query[0];

$query = mysql_query("SELECT SUM(topay) FROM `transactions` WHERE `state` > 0;");
$query = mysql_query("SELECT SUM(topay) FROM `transactions` WHERE `state` > 0 and `state` < 3;");
$query = mysql_fetch_row($query);
$money -= $query[0];

$query = mysql_query("SELECT * FROM `transactions` WHERE `state` = 0 AND `topay` > 0 ORDER BY `id` ASC;");
$query = mysql_query("SELECT * FROM `transactions` WHERE `state` = 0 AND `state` < 3 AND `topay` > 0 ORDER BY `id` ASC;");
while($row = mysql_fetch_assoc($query))
{
print("Money: " . $money . "\n");
Expand All @@ -111,4 +111,4 @@ function getAddress($trans)
echo ("Waiting...\n");
sleep(20);
}
?>
?>