50 lines
1.6 KiB
PHP
50 lines
1.6 KiB
PHP
<?php
|
|
// MSIN-4433 — Génération PDF distribution des dossards (POST + session promoteur).
|
|
|
|
session_start();
|
|
|
|
$_SERVER['PHP_SELF'] = '/compte.php';
|
|
$_SERVER['SCRIPT_NAME'] = '/compte.php';
|
|
|
|
require_once('php/inc_fonctions.php');
|
|
require_once('php/inc_fx_promoteur.php');
|
|
|
|
$strLangue = $_SESSION['lang'] ?? 'fr';
|
|
$reqLang = $_REQUEST['lang'] ?? $_REQUEST['lng'] ?? '';
|
|
if (!empty($reqLang) && in_array($reqLang, ['fr', 'en'], true)) {
|
|
$strLangue = $reqLang;
|
|
}
|
|
$vPage = 'compte.php';
|
|
$vtexte_page = obtenirTextepage($vPage, $strLangue, 2);
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
|
|
http_response_code(405);
|
|
exit;
|
|
}
|
|
|
|
$int_eve_id = (int)($_POST['eve_id'] ?? 0);
|
|
$_REQUEST['eve_id'] = $int_eve_id;
|
|
$_POST['eve_id'] = $int_eve_id;
|
|
|
|
fxBibRequireDistPrintAccess();
|
|
|
|
$tabSelections = fxBibParseDistPrintSelectionsFromPost($_POST);
|
|
$tabIncludeSans = fxBibParseDistPrintIncludeSansFromPost($_POST);
|
|
$strOrient = fxBibDistPrintNormalizeOrient($_POST['dist_print_orient'] ?? 'P');
|
|
$tabSave = fxBibSaveDistPrintSelections($int_eve_id, $tabSelections, $strLangue, $strOrient, $tabIncludeSans);
|
|
|
|
if (!$tabSave['success']) {
|
|
http_response_code(400);
|
|
header('Content-Type: text/plain; charset=utf-8');
|
|
echo $tabSave['message'] ?? 'Invalid selection';
|
|
exit;
|
|
}
|
|
|
|
$strPrintedBy = fxBibGetCurrentPromoteurDisplayName();
|
|
$intComId = (int)($_SESSION['com_id'] ?? 0);
|
|
fxBibSaveDistPrintMeta($int_eve_id, $intComId, $strPrintedBy);
|
|
|
|
// MSIN-4512 — PDF de CE run lit le POST (indépendant de la colonne BD).
|
|
fxBibOutputDistPrintPdf($int_eve_id, $strLangue, $strPrintedBy, $tabIncludeSans);
|
|
exit;
|