First Commit

This commit is contained in:
mark committed 2026-10-19 15:22:52 -07:00
1 parent 5eb9dd037d
commit 2e62c0e60b
11877 files changed
+2035312

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
<?php
include "/m/data1/app.hotlunches.net/db.php";
$year = date("Y",time() + 60 * 60 * 24 * 27);
$month = date("m",time() + 60 * 60 * 24 * 27);
$total = 0;
$gtotal = 0;
$ttotal = 0;
$Amounts = array();
for ($i = 1; $i < 38; $i++) {
$m = $month - $i;
if ($m < 1) {
$m += 12;
if ($m < 1) $m += 12;
if ($m < 1) $m += 12;
if ($m < 1) $m += 12;
if ($m == 12) $year--;
}
$m = sprintf("%02d",$m);
$date = "$year-$m";
$query = "SELECT sum(payment_amount) AS total, count(*) AS number FROM `user_bambora_transactions` WHERE `posting_time` LIKE '$date-%'";
$results = db_query($query);
$row = db_fetch_assoc($results);
extract($row);
$gtotal += $total;
$ttotal += $number;
$Amounts[$date] = sprintf("%8s: %8d %16s\n",$date,$number,'$'.number_format($total,2));
// $Amounts[$date] = sprintf("%s,%d,%s\n",$date,$number,$total);
}
sort($Amounts);
for ($i = 0; $i < count($Amounts); $i++) echo($Amounts[$i]);
printf("%8s: %8d %16s\n","TOTAL",$ttotal,'$'.number_format($gtotal,2));
?>