af55e15ccbf87eec9d2afebd5edb10e6956ee61f
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
5) Written 2008-2012 by schokokeks.org Hosting, namely
6)   Bernd Wurst <bernd@schokokeks.org>
7)   Hanno Böck <hanno@schokokeks.org>
8) 
9) To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
10) 
11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
12) http://creativecommons.org/publicdomain/zero/1.0/
13) 
14) Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
15) */
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

16) 
17) require_once('session/start.php');
18) 
19) require_once('invoice.php');
20) 
21) require_role(ROLE_CUSTOMER);
22) 
bernd Benutze überall title() sta...

bernd authored 13 years ago

23) title('Rechnungen');
24) output('<p>Hier können Sie Ihre bisherigen Rechnungen einsehen und herunterladen.</p>');
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

25) 
Bernd Wurst Zeige zunächst nur unbezahl...

Bernd Wurst authored 11 years ago

26) $show_paid = (isset($_GET['paid']) && $_GET['paid'] == '1');
27) 
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

28) $invoices = my_invoices();
29) 
Bernd Wurst Zeige zunächst nur unbezahl...

Bernd Wurst authored 11 years ago

30) $invoices_to_show = array();
31) foreach ($invoices as $i) {
32)   if ($show_paid || $i['bezahlt'] == 0) {
33)     array_push($invoices_to_show, $i);
34)   }
35) }
36) 
37) if (count($invoices_to_show) == 0) {
38)   $error = 'Keine Rechnungen gefunden.';
39)   if (count($invoices) == 0) {
40)     $error = 'Bisher keine Rechnungen vorhanden.';
41)   } else {
42)     $error = 'Keine offenen Rechnungen vorhanden. Klicken Sie auf den nachstehenden Link um bereits bezahlte Rechnungen zu sehen.';
43)   }
44)   if ($show_paid) {
45)   }
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

46) 
Bernd Wurst Zeige zunächst nur unbezahl...

Bernd Wurst authored 11 years ago

47)   output('<p><em>'.$error.'</em></p>');
48) } else {
49)   output('<table><tr><th>Nr.</th><th>Datum</th><th>Gesamtbetrag</th><th>bezahlt?</th><th>Herunterladen</th></tr>');
50) 
51)   foreach($invoices_to_show AS $invoice)
52)   {
53) 	  $bezahlt = 'Nein';
54)   	if ($invoice['bezahlt'] == 1)
55) 	  	$bezahlt = 'Ja';
56)   	output("<tr><td>".internal_link("html", $invoice['id'], "id={$invoice['id']}")."</td><td>{$invoice['datum']}</td><td>{$invoice['betrag']} €</td><td>{$bezahlt}</td><td>".internal_link("pdf", "PDF", "id={$invoice['id']}").' &#160; '.internal_link("html", "HTML", "id={$invoice['id']}")."</td></tr>\n");
57)   }
58) 
59)   output('</table><br />');
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

60) }
61) 
Bernd Wurst Zeige zunächst nur unbezahl...

Bernd Wurst authored 11 years ago

62) if (! $show_paid) {
63)   output('<p>'.internal_link('', 'Bereits bezahlte Rechnungen zeigen', 'paid=1').'</p>');
64) }
65) output('<p>'.internal_link('upcoming', 'Zukünftige Rechnungsposten anzeigen').'</p>');
bernd Rechnungen unterhalb von "Ü...

bernd authored 14 years ago

66)