1 #include <infocon.style>
4 <page func=InfoCon title="Kontoführung">
12 if ((strlen ($_GET[cur]) > 0) && ($_GET[cur] == "dm")) {
13 $table = "account_dm";
15 $hidden = '<input type=hidden name=currency value="dm">';
16 $add = "¤cy=dm";
19 if (!isset($_GET[blzkto]) && isset($_GET[id])) {
20 pg_exec ($dbh, "SET DateStyle = 'ISO'") or die("Datenbank-Abfrage!");
22 $query = "SELECT $table.blz_kto,datum,category,descr,from_to,statement,$value,name "
23 ."FROM $table JOIN account_names using(blz_kto) "
24 ."WHERE $table.id = $_GET[id]";
25 $sth = pg_exec ($dbh, $query) or die("Datenbank-Abfrage!");
27 if (pg_NumRows ($sth) > 0) {
28 $row = pg_fetch_array ($sth, 0);
29 $date = explode (" ", $row['datum']);
30 $date = explode ("-", $date[0]);
31 $date = sprintf ("%d.%d.%d", $date[2], $date[1], $date[0]);
32 $blzkto = $row['blz_kto'];
33 $add .= '&blzkto='. $blzkto;
36 $blzkto = $_GET[blzkto];
40 <style type="text/css">
50 background-color: #1aa2fe;
56 border: solid #1aa2fe;
63 border: solid #1aa2fe;
68 border: 1px solid #1aa2fe;
74 <h3 class=bar><?=$row['name']?></h3>
76 <form method=post action="update.php">
77 <input class=none type="hidden" name="id" value="<? echo $_GET[id]; ?>">
79 echo ("<input class=\"none\" type=\"hidden\" name=\"blzkto\" value=\"$blzkto\">");
83 <label for=statement>Auszug</label>
84 <input id=statement name=statement size=15 maxlength=15 value="<?=$row['statement']?>" tabindex=1>
87 <label for=datum>Datum</label>
88 <input id=datum name=datum size=15 maxlength=10 value="<?=$date?>" tabindex=2>
92 <label for=category>Kategorie</label>
93 <select id=category name=category tabindex=3>
96 $query = "SELECT DISTINCT category FROM $table WHERE blz_kto = '$blzkto' ORDER BY category";
97 $sth = pg_exec ($dbh, $query);
99 for ($nr=0; $nr <pg_NumRows ($sth); $nr++) {
100 $cat = pg_fetch_array ($sth, $nr);
101 printf ("<option value=\"%s\"%s>%s", $cat['category'], $cat['category'] == $row['category']?" selected":"", $cat['category']);
103 ?></select> <input id=category name=newcategory size=20 maxlength=50 value="" tabindex=4>
106 <label for=from_to>Abs./Empf.</label>
107 <select id=from_to name=from_to tabindex=5>
110 $query = "SELECT DISTINCT from_to FROM $table ";
112 if (!isset($_GET[id])) {
113 $query .= "WHERE blz_kto = '$blzkto' AND datum >= now() - interval '2 years' ";
116 $query .= "ORDER BY from_to";
118 $sth = pg_exec ($dbh, $query);
120 for ($nr=0; $nr <pg_NumRows ($sth); $nr++) {
121 $cat = pg_fetch_array ($sth, $nr);
122 printf ("<option value=\"%s\"%s>%s", $cat['from_to'], $cat['from_to'] == $row['from_to']?" selected":"", $cat['from_to']);
124 ?></select> <input id=from_to name=newfrom_to size=30 maxlength=120 value="" tabindex=6>
127 <label for=value>Betrag</label>
128 <input id=value name=value size=40 maxlength=20 value="<? echo $row[$value]; ?>" tabindex=7>
131 <label for=descr>Verwendungszweck</label>
132 <textarea id=descr name=descr rows=5 cols=67 tabindex=8><? echo $row['descr']; ?></textarea>
135 <? if (isset ($_GET[id])) { ?>
136 <input class=button type=submit value="Update" tabindex=9>
138 <input class=button type=submit value="Delete" name=delete tabindex=9>
140 <input class=button type=submit value="Insert" tabindex=9>
145 <h3 class=bar>Hinweise zur Bearbeitung</h3>
149 <li> Das Datum wird in der Form dd.mm.yyyy erwartet
151 <li> Wenn die Kategorie bzw. Absender/Empfänger noch nicht existieren,
152 werden diese manuell im Textfeld eingegeben
154 <li> Betrag als 999.44 angeben.
156 <li> Die erste Zeile des Verwendungszwecks wird in der Übersicht angezeigt