1 #include <infocon.style>
3 <page title="Kontoführung">
5 <h1 align=center><font face="Helvetica,Arial">Kontoführung</font></h1>
7 <h3 align=center><font face="Helvetica,Arial"> - <?
8 $both = explode (":", $blzkto);
9 printf ("BLZ %s, Konto %s", $both[0], $both[1]);
12 <table width=100% border=1 cellpadding=2 cellspacing=0>
14 <th width=15%>Datum</th>
15 <th width=20%>Kategorie</th>
16 <th width=50%>Verwendungszweck</th>
17 <th width=15%>Betrag</th>
20 $dbh = pg_pconnect ("kuolema", "5432", "<db>")
21 or die("Unable to connect to SQL server");
23 pg_exec ($dbh, "SET DateStyle = 'ISO'") or die("Datenbank-Abfrage!");
25 $where[] = "blz_kto = '$blzkto'";
27 $where[] = "datum >= '$year-01-01'";
29 $where[] = "datum < '$year-01-01'";
31 if (strlen($category)) {
32 $where[] = "category = '$category'";
34 if (strlen($from_to)) {
35 $where[] = "from_to = '$from_to'";
37 if ($input && !$output) {
38 $where[] = "value_dm > 0.0";
39 } elseif ($output && !$input) {
40 $where[] = "value_dm < 0.0";
43 $query = "SELECT datum,oid,category,descr,value_dm FROM account WHERE "
44 . implode ($where, " AND ")
45 . " ORDER BY datum,oid";
46 $sth = pg_exec ($dbh, $query) or die("Datenbank-Abfrage!");
49 for ($nr=0; $nr < pg_NumRows ($sth); $nr++) {
50 $row = pg_fetch_array ($sth, $nr);
54 $date = explode (" ", $row['datum']);
55 $date = explode ("-", $date[0]);
56 $date = sprintf ("%d.%d.%d", $date[2], $date[1], $date[0]);
59 printf ("<td width=\"15%%\" align=\"right\">%s</td>", $date);
60 printf ("<td width=\"20%%\">%s</td>", $row['category']);
61 printf ("<td width=\"50%%\"><a href=\"edit.php3?oid=%d\">%s</a></td>", $row['oid'], $descr[0]);
62 printf ("<td width=\"15%%\" align=\"right\">%5.2f</td>", $row['value_dm']);
63 $sum += $row['value_dm'];
67 echo ("<td width=\"85%\" colspan=\"3\">Summe</td>");
68 printf ("<td width=\"15%%\" align=\"right\">%5.2f</td>", $sum);
74 <? printf ("<a href=\"edit.php3?blzkto=%s\">Neuer Eintrag</a>", $blzkto); ?>