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.
197 righe
7.0 KiB
197 righe
7.0 KiB
<? |
|
$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"]); |
|
$breadcrumb = array(); |
|
$breadcrumb["/" . $radice . "/"] = Modulo::getInfo($radice)["titolo"]; |
|
$breadcrumb["/" . $radice . "/panel.php?codice=" . $record["codice"]] = __("Pannello"); |
|
$breadcrumb[""] = $titolo_modulo; |
|
|
|
include_once($beRoot . "/layout/top.php"); |
|
?><h1><?= $titolo_modulo ?></h1><? |
|
if (empty($lock)) { ?> |
|
<form rel="validate" method="post" action="save.php" id="edit-form"> |
|
<input id="token" type="hidden" name="token" value="<?= tokenGen() ?>"> |
|
<input id="codice_progetto" type="hidden" name="codice_progetto" value="<?= $record["codice"] ?>"> |
|
<? } else { ?> |
|
<div id="edit-form"> |
|
<? } |
|
$tipologieSchede = mop::tipologiaSchede(); |
|
$monitor = $progetto->getManagerMonitoraggio(); |
|
$packs = $monitor->getPacks(); |
|
if (!empty($tipologieSchede)) { |
|
?> |
|
<div id="commands" class="mb-5"> |
|
<div class="commands container-fluid"> |
|
<div class="row"> |
|
<div class="col-12 text-right"> |
|
<? if (!$lock) { ?> |
|
<button class="send-btn btn btn-success btn-sm"> |
|
<span class="fa fa-cogs"></span> <?= __("Predisponi per l'invio") ?> |
|
<span class="badge badge-danger send-count"></span> |
|
</button> |
|
<? } ?> |
|
<? if (!empty($packs)) { |
|
$count = 0; |
|
foreach($packs AS $pack) { |
|
if ($pack["stato"] == 10 || $pack["stato"] == 60) { |
|
$count++; |
|
} |
|
} |
|
?> |
|
<button type="button" class="btn btn-info btn-sm" onclick="showModalWithURL('list.php?codice=<?= $record["codice"] ?>')"> |
|
<span class="fa fa-paper-plane"></span> <?= __("Tracciati") ?> |
|
<? if (!empty($count)) { ?> |
|
<span class="badge badge-danger"><?= $count ?> |
|
<? } ?> |
|
</button> |
|
<? } ?> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
<? |
|
foreach($tipologieSchede AS $key => $scheda) { |
|
$records = $monitor->getScheda($key); |
|
$show = false; |
|
$general_status = []; |
|
$stati = mop::stati(); |
|
ob_start(); |
|
if (!empty($records)) { |
|
foreach($records AS $r) { |
|
$data = explode("|",$r["data"]); |
|
$general_status[] = $r["stato"]; |
|
$status = $stati[$r["stato"]]; |
|
$color = $status["color"]; |
|
$label = $status["label"]; |
|
$style = ""; |
|
if ($r["trasmesso"] == 2) { |
|
$style="text-decoration:line-through; color:#330000"; |
|
} |
|
?> |
|
<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 class="p-0"> |
|
<div id="table-<?= $r["codice"] ?>"> |
|
<table class="table table-condensed m-0 p-0"> |
|
<? |
|
$count = 0; |
|
foreach($scheda["structure"] AS $info) { |
|
?> |
|
<tr> |
|
<th width="200"><strong><?= ($info["titolo"] ?? "") ?></strong></th> |
|
<td style="<?= $style ?>"><?= $data[$count] ?></td> |
|
</tr> |
|
<? |
|
$count++; |
|
} |
|
?> |
|
</table> |
|
</div> |
|
</td> |
|
<td class="text-center align-middle" width="10"> |
|
<? |
|
if (($r["stato"] == 1 || $r["stato"] == 2 || $r["stato"] == 0) && !$lock) { |
|
$show = true; |
|
?> |
|
<input class="selected-scheda" type="checkbox" name="invia[]" value="<?= $r["codice"] ?>" checked onchange="checkShowBtn()"> |
|
<? |
|
} |
|
?> |
|
</td> |
|
</tr> |
|
<? |
|
} |
|
} |
|
$body = ob_get_clean(); |
|
$status = null; |
|
if (!empty($general_status)) { |
|
$general_status = array_unique($general_status); |
|
if (count($general_status) == 1) { |
|
$status = $general_status[0]; |
|
} |
|
} |
|
?> |
|
<div class="card my-1"> |
|
<div class="card-header"> |
|
<h3 data-target="#details-<?= $key ?>" class="card-title"> |
|
<?= $scheda["titolo"] ?> |
|
<? if (isset($status)) { |
|
$status = $stati[$status]; |
|
$color = $status["color"]; |
|
$label = $status["label"]; |
|
?> |
|
<small><span class="badge text-dark" style="background-color:<?= $color ?>"><?= __($label) ?></span></small> |
|
<? } ?> |
|
</h3> |
|
</div> |
|
<div class="card-body p-0 m-0 <?= ($show) ? "" : "collapse" ?>" id="details-<?= $key ?>"> |
|
<table class="m-0 p-0 table table-striped table-hover"> |
|
<thead> |
|
<tr> |
|
<th colspan="2"><?= __("Stato") ?></th> |
|
<th></th> |
|
<th width="10"><?= __("Invia") ?></th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
<? |
|
echo $body; |
|
?> |
|
</tbody> |
|
</table> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
} else { |
|
alertManager::printAlertBox(__("Errore di configurazione")); |
|
} |
|
if (empty($lock)) { ?> |
|
<button class="send-btn btn btn-success btn-block mt-2"> |
|
<span class="fa fa-cogs"></span> <?= __("Predisponi per l'invio") ?> |
|
<span class="badge badge-danger send-count"></span> |
|
</button> |
|
<script> |
|
function checkShowBtn() { |
|
$(".send-btn").hide(); |
|
$(".send-count").html(""); |
|
count = $(".selected-scheda:checked").length; |
|
if (count > 0) { |
|
$(".send-btn").show(); |
|
$(".send-count").html(count); |
|
} |
|
} |
|
checkShowBtn(); |
|
</script> |
|
</form> |
|
<? |
|
} else { |
|
?> |
|
</div> |
|
<script>$(":input","#edit-form").not(".ignore-lock").attr("disabled","disabled").trigger("chosen:updated");</script> |
|
<? |
|
} |
|
include_once($beRoot . "/layout/bottom.php"); |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
|
|
?>
|