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.
218 righe
9.9 KiB
218 righe
9.9 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"public_html/"))."config.php"; |
|
include_once($configPath); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice,$_GET["codice"])) { |
|
$anac = anac::init($_GET["codice"]); |
|
if ($anac !== false) { |
|
$record = $anac->info; |
|
if ($record["smart_cig"] == "S") { $lotto = $anac->getLotti()[0]; } |
|
$breadcrumb = array(); |
|
$breadcrumb["/".$radice."/"] = Modulo::getInfo($radice)["titolo"]; |
|
$breadcrumb = $anac->getBreadcrumb($breadcrumb); |
|
$breadcrumb[""] = __("Pannello"); |
|
include_once ($beRoot."/layout/top.php"); |
|
$stati = anac::getStati(); |
|
$stato = $stati[$record["stato"]] ?? ""; |
|
$alertManager = new alertManager("anac-{$record["codice"]}"); |
|
?> |
|
<div id="commands" class="mb-5"> |
|
<div class="commands container-fluid clearfix"> |
|
<div class="btn-group flex-wrap float-right"> |
|
<? if ($_SESSION["utente"]->permission("simog") && !empty($record["id_gara"])) { ?> |
|
<a class="btn btn-warning" href="/backend/anac/presaInCarico/index.php?codice=<?= $anac->info["codice"] ?>"> |
|
<span class="fa fa-user"></span> <?= __("Prendi in carico") ?> |
|
</a> |
|
<? } ?> |
|
<? |
|
if ($record["smart_cig"] == "S" && !empty($lotto["cig"]) && $lotto["richiesto_simog"] == "S") { |
|
?> |
|
<button type="button" class="btn btn-info" onClick="showModalWithURL('/backend/anac/lotti/ricevuta-cig.php?codice_simog=<?= $anac->info["codice"] ?>&codice_lotto=<?= $lotto["codice"] ?>')"> |
|
<span class="fa fa-file"></span> <?= __("Ricevuta SMART CIG") ?> |
|
</button> |
|
<? |
|
} |
|
?> |
|
<? if ($_SESSION["utente"]->canAssignPermissions()) { ?> |
|
<button type="button" class="btn btn-danger" onClick="managePermessi('anac','<?= $record["codice"] ?>','<?= $record["codice_ente"] ?>')"> |
|
<span class="fa fa-lock"></span> <?= __("Permessi") ?> |
|
</button> |
|
<? } ?> |
|
<? $alertManager->printAlertModalButton() ?> |
|
<button type="button" class="btn btn-primary" onClick="openChat('anac','<?= $record["codice"] ?>','<?= $record["codice_ente"] ?>')"> |
|
<span class="fa fa-envelope"></span> <?= __("Chat interna") ?> |
|
<? $unread = Communicator::countUnreadInitiativeChat('anac',$record["codice"]); ?> |
|
<span id="badge-chat" class="badge"><?= (!empty($unread)) ? $unread : "" ?></span> |
|
</button> |
|
</div> |
|
</div> |
|
</div> |
|
<div class="mt-5"> |
|
<h1 style="border-bottom: 5px solid <?= $stato["color"] ?? "" ?>" class="clearfix"> |
|
<?= __("Gara") ?> #<?= $record["codice"] ?> |
|
<? if (!empty($record["id_gara"])) { ?> |
|
- ID GARA SIMOG: <?= $record["id_gara"] ?> |
|
<? } ?> |
|
<small class="float-right"><?= __($stato["titolo"]); ?></small> |
|
</h1> |
|
</div> |
|
<h3><?= $record["oggetto"] ?></h3> |
|
<? |
|
if ($record["smart_cig"] == "N") { |
|
?><div class="row"> |
|
<div class="col-12 col-lg-4"> |
|
<? |
|
} |
|
?> |
|
<div class="card card-body"> |
|
<? |
|
$ris_comandi = anac::getModuli($record["smart_cig"],$record["stato"]); |
|
if (count($ris_comandi) > 0) { |
|
foreach($ris_comandi AS $id_comando => $rec) { |
|
if (!$rec["lotto"] || $record["smart_cig"] == "S") { |
|
$badge = ""; |
|
$show = true; |
|
$folder = explode("/",$rec["link"]); |
|
$temp = array_pop($folder); |
|
|
|
$folder = implode("/",$folder); |
|
if (file_exists($root.$folder."/check.php")) { include($root.$folder."/check.php"); } |
|
if ($rec["lotto"]) { |
|
$codice_lotto = $lotto["codice"]; |
|
$hrefComando = $rec["link"]; |
|
$hrefComando .= (strpos($rec["link"], "?") === false) ? "?" : "&"; |
|
$hrefComando .= "codice_simog={$record["codice"]}&codice_lotto={$lotto["codice"]}"; |
|
} else { |
|
$hrefComando = $rec["link"]; |
|
$hrefComando .= (strpos($rec["link"], "?") === false) ? "?" : "&"; |
|
$hrefComando .= "codice={$record["codice"]}"; |
|
} |
|
$lock = $anac->checkLock($id_comando); |
|
$status = ""; |
|
if (file_exists($root.$folder."/_status.php") && $show) { |
|
include($root.$folder."/_status.php"); |
|
} |
|
if ($show && $_SESSION["utente"]->permission($radice,$_GET["codice"],$id_comando) && $_SESSION["utente"]->permission($rec["modulo_riferimento"])) { |
|
?> |
|
<a class="btn my-1 <?= $status ?> btn-block btn-<?=($lock==true) ? "secondary" : "info"?>" href="<?= $hrefComando ?>" title="<?= __($rec["descrizione"] ?? $rec["titolo"]) ?>"> |
|
<span class="float-left"><?= __($rec["titolo"]) ?></span> |
|
<? if ($rec["badge"] != "") { |
|
if (file_exists($root.$rec["badge"])) { include($root.$rec["badge"]); } |
|
} ?> |
|
<div class="clearfix"></div> |
|
</a> |
|
<? |
|
} |
|
} |
|
} |
|
} |
|
?> |
|
</div> |
|
<? |
|
if ($record["smart_cig"] == "N") { |
|
?> |
|
</div> |
|
<div class="col-12 col-lg-8"> |
|
<? |
|
$sql = "SELECT codice FROM b_simog_lotti WHERE codice_simog = :codice AND eliminato = 'N'"; |
|
$lotti = $pdo->go($sql,[":codice"=>$record["codice"]]); |
|
$lotti_no_cig = $pdo->go($sql . " AND (cig = '' OR cig IS NULL) " ,[":codice"=>$record["codice"]]); |
|
if ($record["stato"] < 20) { ?> |
|
<div class="d-flex mb-1"> |
|
<? if (empty($anac->getRelazioni())) { ?> |
|
<div class="col m-0 p-0"> |
|
<a class="btn btn-block btn-info mb-1" href="/backend/anac/lotti/edit.php?codice_simog=<?= $record["codice"] ?>&codice_lotto=0"> |
|
<span class="fa fa-plus-circle"></span> <?= __("Aggiungi lotto") ?> |
|
</a> |
|
</div> |
|
<? } |
|
if ($lotti_no_cig->rowCount() > 0 && !empty($record["id_gara"]) && $_SESSION["utente"]->permission("simog")) { ?> |
|
<div class="col m-0 p-0"> |
|
<button class="btn btn-block btn-warning mb-1" onClick="showModalWithURL('/backend/anac/massive.php?codice=<?= $record["codice"] ?>&token=<?= tokenGen() ?>');"> |
|
<span class="fa fa-layer-group"></span> <?= __("Ottieni CIG Mancanti") ?> |
|
</button> |
|
</div> |
|
<? } ?> |
|
</div> |
|
<? } |
|
if (!empty($lotti->rowCount())) { |
|
if ($lotti->rowCount() != $anac->getDati()["numero_lotti"]) { |
|
$alertManager->addDangerAlert(__("Numero di lotti non coerente con i dati inseriti in gara")); |
|
alertManager::printAlertCompact(__("Numero di lotti non coerente con i dati inseriti in gara")); |
|
} |
|
?> |
|
<table class="table table-striped table-hover" id="tab-data" width="100%"> |
|
<thead> |
|
<tr> |
|
<th width="10"></th> |
|
<th width="100"><?= __("CIG") ?></th> |
|
<th><?= __("Oggetto") ?></th> |
|
<th width="150"></th> |
|
<th width="150"></th> |
|
</tr> |
|
</thead> |
|
<tbody id="sortable"> |
|
</tbody> |
|
</table> |
|
<script> |
|
var table = $("#tab-data").DataTable({ |
|
"processing": true, |
|
"serverSide": true, |
|
"language": { |
|
"url": "/dictionary/datatables/<?= $_SESSION["language"] ?>.lang" |
|
}, |
|
"ajax": { |
|
"url": "lotti/table.php", |
|
"data": function (d) { |
|
d.codice_simog = "<?= $anac->info["codice"] ?>" |
|
} |
|
}, |
|
"order": [[1,'asc']], |
|
"drawCallback": function( settings ) { |
|
$('[data-toggle="tooltip"]').tooltip(); |
|
}, |
|
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, '<?= __("tutti") ?>']], |
|
"columns": [ |
|
{"class":"handle"}, |
|
{"class":"text-center"}, |
|
null, |
|
{ "orderable": false }, |
|
{ "orderable": false } |
|
] |
|
}); |
|
$( "#sortable" ).sortable({ |
|
handle: ".handle", |
|
update: function( event, ui ) { |
|
$("tr","#sortable").each(function(index, el) { |
|
$(this).find(".ordinamento").val(index); |
|
}); |
|
$.ajax({ |
|
type: "POST", |
|
url: 'lotti/save-order.php', |
|
data: $('.ordinamento').serialize(), |
|
async: true |
|
}); |
|
} |
|
}); |
|
</script> |
|
<? |
|
} else { |
|
alertManager::printWarningBox(__("Nessun lotto inserito")); |
|
} |
|
?> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
if (!empty($alertManager->alerts)) { |
|
$alertManager->printModal(); |
|
} |
|
include_once ($beRoot."/layout/bottom.php"); |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/backend/index.php">'; |
|
die(); |
|
} |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/backend/index.php">'; |
|
die(); |
|
} |
|
?>
|
|
|