";
/******************************************************/
/*Funzione di visualizzazione globale */
/******************************************************/
//crea la pagina delle affluenze
function all() {
global $bgcolor1, $bgcolor2, $prefix,$aid2,$perms,$id_sede,$id_comune2,$id_cons_gen;
$aid=$_SESSION['aid'];
$dbi=$_SESSION['dbi'];
$prefix=$_SESSION['prefix'];
OpenTable();
$resmod = mysql_query("SELECT id_comune,permessi FROM ".$prefix."_ele_operatori where id_cons='0' and aid='$aid' and id_comune='0'", $dbi);
list ($id_comu,$permessi) = mysql_fetch_row($resmod);
if ($perms!=256)
{
Closetable();
return;
}
$resmod = mysql_query("SELECT * FROM ".$prefix."_ele_operatori where id_cons=0 and id_comune>0", $dbi);
echo "
";
CloseTable();
}
function oper_admin() {
global $bgcolor1, $bgcolor2, $prefix, $dbi,$id_cons_gen;
$aid=$_SESSION['aid'];
$dbi=$_SESSION['dbi'];
$prefix=$_SESSION['prefix'];
$pwd=$_SESSION['pwd'];
$perms=ChiSei(0);
if ($perms==256) {
$aid2=$_GET['aid2'];
$do=$_GET['do'];
$id_comune2=$_GET['id_comune2'];
$permessi=$_GET['permessi'];
if ($do == "add") {
if ($aid2) {
$result = mysql_query("select * from ".$prefix."_ele_operatori where aid='$aid2'", $dbi);
$result = mysql_query("insert into ".$prefix."_ele_operatori (id_cons,id_sede,id_comune,permessi,aid) values ('0','0','$id_comune2','$permessi','$aid2')", $dbi) || die("
Errore di inserimento: ".mysql_error());
Header("Location: admin.php?op=oper_admin&id_cons_gen=$id_cons_gen");
} else {
OpenTable();
echo ""._GESTIONE." "._OPERATORI." aid=$aid2; ";
echo "
"._IMM." "._OPERATORI."";
CloseTable();
}
}else if ($do == "update") {
$result = mysql_query("update ".$prefix."_ele_operatori set permessi='$permessi' where id_cons='0' and aid='$aid2' ", $dbi) || die("
Errore di inserimento: ".mysql_error());
Header("Location: admin.php?op=oper_admin&id_cons_gen=$id_cons_gen");
}
}else die("Non ci provare...");
}
//****************************
// switch
//****************************
if ($do!="")
oper_admin();
include("modules/Elezioni/funzionidata.php");
include("modules/Elezioni/ele.php");
ele();
all();
include("footer.php");
?>