bd22f03937341179a1beaf87aafcde8e61882589
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) 
Bernd Wurst Updated copyright notice (2...

Bernd Wurst authored 11 years ago

5) Written 2008-2013 by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

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 Revert "Umstellung auf mysqli"

Bernd Wurst authored 10 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();
Bernd Wurst Revert "Umstellung auf mysqli"

Bernd Wurst authored 10 years ago

25)   while($line = mysql_fetch_assoc($result))
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

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;
Bernd Wurst Revert "Umstellung auf mysqli"

Bernd Wurst authored 10 years ago

35)   $result = db_query("SELECT pdfdata FROM kundendaten.ausgestellte_rechnungen WHERE kunde={$c} AND id={$id}");
36)   if (mysql_num_rows($result) == 0)
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

37) 	system_failure('Ungültige Rechnungsnummer oder nicht eingeloggt');
Bernd Wurst Revert "Umstellung auf mysqli"

Bernd Wurst authored 10 years ago

38)   return mysql_fetch_object($result)->pdfdata;
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

39) 
40) }
41) 
42) 
43) function invoice_details($id)
44) {
45)   $c = (int) $_SESSION['customerinfo']['customerno'];
46)   $id = (int) $id;
Bernd Wurst Revert "Umstellung auf mysqli"

Bernd Wurst authored 10 years ago

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)
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

49) 	system_failure('Ungültige Rechnungsnummer oder nicht eingeloggt');
Bernd Wurst Revert "Umstellung auf mysqli"

Bernd Wurst authored 10 years ago

50)   return mysql_fetch_assoc($result);
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

51) }
52) 
53) function invoice_items($id)
54) {
55)   $c = (int) $_SESSION['customerinfo']['customerno'];
56)   $id = (int) $id;
Bernd Wurst Revert "Umstellung auf mysqli"

Bernd Wurst authored 10 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}");
58)   if (mysql_num_rows($result) == 0)
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

59) 	system_failure('Ungültige Rechnungsnummer oder nicht eingeloggt');
60)   $ret = array();
Bernd Wurst Revert "Umstellung auf mysqli"

Bernd Wurst authored 10 years ago

61)   while($line = mysql_fetch_assoc($result))
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

62)   array_push($ret, $line);
63)   return $ret;
64) }
65) 
66) 
67) function upcoming_items()
68) {
69)   $c = (int) $_SESSION['customerinfo']['customerno'];
Bernd Wurst Revert "Umstellung auf mysqli"

Bernd Wurst authored 10 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");
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

71)   $ret = array();
Bernd Wurst Revert "Umstellung auf mysqli"

Bernd Wurst authored 10 years ago

72)   while($line = mysql_fetch_assoc($result))