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.
52 righe
2.3 KiB
52 righe
2.3 KiB
<? |
|
$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(); |
|
?> |
|
<h1><?= $titolo ?></h1> |
|
<h3><?= Ente::getInfoFromID($record["codice_ente"])[0]["denominazione"] ?></h3><br> |
|
<? |
|
$schedePreviste = Programma::getSchedeProgramma($record["tipologia"]); |
|
if (!empty($schedePreviste)) { |
|
foreach($schedePreviste AS $idScheda => $titoloScheda) { |
|
$badge = "<span class='alert alert-warning p-2 mx-1 my-0'><small><span class=\"fa fa-exclamation-triangle\"></span> " . __("Non generato") . "</small></span>"; |
|
$editor = null; |
|
$editor = new editorManager("programmazione-art21",$programma->getIdEditorScheda($idScheda)); |
|
$download = false; |
|
if (!empty($editor->latest())) { |
|
$download = true; |
|
$badge = "<span class='alert alert-success p-2 mx-1 my-0'><small><span class=\"fa fa-check\"></span> " . __("Generato") . "</small></span>"; |
|
} |
|
?> |
|
<div class="card mb-2"> |
|
<div class="card-body"> |
|
<?= $badge ?> |
|
<strong><?= strtoupper($idScheda) ?> - <?= __($titoloScheda) ?></strong> |
|
<a href="/backend/progetti/programmazione/pdf/scheda.php?codice=<?= $record["codice"] ?>&scheda=<?= $idScheda ?>" class="btn btn-sm btn-primary float-right"> |
|
<span class="fa fa-edit"></span> |
|
</a> |
|
<? if ($download) { ?> |
|
<a target="_blank" title="<?= __("Esporta PDF") ?>" href="/backend/progetti/programmazione/pdf/download.php?codice=<?= $record["codice"] ?>&scheda=<?= $idScheda ?>&format=pdf" class="btn btn-sm btn-danger float-right"> |
|
<span class="fa fa-file-pdf"></span> |
|
</a> |
|
<? } ?> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
} else { |
|
alertManager::printAlertBox(__("Il programma non prevede schede")); |
|
} |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|