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.
129 righe
4.7 KiB
129 righe
4.7 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
|
|
if (!empty($_SESSION["utente"]->oe)) { |
|
$modulo = modulo::getInfo("contratti"); |
|
|
|
$breadcrumb = []; |
|
$breadcrumb[] = $modulo["titolo"]; |
|
|
|
include_once($root."/layout/top.php"); |
|
?> |
|
<div class="container-fluid"> |
|
<div class="row"> |
|
<div class="col-6"> |
|
<h1><?= __("Contratti") ?></h1> |
|
</div> |
|
</div> |
|
|
|
<? |
|
$list = publicStipula::getList(); |
|
|
|
if (!empty($list)) { |
|
$stati['tutti'] = ['titolo' => 'Tutti', "color" => "#00000000"]; |
|
|
|
if ($_SESSION['ente']->hasModulo('contratti.documentale')) { |
|
$stati["richiesta_documentale"] = ["titolo"=>"In attesa di Documentazione","color"=>"#2A9FD6"]; |
|
} |
|
|
|
$stati['attesa'] = ["titolo"=>"In attesa di firma","color"=>"#FC0"]; |
|
$stati["archivio"] = ["titolo"=>"Archivio","color"=>"#0C0"]; |
|
|
|
?> |
|
|
|
<div class="btn-group-toggle mb-2" data-toggle="buttons"> |
|
<? |
|
foreach ($stati as $stat => $stato) { |
|
$count[$stat] = count(publicStipula::getList(["b_contratti.stato"=>$stat],[],0,-1)); |
|
} |
|
|
|
if(!empty($count['richiesta_documentale']) && $count['richiesta_documentale'] >= 1){ |
|
$checked = 'richiesta_documentale'; |
|
}elseif(!empty($count['attesa']) && $count['attesa'] >= 1){ |
|
$checked = 'attesa'; |
|
}else{ |
|
$checked = 'tutti'; |
|
} |
|
|
|
foreach($stati AS $stat => $stato) { |
|
?> |
|
<label style="border-bottom: 5px solid <?= $stato["color"] ?>" id="stato-<?= $stat ?>-button" class="btn btn-default" > |
|
<input type="radio" name="status" value="<?= $stat ?>" onChange='table.draw();' autocomplete="off" <?= ($stat == $checked) ? 'checked' : null?> > |
|
<span class='label-html'> |
|
<?= __($stato["titolo"]) ?> |
|
<? |
|
if ($count > 0) { |
|
?> |
|
<span class="badge badge-primary"><?= $count[$stat] ?? null ?></span> |
|
<? |
|
} |
|
?> |
|
</span> |
|
</label> |
|
<? |
|
} |
|
?> |
|
</div> |
|
<div class="card 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"><?= __("ID") ?></th> |
|
<th width="10"><?= __("CIG") ?></th> |
|
<th><?= __("Oggetto") ?></th> |
|
<th width="200"><?= __("Data stipula") ?></th> |
|
<th width="100"><?= __("Data inizio") ?></th> |
|
<th width="100"><?= __("Data fine") ?></th> |
|
<th width="10"></th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
</tbody> |
|
</table> |
|
</div> |
|
</div> |
|
<script> |
|
var table = $("#tab-data").DataTable({ |
|
"processing": true, |
|
"serverSide": true, |
|
"language": { |
|
"url": "/dictionary/datatables/<?= $_SESSION["language"] ?>.lang" |
|
}, |
|
"ajax": { |
|
"url": "/contratti/table.php", |
|
"data": function (d) { |
|
d.stato = $('input[name=status]:checked').val(); |
|
} |
|
}, |
|
"order": [[2,'desc']], |
|
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, '<?= __("tutti") ?>']], |
|
"columns": [ |
|
{ "class": "text-center" }, |
|
{ "class": "text-center" }, |
|
null, |
|
{ "class": "text-center" }, |
|
{ "class": "text-center" }, |
|
{ "class": "text-center" }, |
|
{ "orderable": false } |
|
] |
|
}); |
|
</script> |
|
<? |
|
} else { |
|
?> |
|
<div class="row"> |
|
<div class="offset-lg-3 col-lg-6 col-12"> |
|
<? alertManager::printWarningBox(__("Nessun risultato")); ?> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
?> |
|
</div> |
|
<? |
|
include_once($root."/layout/bottom.php"); |
|
} |
|
?>
|