Hanno Böck
Spaces between string concat (.) operator, new PER codingstyle
Hanno Böck commited 354c05a at 2023-10-31 17:49:30
<?php
/*
This file belongs to the Webinterface of schokokeks.org Hosting
Written by schokokeks.org Hosting, namely
Bernd Wurst <bernd@schokokeks.org>
Hanno Böck <hanno@schokokeks.org>
This code is published under a 0BSD license.
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.
*/
require_once('inc/base.php');
require_once('inc/security.php');
use_module('contacts');
require_once('contacts.php');
function my_invoices()
{
$c = (int) $_SESSION['customerinfo']['customerno'];
$result = db_query("SELECT id,datum,betrag,bezahlt,abbuchung,sepamandat FROM kundendaten.ausgestellte_rechnungen WHERE kunde=? ORDER BY id DESC", [$c]);
$ret = [];
while ($line = $result->fetch()) {
array_push($ret, $line);
}
return $ret;
}
function get_pdf($id)
{
$c = (int) $_SESSION['customerinfo']['customerno'];
$id = (int) $id;
$result = db_query("SELECT pdfdata FROM kundendaten.ausgestellte_rechnungen WHERE kunde=:c AND id=:id", [":c" => $c, ":id" => $id]);
if ($result->rowCount() == 0) {
system_failure('Ungültige Rechnungsnummer oder nicht eingeloggt');
}
return $result->fetch(PDO::FETCH_OBJ)->pdfdata;
}
function invoice_address($customer = null)
{
$c = (int) $_SESSION['customerinfo']['customerno'];
if ($customer != null && have_role(ROLE_SYSADMIN)) {
$c = (int) $customer;
}
$result = db_query("SELECT contact_kunde, contact_rechnung FROM kundendaten.kunden WHERE id=?", [$c]);
$kontakte = $result->fetch();
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX