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.
527 righe
23 KiB
527 righe
23 KiB
<!doctype html> |
|
<? |
|
include '../../lib/api.php'; |
|
define('WS_MODULE', 'domanda'); |
|
define('WS_MODULE_SCONTI', 'elenco_sconti'); |
|
|
|
$id_domanda = intval($_POST['domanda']); |
|
define('THIS_PERMISSION', GRUPPO_ISTANZE); |
|
define ('THIS_PERMISSION2' , GRUPPO_REGIONE); |
|
include_once (ROOT . "layout/include_permission.php"); |
|
//Utils::print_array($_POST); |
|
|
|
//$id_domanda = '36405'; |
|
if ($id_domanda > 0) { |
|
$domanda = new Domanda($id_domanda); |
|
$richiedente = new Account($domanda->ID_ACCOUNT); |
|
} else { |
|
exit('Nessuna domanda selezionata'); |
|
} |
|
$state['readonly'] = 'readonly="readonly"'; |
|
$state['disabled'] = 'disabled="disabled"'; |
|
$IDDomanda = $domanda->ID; |
|
$allegati = $domanda->allegati; |
|
//$sconti = $domanda->richieste_sconti; |
|
$domDataTable = 'lBrtip'; |
|
|
|
|
|
//Utils::print_array($sconti);exit(); |
|
//Utils::print_array($richiedente);exit(); |
|
/* |
|
echo "<br>FASCIA <b>".$domanda->GetFascia()."</b>"; |
|
echo "<br>CANONE ANNUO <b>".$domanda->GetCanoneAnnuo()."</b>"; |
|
echo "<br>ISEE <b>".$domanda->GetISEE()."</b>"; |
|
echo "<br>INCIDENZA <b>".$domanda->GetIncidenza()."</b>"; |
|
echo "<br>PERC CONTR <b>".$domanda->GetPercentualeContributo()."</b>"; |
|
echo "<br>CONTRIBUTO TEORICO <b>".$domanda->GetContributoTeorico()."</b>"; |
|
echo "<br>CONTRIBUTO SPETTANTE <b>".$domanda->GetContributo()."</b>"; |
|
exit(); |
|
*/ |
|
?> |
|
<html lang="en"> |
|
<? include_once ROOT . 'layout/head.php'; ?> |
|
<body> |
|
<? include_once ROOT . 'layout/header.php'; ?> |
|
<main role="main" class="<?= $cssColumNavBar ?>" > |
|
<div class="container-fluid"> |
|
<? include_once ROOT . 'layout/menu.php'; ?> |
|
|
|
<div class="row"> |
|
<div class="col-sm-12"> |
|
<nav aria-label="breadcrumb"> |
|
<ol class="breadcrumb"> |
|
<li class="breadcrumb-item"><a href="#">Home</a></li> |
|
<li class="breadcrumb-item active"><a href="domande.php">Elenco domande</a></li> |
|
<li class="breadcrumb-item active" aria-current="page">Visualizzazione domanda</li> |
|
</ol> |
|
</nav> |
|
</div> |
|
</div> |
|
|
|
<div class="card"> |
|
<div class="card-header"> |
|
<i class="fas fa-address-card"></i> Dati Istanza<br> |
|
<h3>Identificativo istanza (id) <?= $IDDomanda ?></span></h3> |
|
</div> |
|
<div class="card-body"> |
|
<div class="row"> |
|
<div class="col-sm-12"> |
|
<ul class="nav nav-tabs" id="myTab" role="tablist"> |
|
<li class="nav-item"> |
|
<a class="nav-link active" id="richiedente-tab" data-toggle="tab" href="#richiedenteTab" role="tab" aria-controls="richiedenteTab" aria-selected="true">Anagrafica del richiedente</a> |
|
</li> |
|
<li class="nav-item"> |
|
<a class="nav-link" id="nucleo-tab" data-toggle="tab" href="#nucleoTab" role="tab" aria-controls="nucleoTab" aria-selected="false">Nucleo familiare</a> |
|
</li> |
|
<li class="nav-item"> |
|
<a class="nav-link" id="istanza-tab" data-toggle="tab" href="#istanzaTab" role="tab" aria-controls="istanzaTab" aria-selected="false">Istanza</a> |
|
</li> |
|
<li class="nav-item"> |
|
<a class="nav-link" id="allegati-tab" data-toggle="tab" href="#allegatiTab" role="tab" aria-controls="allegatiTab" aria-selected="false">Allegati</a> |
|
</li> |
|
<li class="nav-item"> |
|
<a class="nav-link" id="sconti-tab" data-toggle="tab" href="#scontiTab" role="tab" aria-controls="scontiTab" aria-selected="false">Richieste sconti</a> |
|
</li> |
|
</ul> |
|
<div class="tab-content"> |
|
<div class="tab-pane active" id="richiedenteTab" role="tabpanel" aria-labelledby="richiedente-tab"> |
|
<div class="card"> |
|
<div class="card-body"> |
|
<?include_once 'domanda/include_anagrafica_richiedente.php';?> |
|
</div> |
|
</div> |
|
</div> |
|
<div class="tab-pane " id="nucleoTab" role="tabpanel" aria-labelledby="nucleo-tab"> |
|
<div class="card"> |
|
<div class="card-body"> |
|
<?include_once 'domanda/include_nucleo_familiare.php';?> |
|
</div> |
|
</div> |
|
</div> |
|
<div class="tab-pane " id="istanzaTab" role="tabpanel" aria-labelledby="istanza-tab"> |
|
<div class="card"> |
|
<div class="card-body"> |
|
<?include_once 'domanda/include_istanza.php';?> |
|
</div> |
|
</div> |
|
</div> |
|
<div class="tab-pane " id="allegatiTab" role="tabpanel" aria-labelledby="allegati-tab"> |
|
<div class="card"> |
|
<div class="card-body"> |
|
<?include_once 'domanda/include_allegati.php';?> |
|
</div> |
|
</div> |
|
</div> |
|
<div class="tab-pane " id="scontiTab" role="tabpanel" aria-labelledby="sconti-tab"> |
|
<div class="card"> |
|
<div class="card-body"> |
|
<?include_once 'domanda/include_sconti.php';?> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
</div> |
|
<? include_once ROOT . 'layout/footer.php'; ?> |
|
</main> |
|
</body> |
|
<script type="text/javascript"> |
|
var tabActive = null; |
|
|
|
$(document).ready(function () { |
|
|
|
listRichieste(); |
|
$('#myTab a').on('click', function (e) { |
|
tabActive =$(this)[0].id; |
|
console.log(tabActive); |
|
if(tabActive == 'sconti-tab'){ |
|
//reloadRichieste(); |
|
} |
|
$(this).tab('show'); |
|
|
|
}) |
|
|
|
setReadOnly(); |
|
}); |
|
function reloadRichieste(){ |
|
$("#lista_richieste").DataTable().ajax.reload(function (json) { |
|
|
|
}); |
|
} |
|
|
|
|
|
function listRichieste(reload) { |
|
|
|
$("#lista_richieste").DataTable({ |
|
'processing': true, |
|
'serverSide': true, |
|
'paging': true, |
|
'serverMethod': 'post', |
|
'autoWidth': false, |
|
"dom": 'lrtp', |
|
"order": [[0, 'desc'],[5, 'asc']], |
|
'ajax': { |
|
'url': WS_CALL, // + '?module=istituto&action=list_istituti' |
|
'data': { |
|
'module': 'domanda', |
|
'action': 'listSconti', |
|
'id': '<?=$domanda->ID?>' |
|
} |
|
}, |
|
'columnDefs': [ |
|
{'width': '80px', 'targets': 1}, |
|
{'width': '80px', 'targets': 3}, |
|
{'width': '80px', 'targets': 4}, |
|
{'width': '80px', 'targets': 7}, |
|
{'width': '80px', 'targets': 8} |
|
|
|
], |
|
'columns': [ |
|
{data: 'ID', "visible": true},//0 |
|
{data: 'DATA_RICHIESTA', "visible": true},//1 |
|
{data: 'TIPO_RICHIESTA', "visible": true},//1 |
|
{data: 'BENEFICIARIO', "visible": true},//2 |
|
{data: 'IBAN_RICHIESTA', "visible": true},//2 |
|
{data: 'DATA_ACQUISTO', "visible": true},//3 |
|
{data: 'DATA_VOLO', "visible": true},//4 |
|
{data: 'NUMERO_VOLO', "visible": true},//5 |
|
{data: 'TRATTA', "visible": true},//6 |
|
{data: 'COSTO_TRATTA', "visible": true},//7 |
|
{data: 'SCONTO_TOTALE', "visible": true},//8 |
|
{data: 'STATO', orderable: false},//9 |
|
{data: 'OP', orderable: false}//10 |
|
//{data: 'OP', "visible": !readOnly, orderable: false} |
|
], |
|
'initComplete': function (settings, json) { |
|
//checkRenderRequest(json); |
|
} |
|
}); |
|
} |
|
|
|
function openStreamer(id, t = '') { |
|
if(t===''){ |
|
var object = { |
|
id: id, |
|
module: 'streamerFile', |
|
action: 'download' |
|
}; |
|
}else{ |
|
var object = { |
|
id: id, |
|
module: 'streamerFile', |
|
action: 'download_sconti', |
|
type: t |
|
}; |
|
} |
|
|
|
$.redirect(WS_CALL, object, "POST"); |
|
} |
|
function openStreamerDomanda(){ |
|
var object = { |
|
id: '<?=intval($id_domanda)?>', |
|
module: 'streamerFile', |
|
action: 'download_istanza' |
|
}; |
|
$.redirect(WS_CALL, object, "POST"); |
|
} |
|
function openStreamerProtocollo(){ |
|
var object = { |
|
id: '<?=intval($id_domanda)?>', |
|
module: 'streamerFile', |
|
action: 'download_protocollo' |
|
}; |
|
$.redirect(WS_CALL, object, "POST"); |
|
} |
|
|
|
function riammettiDomanda(){ |
|
$('#loader').show(); |
|
var form = document.getElementById('form-riammetti-domanda'); |
|
|
|
var formInvio = new FormData(form); |
|
formInvio.set('module', 'domanda'); |
|
formInvio.set('action', 'riammettiDomanda'); |
|
postdata(WS_CALL, formInvio, function (response) { |
|
$('#loader').hide(); |
|
var risp = jQuery.parseJSON(response); |
|
if (risp.esito === 1) { |
|
Swal.fire({ |
|
type: 'success', |
|
title: 'OK', |
|
text: "Operazione completata con successo", |
|
showCancelButton: false, |
|
confirmButtonColor: '#3085d6', |
|
confirmButtonText: 'OK', |
|
allowOutsideClick: false |
|
}).then((result) => { |
|
redirectDomanda('<?=$domanda->ID?>'); |
|
}); |
|
|
|
} else { |
|
functionSwall('error', risp.erroreDescrizione, ''); |
|
} |
|
}); |
|
} |
|
function escludiDomanda(){ |
|
Swal.fire({ |
|
title: "Attenzione", |
|
text: "Sicuro di volere procedere con l'esclusione dell'istanza?.", |
|
icon: 'warning', |
|
showCancelButton: true, |
|
confirmButtonColor: '#3085d6', |
|
cancelButtonColor: '#d33', |
|
confirmButtonText: 'OK' |
|
}).then((result) => { |
|
if (result.value) { |
|
$('#loader').show(); |
|
var form = document.getElementById('form-escludi-domanda'); |
|
|
|
var formInvio = new FormData(form); |
|
formInvio.set('module', 'domanda'); |
|
formInvio.set('action', 'escludiDomanda'); |
|
postdata(WS_CALL, formInvio, function (response) { |
|
$('#loader').hide(); |
|
var risp = jQuery.parseJSON(response); |
|
if (risp.esito === 1) { |
|
Swal.fire({ |
|
type: 'success', |
|
title: 'OK', |
|
text: "Operazione completata con successo", |
|
showCancelButton: false, |
|
confirmButtonColor: '#3085d6', |
|
confirmButtonText: 'OK', |
|
allowOutsideClick: false |
|
}).then((result) => { |
|
redirectDomanda('<?=$domanda->ID?>'); |
|
}); |
|
|
|
} else { |
|
functionSwall('error', risp.erroreDescrizione, ''); |
|
} |
|
}); |
|
} |
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
function annullaDomanda(){ |
|
Swal.fire({ |
|
title: "Attenzione", |
|
text: "Sicuro di volere procedere con l'annullamento dell'istanza? Questa operazione è irreversibile dal sistema.", |
|
icon: 'warning', |
|
showCancelButton: true, |
|
confirmButtonColor: '#3085d6', |
|
cancelButtonColor: '#d33', |
|
confirmButtonText: 'OK' |
|
}).then((result) => { |
|
if (result.value) { |
|
$('#loader').show(); |
|
var form = document.getElementById('form-annulla-domanda'); |
|
|
|
var formInvio = new FormData(form); |
|
formInvio.set('module', 'domanda'); |
|
formInvio.set('action', 'annullaDomanda'); |
|
postdata(WS_CALL, formInvio, function (response) { |
|
$('#loader').hide(); |
|
var risp = jQuery.parseJSON(response); |
|
if (risp.esito === 1) { |
|
Swal.fire({ |
|
type: 'success', |
|
title: 'OK', |
|
text: "Operazione completata con successo", |
|
showCancelButton: false, |
|
confirmButtonColor: '#3085d6', |
|
confirmButtonText: 'OK', |
|
allowOutsideClick: false |
|
}).then((result) => { |
|
redirectDomanda('<?=$domanda->ID?>'); |
|
}); |
|
|
|
} else { |
|
functionSwall('error', risp.erroreDescrizione, ''); |
|
} |
|
}); |
|
} |
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
function setReadOnly() { |
|
$('#form-domanda :input').each(function () { |
|
$(this).attr('readonly', 'readonly'); |
|
$('.form-check-input').attr('disabled', 'disabled'); |
|
$('.form-check-input-lavoro').attr('disabled', 'disabled'); |
|
$('.form-check-input-dichiarazioni').attr('disabled', 'disabled'); |
|
$('.form-check-input-dich-nonobbligatoria').attr('disabled', 'disabled'); |
|
}); |
|
|
|
$('#form-iban :input').each(function () { |
|
$(this).removeClass('is-valid'); |
|
$(this).removeClass('is-invalid'); |
|
$(this).change(function () { |
|
isModified = true; |
|
console.log($(this)[0].id); |
|
if($(this)[0].id === "vi_c_Iban_cambio" || $(this)[0].id === "ripeti_iban_cambio"){ |
|
console.log('this: ', $(this)[0].id); |
|
console.log('vi_c_Iban_cambio: ', $("#vi_c_Iban_cambio").val()); |
|
console.log('ripeti_iban_cambio: ', $("#ripeti_iban_cambio").val()); |
|
if($("#vi_c_Iban_cambio").val() != $("#ripeti_iban_cambio").val()){ |
|
console.log('is-invalid'); |
|
$("#vi_c_Iban_cambio").removeClass('is-valid').addClass('is-invalid'); |
|
$("#ripeti_iban_cambio").removeClass('is-valid').addClass('is-invalid'); |
|
}else{ |
|
console.log('is-valid'); |
|
$("#vi_c_Iban_cambio").removeClass('is-invalid').addClass('is-valid'); |
|
$("#ripeti_iban_cambio").removeClass('is-invalid').addClass('is-valid'); |
|
} |
|
}else if ($(this)[0].id != "vi_c_Iban_cambio" && $(this)[0].id != "ripeti_iban_cambio") { |
|
$(this).addClass('is-valid'); |
|
} |
|
$('#btn-refresh').show(); |
|
|
|
}); |
|
}); |
|
|
|
|
|
} |
|
|
|
function resetForm(){ |
|
var form = document.getElementById('form-iban'); |
|
form.reset(); |
|
} |
|
|
|
|
|
function saveCambioIban() { |
|
$('#loader').show(); |
|
var form = document.getElementById('form-iban'); |
|
|
|
var formInvio = new FormData(form); |
|
formInvio.set('module', 'domanda'); |
|
formInvio.set('action', 'saveIban'); |
|
|
|
postdata(WS_CALL, formInvio, function (response) { |
|
$('#loader').hide(); |
|
var risp = jQuery.parseJSON(response); |
|
if (risp.esito === 1) { |
|
isModified = false; |
|
Swal.fire({ |
|
type: 'success', |
|
title: 'OK', |
|
text: "Operazione completata con successo", |
|
showCancelButton: false, |
|
confirmButtonColor: '#3085d6', |
|
confirmButtonText: 'OK', |
|
allowOutsideClick: false |
|
}).then((result) => { |
|
reloadIban(); |
|
}); |
|
|
|
} else { |
|
functionSwall('error', risp.erroreDescrizione, ''); |
|
} |
|
}); |
|
|
|
} |
|
|
|
function riammettiIstanza(id) { |
|
Swal.fire({ |
|
title: "Attenzione", |
|
text: "Sei sicuro di voler proseguire con l'operazione selezionata?", |
|
icon: 'warning', |
|
showCancelButton: true, |
|
confirmButtonColor: '#3085d6', |
|
cancelButtonColor: '#d33', |
|
confirmButtonText: 'OK' |
|
}).then((result) => { |
|
if (result.value) { |
|
$('#loader').show(); |
|
var object = { |
|
module: 'domanda', |
|
action: 'riammettiIstanza', |
|
id_domanda_sconti: id |
|
}; |
|
postdataClassic(WS_CALL, object, function (response) { |
|
var risp = jQuery.parseJSON(response); |
|
if (risp.esito === 1) { |
|
$('#loader').hide(); |
|
var risp = jQuery.parseJSON(response); |
|
if (risp.esito === 1) { |
|
isModified = false; |
|
Swal.fire({ |
|
type: 'success', |
|
title: 'OK', |
|
text: "Operazione completata con successo", |
|
showCancelButton: false, |
|
confirmButtonColor: '#3085d6', |
|
confirmButtonText: 'OK', |
|
allowOutsideClick: false |
|
}).then((result) => { |
|
reloadRichieste(); |
|
}); |
|
} else { |
|
functionSwall('error', risp.erroreDescrizione, ''); |
|
} |
|
} else { |
|
$('#loader').hide(); |
|
functionSwall('error', risp.erroreDescrizione, ""); |
|
} |
|
}); |
|
|
|
|
|
} |
|
}); |
|
} |
|
|
|
|
|
function impersonificaUtente(codice_fiscale) { |
|
Swal.fire({ |
|
title: 'Attenzione', |
|
type: 'warning', |
|
text: "Sei sicuro di voler proseguire con l'operazione selezionata?", |
|
showCancelButton: true, |
|
confirmButtonColor: "#31aa47", |
|
confirmButtonText: "OK", |
|
cancelButtonText: "ANNULLA", |
|
closeOnConfirm: true, |
|
closeOnCancel: true |
|
}).then((result) => { |
|
if (result.value == true) { |
|
var object = { |
|
module: "impersonificazione", |
|
action: "saveRichiesta", |
|
CODICE_FISCALE: codice_fiscale |
|
}; |
|
$('#loader').show(); |
|
postdataClassic(WS_CALL, object, function (response, textStatus, xhr) { |
|
var risp = jQuery.parseJSON(response); |
|
if (risp.esito === 1) { |
|
$('#loader').hide(); |
|
$.redirect("<?=FRONTEND_URL?>", { |
|
id: risp.dati.id, |
|
guid: risp.dati.guid, |
|
cf: risp.dati.cf, |
|
}); |
|
} else { |
|
$('#loader').hide(); |
|
functionSwall('error', risp.erroreDescrizione, ""); |
|
} |
|
}), function (reason) { |
|
loader("hide"); |
|
console.log(reason); |
|
swalfunction("error", "Errore " + reason.status) |
|
}; |
|
} |
|
}); |
|
} |
|
|
|
</script> |
|
|
|
</html>
|