#include

- -

> ", "", "") or die("Unable to connect to SQL server"); pg_exec ($dbh, "SET DateStyle = 'ISO'") or die("Datenbank-Abfrage!"); $table = "account"; $value = "value_eur"; $add = ''; if ((strlen ($currency) > 0) && ($currency == "dm")) { $table = "account_dm"; $value = "value_dm"; $add = "&cur=dm"; } $where[] = "blz_kto = '$blzkto'"; if (strlen($year)) { $where[] = sprintf ("datum >= '%04d-01-01'", $year); $year++; $where[] = sprintf ("datum < '%04d-01-01'", $year); } if (strlen($statement)) { $where[] = "statement = '$statement'"; } if (strlen($category)) { $where[] = "category = '$category'"; } if (strlen($from_to)) { $where[] = "from_to = '$from_to'"; } if ($input && !$output) { $where[] = "$value > 0.0"; } elseif ($output && !$input) { $where[] = "$value < 0.0"; } $query = "SELECT datum,oid,category,descr,$value FROM $table WHERE " . implode ($where, " AND ") . " ORDER BY datum,oid"; $sth = pg_exec ($dbh, $query) or die("Datenbank-Abfrage!"); $sum = 0.0; $color = ""; for ($nr=0; $nr < pg_NumRows ($sth); $nr++) { $row = pg_fetch_array ($sth, $nr); $color = $color==""?"":""; $descr = explode (" ", $row['descr']); $date = explode (" ", $row['datum']); $date = explode ("-", $date[0]); $date = sprintf ("%d.%d.%d", $date[2], $date[1], $date[0]); printf ("", $color); printf ("", $date); printf ("", $row['category']); printf ("", $row['oid'], $add, $descr[0]); printf ("", $row[$value]); $sum += $row[$value]; echo (""); } echo (""); echo (""); printf ("", $sum); echo (""); ?>
Datum Kategorie Verwendungszweck Betrag
%s%s%s%5.2f
Summe%5.2f

Neuer Eintrag", $blzkto); ?> # Local variables: # mode: text # mode: auto-fill # end: