printf ("<option value=\"%s\">%s", $cat['category'], $cat['category']);
}
?></select><br>
-<b>Währung</b>: <input type=radio name=currency value=eur checked> Euro <input type=radio name=currency value=dm> DM<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>
pg_exec ($dbh, "SET DateStyle = 'ISO'") or die("Datenbank-Abfrage!");
- if ($_POST[currency] == "eur") {
- $table = "sales";
- } elseif ($_POST[currency] == "dm") {
- $table = "sales_dm";
- } else {
- die ("Unknown currency");
- }
+ $table = "sales";
if (strlen($_POST[year])) {
# $where[] = "date >= '$year-01-01'";
# $year++;
# $where[] = "date < '$year-01-01'";
$where[] = "date ~* '$_POST[year]'";
-
- # Implicit selection of currency
- if ($_POST[year] < 2002) {
- $table = "sales_dm";
- } elseif ($_POST[year] > 2001) {
- $table = "sales";
- }
}
if (strlen($_POST[category])) {
$where[] = "category = '$_POST[category]'";
printf ("<tr bgcolor=\"#%s\">", $color);
printf ("<td width=\"15%%\" align=\"right\">%s</td>", $date);
printf ("<td width=\"20%%\">%s</td>", $row['category']);
- printf ("<td width=\"50%%\"><a href=\"edit.php?oid=%d&cur=%s\">%s</a></td>",
- $row['oid'], $currency, $row['description']);
+ printf ("<td width=\"50%%\"><a href=\"edit.php?oid=%d\">%s</a></td>",
+ $row['oid'], $row['description']);
printf ("<td width=\"15%%\" align=\"right\">%5.2f</td>", $row['price']);
$sum += $row['price'];
echo ("</tr>");