#include ", "", "") or die("Unable to connect to SQL server"); pg_exec ($dbh, "SET DateStyle = 'ISO'") or die("Datenbank-Abfrage!"); if (isset($_GET['month'])) $month = $_GET['month']; else $month = date('Y-m'); ?> %s > '; $table_foot = '
Datum Dauer Verwendungszweck
'; $table_row = '%s%s%s'; $table_sum = ' %sSum'; $query = "SELECT oid,start,customer,time,task FROM stempel WHERE time IS NOT NULL "; if (isset($month) && $month !== 'all') $query .= "AND start LIKE '".$month."-%' "; $query .= "ORDER BY customer,start"; $sth = pg_exec ($dbh, $query); $customer = ''; while ($row = pg_fetch_array ($sth)) { if ($customer != $row['customer']) { if (strlen($customer)) { printf($table_sum, $color, min2hour($sum)); echo($table_foot); } printf($table_head, $row['customer']); $customer = $row['customer']; $sum = 0; $color = ""; } $sum += $row['time']; $d = explode(' ', $row['start']); printf($table_row, $color, $d[0], min2hour($row['time']), $row['oid'], $row['task']); $color = $color==""?"":""; } printf($table_sum, $color, min2hour($sum)); echo($table_foot); ?>
# Local variables: # mode: text # mode: auto-fill # end: