84 lines
2.1 KiB
PHP
Executable File
84 lines
2.1 KiB
PHP
Executable File
<?php
|
|
include_once ("../core/config.php");
|
|
$UTENTE = login();
|
|
$DIRITTI = diritti('Utente');
|
|
?>
|
|
<html>
|
|
<head>
|
|
<script type="text/javascript">
|
|
<!--
|
|
function confirmation(testo) {
|
|
alert(testo)
|
|
document.location.href='main.php'
|
|
}
|
|
//-->
|
|
</script>
|
|
|
|
<?php
|
|
if (isset($_GET['id'])) {
|
|
$id = $_GET['id'];
|
|
if (isset($_GET['azione'])) {
|
|
$azione = $_GET['azione'];
|
|
$genera = 0;
|
|
switch ($azione) {
|
|
case "wf_ordrm":
|
|
$query = "DELETE FROM wf_ordini WHERE id = $id";
|
|
$testo = "Confermate la cancellazione dell'ordine?";
|
|
break;
|
|
case "wf_on":
|
|
$query = "UPDATE wf_iscritto SET attivo = 1 WHERE id = $id";
|
|
$testo = "Confermate l'abilitazione dell'utente?";
|
|
break;
|
|
case "wf_off":
|
|
$query = "UPDATE wf_iscritto SET attivo = 0 WHERE id = $id";
|
|
$testo = "Confermate la disabilitazione dell'utente?";
|
|
break;
|
|
|
|
case "wf_palestra_on":
|
|
$query = "UPDATE wf_palestra SET attivo = 1 WHERE id = $id";
|
|
$testo = "Confermate l'abilitazione della palestra?";
|
|
break;
|
|
case "wf_palestra_off":
|
|
$query = "UPDATE wf_palestra SET attivo = 0 WHERE id = $id";
|
|
$testo = "Confermate la disabilitazione della palestra?";
|
|
break;
|
|
|
|
case "wf_art_on":
|
|
$query = "UPDATE wf_materiale SET attivo = 1 WHERE id = $id";
|
|
$testo = "Confermate l'abilitazione dell'articolo?";
|
|
break;
|
|
case "wf_art_off":
|
|
$query = "UPDATE wf_materiale SET attivo = 0 WHERE id = $id";
|
|
$testo = "Confermate la disabilitazione dell'articolo?";
|
|
break;
|
|
|
|
default:
|
|
$testo = "Regola non implementata";
|
|
break;
|
|
}
|
|
|
|
if (isset($_GET['ref'])) {
|
|
$ref = pack ('H*', $_GET['ref']);
|
|
mysql_query( $query, $DB_ID );
|
|
if ($genera) genera($DB_ID);
|
|
?>
|
|
<script type="text/javascript">
|
|
document.location.href="<?php print $ref ?>"
|
|
</script>
|
|
<?php } else {
|
|
$ref = unpack ('H*', $_SERVER["HTTP_REFERER"]);
|
|
?>
|
|
<script type="text/javascript">
|
|
var r = confirm("<?php print $testo ?>");
|
|
if (r == true) {
|
|
document.location.href="<?php print $_SERVER['REQUEST_URI']?>&ref=<?php print $ref[1] ?>"
|
|
} else {
|
|
document.location.href="<?php print $_SERVER['HTTP_REFERER']?>"
|
|
}
|
|
</script>
|
|
<?php }
|
|
|
|
}
|
|
}
|
|
?>
|