#include <infocon.style>
<page func=InfoCon title="Buchhaltung">
+<calendar_init -5>
-<h3>Nicht bezahlte Rechnungen</h3>
+<style type="text/css">
+span.in { color: green; }
+span.out { color: red; }
+span.in:hover, span.out:hover { background: yellow; border: 1px solid #ccc; }
+</style>
+
+<h3>Übersichten</h3>
<?
$dbh = pg_pconnect ("<dbhost>", "<dbport>", "<dbname>")
<b>Jahr:</b> <select name=year>
<option>
<?
- $query = "SELECT DISTINCT substr(date,0,5) AS year FROM sales ORDER BY substr(date,0,5)";
+ $query = "SELECT DISTINCT substr(date,0,5) AS year FROM sales ORDER BY substr(date,0,5) DESC";
$sth = pg_exec ($dbh, $query);
for ($nr=0; $nr <pg_NumRows ($sth); $nr++) {
?></select><br>
<b>Zahlung</b>: <input type=checkbox name=input value=1 checked> Einnahmen <input type=checkbox name=output value=1 checked> Ausgaben<br>
-<p><center><input type=submit value="Query"> <input type=reset value="Reset"></center><p>
+<p><center>
+<input class=button type=submit name=submit value="List">
+<input class=button type=submit name=submit value="Overview">
+<input class=button type=submit name=submit value="Tally">
+<input class=button type=reset value="Reset">
+</center></p>
</form>
<?
for ($nr=0; $nr <pg_NumRows ($sth); $nr++) {
$row = pg_fetch_array ($sth, $nr);
$date = substr ($row['date'],6,2) . "." . substr ($row['date'],4,2) . "." . substr ($row['date'],0,4);
- printf (" <input type=\"checkbox\" name=\"pay_dm_%d\" value=\"1\">", $row['nr']);
- printf ("%d. %s %s (%.2f DM)<br>", $row['nr'], $date, $row['description'], $row['price']);
+ printf (" <input type=\"text\" id=\"date_%d\" name=\"date_%d\" size=\"6\" value=\"\">", $row['nr'], $row['nr']);
+ printf (" <img class=\"calendar\" src=\"<root_prefix>pix/calendar.gif\" onclick=\"event.cancelBubble=true;popcalendar('date_%d');\" alt=\"\">", $row['nr']);
+ printf (" %d. %s %s (%.2f DM)<br>", $row['nr'], $date, $row['description'], $row['price']);
}
$query = "SELECT nr,date,description,price FROM sales WHERE paid=0 ORDER BY date,nr";
for ($nr=0; $nr <pg_NumRows ($sth); $nr++) {
$row = pg_fetch_array ($sth, $nr);
$date = substr ($row['date'],6,2) . "." . substr ($row['date'],4,2) . "." . substr ($row['date'],0,4);
- printf (" <input type=\"checkbox\" name=\"pay_%d\" value=\"1\">", $row['nr']);
- printf ("%d. %s %s (%.2f €)<br>", $row['nr'], $date, $row['description'], $row['price']);
+ printf (" <input type=\"text\" id=\"date_%d\" name=\"date_%d\" size=\"6\" value=\"\">", $row['nr'], $row['nr']);
+ printf (" <img class=\"calendar\" src=\"<root_prefix>pix/calendar.gif\" onclick=\"event.cancelBubble=true;popcalendar('date_%d');\" alt=\"\">", $row['nr']);
+ printf (' <span class="%s">%d. %s %s (%.2f €)</span><br>',
+ $row['price'] < 0 ? 'out' : 'in',
+ $row['nr'], $date, $row['description'], $row['price']);
}
if ($form > 0) {
- echo ("<p><input type=\"submit\" value=\"Bezahlen\"> <input type=\"reset\" value=\"Reset\"><p>");
+ echo ("<p><input type=\"submit\" class=\"button\" value=\"Bezahlen\"> <input type=\"reset\" class=\"button\" value=\"Reset\"><p>");
echo ("</form>");
}
?>