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.
 
 
 

294 righe
16 KiB

<!doctype html>
<?
include '../../lib/api.php';
define('WS_MODULE', 'domande_controlli');
define('THIS_PERMISSION', GRUPPO_ISTANZE);
define('THIS_PERMISSION2', GRUPPO_REGIONE);
include_once (ROOT . "layout/include_permission.php");
$action = 'listSconti';
$domDataTable = 'lBrftip';
$datiControlli = DomandaScontiControlli::getEsiti();
//Utils::print_array($datiControlli);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" aria-current="page">Istanze da controllare</li>
</ol>
</nav>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="card" >
<div class='card-header bg-primary text-white'>Sezione Controllo Istanze</div>
<div class="card-body">
<h5 class="card-title"></h5>
<div id="rigaGenerazione">
<p class="card-text">Per generare l'elenco delle istanze da sottoporre a controllo, clicca sul tasto che segue.</p>
<p class="card-text">L'elenco delle pratiche sarà generato randomicamente, estraendo
l'1.5% delle richieste residenti e l'1.5% delle richieste prioritarie, nello stato "PRESA IN CARICO".</p>
<button class="btn btn-primary" onclick="generaElenco()">Genera Elenco Istanze da Controllare</button>
</div>
<div id="rigaGenerata">
<p class="card-text">Sono presenti ancora <strong><span id='rimanenti'></span></strong> domande da controllare</p>
</div>
<hr>
<? if (!empty($datiControlli)) { ?>
<div><b>Stato Controlli:</b>
<?
foreach ($datiControlli as $esiti) {
if ($esiti['ESITO'] == 0) {
echo "Richieste da controllare: <i class='fa fa-spinner text-warning'></i> <b>" . $esiti['TOTALE'] . "</b> | ";
} else if ($esiti['ESITO'] == 1) {
echo "Richieste Validate: <i class='fa fa-thumbs-up text-success'></i> <b>" . $esiti['TOTALE'] . "</b> | ";
} else if ($esiti['ESITO'] == 99) {
echo "Richieste Escluse: <i class='fa fa-thumbs-down text-danger'></i> <b>" . $esiti['TOTALE'] . "</b> | ";
}
?>
<? } ?>
</div>
<? } ?>
</div>
</div>
</div>
</div>
<div class="row mt-5">
<div class="col-sm-12">
<h4 class="card-title">ELENCO RICHIESTE DI SCONTO PRESE IN CARICO E DA CONTROLLARE</h4>
<div id="searchStatoTable"></div>
<table id="lista_richieste" class="table table-striped table-bordered" style="width:100%">
<thead>
<tr>
<th scope="col">ID</th>
<th scope="col">Data Richiesta</th>
<th scope="col">Tipo</th>
<th scope="col">Beneficiario</th>
<th scope="col">Data Acquisto</th>
<th scope="col">Data Volo</th>
<th scope="col">Biglietto/Compagnia/Tratta/Costo</th>
<th scope="col">Sconto</th>
<th scope="col">Stato</th>
<th scope="col">#</th>
</tr>
</thead>
</table>
</div>
</div>
<div id="editEscludiRichiesta" class="modal fade" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">RICHIESTA DI SCONTO NON APPROVATA</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form class="col s12" id="form-edit-sconto" action="javascript:siparsFramework.ModModal('form-edit-sconto', 'elenco_sconti')">
<input type="hidden" readonly id="action" name="action" value="escludi" />
<input type="hidden" readonly id="edit_ID" readonly="readonly" name="ID" />
<div class="modal-body">
<div class="form-group">
<label for="oggetto">Beneficiario</label>
<input type="text" readonly="readonly" class="form-control" id="edit_CODICE_FISCALE" name="CODICE_FISCALE"/>
</div>
<div class="form-group">
<label for="oggetto">Numero volo</label>
<input type="text" readonly="readonly" class="form-control" id="edit_NUMERO_VOLO" name="NUMERO_VOLO"/>
</div>
<div class="form-group">
<label for="domanda">Note di non approvazione<span class="text-danger">*</span></label>
<textarea class="form-control" id="edit_NOTE" name="NOTE" rows="10" required></textarea>
</div>
<div class="row">
<div class="col-12">
<h5 class="text-danger">ATTENZIONE! L'operazione è irreversibile. Per revocare l'operazione contattare l'amministratore di sistema! Clicca sul pulsante "Procedi" per continuare.</h5>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annulla</button>
<button class="btn btn-danger" type="submit" name="save">Procedi</button>
</div>
</form>
</div>
</div>
</div>
<div id="editValidaRichiesta" class="modal fade" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">RICHIESTA DI SCONTO VERIFICATA</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form class="col s12" id="form-edit-sconto-valida" action="javascript:siparsFramework.ModModal('form-edit-sconto-valida', 'elenco_sconti')">
<input type="hidden" readonly id="action" name="action" value="valida" />
<input type="hidden" readonly id="edit_ID" readonly="readonly" name="ID" />
<div class="modal-body">
<div class="form-group">
<label for="oggetto">Beneficiario</label>
<input type="text" readonly="readonly" class="form-control" id="edit_CODICE_FISCALE" name="CODICE_FISCALE"/>
</div>
<div class="form-group">
<label for="oggetto">Numero volo</label>
<input type="text" readonly="readonly" class="form-control" id="edit_NUMERO_VOLO" name="NUMERO_VOLO"/>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annulla</button>
<button class="btn btn-danger" type="submit" name="save">Procedi</button>
</div>
</form>
</div>
</div>
</div>
</div>
<? include_once ROOT . 'layout/footer.php'; ?>
</main>
<script type="text/javascript">
var table;
$(document).ready(function () {
table = $('#lista_richieste').DataTable({
'processing': true,
'serverSide': true,
'serverMethod': 'post',
'autoWidth': false,
"order": [[4, 'desc']],
dom: '<?= $domDataTable ?>',
'ajax': {
'url': WS_CALL,
'data': {
'module': '<?= WS_MODULE ?>',
'action': '<?= $action ?>',
'stato': '<?= $stDomande ?>'
}
},
'columnDefs': [
{'width': '80px', 'targets': 1},
{'width': '80px', 'targets': 3},
{'width': '80px', 'targets': 4},
{'width': '80px', 'targets': 6},
{'width': '80px', 'targets': 7},
{'width': '100px', 'targets': 8}
],
'columns': [
{data: 'ID', "visible": true, orderable: false}, //0
{data: 'DATA_RICHIESTA', "visible": true, orderable: false}, //1
{data: 'PRIORITA', "visible": true, orderable: false}, //2
{data: 'BENEFICIARIO', "visible": true, orderable: false}, //3
{data: 'DATA_ACQUISTO', "visible": true, orderable: false}, //4
{data: 'DATA_VOLO', "visible": true}, //5
{data: 'TRATTA', "visible": true, orderable: false}, //6
{data: 'SCONTO_TOTALE', "visible": true, orderable: false}, //7
{data: 'STATO', orderable: false}, //8
{data: 'OP', orderable: false}//9
//{data: 'OP', "visible": !readOnly, orderable: false}
],
initComplete: function () {
var table = $('#lista_richieste').DataTable();
var info = table.page.info();
gestisciAlertHeader(info.recordsDisplay);
// console.log("Total records after filtering (iTotalDisplayRecords): " + info.recordsDisplay);
// console.log("Total records overall (iTotalRecords): " + info.recordsTotal);
},
});
});
function gestisciAlertHeader(num_record) {
if (num_record > 0) {
$("#rigaGenerazione").attr("hidden", true);
$("#rimanenti").html(num_record);
$("#rigaGenerata").attr("hidden", false);
} else {
$("#rigaGenerazione").attr("hidden", false);
$("#rigaGenerata").attr("hidden", true);
}
}
function openStreamer(id, t) {
var object = {
id: id,
module: 'streamerFile',
action: 'download_sconti',
type: t
};
$.redirect(WS_CALL, object, "POST");
}
function generaElenco() {
Swal.fire({
title: "Attenzione",
text: "Sei sicuro di voler proseguire con l'operazione selezionata?",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Procedi',
cancelButtonText: 'Annulla'
}).then((result) => {
if (result.value) {
$('#loader').show();
var object = {
module: "domande_controlli",
action: "generaRecord"
}
postdataClassic(WS_CALL, object, function (response) {
console.log(response);
var risp = jQuery.parseJSON(response);
if (risp.esito === 1) {
$('#loader').hide();
Swal.fire({
type: 'success',
title: 'OK',
text: "Operazione completata con successo",
showCancelButton: false,
confirmButtonColor: '#3085d6',
confirmButtonText: 'OK',
allowOutsideClick: false
}).then((result) => {
console.log("devo fare il reload");
table.ajax.reload(function (data) {
var rowCount = table.rows().count(); // Ottieni il numero di righe
if (data.iTotalDisplayRecords > 0) {
gestisciAlertHeader(data.iTotalDisplayRecords);
}
});
});
} else {
$('#loader').hide();
functionSwall('error', risp.erroreDescrizione, "");
}
});
}
});
}
</script>
</body>
</html>