1 #include <infocon.style>
4 <page func=InfoCon title="Kontoführung">
8 <table class=font width=100% border=0 cellpadding=2 cellspacing=0>
10 <th width=10%><font face="Helvetica,Arial">Datum</font></th>
11 <th width=10%><font face="Helvetica,Arial">Kategorie</font></th>
12 <th width=70%><font face="Helvetica,Arial">Verwendungszweck</font></th>
13 <th width=10%><font face="Helvetica,Arial">Betrag</font></th>
16 pg_exec ($dbh, "SET DateStyle = 'ISO'") or die("Datenbank-Abfrage!");
21 if ((strlen ($currency) > 0) && ($currency == "dm")) {
22 $table = "account_dm";
27 $where[] = "blz_kto = '$blzkto'";
29 $where[] = sprintf ("datum >= '%04d-01-01'", $year);
31 $where[] = sprintf ("datum < '%04d-01-01'", $year);
33 if (strlen($statement)) {
34 $where[] = "statement = '$statement'";
36 if (strlen($category)) {
37 $where[] = "category = '$category'";
39 if (strlen($keyword)) {
40 $where[] = "descr ~* '$keyword'";
42 if (strlen($from_to)) {
43 $where[] = "from_to = '$from_to'";
45 if ($input && !$output) {
46 $where[] = "$value > 0.0";
47 } elseif ($output && !$input) {
48 $where[] = "$value < 0.0";
51 $query = "SELECT datum,oid,category,descr,$value FROM $table WHERE "
52 . implode ($where, " AND ")
53 . " ORDER BY datum,oid";
54 $sth = pg_exec ($dbh, $query) or die("Datenbank-Abfrage!");
60 for ($nr=0; $nr < pg_NumRows ($sth); $nr++) {
61 $row = pg_fetch_array ($sth, $nr);
62 $color = $color=="<cold>"?"<coln>":"<cold>";
66 $date = explode (" ", $row['datum']);
67 $date = explode ("-", $date[0]);
68 $date = sprintf ("%d.%d.%d", $date[2], $date[1], $date[0]);
70 printf ("<tr bgcolor=\"#%s\">", $color);
71 printf ("<td width=\"10%%\" align=\"right\"><font face=\"Helvetica,Arial\">%s</font></td>", $date);
72 printf ("<td width=\"10%%\" align=\"center\"><font face=\"Helvetica,Arial\">%s</font></td>", $row['category']);
73 printf ("<td width=\"70%%\"><font face=\"Helvetica,Arial\"><a href=\"edit.php3?oid=%d%s\">%s</a></font></td>",
74 $row['oid'], $add, $descr[0]);
75 printf ("<td width=\"10%%\" align=\"right\"><font face=\"Helvetica,Arial\">%5.2f</font></td>", $row[$value]);
77 if ($row[$value] > 0) {
78 $sum_in += $row[$value];
80 $sum_out += $row[$value];
84 $color = $color=="<cold>"?"<coln>":"<cold>";
85 printf ("<tr bgcolor=\"#%s\">", $color);
86 echo ("<th width=\"90%\" colspan=\"3\"><font face=\"Helvetica,Arial\">Summe</font></th>");
87 printf ("<th width=\"10%%\" align=\"right\"><font face=\"Helvetica,Arial\">%5.2f</font></th>", $sum);
89 if (strlen($statement)) {
90 $color = $color=="<cold>"?"<coln>":"<cold>";
91 printf ("<tr bgcolor=\"#%s\">", $color);
92 echo ("<th width=\"90%\" colspan=\"3\"><font face=\"Helvetica,Arial\">Summe Einnahmen</font></th>");
93 printf ("<th width=\"10%%\" align=\"right\"><font face=\"Helvetica,Arial\">%5.2f</font></th>", $sum_in);
95 $color = $color=="<cold>"?"<coln>":"<cold>";
96 printf ("<tr bgcolor=\"#%s\">", $color);
97 echo ("<th width=\"90%\" colspan=\"3\"><font face=\"Helvetica,Arial\">Summe Ausgaben</font></th>");
98 printf ("<th width=\"10%%\" align=\"right\"><font face=\"Helvetica,Arial\">%5.2f</font></th>", $sum_out*-1);
105 <? printf ("<a href=\"edit.php3?blzkto=%s\">Neuer Eintrag</a>", $blzkto); ?>