Files
ms1inscription-v5/dossard_print.php

50 lines
1.4 KiB
PHP

<?php
/**
* MSIN-4485 — Endpoint PDF dossard (1 participant).
* Isolé du tunnel / panier ; droit inscriptions_gestion.dossard_print.
*/
session_start();
$_SERVER['PHP_SELF'] = '/compte.php';
$_SERVER['SCRIPT_NAME'] = '/compte.php';
require_once __DIR__ . '/php/inc_fonctions.php';
require_once __DIR__ . '/php/inc_fx_dossard_print.php';
$strLangue = $_SESSION['lang'] ?? 'fr';
$reqLang = $_REQUEST['lang'] ?? $_REQUEST['lng'] ?? '';
if (!empty($reqLang) && in_array($reqLang, array('fr', 'en'), true)) {
$strLangue = $reqLang;
}
$vPage = 'compte.php';
$vtexte_page = obtenirTextepage($vPage, $strLangue, 2);
$intParId = intval($_GET['par_id'] ?? $_POST['par_id'] ?? 0);
$intEveId = intval($_GET['eve_id'] ?? $_POST['eve_id'] ?? 0);
$intComId = intval($_SESSION['com_id'] ?? 0);
if ($intComId <= 0 || $intParId <= 0 || $intEveId <= 0) {
http_response_code(403);
header('Content-Type: text/plain; charset=utf-8');
echo 'Accès refusé.';
exit;
}
if (!fxDossardPrintCan($intComId, $intEveId)) {
http_response_code(403);
header('Content-Type: text/plain; charset=utf-8');
echo 'Droit insuffisant.';
exit;
}
$arrRow = fxDossardPrintLoadParticipant($intParId, $intEveId);
if ($arrRow === null) {
http_response_code(404);
header('Content-Type: text/plain; charset=utf-8');
echo 'Participant introuvable.';
exit;
}
fxDossardPrintOutputPdf($arrRow);