37 lines
1009 B
PHP
37 lines
1009 B
PHP
<?php
|
|
/**
|
|
* MSIN-4485 — Sauvegarde layout dossard (N boîtes / champs).
|
|
*/
|
|
ob_start();
|
|
error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_WARNING);
|
|
ini_set('display_errors', '0');
|
|
|
|
require_once dirname(__FILE__) . '/php/inc_functions.php';
|
|
require_once dirname(__FILE__) . '/../php/inc_fx_dossard_print.php';
|
|
|
|
fxSuperadmAjaxAuthOrJsonExit();
|
|
if (session_status() === PHP_SESSION_ACTIVE) {
|
|
session_write_close();
|
|
}
|
|
|
|
while (ob_get_level() > 0) {
|
|
ob_end_clean();
|
|
}
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
|
|
$strRaw = file_get_contents('php://input');
|
|
$arrIn = is_string($strRaw) ? json_decode($strRaw, true) : null;
|
|
if (!is_array($arrIn)) {
|
|
http_response_code(400);
|
|
echo json_encode(array('ok' => false, 'error' => 'JSON invalide.'));
|
|
exit;
|
|
}
|
|
|
|
$intEveId = isset($arrIn['eve_id']) ? intval($arrIn['eve_id']) : 0;
|
|
$arrResult = fxDossardPrintSaveLayout($arrIn, $intEveId);
|
|
if (empty($arrResult['ok'])) {
|
|
http_response_code(400);
|
|
}
|
|
echo json_encode($arrResult);
|
|
exit;
|