Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
59 righe
1.6 KiB
59 righe
1.6 KiB
<? |
|
$error = true; |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"public_html/"))."config.php"; |
|
include_once($configPath); |
|
if (isset($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice) && tokenVerify()) { |
|
$path = "{$config["chunk_folder"]}/{$_SESSION["utente"]->codice}/{$_POST["filechunk"]}"; |
|
if (file_exists($path)) { |
|
$xml = simplexml_load_file($path); |
|
$uploaded = xmlToArray($xml); |
|
if (!empty($uploaded)) { |
|
$error = false; |
|
$errors = []; |
|
if (!empty($uploaded["pubblicazione"]["metadata"]["annoRiferimento"]) && !empty($uploaded["pubblicazione"]["data"]["lotto"])) { |
|
$annoRiferimento = $uploaded["pubblicazione"]["metadata"]["annoRiferimento"]; |
|
$errors = anac::massiveImport($_SESSION["ente"]->codice,$annoRiferimento,$uploaded["pubblicazione"]["data"]["lotto"]); |
|
} else { |
|
$errors[] = __("Formato non riconosciuto"); |
|
} |
|
if (empty($errors)) { |
|
?> |
|
<script> |
|
swal({title:js_dict["success-msg"],type:"success"}).then(function(){ |
|
window.location.reload(); |
|
}); |
|
</script> |
|
<? |
|
} else { |
|
alertManager::printAlertBox(__("Errori nell'importazione")); |
|
?> |
|
<div class="table-responsive"> |
|
<table class="table table-striped"> |
|
<thead> |
|
<tr> |
|
<th><?= __("errore") ?></th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
<? |
|
foreach($errors AS $errore) { |
|
?> |
|
<tr> |
|
<td><strong><?= $errore ?></strong></td> |
|
</tr> |
|
<? |
|
} |
|
?> |
|
</tbody> |
|
</table> |
|
</div> |
|
<? |
|
} |
|
} |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|
|
|