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('inc/base.php');
18) require_once('inc/security.php');
19) 
20) function my_invoices()
21) {
22)   $c = (int) $_SESSION['customerinfo']['customerno'];
Bernd Wurst Zeige zunächst nur unbezahl...

Bernd Wurst authored 11 years ago

23)   $result = db_query("SELECT id,datum,betrag,bezahlt,abbuchung FROM kundendaten.ausgestellte_rechnungen WHERE kunde={$c} ORDER BY id DESC");
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

24)   $ret = array();
25)   while($line = mysql_fetch_assoc($result))
26)   	array_push($ret, $line);
27)   return $ret;
28) }
29) 
30) 
31) function get_pdf($id)
32) {
33)   $c = (int) $_SESSION['customerinfo']['customerno'];
34)   $id = (int) $id;
35)   $result = db_query("SELECT pdfdata FROM kundendaten.ausgestellte_rechnungen WHERE kunde={$c} AND id={$id}");
36)   if (mysql_num_rows($result) == 0)
37) 	system_failure('Ungültige Rechnungsnummer oder nicht eingeloggt');
38)   return mysql_fetch_object($result)->pdfdata;
39) 
40) }
41) 
42) 
43) function invoice_details($id)
44) {
45)   $c = (int) $_SESSION['customerinfo']['customerno'];
46)   $id = (int) $id;
47)   $result = db_query("SELECT kunde,datum,betrag,bezahlt,abbuchung FROM kundendaten.ausgestellte_rechnungen WHERE kunde={$c} AND id={$id}");
48)   if (mysql_num_rows($result) == 0)
49) 	system_failure('Ungültige Rechnungsnummer oder nicht eingeloggt');
50)   return mysql_fetch_assoc($result);
51) }
52) 
53) function invoice_items($id)
54) {
55)   $c = (int) $_SESSION['customerinfo']['customerno'];
56)   $id = (int) $id;
Bernd Wurst Einheit bei Rechnungsposten...

Bernd Wurst authored 11 years ago

57)   $result = db_query("SELECT id, beschreibung, datum, enddatum, betrag, einheit, brutto, mwst, anzahl FROM kundendaten.rechnungsposten WHERE rechnungsnummer={$id} AND kunde={$c}");
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

58)   if (mysql_num_rows($result) == 0)
59) 	system_failure('Ungültige Rechnungsnummer oder nicht eingeloggt');
60)   $ret = array();
61)   while($line = mysql_fetch_assoc($result))
62)   array_push($ret, $line);
63)   return $ret;
64) }
65) 
66) 
67) function upcoming_items()
68) {
69)   $c = (int) $_SESSION['customerinfo']['customerno'];
Bernd Wurst Einheit bei Rechnungsposten...

Bernd Wurst authored 11 years ago

70)   $result = db_query("SELECT anzahl, beschreibung, startdatum, enddatum, betrag, einheit, brutto, mwst FROM kundendaten.upcoming_items WHERE kunde={$c} ORDER BY startdatum ASC");