</tr>';
$table_foot = '</table>';
$table_row = '<tr bgcolor=#%s><td>%s</td><td>%s</td><td><a href="edit.php?id=%d">%s</a></td></tr>';
+ $table_sum = '<tr bgcolor=#%s><td> </td><td>%s</td><td>Sum</td></tr>';
$query = "SELECT oid,start,customer,time,task FROM stempel WHERE time IS NOT NULL ";
if (isset($month) && $month !== 'all')
while ($row = pg_fetch_array ($sth)) {
if ($customer != $row['customer']) {
- if (strlen($customer))
+ if (strlen($customer)) {
+ printf($table_sum, $color, min2hour($sum));
echo($table_foot);
+ }
printf($table_head, $row['customer']);
$customer = $row['customer'];
- $color = "<cold>";
+ $sum = 0;
+ $color = "<coln>";
}
+ $sum += $row['time'];
$d = explode(' ', $row['start']);
- $color = $color=="<cold>"?"<coln>":"<cold>";
printf($table_row, $color, $d[0], min2hour($row['time']), $row['oid'], $row['task']);
+ $color = $color=="<cold>"?"<coln>":"<cold>";
}
+ printf($table_sum, $color, min2hour($sum));
+ echo($table_foot);
?>
-</table>
</page>