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.
108 righe
4.0 KiB
108 righe
4.0 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
if (isset($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice)) { |
|
include_once($root."/backend/layout/top.php"); |
|
?> |
|
<div class="container-fluid pt-5 pb-3"> |
|
<div class="row"> |
|
<div class="col-12"> |
|
<h2> |
|
<?= Modulo::header($radice) ?> |
|
</h2> |
|
</div> |
|
</div> |
|
</div> |
|
<? if (!$_SESSION["utente"]->readOnly) { ?> |
|
<div id="commands" class="mb-5"> |
|
<div class="commands container-fluid"> |
|
<div class="row"> |
|
<div class="col-12 text-right"> |
|
<a href="/backend/pagine/edit.php?codice=0" class="btn btn-success" title="<?= __('Aggiungi nuovo') ?>"><i class="fa fa-plus-circle mr-2"></i><?= __('Aggiungi nuovo') ?></a> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
<? } |
|
$bind = array(); |
|
$bind[":codice_ente"]=$_SESSION["ente"]->codice; |
|
$strsql = "SELECT b_pagina.* FROM b_pagina WHERE soft_delete = 'N' AND codice_ente = :codice_ente ORDER BY b_pagina.ordinamento ASC " ; |
|
$risultato = $pdo->go($strsql,$bind); //invia la query contenuta in $strsql al database apero e connesso |
|
if ($risultato->rowCount()>0) { |
|
?> |
|
<div class="card"> |
|
<div class="card-body"> |
|
<table class="table table-striped table-hover tab-data" width="100%"> |
|
<thead> |
|
<tr> |
|
<th width="10"></th> |
|
<th width="10"></th> |
|
<th><?= __("Titolo") ?></th> |
|
<th width="10"><?= __("Tipo") ?></th> |
|
<th width="10"></th> |
|
<th width="10"></th> |
|
<th width="10"></th> |
|
<th width="10"></th> |
|
</tr> |
|
</thead> |
|
<tbody id="body-pagine"> |
|
<? |
|
while ($record = $risultato->fetch(PDO::FETCH_ASSOC)) { |
|
$stato = "bg-disabled"; |
|
$stato_label = __('disattivo'); |
|
if ($record["attivo"]=="S") { |
|
$stato = "bg-active"; |
|
$stato_label = __('attivo'); |
|
} |
|
|
|
$href = "id".$record["codice"]."-".$record["titolo"]; |
|
$href = "/pagine/".sanitize_string($href); |
|
if ($record["tipologia"]=="Link") { $href = $record["link"]; } |
|
|
|
?> |
|
<tr id="record_<?= $record["codice"] ?>"> |
|
<td> |
|
<input class="ordinamento" type="hidden" name="ordinamento[<?= $record["codice"] ?>]" value="<?= $record["ordinamento"] ?>"> |
|
<div id="flag_<?= $record["codice"] ?>" class="float-left status_flag <?= $stato ?>"><span class="sr-only">Stato <?= $stato_label ?></span></div> |
|
</td> |
|
<td class="handle"><span class="fa fa-bars"></span></td> |
|
<td><?= $record["titolo"] ?></td> |
|
<td><?= $record["tipologia"] ?></td> |
|
<td><a href="<?= $href ?>" class="btn-sm btn-default" title="<?= __('visualizza') ?>"><span class="fa fa-search"></span></a></td> |
|
<td><a class="btn btn-sm btn-info" href="/backend/pagine/edit.php?codice=<?= $record["codice"] ?>"><span class="fa fa-pencil-alt"></span></a></td> |
|
<td><button onClick="disabilita(<?= $record["codice"] ?>,'pagine'); return false" class="btn btn-sm btn-warning"><span class="fa fa-sync"></span></button></td> |
|
<td><button onClick="elimina(<?= $record["codice"] ?>,'pagine'); return false" class="btn btn-sm btn-danger"><span class="fa fa-times"></span></button></td> |
|
</tr> |
|
<? |
|
} |
|
?> |
|
</tbody> |
|
</table> |
|
</div> |
|
</div> |
|
<script> |
|
$( "#body-pagine" ).sortable({ |
|
handle: ".handle", |
|
update: function( event, ui ) { |
|
$("tr","#body-pagine").each(function(index, el) { |
|
$(this).find(".ordinamento").val(index); |
|
}); |
|
$.ajax({ |
|
type: "POST", |
|
url: 'save-order.php', |
|
data: $('.ordinamento').serialize(), |
|
async: true |
|
}); |
|
} |
|
}); |
|
</script> |
|
<? |
|
} else { |
|
alertManager::printWarningBox(__("Nessun risultato")); |
|
} |
|
include_once($root."/backend/layout/bottom.php"); |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
?>
|
|
|