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.
37 righe
1.5 KiB
37 righe
1.5 KiB
<? |
|
$error = true; |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice,$_POST["codice"]) && isset($_SESSION["ente"])) { |
|
$bind = array(":codice"=>$_POST["codice"]); |
|
$sql = "SELECT * FROM b_impostazioni_dati_minimi WHERE codice = :codice "; |
|
$ris = $pdo->go($sql,$bind); |
|
if ($ris->rowCount() === 1) { |
|
$record = $ris->fetch(PDO::FETCH_ASSOC); |
|
$attivo = "S"; |
|
if ($record["attivo"] == "S") { $attivo = "N"; } |
|
$bind = array(":codice"=>$_POST["codice"],":attivo"=>$attivo); |
|
$bind[":utente"] = $_SESSION["utente"]->codice; |
|
$sql = "UPDATE b_impostazioni_dati_minimi SET attivo = :attivo, utente_modifica = :utente WHERE codice = :codice "; |
|
$ris = $pdo->go($sql,$bind); |
|
if ($ris->rowCount() === 1) { |
|
$error = false; |
|
scriviLog("b_impostazioni_dati_minimi","UPDATE",$pdo->getSQL(),$_POST["codice"]); |
|
if ($attivo == "S") { |
|
?> |
|
$("#flag_<?= $record["codice"] ?>").removeClass('bg-danger').addClass('bg-success').html('<span class="sr-only"><?= __('attivo') ?></span>'); |
|
<? |
|
} else { |
|
?> |
|
$("#flag_<?= $record["codice"] ?>").removeClass('bg-success').addClass('bg-danger').html('<span class="sr-only"><?= __('disattivo') ?></span>'); |
|
<? |
|
} |
|
} |
|
} |
|
} |
|
|
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|
|
|