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.
136 righe
6.8 KiB
136 righe
6.8 KiB
<!doctype html> |
|
<? |
|
include '../../lib/api.php'; |
|
define('WS_MODULE', 'faq'); |
|
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'; ?> |
|
|
|
<? include_once ROOT . 'layout/menu.php'; ?> |
|
<main role="main" class="<?= $cssColumNavBar ?>"> |
|
<div class="container-fluid"> |
|
<nav aria-label="breadcrumb"> |
|
<ol class="breadcrumb"> |
|
<li class="breadcrumb-item active">Faq</li> |
|
</ol> |
|
</nav> |
|
<div id="editFaq" class="modal fade" role="dialog" aria-hidden="true"> |
|
<div class="modal-dialog"> |
|
<div class="modal-content"> |
|
<div class="modal-header"> |
|
<h5 class="modal-title">Faq</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-faq" action="javascript:siparsFramework.ModModal('form-edit-faq', '<?= 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="categoria">Categoria</label> |
|
<select class="form-control" id="edit_ID_CATEGORIA" name="ID_CATEGORIA"> |
|
<? foreach ($CATEGORIE_FAQ as $key => $value) { ?> |
|
<option value="<?= $key ?>"><?= $value ?></option> |
|
<? } ?> |
|
</select> |
|
</div> |
|
<div class="form-group"> |
|
<label for="oggetto">Domanda</label> |
|
<input type="text" class="form-control" id="edit_OGGETTO" name="OGGETTO"/> |
|
</div> |
|
<div class="form-group"> |
|
<label for="domanda">Risposta</label> |
|
<textarea class="form-control" id="edit_DOMANDA" name="DOMANDA" rows="10"></textarea> |
|
</div> |
|
</div> |
|
<div class="modal-footer"> |
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</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 text-right"> |
|
<button data-toggle="modal" data-target="#editFaq" class="btn btn-primary" type="button" name="newFaq" onclick="resetField()"><i class="fas fa-add"></i> Nuova F.A.Q.</button> |
|
</div> |
|
<div class="card-content"> |
|
<br> |
|
<div class="col s12"> |
|
<table id="lista_Faq" class="table table-striped table-bordered" style="width:100%"> |
|
<thead> |
|
<tr> |
|
<th>#</th> |
|
<th>Categoria</th> |
|
<th>Domanda</th> |
|
<th>Risposta</th> |
|
<th>Data</th> |
|
<th>Pubblicata</th> |
|
<th>Cancella</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('newFaq', { |
|
text: 'Nuova faq', |
|
href: '#editFaq', |
|
fn: 'resetField()' |
|
}, ''); |
|
|
|
$('#lista_Faq').DataTable({ |
|
'processing': true, |
|
'serverSide': true, |
|
'serverMethod': 'post', |
|
"order": [[0, 'desc']], |
|
'ajax': { |
|
'url': WS_CALL, |
|
'data': { |
|
'module': "<?= WS_MODULE ?>", |
|
'action': "listDataTable" |
|
} |
|
}, |
|
'columns': [ |
|
{data: 'ID'}, |
|
{data: 'CATEGORIA', orderable: false}, |
|
{data: 'OGGETTO', orderable: false}, |
|
{data: 'DOMANDA', orderable: false}, |
|
{data: 'DATA', orderable: false}, |
|
{data: 'PUBBLICATA', orderable: false}, |
|
{data: 'CANCELLATO', orderable: false}, |
|
{data: 'MODIFICA', orderable: false} |
|
], |
|
initComplete: function (settings, json) { |
|
siparsFramework.DataTableEventXhr();// |
|
} |
|
}); |
|
}); |
|
|
|
function resetField() { |
|
$("#edit_ID").val(0); |
|
$("#edit_OGGETTO").val(''); |
|
$("#edit_DOMANDA").val(''); |
|
} |
|
</script> |
|
|
|
</body> |
|
</html>
|
|
|