1 #include <infocon.style>
3 <page func=InfoCon title="Kontoführung">
5 <h3 align=center><font face="Helvetica,Arial"> - <?
6 $both = explode (":", $blzkto);
7 printf ("BLZ %s, Konto %s", $both[0], $both[1]);
10 <table width=100% border=0 cellpadding=2 cellspacing=0>
12 <th width=10%><font face="Helvetica,Arial">Datum</font></th>
13 <th width=10%><font face="Helvetica,Arial">Kategorie</font></th>
14 <th width=70%><font face="Helvetica,Arial">Verwendungszweck</font></th>
15 <th width=10%><font face="Helvetica,Arial">Betrag</font></th>
18 $dbh = pg_pconnect ("<dbhost>", "<dbport>", "<dbname>")
19 or die("Unable to connect to SQL server");
21 pg_exec ($dbh, "SET DateStyle = 'ISO'") or die("Datenbank-Abfrage!");
23 $where[] = "blz_kto = '$blzkto'";
25 $where[] = "datum >= '$year-01-01'";
27 $where[] = "datum < '$year-01-01'";
29 if (strlen($category)) {
30 $where[] = "category = '$category'";
32 if (strlen($from_to)) {
33 $where[] = "from_to = '$from_to'";
35 if ($input && !$output) {
36 $where[] = "value_dm > 0.0";
37 } elseif ($output && !$input) {
38 $where[] = "value_dm < 0.0";
41 $query = "SELECT datum,oid,category,descr,value_dm FROM account WHERE "
42 . implode ($where, " AND ")
43 . " ORDER BY datum,oid";
44 $sth = pg_exec ($dbh, $query) or die("Datenbank-Abfrage!");
48 for ($nr=0; $nr < pg_NumRows ($sth); $nr++) {
49 $row = pg_fetch_array ($sth, $nr);
50 $color = $color=="<cold>"?"<coln>":"<cold>";
54 $date = explode (" ", $row['datum']);
55 $date = explode ("-", $date[0]);
56 $date = sprintf ("%d.%d.%d", $date[2], $date[1], $date[0]);
58 printf ("<tr bgcolor=\"#%s\">", $color);
59 printf ("<td width=\"10%%\" align=\"right\"><font face=\"Helvetica,Arial\">%s</font></td>", $date);
60 printf ("<td width=\"10%%\" align=\"center\"><font face=\"Helvetica,Arial\">%s</font></td>", $row['category']);
61 printf ("<td width=\"70%%\"><font face=\"Helvetica,Arial\"><a href=\"edit.php3?oid=%d\">%s</a></font></td>", $row['oid'], $descr[0]);
62 printf ("<td width=\"10%%\" align=\"right\"><font face=\"Helvetica,Arial\">%5.2f</font></td>", $row['value_dm']);
63 $sum += $row['value_dm'];
67 echo ("<th width=\"90%\" colspan=\"3\"><font face=\"Helvetica,Arial\">Summe</font></th>");
68 printf ("<th width=\"10%%\" align=\"right\"><font face=\"Helvetica,Arial\">%5.2f</font></th>", $sum);
74 <? printf ("<a href=\"edit.php3?blzkto=%s\">Neuer Eintrag</a>", $blzkto); ?>