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.
128 righe
5.4 KiB
128 righe
5.4 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$id_modulo = "ooee"; |
|
$cmd_info = stipula::getInfoModulo($id_modulo); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice,$_GET["codice"],$id_modulo) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"])) { |
|
$contratto = stipula::init($_GET["codice"]); |
|
if (!empty($contratto)) { |
|
$record = $contratto->info; |
|
$lock = $contratto->checkLock($cmd_info["id"]); |
|
$titolo_modulo = __($cmd_info["titolo"]); |
|
$breadcrumb = array(); |
|
$breadcrumb["/".$radice."/"] = Modulo::getInfo($radice)["titolo"]; |
|
$breadcrumb = $contratto->getBreadcrumb($breadcrumb); |
|
$breadcrumb["/".$radice."/panel.php?codice=".$record["codice"]] = __("Pannello"); |
|
$breadcrumb[""] = $titolo_modulo; |
|
|
|
include_once ($beRoot."/layout/top.php"); |
|
if (!$lock) { |
|
?> |
|
<div id="commands" class="mb-5"> |
|
<div class="commands container-fluid"> |
|
<div class="row"> |
|
<div class="col-12 text-right"> |
|
<button onClick="showModalWithURL('search.php?codice_contratto=<?= $record["codice"] ?>')" class="btn btn-success" title="<?= __('Aggiungi nuovo') ?>"><span class="fa fa-plus-circle"></span> <?= __('Aggiungi nuovo') ?></button> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
<? } ?> |
|
<h1> |
|
<?= $titolo_modulo ?> |
|
</h1> |
|
<? |
|
$contraenti = $contratto->getContraenti("oe"); |
|
|
|
if (!empty($contraenti)) { ?> |
|
<div class="card"> |
|
<div class="card-body"> |
|
<table class="table table-striped table-hover"> |
|
<thead> |
|
<tr> |
|
<th width="200"><?= __("Codice Fiscale") ?></th> |
|
<th><?= __("Denominazione") ?></th> |
|
<th width="10"></th> |
|
<th width="10"></th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
<? |
|
foreach($contraenti AS $contraente) { |
|
?> |
|
<tr> |
|
<td><?= $contraente["cf"] ?></td> |
|
<td> |
|
<? if (!empty($contraente["codice_operatore"])) { ?><a href="#" onclick="showCompany(<?= $contraente["codice_operatore"] ?>)"><? } ?> |
|
<?= $contraente["denominazione"] ?> |
|
<? if (!empty($contraente["codice_operatore"])) { ?></a><? } ?> |
|
</td> |
|
<td> |
|
<button onClick="showModalWithURL('edit.php?codice_contratto=<?= $record["codice"] ?>&codice=<?= $contraente["codice"] ?>')" class="btn btn-sm btn-primary" title="<?= __('Modifica') ?>"><span class="fa fa-edit"></span></button> |
|
</td> |
|
<td> |
|
<button onClick="elimina(<?= $contraente["codice_relazione"] ?>,'contratti/ooee','codice_contratto=<?= $record["codice"] ?>&codice_operatore=<?=$contraente["codice_operatore"]?>')" class="btn btn-sm btn-danger" title="<?= __('Elimina') ?>"><span class="fa fa-times"></span></button> |
|
</td> |
|
</tr> |
|
<? |
|
} |
|
?> |
|
</tbody> |
|
</table> |
|
</div> |
|
</div> |
|
<script type="text/javascript"> |
|
|
|
$(document).ready(function(){ |
|
function bindPecCheck() { |
|
const pec = $("#pec:not([readonly])"); |
|
if (pec.length) { |
|
const form = $("#edit-form"); |
|
$("#submit-btn").unbind("click"); |
|
$("#submit-btn").on("click",function(e) { |
|
e.preventDefault(); |
|
$.ajax({ |
|
url:"/backend/contratti/ooee/check.php", |
|
type: "POST", |
|
data: { |
|
pec: $("#pec").val() |
|
}, |
|
success: function(data) { |
|
if (data.count) { |
|
swal({ |
|
title:js_dict.attenzione, |
|
text:js_dict["pec-gia-in-uso"], |
|
type:"warning", |
|
showCancelButton: true, |
|
cancelButtonText: js_dict["annulla"] |
|
}).then(function(result){ |
|
if (result.value) { |
|
form.submit(); |
|
} |
|
}) |
|
} else { |
|
form.submit(); |
|
} |
|
}, |
|
error: function() { |
|
form.submit(); |
|
} |
|
}) |
|
}) |
|
} |
|
} |
|
const observer = new MutationObserver(bindPecCheck) |
|
observer.observe(document.getElementById("modal-helper"), {childList: true, subtree:true}); |
|
}) |
|
</script> |
|
<? } else { alertManager::printWarningBox(__("Nessun risultato")); } |
|
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(); |
|
} |
|
?>
|
|
|