";
}
OpenTable();
$resmod = mysql_query("SELECT * FROM ".$prefix."_ele_operatori where id_cons=$id_cons and permessi<64 order by aid", $dbi);
echo "
";
echo "
"._UTENTE."
"
."
"._SEDE."
"
."
"._PERMESSI."
";
echo "
"._FUNZIONI."
";
$restmp = mysql_query("SELECT aid FROM ".$prefix."_ele_operatori where id_cons=$id_cons and permessi<64 order by aid", $dbi);
if($restmp) {
$listmp='';$virg='';
while (list($artmp) = mysql_fetch_row($restmp)){ //elenco degli operatori gia' autorizzati
$listmp .= $virg."'".$artmp."'";
$virg=',';
}
}
if (!$listmp) $listmp="''";
$resins = mysql_query("select aid from ".$prefix."_authors where id_comune=$id_comune and (admincomune=1 and aid not in ($listmp)) order by aid",$dbi); // operatori registrati ma non ancora autorizzati
echo "
";
CloseTable();
}
function permessi($ok, $do,$aid2,$id_sede,$permessi,$id_comune) {
global $prefix, $dbi, $id_cons,$id_cons_gen,$currentlang;
$perms=ChiSei($id_cons_gen);
if ($perms!=256) $id_comune=$_SESSION['id_comune'];
if ($perms>32 and $permessi<$perms and $aid2) {
if ($do == "autorizza") {
$result = mysql_query("insert into ".$prefix."_ele_operatori (id_cons,id_sede,id_comune,permessi,aid) values ('$id_cons','$id_sede','$id_comune','$permessi','$aid2')", $dbi)||die("Errore 1301: Non e' stato possibile inserire l'utente!".mysql_error());
Header("Location: admin.php?op=permessi&id_cons_gen=$id_cons_gen");
} elseif ($do == "update") {
$result = mysql_query("update ".$prefix."_ele_operatori set id_sede='$id_sede' , permessi='$permessi' where id_cons='$id_cons' and aid='$aid2' ", $dbi);
if (!$result) return;
Header("Location: admin.php?op=permessi&id_cons_gen=$id_cons_gen");
}
}
}
//****************************
// switch
//****************************
if ($do) permessi($ok, $do,$aid2,$id_sede,$permessi,$id_comune);
ele();
all();
include("footer.php");
?>