Browse code

Hinweis auf unbezahlte Rechnungen

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1364 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on05/05/2009 07:48:59
Showing1 changed files
... ...
@@ -52,19 +52,26 @@ output("<p>Auf der linken Seite sehen Sie ein Auswahlmenü mit den Funktionen, d
52 52
 
53 53
 output("<div class=\"overview\">");
54 54
 
55
-# Modul "email"
56 55
 if (have_module('email') && ($_SESSION['role'] & ROLE_MAILACCOUNT || $_SESSION['role'] & ROLE_VMAIL_ACCOUNT)) {
57 56
   output("<div class=\"block\">".internal_link("../email/chpass", "<img src=\"{$prefix}images/pwchange.png\" alt=\"\" /> Passwort ändern ")."</div>");
58 57
 }
59 58
 
60
-# Modul "index", kann man nicht ausschalten
61 59
 if ($_SESSION['role'] & ROLE_CUSTOMER || $_SESSION['role'] & ROLE_SYSTEMUSER) {
62 60
   output("<div class=\"block\">".internal_link("chpass", "<img src=\"{$prefix}images/pwchange.png\" alt=\"\" /> Passwort ändern ")."</div>");
63 61
 }
64 62
 
65
-# Modul "invoice"
66 63
 if (have_module('invoice') && $_SESSION['role'] & ROLE_CUSTOMER) {
67
-  output("<div class=\"block\">".internal_link("../invoice/current", "<img src=\"{$prefix}images/invoice.png\" alt=\"\" /> Ihre Rechnungen ")."</div>");
64
+  require_once('modules/invoice/include/invoice.php');
65
+  $unpayed_invoices = 0;
66
+  $my_invoices = my_invoices();
67
+  foreach($my_invoices AS $inv) {
68
+    if ($inv['bezahlt'] == 0)
69
+      $unpayed_invoices++;
70
+  }
71
+  $extra = '';
72
+  if ($unpayed_invoices > 0)
73
+    $extra = '<span style="color: red;">('.$unpayed_invoices.' unbezahlt)</span>';
74
+  output("<div class=\"block\">".internal_link("../invoice/current", "<img src=\"{$prefix}images/invoice.png\" alt=\"\" /> Ihre Rechnungen {$extra}")."</div>");
68 75
 }
69 76
 
70 77
 if ($_SESSION['role'] & ROLE_SYSTEMUSER) {