Überarbeitete Version der 1. Version. Es bestehen noch grosse Feher in einzelnen Skripten.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
if (session_status() !== PHP_SESSION_ACTIVE) session_start();
|
||||
|
||||
if (empty($_SESSION['access_granted_trainer']) || $_SESSION['access_granted_trainer'] !== true || empty($_SESSION['passcodetrainer_id']) || $_SESSION['passcodetrainer_id'] < 1) {
|
||||
if (empty($_SESSION['access_granted_trainer']) || $_SESSION['access_granted_trainer'] !== true || empty($_SESSION['user_id_trainer']) || $_SESSION['user_id_trainer'] < 1) {
|
||||
http_response_code(403);
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -4,11 +4,6 @@ use Sprain\SwissQrBill\PaymentPart\Output\DisplayOptions;
|
||||
use Sprain\SwissQrBill\PaymentPart\Output\TcPdfOutput\TcPdfOutput;
|
||||
use TCPDF;
|
||||
|
||||
|
||||
if (!isset($baseDir)) $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
|
||||
require $baseDir . '/../composer/vendor/autoload.php';
|
||||
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
// Show all errors except deprecation notices (these come from vendor libraries
|
||||
@@ -18,10 +13,20 @@ error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED);
|
||||
// Add a higher memory limit
|
||||
ini_set('memory_limit', '256M'); // Start with 256M, increase if needed
|
||||
|
||||
session_start();
|
||||
if (!isset($baseDir)) $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
|
||||
require_once $baseDir . '/../scripts/session_functions.php';
|
||||
|
||||
ini_wkvs_session();
|
||||
|
||||
check_user_permission('trainer');
|
||||
|
||||
verify_csrf();
|
||||
|
||||
require $baseDir . '/../composer/vendor/autoload.php';
|
||||
|
||||
|
||||
if (empty($_SESSION['access_granted_trainer']) || $_SESSION['access_granted_trainer'] !== true || empty($_SESSION['passcodetrainer_id']) || $_SESSION['passcodetrainer_id'] < 1) {
|
||||
if (empty($_SESSION['access_granted_trainer']) || $_SESSION['access_granted_trainer'] !== true || empty($_SESSION['user_id_trainer']) || $_SESSION['user_id_trainer'] < 1) {
|
||||
http_response_code(403);
|
||||
header("Location: /intern/trainer");
|
||||
exit;
|
||||
@@ -338,7 +343,6 @@ if (isset($_POST['postversand'])) {
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
if ($totalPreis !== 0) {
|
||||
require __DIR__ . '/ajax-neu_qr_rechnung.php';
|
||||
}
|
||||
@@ -350,7 +354,7 @@ $pdf->SetX($columns['name']['max_width'] + $columns['programm']['max_width'] + $
|
||||
$pdf->Cell($columns['preis']['max_width'], 10, 'CHF ' . number_format($totalPreis, 2), 0, 1, 'C');
|
||||
$pdf->SetFont('GoogleSansFlex-Regular', '', 10);
|
||||
|
||||
if ($totalPreis !== 0) {
|
||||
if ($totalPreis === 0) {
|
||||
$pdf->Ln(10);
|
||||
$pdf->SetTextColor(90, 103, 39);
|
||||
$pdf->MultiCell(0, 8, 'Diese Rechnung wurde als bezahlt eigetragen, da der Betrag 0 CHF beträgt', 0, 'L');
|
||||
@@ -410,7 +414,7 @@ $stmt->execute();
|
||||
$stmt->close();
|
||||
|
||||
// 2. DELETE basket items
|
||||
db_delete($mysqli, $tableBasketItems, ['user_id' => intval($_SESSION['passcodetrainer_id'])]);
|
||||
db_delete($mysqli, $tableBasketItems, ['user_id' => intval($_SESSION['user_id_trainer'])]);
|
||||
|
||||
$mysqli->close();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user