Display only visible items
authorJoey Schulze <joey@infodrom.org>
Mon, 6 Nov 2017 21:25:39 +0000 (22:25 +0100)
committerJoey Schulze <joey@infodrom.org>
Mon, 6 Nov 2017 21:25:39 +0000 (22:25 +0100)
src/InfoCon/buch/index.wml

index 6e2fe54..1e2084c 100644 (file)
@@ -51,7 +51,7 @@ span.in:hover, span.out:hover { background: yellow; border: 1px solid #ccc; }
 
 <?
   $form = 0;
 
 <?
   $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) {
   $sth = pg_exec ($dbh, $query);
 
   if (pg_NumRows ($sth) > 0) {
@@ -68,7 +68,7 @@ span.in:hover, span.out:hover { background: yellow; border: 1px solid #ccc; }
     printf (" %d. %s %s (%.2f&nbsp;DM)<br>", $row['nr'], $date, $row['description'], $row['price']);
   }
 
     printf (" %d. %s %s (%.2f&nbsp;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) {
   $sth = pg_exec ($dbh, $query);
 
   if (!form && pg_NumRows ($sth) > 0) {