updated report page
git-svn-id: svn://anubis/tipman@5 ce01c143-e732-0410-ac0e-c064f6e6c7ef
This commit is contained in:
parent
159338a18c
commit
6b0600ac4d
10
report.css
Normal file
10
report.css
Normal file
@ -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;
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
include_once("vars.inc");
|
include_once("vars.inc");
|
||||||
|
include_once("functions.inc");
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
@ -18,7 +19,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Some variables */
|
/* Some variables */
|
||||||
$user = $_SESSION['user'];
|
$userID = get_userID($_SESSION['user']);
|
||||||
$year = $_GET['year'];
|
$year = $_GET['year'];
|
||||||
$tip_totals = Array();
|
$tip_totals = Array();
|
||||||
|
|
||||||
@ -27,6 +28,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>TipMan Report for $year</title>
|
<title>TipMan Report for $year</title>
|
||||||
|
<link rel="stylesheet" href="report.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
EOP;
|
EOP;
|
||||||
@ -38,7 +40,7 @@ SELECT MONTH(tips.date) AS month,
|
|||||||
IF(DAYOFMONTH(tips.date) < 16, 1, 2) AS period,
|
IF(DAYOFMONTH(tips.date) < 16, 1, 2) AS period,
|
||||||
SUM(tips.amount) AS tip_total
|
SUM(tips.amount) AS tip_total
|
||||||
FROM tips
|
FROM tips
|
||||||
WHERE user = $user
|
WHERE user = $userID
|
||||||
AND YEAR(tips.date) = $year
|
AND YEAR(tips.date) = $year
|
||||||
GROUP BY month, period;
|
GROUP BY month, period;
|
||||||
EOQ
|
EOQ
|
||||||
@ -65,12 +67,13 @@ EOQ
|
|||||||
$tip_totals[$monthIndex][2] = 0;
|
$tip_totals[$monthIndex][2] = 0;
|
||||||
|
|
||||||
/* Print a row in the report table */
|
/* Print a row in the report table */
|
||||||
print('<td>');
|
print('<tr>');
|
||||||
printf('<td rowspan="2">%s</td>', date('F', $monthTimestamp));
|
printf('<td rowspan="2">%s</td>', date('F', $monthTimestamp));
|
||||||
print('<td>1 - 15</td>');
|
print('<td>1 - 15</td>');
|
||||||
printf('<td>$%.2f</td>', $tip_totals[$monthIndex][1]);
|
printf('<td>$%.2f</td>', $tip_totals[$monthIndex][1]);
|
||||||
printf('<td rowspan="2">$%.2f</td>',
|
printf('<td rowspan="2">$%.2f</td>',
|
||||||
$tip_totals[$monthIndex][1] + $tip_totals[$monthIndex][2]);
|
$tip_totals[$monthIndex][1] + $tip_totals[$monthIndex][2]);
|
||||||
|
print('</tr><tr>');
|
||||||
printf('<td>16 - %d</td>', date('t', $monthTimestamp));
|
printf('<td>16 - %d</td>', date('t', $monthTimestamp));
|
||||||
printf('<td>$%.2f</td>', $tip_totals[$monthIndex][2]);
|
printf('<td>$%.2f</td>', $tip_totals[$monthIndex][2]);
|
||||||
print("</tr>\n");
|
print("</tr>\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user