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 class=font 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!");
26 if ((strlen ($currency) > 0) && ($currency == "dm")) {
27 $table = "account_dm";
32 $where[] = "blz_kto = '$blzkto'";
34 $where[] = sprintf ("datum >= '%04d-01-01'", $year);
36 $where[] = sprintf ("datum < '%04d-01-01'", $year);
38 if (strlen($statement)) {
39 $where[] = "statement = '$statement'";
41 if (strlen($category)) {
42 $where[] = "category = '$category'";
44 if (strlen($keyword)) {
45 $where[] = "descr ~* '$keyword'";
47 if (strlen($from_to)) {
48 $where[] = "from_to = '$from_to'";
50 if ($input && !$output) {
51 $where[] = "$value > 0.0";
52 } elseif ($output && !$input) {
53 $where[] = "$value < 0.0";
56 $query = "SELECT datum,oid,category,descr,$value FROM $table WHERE "
57 . implode ($where, " AND ")
58 . " ORDER BY datum,oid";
59 $sth = pg_exec ($dbh, $query) or die("Datenbank-Abfrage!");
65 for ($nr=0; $nr < pg_NumRows ($sth); $nr++) {
66 $row = pg_fetch_array ($sth, $nr);
67 $color = $color=="<cold>"?"<coln>":"<cold>";
71 $date = explode (" ", $row['datum']);
72 $date = explode ("-", $date[0]);
73 $date = sprintf ("%d.%d.%d", $date[2], $date[1], $date[0]);
75 printf ("<tr bgcolor=\"#%s\">", $color);
76 printf ("<td width=\"10%%\" align=\"right\"><font face=\"Helvetica,Arial\">%s</font></td>", $date);
77 printf ("<td width=\"10%%\" align=\"center\"><font face=\"Helvetica,Arial\">%s</font></td>", $row['category']);
78 printf ("<td width=\"70%%\"><font face=\"Helvetica,Arial\"><a href=\"edit.php3?oid=%d%s\">%s</a></font></td>",
79 $row['oid'], $add, $descr[0]);
80 printf ("<td width=\"10%%\" align=\"right\"><font face=\"Helvetica,Arial\">%5.2f</font></td>", $row[$value]);
82 if ($row[$value] > 0) {
83 $sum_in += $row[$value];
85 $sum_out += $row[$value];
90 echo ("<th width=\"90%\" colspan=\"3\"><font face=\"Helvetica,Arial\">Summe</font></th>");
91 printf ("<th width=\"10%%\" align=\"right\"><font face=\"Helvetica,Arial\">%5.2f</font></th>", $sum);
93 if (strlen($statement)) {
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);
99 echo ("<th width=\"90%\" colspan=\"3\"><font face=\"Helvetica,Arial\">Summe Ausgaben</font></th>");
100 printf ("<th width=\"10%%\" align=\"right\"><font face=\"Helvetica,Arial\">%5.2f</font></th>", $sum_out*-1);
107 <? printf ("<a href=\"edit.php3?blzkto=%s\">Neuer Eintrag</a>", $blzkto); ?>