projects
/
infodrom.org
/
service.infodrom.org
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9e70aad
)
Use a <select> box for the year
author
Joey Schulze
<joey@infodrom.org>
Sun, 11 Feb 2007 18:42:10 +0000
(18:42 +0000)
committer
Joey Schulze
<joey@infodrom.org>
Sun, 11 Feb 2007 18:42:10 +0000
(18:42 +0000)
src/InfoCon/buch/index.wml
patch
|
blob
|
history
diff --git
a/src/InfoCon/buch/index.wml
b/src/InfoCon/buch/index.wml
index
b2001e9
..
3282f8a
100644
(file)
--- a/
src/InfoCon/buch/index.wml
+++ b/
src/InfoCon/buch/index.wml
@@
-2,15
+2,28
@@
<page func=InfoCon title="Buchhaltung">
<page func=InfoCon title="Buchhaltung">
+<h3>Nicht bezahlte Rechnungen</h3>
+
+<?
+ $dbh = pg_pconnect ("<dbhost>", "<dbport>", "<dbname>")
+ or die("Unable to connect to SQL server");
+?>
<form method=POST action=list.php>
<input type=hidden name=blzkto value="<? echo $blzkto; ?>">
<form method=POST action=list.php>
<input type=hidden name=blzkto value="<? echo $blzkto; ?>">
-<b>Jahr</b>: <input name=year size=10 maxlength=4><br>
-<b>Kategorie:</b> <select name=category>
+<b>Jahr:</b> <select name=year>
<option>
<?
<option>
<?
- $
dbh = pg_pconnect ("<dbhost>", "<dbport>", "<dbname>")
-
or die("Unable to connect to SQL server"
);
+ $
query = "SELECT DISTINCT substr(date,0,5) AS year FROM sales ORDER BY substr(date,0,5)";
+
$sth = pg_exec ($dbh, $query
);
+ for ($nr=0; $nr <pg_NumRows ($sth); $nr++) {
+ $cat = pg_fetch_array ($sth, $nr);
+ printf ("<option value=\"%s\">%s", $cat["year"], $cat["year"]);
+ }
+?></select><br>
+<b>Kategorie:</b> <select name=category>
+<option>
+<?
$query = "SELECT DISTINCT category FROM sales ORDER BY category";
$sth = pg_exec ($dbh, $query);
$query = "SELECT DISTINCT category FROM sales ORDER BY category";
$sth = pg_exec ($dbh, $query);