diff --git a/report.css b/report.css new file mode 100644 index 0000000..3deae07 --- /dev/null +++ b/report.css @@ -0,0 +1,10 @@ +table { + border-top: solid 1px #000; + border-left: solid 1px #000; +} + +th, td { + border-bottom: solid 1px #000; + border-right: solid 1px #000; + padding: 2px 1ex; +} diff --git a/report.php b/report.php index 4861d59..5ebfc81 100644 --- a/report.php +++ b/report.php @@ -1,5 +1,6 @@ TipMan Report for $year + EOP; @@ -38,7 +40,7 @@ SELECT MONTH(tips.date) AS month, IF(DAYOFMONTH(tips.date) < 16, 1, 2) AS period, SUM(tips.amount) AS tip_total FROM tips -WHERE user = $user +WHERE user = $userID AND YEAR(tips.date) = $year GROUP BY month, period; EOQ @@ -65,12 +67,13 @@ EOQ $tip_totals[$monthIndex][2] = 0; /* Print a row in the report table */ - print(''); + print(''); printf('%s', date('F', $monthTimestamp)); print('1 - 15'); printf('$%.2f', $tip_totals[$monthIndex][1]); printf('$%.2f', $tip_totals[$monthIndex][1] + $tip_totals[$monthIndex][2]); + print(''); printf('16 - %d', date('t', $monthTimestamp)); printf('$%.2f', $tip_totals[$monthIndex][2]); print("\n");