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.
176 righe
6.8 KiB
176 righe
6.8 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
|
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice)) { |
|
|
|
include_once ($beRoot."/layout/top.php"); |
|
|
|
$stati = stipula::getStati(); |
|
$badge = stipula::getCountBadge(); |
|
|
|
$bind = [":codice_gestore"=>$_SESSION["ente"]->codice]; |
|
$sql = "SELECT codice FROM b_contratti WHERE codice_gestore = :codice_gestore "; |
|
if ($_SESSION["utente"]->gerarchia > 10) { |
|
$ids = Utente::getPermissionsInModulo($_SESSION["ente"]->codice,$_SESSION["utente"]->codice,"contratti"); |
|
$ids = implode(",",$ids); |
|
$sql .= " AND codice IN ({$ids}) "; |
|
} |
|
if (!$_SESSION["utente"]->fromHere()) { |
|
$sql .= " AND codice_ente = :codice_ente"; |
|
$bind[":codice_ente"] = $_SESSION["utente"]->codice_ente; |
|
} |
|
$risultato = $pdo->go($sql,$bind); |
|
?> |
|
<div class="container-fluid pt-5 pb-3"> |
|
<div class="row"> |
|
<div class="col-12"> |
|
<h2> |
|
<?= Modulo::header($radice) ?> |
|
</h2> |
|
</div> |
|
</div> |
|
</div> |
|
<? $proceed = $_SESSION["ente"]->checkLimite($radice,true); ?> |
|
|
|
<div id="commands" class="mb-5"> |
|
<div class="commands container-fluid"> |
|
<div class="row <?= ( $_SESSION['ente']->hasModulo('contratti.documentale') ) ? '' : 'flex-row-reverse' ?> "> |
|
|
|
<div class="<?= ( $_SESSION['ente']->hasModulo('contratti.documentale') ) ? 'col-12 col-md-12 d-flex w-100' : 'col-4 col-md-3 col-lg-2 d-flex' ?> align-items-end justify-content-center justify-content-md-end px-0"> |
|
<? if($_SESSION['ente']->hasModulo('contratti.documentale') && $risultato->rowCount() > 0 && $badge > 0){ ?> |
|
<div class="col-12 col-md-5 col-lg-4 text-right"> |
|
<div class="btn-group-toggle" data-toggle="buttons"> |
|
<button class="badgeButton btn btn-secondary "> |
|
<span class="mr-1 badge badge-danger "><?= $badge ?></span> |
|
<input id="filterBadge" type="checkbox" autocomplete="off" value="off"> <?= __('Avvisi') ?> |
|
</button> |
|
</div> |
|
</div> |
|
<?} ?> |
|
|
|
<? if ($proceed && !$_SESSION["utente"]->readOnly) { ?> |
|
<a href="/backend/<?= $radice ?>/edit.php?codice=0" class="btn btn-success" title="<?= __('Aggiungi nuovo') ?>"><span class="fa fa-plus-circle"></span> <?= __('Aggiungi nuovo') ?></a> |
|
<? } ?> |
|
|
|
<? if($_SESSION['ente']->hasModulo('contratti.documentale') && $_SESSION["utente"]->gerarchia <= 10){ ?> |
|
<a href="/backend/contratti/admin-documentale/index.php" class="btn btn-primary ml-2" title="<?= __('Classi Documentali')?>"> <span class="far fa-file-alt"></span> <?= __('Classi Documentali') ?> </a> |
|
<?} ?> |
|
</div> |
|
</div> |
|
|
|
<div class="row"> |
|
|
|
|
|
<div class="col-12 px-0"> |
|
<? if ($risultato->rowCount() > 0) { ?> |
|
<label><?= __("Stato") ?></label> |
|
<select name="status" id="filtroStatus" onChange="table.draw();"> |
|
<option value=""><?= __("Tutti") ?></option> |
|
<? |
|
foreach($stati AS $stat => $stato) { |
|
?> |
|
<option style="border-left: 5px solid <?= $stato["color"] ?>" value="<?= $stat ?>"> |
|
<?= __($stato["titolo"]) ?> |
|
</option> |
|
<? |
|
} |
|
?> |
|
</select> |
|
<? } ?> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
<? |
|
if ($risultato->rowCount() > 0) { |
|
?> |
|
<div class="card mb-2"> |
|
<div class="card-body"> |
|
<div class="table-responsive"> |
|
<h2 id="table-title"></h2> |
|
<table class="table table-striped table-hover" id="tab-data" width="100%"> |
|
<thead> |
|
<tr> |
|
|
|
<th width="10"></th> |
|
<th width="150"></th> |
|
<th width="10"><?= __("ID") ?></th> |
|
<th width="5"></th> |
|
<th><?= __("Oggetto") ?></th> |
|
<th><?= __("Valore totale") ?></th> |
|
<th width="100"><?= __("Data Stipula") ?></th> |
|
<th width="100"><?= __("Data inizio") ?></th> |
|
<th width="100"><?= __("Data Fine") ?></th> |
|
|
|
<? if($_SESSION['ente']->hasModulo('contratti.documentale')){ ?> |
|
<!-- far apparire la colonna solo se c'e almeno una richiesta e il modulo classi documentali è attivo --> |
|
<th width="80"><?= __('Stato Risposte') ?></th> |
|
<? }else{ ?> |
|
<th class="d-none"></th> |
|
<? } ?> |
|
<th width="5"></th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
</tbody> |
|
</table> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
<script> |
|
|
|
$('.badgeButton').on('click', function(){ |
|
if ($('#filterBadge').val() == 'off') { |
|
$('#filterBadge').val('on') |
|
}else{ |
|
$('#filterBadge').val('off') |
|
} |
|
table.draw(); |
|
}) |
|
|
|
var table = $("#tab-data").DataTable({ |
|
"processing": true, |
|
"serverSide": true, |
|
"language": { |
|
"url": "/dictionary/datatables/<?= $_SESSION["language"] ?>.lang" |
|
}, |
|
"ajax": { |
|
"url": "table.php", |
|
"data": function (d) { |
|
d.stato = $('#filtroStatus').val(); |
|
d.badge = $('#filterBadge').val() ?? null; |
|
} |
|
}, |
|
"order": [[2,'desc']], |
|
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, '<?= __("tutti") ?>']], |
|
"columns": [ |
|
{ "orderable": false }, |
|
{ "orderable": false }, |
|
null, |
|
null, |
|
null, |
|
null, |
|
null, |
|
null, |
|
null, |
|
{"class": "<?= ($_SESSION['ente']->hasModulo('contratti.documentale')) ? 'text-nowrap text-center': 'd-none' ?>"}, |
|
{ "orderable": false } |
|
], |
|
"drawCallback": function(settings, json) { |
|
$('[data-toggle="tooltip"]').tooltip(); |
|
} |
|
}); |
|
</script> |
|
<? |
|
} else { |
|
alertManager::printWarningBox(__("Nessun risultato")); |
|
} |
|
include_once ($beRoot."/layout/bottom.php"); |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
?>
|
|
|