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.
107 righe
5.1 KiB
107 righe
5.1 KiB
<? |
|
$error = true; |
|
$configPath = substr(__DIR__, 0, strpos(__DIR__, "public_html")) . "/config.php"; |
|
include_once($configPath); |
|
$id_modulo = "invia-mop"; |
|
$cmd_info = progetto::getInfoModulo($id_modulo); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"], $_GET["codice"], $id_modulo)) { |
|
$progetto = progetto::init($_GET["codice"]); |
|
if (!empty($progetto)) { |
|
$record = $progetto->info; |
|
$lock = $progetto->checkLock($cmd_info["id"]); |
|
$titolo_modulo = __($cmd_info["titolo"]); |
|
?><h1><?= $titolo_modulo ?></h1><? |
|
$monitor = $progetto->getManagerMonitoraggio(); |
|
$packs = $monitor->getPacks(); |
|
if (!empty($packs)) { |
|
$error = false; |
|
$stati = mop::stati(); |
|
?> |
|
<table class="table table-striped table-hover"> |
|
<thead> |
|
<tr> |
|
<th colspan="2"><?= __("Stato") ?></th> |
|
<th><?= __("Tracciato") ?></th> |
|
<th><?= __("Data creazione") ?></th> |
|
<th><?= __("Data invio") ?></th> |
|
<th></th> |
|
<th></th> |
|
<th></th> |
|
<th></th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
<? |
|
foreach($packs AS $pack) { |
|
$status = $stati[$pack["stato"]]; |
|
$color = $status["color"]; |
|
$label = $status["label"]; |
|
?> |
|
<tr> |
|
<td width="10"> |
|
<div class="status_flag" style="background-color:<?= $color ?>"></div> |
|
</td> |
|
<td width="200" class="align-middle text-center"> |
|
<?= __($label) ?> |
|
</td> |
|
<td><?= $pack["nome"] ?></td> |
|
<td><?= mysql2datetime($pack["timestamp_creazione"]) ?></td> |
|
<td><?= mysql2datetime($pack["timestamp_invio"]) ?></td> |
|
<td width="10"><a target="_blank" href="download.php?codice=<?= $record["codice"] ?>&tracciato=<?= $pack["codice"] ?>" class="btn btn-warning btn-sm " title="<?= __("Download") ?>"><span class="fa fa-download"></span></a></td> |
|
<td width="10"> |
|
<? if ($pack["stato"] == "10") { ?> |
|
<button class="btn btn-info btn-sm" onclick="showModalWithURL('/backend/progetti/invia-mop/login.php?action=send&codice=<?= $record["codice"] ?>&tracciato=<?= $pack["codice"] ?>')" title="<?= __("Invia") ?>"><span class="fa fa-paper-plane"></span></button> |
|
<? } ?> |
|
</td> |
|
<td> |
|
<? if ($pack["stato"] == "60") { ?> |
|
<button class="btn btn-success btn-sm" onclick="showModalWithURL('/backend/progetti/invia-mop/login.php?action=verify&codice=<?= $record["codice"] ?>&tracciato=<?= $pack["codice"] ?>')" title="<?= __("Verifica automatica") ?>"><span class="fa fa-check"></span></button> |
|
<? } ?> |
|
</td> |
|
<td> |
|
<? if ($pack["stato"] <= 60) { ?> |
|
<a href="#" id="upload-pack-<?= $pack["codice"] ?>" class="btn btn-primary btn-sm fileinput-button" title="<?= __("Verifica manuale") ?>"> |
|
<input id="txt-input-fileupload-<?= $pack["codice"] ?>" class="attachment-fileupload" type='file' name='files[]'> |
|
<span class="fa fa-upload"></span> |
|
</button> |
|
<div id="verify-pack-module-<?= $pack["codice"] ?>" class="collapse"> |
|
<? ob_start() ?> |
|
$("#wait_div").show(); |
|
$.ajax({ |
|
url: '/backend/progetti/invia-mop/upload.php', |
|
type: 'POST', |
|
dataType: 'text', |
|
data: "codice=<?= $record["codice"]; ?>&tracciato=<?= $pack["codice"]; ?>&filechunk="+file.name |
|
}) |
|
.done(function(response) { |
|
$("#wait_div").hide(); |
|
showModalWithURL('esito.php?codice=<?= $record["codice"]; ?>&tracciato=<?= $pack["codice"]; ?>'); |
|
}) |
|
.fail(function() { |
|
$("#wait_div").hide(); |
|
swal(js_dict["error-retry"],"<?= __("Verificare che il file di esito sia corretto") ?>"); |
|
}); |
|
<? |
|
$successScript = ob_get_clean(); |
|
filesManager::insertUploadForm($successScript,"verifica-mop-{$pack["codice"]}",["allowedTypes"=>[".txt"],"maxNumberOfFiles"=>1]); |
|
?> |
|
</div> |
|
<? } else if (!empty($pack["esito"])) { ?> |
|
<button class="btn btn-danger btn-sm" onclick="showModalWithURL('/backend/progetti/invia-mop/esito.php?codice=<?= $record["codice"] ?>&tracciato=<?= $pack["codice"] ?>')" title="<?= __("Esito") ?>"><span class="fa fa-exclamation-triangle"></span></button> |
|
<? } ?> |
|
</td> |
|
</tr> |
|
<? |
|
} |
|
?> |
|
</tbody> |
|
</table> |
|
<? |
|
} |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|