Add colors
authorJoey Schulze <joey@infodrom.org>
Sun, 24 Aug 2014 18:20:00 +0000 (18:20 +0000)
committerJoey Schulze <joey@infodrom.org>
Sun, 24 Aug 2014 18:20:00 +0000 (18:20 +0000)
src/InfoCon/buch/index.wml

index 1345467..a0685e2 100644 (file)
@@ -2,6 +2,12 @@
 
 <page func=InfoCon title="Buchhaltung">
 
+<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>Nicht bezahlte Rechnungen</h3>
 
 <?
@@ -73,7 +79,9 @@
     $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&nbsp;&euro;)<br>", $row['nr'], $date, $row['description'], $row['price']);
+    printf ('<span class="%s">%d. %s %s (%.2f&nbsp;&euro;)</span><br>',
+           $row['price'] < 0 ? 'out' : 'in',
+           $row['nr'], $date, $row['description'], $row['price']);
   }
 
   if ($form > 0) {