1 #include <infocon.style>
4 <page func=InfoCon title="Kontoführung">
6 <h3 class=bar align=center><font face="Helvetica,Arial"> - <?
7 $both = explode (":", $blzkto);
8 printf ("BLZ %s, Konto %s", $both[0], $both[1]);
11 <table class=font width=100% border=0 cellpadding=2 cellspacing=0>
13 <th width=10%><font face="Helvetica,Arial">Datum</font></th>
14 <th width=10%><font face="Helvetica,Arial">Kategorie</font></th>
15 <th width=70%><font face="Helvetica,Arial">Verwendungszweck</font></th>
16 <th width=10%><font face="Helvetica,Arial">Betrag</font></th>
19 pg_exec ($dbh, "SET DateStyle = 'ISO'") or die("Datenbank-Abfrage!");
24 if ((strlen ($currency) > 0) && ($currency == "dm")) {
25 $table = "account_dm";
30 $where[] = "blz_kto = '$blzkto'";
32 $where[] = sprintf ("datum >= '%04d-01-01'", $year);
34 $where[] = sprintf ("datum < '%04d-01-01'", $year);
36 if (strlen($statement)) {
37 $where[] = "statement = '$statement'";
39 if (strlen($category)) {
40 $where[] = "category = '$category'";
42 if (strlen($keyword)) {
43 $where[] = "descr ~* '$keyword'";
45 if (strlen($from_to)) {
46 $where[] = "from_to = '$from_to'";
48 if ($input && !$output) {
49 $where[] = "$value > 0.0";
50 } elseif ($output && !$input) {
51 $where[] = "$value < 0.0";
54 $query = "SELECT datum,oid,category,descr,$value FROM $table WHERE "
55 . implode ($where, " AND ")
56 . " ORDER BY datum,oid";
57 $sth = pg_exec ($dbh, $query) or die("Datenbank-Abfrage!");
63 for ($nr=0; $nr < pg_NumRows ($sth); $nr++) {
64 $row = pg_fetch_array ($sth, $nr);
65 $color = $color=="<cold>"?"<coln>":"<cold>";
69 $date = explode (" ", $row['datum']);
70 $date = explode ("-", $date[0]);
71 $date = sprintf ("%d.%d.%d", $date[2], $date[1], $date[0]);
73 printf ("<tr bgcolor=\"#%s\">", $color);
74 printf ("<td width=\"10%%\" align=\"right\"><font face=\"Helvetica,Arial\">%s</font></td>", $date);
75 printf ("<td width=\"10%%\" align=\"center\"><font face=\"Helvetica,Arial\">%s</font></td>", $row['category']);
76 printf ("<td width=\"70%%\"><font face=\"Helvetica,Arial\"><a href=\"edit.php3?oid=%d%s\">%s</a></font></td>",
77 $row['oid'], $add, $descr[0]);
78 printf ("<td width=\"10%%\" align=\"right\"><font face=\"Helvetica,Arial\">%5.2f</font></td>", $row[$value]);
80 if ($row[$value] > 0) {
81 $sum_in += $row[$value];
83 $sum_out += $row[$value];
87 $color = $color=="<cold>"?"<coln>":"<cold>";
88 printf ("<tr bgcolor=\"#%s\">", $color);
89 echo ("<th width=\"90%\" colspan=\"3\"><font face=\"Helvetica,Arial\">Summe</font></th>");
90 printf ("<th width=\"10%%\" align=\"right\"><font face=\"Helvetica,Arial\">%5.2f</font></th>", $sum);
92 if (strlen($statement)) {
93 $color = $color=="<cold>"?"<coln>":"<cold>";
94 printf ("<tr bgcolor=\"#%s\">", $color);
95 echo ("<th width=\"90%\" colspan=\"3\"><font face=\"Helvetica,Arial\">Summe Einnahmen</font></th>");
96 printf ("<th width=\"10%%\" align=\"right\"><font face=\"Helvetica,Arial\">%5.2f</font></th>", $sum_in);
98 $color = $color=="<cold>"?"<coln>":"<cold>";
99 printf ("<tr bgcolor=\"#%s\">", $color);
100 echo ("<th width=\"90%\" colspan=\"3\"><font face=\"Helvetica,Arial\">Summe Ausgaben</font></th>");
101 printf ("<th width=\"10%%\" align=\"right\"><font face=\"Helvetica,Arial\">%5.2f</font></th>", $sum_out*-1);
108 <? printf ("<a href=\"edit.php3?blzkto=%s\">Neuer Eintrag</a>", $blzkto); ?>