$error = true;
$configPath = substr(__DIR__, 0, strpos(__DIR__, "public_html")) . "/config.php";
include_once($configPath);
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission('programmazione-art21') && !empty($_GET["codice"])) {
$programma = Programma::init($_GET["codice"]);
if (!empty($programma)) {
$error = false;
$record = $programma->info;
$titolo = $programma->getTitolo();
?>
= $titolo ?>
= Ente::getInfoFromID($record["codice_ente"])[0]["denominazione"] ?>
$schedePreviste = Programma::getSchedeProgramma($record["tipologia"]);
if (!empty($schedePreviste)) {
foreach($schedePreviste AS $idScheda => $titoloScheda) {
$badge = " " . __("Non generato") . "";
$editor = null;
$editor = new editorManager("programmazione-art21",$programma->getIdEditorScheda($idScheda));
$download = false;
if (!empty($editor->latest())) {
$download = true;
$badge = " " . __("Generato") . "";
}
?>
}
} else {
alertManager::printAlertBox(__("Il programma non prevede schede"));
}
}
}
if ($error) {
header('HTTP/1.0 403 Forbidden');
die();
}
?>