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.
176 righe
6.8 KiB
176 righe
6.8 KiB
<!doctype html> |
|
<? |
|
include '../../lib/api.php'; |
|
define('WS_MODULE', 'aeroporti'); |
|
define('THIS_PERMISSION', GRUPPO_ISTANZE); |
|
include_once (ROOT . "layout/include_permission.php"); |
|
|
|
|
|
$codice= Utils::getFromReq('codice'); |
|
$aeroporto = new Aeroporti($codice); |
|
|
|
$all_compagnie = AnagraficaCompagnie::ListCompagnie(); |
|
|
|
//Utils::print_array($all_compagnie);exit(); |
|
|
|
if(empty($aeroporto->CODICE)){ |
|
Utils::RedirectTo(HTTP_PRIVATE_SECTION . "aeroporti.php"); |
|
} |
|
|
|
?> |
|
<html lang="en"> |
|
<? include_once ROOT . 'layout/head.php'; ?> |
|
<body> |
|
<? include_once ROOT . 'layout/header.php'; ?> |
|
|
|
<main role="main" class="<?= $cssColumNavBar ?>"> |
|
<div class="container"> |
|
<? 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"><a href="aeroporti.php">AEROPORTI</a></li> |
|
<li class="breadcrumb-item active" aria-current="page">ELENCO COMPAGNIE</li> |
|
</ol> |
|
</nav> |
|
</div> |
|
</div> |
|
<div id="editCompagnia" class="modal fade" role="dialog" aria-hidden="true"> |
|
<div class="modal-dialog"> |
|
<div class="modal-content"> |
|
<div class="modal-header"> |
|
<h5 class="modal-title">Compagnia</h5> |
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
|
<span aria-hidden="true">×</span> |
|
</button> |
|
</div> |
|
<form class="col s12" id="form-edit-compagnie" action="javascript:siparsFramework.ModModal('form-edit-compagnie', '<?= WS_MODULE ?>')"> |
|
<input type="hidden" id="action" name="action" value="add_compagnia" /> |
|
<input type="hidden" id="edit_AEROPORTO" value="<?=$aeroporto->CODICE?>" readonly="readonly" name="AEROPORTO" /> |
|
<div class="modal-body"> |
|
<div class="form-group"> |
|
<label for="domanda">Compagnia</label> |
|
<select class="form-control" id="edit_COMPAGNIA" required name="COMPAGNIA"> |
|
<option value="">Seleziona la compagnia</option> |
|
<? |
|
foreach ($all_compagnie as $v){?> |
|
<option value="<?=$v['ID']?>"><?=$v['NOME']?></option> |
|
<?} |
|
?> |
|
</select> |
|
</div> |
|
</div> |
|
<div class="modal-footer"> |
|
<button type="button" class="btn btn-danger" data-dismiss="modal">Annulla</button> |
|
<button class="btn btn-primary" type="submit" name="save">Salva</button> |
|
</div> |
|
</form> |
|
</div> |
|
</div> |
|
</div> |
|
<div class="row"> |
|
<div class="col s12"> |
|
<div class="card"> |
|
<div class="card-header"> |
|
<span style="font-size: xxx-large"><i class="fas fa-globe text-primary"></i></span> |
|
<span class="card-title">ELENCO COMPAGNIE CHE OPERANO NELL'AEROPORTO DI <b><?=$aeroporto->NOME?> [<?=$codice?>]</b></span> |
|
<button data-toggle="modal" data-target="#editCompagnia" class="btn btn-primary float-right" type="button" name="newCompagnia" onclick="resetField()"><i class="fas fa-add"></i> Aggiungi Compagnia</button> |
|
</div> |
|
<div class="card-content"> |
|
<br> |
|
<div class="col s12"> |
|
<table id="lista_Compagnia" class="table table-striped table-bordered" style="width:100%"> |
|
<thead> |
|
<tr> |
|
<th>#</th> |
|
<th>Nome</th> |
|
<th>Adesione allo sconto del 25% per i residenti</th> |
|
<th>Data adesione</th> |
|
<th>Elimina</th> |
|
</tr> |
|
</thead> |
|
</table> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
</main> |
|
<? include_once ROOT . 'layout/footer.php'; ?> |
|
<script type="text/javascript"> |
|
$(document).ready(function () { |
|
//$('.modal').modal(); |
|
|
|
siparsFramework.ButtonAdd('newCompagnia', { |
|
text: 'Nuova compagnia', |
|
href: '#editCompagnia', |
|
fn: 'resetField()' |
|
}, ''); |
|
|
|
$('#lista_Compagnia').DataTable({ |
|
'processing': true, |
|
'serverSide': true, |
|
'serverMethod': 'post', |
|
"order": [[0, 'desc']], |
|
'ajax': { |
|
'url': WS_CALL, |
|
'data': { |
|
'module': "<?= WS_MODULE ?>", |
|
'action': "listCompagnie", |
|
'codice': "<?=$codice?>" |
|
} |
|
}, |
|
'columns': [ |
|
{data: 'ID'}, |
|
{data: 'NOME', orderable: false}, |
|
{data: 'ADESIONE', orderable: false}, |
|
{data: 'DATA_ADESIONE', orderable: false}, |
|
{data: 'MODIFICA', orderable: false} |
|
], |
|
initComplete: function (settings, json) { |
|
siparsFramework.DataTableEventXhr();// |
|
} |
|
}); |
|
}); |
|
|
|
function deleteCompagnia(id){ |
|
|
|
|
|
Swal.fire({ |
|
title: "Attenzione", |
|
text: "Sei sicuro di volere procedere con l'operazione?", |
|
icon: "warning", |
|
closeModal: true, |
|
showCancelButton: true, |
|
confirmButtonColor: '#3085d6', |
|
cancelButtonColor: '#d33', |
|
confirmButtonText: 'OK' |
|
}).then((result) => { |
|
if (result.value) { |
|
|
|
var options = { |
|
module: 'aeroporti', |
|
action: 'delete_compagnia', |
|
id: id, |
|
aeroporto: '<?=$aeroporto->CODICE?>' |
|
} |
|
|
|
$.post(WS_CALL, |
|
options, |
|
function (data) { |
|
var datatbale_name = $('#lista_Compagnia').DataTable(); |
|
datatbale_name.ajax.reload(null, false); |
|
}); |
|
} |
|
}); |
|
} |
|
|
|
|
|
</script> |
|
|
|
</body> |
|
</html>
|
|
|