#include <infocon.style>
<page func=InfoCon title="Buchhaltung">
+<calendar_init -5>
<style type="text/css">
span.in { color: green; }
span.in:hover, span.out:hover { background: yellow; border: 1px solid #ccc; }
</style>
-<h3>Nicht bezahlte Rechnungen</h3>
+<h3>Übersichten</h3>
<?
$dbh = pg_pconnect ("<dbhost>", "<dbport>", "<dbname>")
<?
$form = 0;
- $query = "SELECT nr,date,description,price FROM sales_dm WHERE paid=0 ORDER BY date,nr";
+ $query = "SELECT nr,date,description,price FROM sales_dm WHERE paid=0 AND visible=1 ORDER BY date,nr";
$sth = pg_exec ($dbh, $query);
if (pg_NumRows ($sth) > 0) {
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";
+ $query = "SELECT nr,date,description,price FROM sales WHERE paid=0 AND visible=1 ORDER BY date,nr";
$sth = pg_exec ($dbh, $query);
if (!form && pg_NumRows ($sth) > 0) {
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 ('<span class="%s">%d. %s %s (%.2f €)</span><br>',
+ 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']);
}