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.
138 righe
5.8 KiB
138 righe
5.8 KiB
<!doctype html> |
|
<? |
|
include '../../lib/api.php'; |
|
define('WS_MODULE', 'compagnie'); |
|
define('THIS_PERMISSION', GRUPPO_ISTANZE); |
|
include_once (ROOT . "layout/include_permission.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 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="save" /> |
|
<input type="hidden" id="edit_ID" readonly="readonly" name="ID" /> |
|
<div class="modal-body"> |
|
<div class="form-group"> |
|
<label for="nome">Nome</label> |
|
<input type="text" class="form-control" id="edit_NOME" required name="NOME"/> |
|
</div> |
|
<div class="form-group"> |
|
<label for="domanda">Adesione</label> |
|
<select class="form-control" id="edit_ADESIONE" required name="ADESIONE"> |
|
<option value="0">NO</option> |
|
<option value="1">SI</option> |
|
</select> |
|
</div> |
|
<div class="form-group"> |
|
<label for="domanda">Data adesione</label> |
|
<input type="date" class="form-control" id="edit_DATA_ADESIONE" name="DATA_ADESIONE"/> |
|
</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">ANAGRAFICA DI TUTTE LE COMPAGNIE CENSITE</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> Nuova 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>Modifica</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': "listDataTable" |
|
} |
|
}, |
|
'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 resetField() { |
|
$("#edit_ID").val(0); |
|
$("#edit_NOME").val(''); |
|
$("#edit_ADESIONE").val(''); |
|
$("#edit_DATA_ADESIONE").val(''); |
|
} |
|
</script> |
|
|
|
</body> |
|
</html>
|
|
|