Pannello gestione utenti/moduli
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
include_once ("../core/config.php");
|
||||
$UTENTE = login();
|
||||
//isadmin();
|
||||
$DIRITTI = diritti();
|
||||
?>
|
||||
<?php include_once ("../core/top.php"); ?>
|
||||
|
||||
@@ -16,6 +16,7 @@ if (isset($_GET['id'])) {
|
||||
} else if (isset ($_POST['id'])) {
|
||||
$modifica = 2;
|
||||
$id = $_POST['id'];
|
||||
$rm = $_POST['rm'];
|
||||
$utente = $_POST['utente'];
|
||||
$password1 = $_POST['password1'];
|
||||
$password2 = $_POST['password2'];
|
||||
@@ -33,7 +34,11 @@ if (isset($_GET['id'])) {
|
||||
$querypwd = "";
|
||||
}
|
||||
|
||||
if ($id > 0) {
|
||||
if ( $rm == 1) {
|
||||
$testo = "L'utente e' stato correttamente rimosso";
|
||||
$query = "DELETE FROM permessi WHERE id_utenti = $id";
|
||||
$query2 = "DELETE FROM utenti WHERE id = $id";
|
||||
} elseif ($id > 0) {
|
||||
$testo = "L'utente e' stato correttamente modificato";
|
||||
$query = "UPDATE utenti SET $querypwd admin = $admin, attivo=$attivo, modifica = NOW(), mail='$mail' WHERE `id`=$id";
|
||||
} else {
|
||||
@@ -47,7 +52,7 @@ if (isset($_GET['id'])) {
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php if (mysql_query( $query, $DB_ID )) { ?>
|
||||
<?php if (mysql_query( $query, $DB_ID ) && ((!is_null ($query2) && mysql_query( $query2, $DB_ID )) || (is_null ($query2)))) { ?>
|
||||
<?php print $testo ?><br>
|
||||
<?php } else { ?>
|
||||
Non e' stato possibile eseguire l'operazione richiesta a causa di un errore: <?php print mysql_error() ?><br>
|
||||
@@ -59,7 +64,7 @@ Non e' stato possibile eseguire l'operazione richiesta a causa di un errore: <?p
|
||||
<td><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif" width="1" height="5" alt=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="button" value="Ok" onclick="location.href = 'utenti.php';"></button></td>
|
||||
<td><input type="button" value="Ok" onclick="location.href = '<?php print $CONF['base_url'] ?>/utenti/index.php';"></button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif" width="1" height="10" alt=""></td>
|
||||
@@ -74,13 +79,17 @@ Non e' stato possibile eseguire l'operazione richiesta a causa di un errore: <?p
|
||||
|
||||
<?php if (($modifica == 0 || $modifica == 1) && !isset($_GET['rm'])) { ?>
|
||||
|
||||
|
||||
<script type="text/javascript" src="<?php print $CONF['base_url'] ?>/jquery/jquery.js"></script>
|
||||
<script type="text/javascript" src="<?php print $CONF['base_url'] ?>/jquery/jquery.validate.js"></script>
|
||||
<script type="text/javascript" src="<?php print $CONF['base_url'] ?>/jquery/jquery.validate.password.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="<?php print $CONF['base_url'] ?>/jquery/jquery.validate.password.css" />
|
||||
|
||||
<script type="text/javascript">
|
||||
function DoSubmit(){
|
||||
document.getElementById("rm").value = '1';
|
||||
return true;
|
||||
}
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#modulo").validate( {
|
||||
@@ -136,9 +145,10 @@ $(document).ready(function()
|
||||
<form action="modutenti.php" method="post" id="modulo">
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="90%">
|
||||
<?php if ($modifica == 1) { ?>
|
||||
<input type="hidden" name="id" value="<?php print $dato['id'] ?>">
|
||||
<input type="hidden" name="id" id="id" value="<?php print $dato['id'] ?>">
|
||||
<input type="hidden" name="rm" id="rm" value="0">
|
||||
<?php } else { ?>
|
||||
<input type="hidden" name="id" value="-1">
|
||||
<input type="hidden" name="id" d="id" value="-1">
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif" width="30" height="1" alt=""></td>
|
||||
@@ -158,7 +168,11 @@ $(document).ready(function()
|
||||
<td><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif" width="80" height="1" alt=""></td>
|
||||
<td>Attivo <input name="attivo" type="checkbox" value=1 <?php if ($dato['attivo']) { print "checked=\"checked\""; } ?>></td>
|
||||
<td><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif" width="20" height="1" alt=""></td>
|
||||
<?php if ($UTENTE['admin']) { ?>
|
||||
<td>Admin <input name="admin" type="checkbox" value=1 <?php if ($dato['admin']) { print "checked=\"checked\""; } ?>></td>
|
||||
<?php } else { ?>
|
||||
<td> </td>
|
||||
<?php } ?>
|
||||
<td colspan="4"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif" width="250" height="1" alt=""></td>
|
||||
</tr>
|
||||
<tr><td colspan="9"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif" width="1" height="5" alt=""></td></tr>
|
||||
@@ -195,7 +209,11 @@ $(document).ready(function()
|
||||
<tr><td align="center" colspan="9">
|
||||
<input type="submit" value="<?php print $bottone ?>">
|
||||
|
||||
<input type="button" value="Annulla" onclick="location.href = 'utenti.php';"></button>
|
||||
<input type="button" value="Annulla" onclick="location.href = '<?php print $CONF['base_url'] ?>/utenti/index.php';"></button>
|
||||
<?php if ($modifica == 1) { ?>
|
||||
|
||||
<input type="submit" value="Rimuovi" onclick="DoSubmit()">
|
||||
<?php } ?>
|
||||
</td></tr>
|
||||
|
||||
<tr><td colspan="9"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif" width="1" height="10" alt=""></td></tr>
|
||||
@@ -203,4 +221,4 @@ $(document).ready(function()
|
||||
</form>
|
||||
<?php } ?>
|
||||
|
||||
<?php include_once ("footer.php"); ?>
|
||||
<?php include_once ("../core/footer.php"); ?>
|
||||
|
||||
Reference in New Issue
Block a user