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.
98 righe
4.2 KiB
98 righe
4.2 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$id_modulo = "esponenti"; |
|
$cmd_info = stipula::getInfoModulo($id_modulo); |
|
$error = true; |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"]) && $_SESSION["utente"]->permission($radice,$_GET["codice_contratto"],$id_modulo)) { |
|
$contratto = stipula::init($_GET["codice_contratto"]); |
|
if (!empty($contratto)) { |
|
$record = $contratto->info; |
|
$lock = $contratto->checkLock($cmd_info["id"]); |
|
if (!$lock) { |
|
if ($_GET["tipologia"]=="uff") { |
|
$tipologia = "uff"; |
|
$esponenti = $contratto->getUfficialiRoganti(); |
|
$ruoli = stipula::ruoliUfficiali(); |
|
} else { |
|
$tipologia = "ore"; |
|
$esponenti = $contratto->getEsponentiSA(); |
|
$ruoli = stipula::ruoliEsponentiSA(); |
|
} |
|
$error = false; |
|
if (!empty($esponenti)) { |
|
?> |
|
<div class="card"> |
|
<div class="card-header"> |
|
<div class="card-title"><?= __("Cerca Esponente") ?></div> |
|
</div> |
|
<div class="card-body"> |
|
<table class="table table-condensed table-striped table-hover" id="searchEsponenti"> |
|
<thead> |
|
<tr> |
|
<th width="150"><?= __("Codice Fiscale") ?></th> |
|
<th ><?= __("Nominativo") ?></th> |
|
<th width="150"><?= __("Ruolo") ?></th> |
|
<th width="100"><?= __("Data nascita") ?></th> |
|
<th width="10"></th> |
|
<th width="10"></th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
<? |
|
foreach($esponenti AS $esponente) { |
|
?> |
|
<tr id="esponente-<?= $esponente["codice"] ?>"> |
|
<td><?= $esponente["cf"] ?></td> |
|
<td><?= $esponente["denominazione"] ?></td> |
|
<td><?= (!empty($ruoli[$esponente["ruolo"]])) ? __($ruoli[$esponente["ruolo"]]) : "" ?></td> |
|
<td><?= $esponente["dataNascita"] ?? "" ?></td> |
|
<td> |
|
<button type="button" onClick="showModalWithURL('/backend/contratti/esponenti/edit.php?add=true&codice_contratto=<?= $record["codice"] ?>&codice=<?= $esponente["codice"] ?>&tipologia=<?= $tipologia ?>')" class="btn btn-sm btn-success"><span class="fa fa-check"></span></button> |
|
</td> |
|
<td> |
|
<button onClick="elimina(<?= $esponente["codice"] ?>,'contratti/esponenti','codice_contratto=<?= $record["codice"] ?>')" class="btn btn-sm btn-danger" title="<?= __('Elimina') ?>"><span class="fa fa-times"></span></button> |
|
</td> |
|
</tr> |
|
<? |
|
} |
|
?> |
|
</tbody> |
|
</table> |
|
</div> |
|
</div> |
|
<script> |
|
var tabEsponenti = $("#searchEsponenti").DataTable({ |
|
"processing": true, |
|
"serverSide": false, |
|
"sort": true, |
|
"info": true, |
|
"filter": true, |
|
"paginate": true, |
|
"language": { |
|
"url": "/dictionary/datatables/<?= $_SESSION["language"] ?>.lang" |
|
}, |
|
"columns": [ |
|
null, |
|
null, |
|
null, |
|
null, |
|
{ "orderable": false }, |
|
{ "orderable": false } |
|
] |
|
}); |
|
</script> |
|
<button type="button" onClick="showModalWithURL('/backend/contratti/esponenti/edit.php?codice_contratto=<?= $record["codice"] ?>&codice=0&tipologia=<?= $tipologia ?>')" class="btn btn-lg btn-warning btn-block mt-2"><span class="fa fa-edit"></span> <?= __("Inserimento manuale") ?></button> |
|
<? } else { ?> |
|
<script> |
|
showModalWithURL('/backend/contratti/esponenti/edit.php?codice_contratto=<?= $record["codice"] ?>&codice=0&tipologia=<?= $tipologia ?>'); |
|
</script> |
|
<? } |
|
} |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|
|
|