= 41) { $PHP_SELF = $_SERVER['PHP_SELF']; } } $aid=$_SESSION['aid']; $dbi=$_SESSION['dbi']; $id_comune=$_SESSION['id_comune']; $prefix=$_SESSION['prefix']; $currentlang=$_SESSION['lang']; $bgcolor1=$_SESSION['bgcolor1']; $bgcolor2=$_SESSION['bgcolor2']; $bgcolor1='#e7e7e7'; $param=strtolower($_SERVER['REQUEST_METHOD']) == 'get' ? $_GET : $_POST; if (!isset($id_cons_gen)) if (isset($param['id_cons_gen'])) $id_cons_gen=$param['id_cons_gen'];else $id_cons_gen='0'; $perms=ChiSei($id_cons_gen); ##modifica if ($perms>128){ if (isset($param['id_comune']) && intval($param['id_comune'])>0) { $id_comune=intval($param['id_comune']); $_SESSION['id_comune']=$id_comune; } } if ($id_cons_gen) { if ($id_comune and $perms<256) $sql = "SELECT t1.tipo_cons,t1.descrizione,t2.id_cons_gen FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen='$id_cons_gen'"; else $sql = "SELECT t1.tipo_cons,t1.descrizione,t1.id_cons_gen FROM ".$prefix."_ele_consultazione as t1 where t1.id_cons_gen='$id_cons_gen'"; }else{ if($perms>128) $sql = "SELECT tipo_cons,descrizione,id_cons_gen FROM ".$prefix."_ele_consultazione order by data_fine desc limit 0,1 "; else $sql = "SELECT t1.tipo_cons,t1.descrizione,t2.id_cons_gen FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2, ".$prefix."_ele_operatori as t3 where t3.id_comune=$id_comune and t3.id_comune=t2.id_comune and t1.id_cons_gen=t2.id_cons_gen and t2.chiusa='0' and (t3.id_cons=t2.id_cons or t3.id_cons=0) and t3.permessi>0 and t3.aid='$aid' order by t1.data_fine desc limit 0,1 "; } $res = mysql_query("$sql",$dbi); $espandi=0; if (mysql_num_rows($res)) list($tipo_cons,$descr_cons,$id_cons_gen) = mysql_fetch_row($res); $res = mysql_query("SELECT t2.id_cons FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen='$id_cons_gen' and t2.id_comune='$id_comune'" , $dbi); if (mysql_num_rows($res)) list($id_cons) = mysql_fetch_row($res); else $espandi=1; if(!isset($tipo_cons))$tipo_cons=0; $res = mysql_query("SELECT genere,voto_g,voto_l,voto_c,circo FROM ".$prefix."_ele_tipo where tipo_cons='$tipo_cons' and lingua='$currentlang'" , $dbi); list($genere,$votog,$votol,$votoc,$conscirc) = mysql_fetch_row($res); if (!$perms) $perms=ChiSei($id_cons_gen); //include("modules/Elezioni/language/lang-$currentlang.php"); //************************************************************************** // ELE //************************************************************************** if(!isset($id_cons))$id_cons=0; $res = mysql_query("SELECT t1.limite FROM ".$prefix."_ele_conf as t1 left join ".$prefix."_ele_cons_comune as t2 on t1.id_conf=t2.id_conf where t2.id_cons='$id_cons'" , $dbi); list($limite) = mysql_fetch_row($res); function ele() { global $espandi, $aid, $bgcolor1, $bgcolor2,$bgcolor5, $prefix, $dbi, $offset, $min,$descr_cons,$fascia, $id_cons_gen,$tipo_cons,$genere,$op,$id_comune,$perms,$id_cons,$votog,$votol,$votoc,$votocirc,$tema; include ("header.php"); //immagine bullet $bullet="\""; $bgcolor1='#e7e7e7'; $sqlcomu="select descrizione,fascia from ".$prefix."_ele_comuni where id_comune='$id_comune'"; $res = mysql_query($sqlcomu); list($descr_comu,$fascia)=mysql_fetch_row($res); $otable= "\n
   "; $otable1= "\n
"; $ctable= "
"; $currentlang=$_SESSION['lang']; echo "
"; echo $otable; echo ""; echo ""; if ($perms<128) { $res = mysql_query("select t3.id_cons, t2.descrizione,t4.genere, t2.id_cons_gen, t3.chiusa from ".$prefix."_ele_operatori as t1, ".$prefix."_ele_consultazione as t2, ".$prefix."_ele_cons_comune as t3, ".$prefix."_ele_tipo as t4 where t4.lingua='$currentlang' and t2.tipo_cons=t4.tipo_cons and t1.aid='$aid' and t3.id_cons_gen=t2.id_cons_gen and (t1.id_cons=t3.id_cons or t1.permessi=64) and t1.id_comune=t3.id_comune and t1.id_comune=$id_comune and t3.chiusa='0' order by t2.data_inizio desc", $dbi); }else{ $res = mysql_query("SELECT '', t1.descrizione,t2.genere, t1.id_cons_gen,'' FROM ".$prefix."_ele_consultazione as t1,".$prefix."_ele_tipo as t2 where t2.lingua='$currentlang' and t1.tipo_cons=t2.tipo_cons order by t1.data_inizio desc", $dbi); $sqlcomu="select id_comune,descrizione from ".$prefix."_ele_comuni order by descrizione asc"; } echo ""._SCELTA_CONS.": "; // controllo delle opzioni utilizzabili: sono quelle che hanno genitori in quella precedente // esempio si possono inserire i candidati solo se prima sono state inserite le liste $resq = mysql_query("select count(0) from ".$prefix."_ele_circoscrizione where id_cons=$id_cons", $dbi); if ($resq) list($nrcirco)=mysql_fetch_row($resq); else $nrcirco=0; $resq = mysql_query("select count(0) from ".$prefix."_ele_sede where id_cons=$id_cons", $dbi); if ($resq) list($nrsede)=mysql_fetch_row($resq); else $nrsede=0; $resq = mysql_query("select count(0) from ".$prefix."_ele_gruppo where id_cons=$id_cons", $dbi); if ($resq) list($nrgruppo)=mysql_fetch_row($resq); else $nrgruppo=0; $resq = mysql_query("select count(0) from ".$prefix."_ele_lista where id_cons=$id_cons", $dbi); if ($resq) list($nrlista)=mysql_fetch_row($resq); else $nrlista=0; $resq = mysql_query("SELECT sum(voti_complessivi) from ".$prefix."_ele_voti_parziale where id_cons=$id_cons", $dbi); if ($resq) list($nraff)=mysql_fetch_row($resq); else $nraff=0; if ($genere==0) $tmpval='voti_ref'; else $tmpval='sezioni'; $resq = mysql_query("SELECT sum(validi) from ".$prefix."_ele_$tmpval where id_cons=$id_cons", $dbi); if ($resq) list($nrvoti)=mysql_fetch_row($resq); else $nrvoti=0; unset($resq); if ($perms==256) // il superuser puo' scegliere il comune su cui lavorare { $rescomu= mysql_query("$sqlcomu",$dbi); echo ""; echo $ctable; echo "
"; echo "
"; echo $otable1; echo "
"; echo ""; if ($perms>128) { # $bullet"._COLLEGI."
echo " "; # $bullet"._BACKUP."
# $bullet"._RESTORE." } // Amministrazione locale solo superuser e adminuser if ($perms>16 and ! $espandi) { echo " "; } //Amministrazione normale operatore echo "
$bullet"._HELP."
"._SUPER." $bullet"._CONFIGURAZIONE."
"; if($op=="configurazione" || $op=="widget" || $op=="plugin"){ echo "      - "._WIDGET.""; echo "
      - "._PLUGINS.""; echo "
"; } echo " $bullet"._TIPO_ADM."
$bullet"._CONFCONS."
$bullet"._DEFCOMUNE."
$bullet"._AMMINISTRATORI."
$bullet"._CONSULTAZIONE_ADM."
$bullet"._AFFLUENZE."
$bullet"._INSCOMUNE."
"._ADMIN." "; if ($perms>32) { echo "$bullet"._CONSULTAZIONI."
$bullet"._SCARICA."
"; # if($nrgruppo==0 and $nrlista==0) echo "$bullet"._IMPORTA."
"; echo "$bullet"._OPERATORI."
$bullet"._PERMESSI."
"; } echo "$bullet "._COME."
$bullet "._NUMERI."
$bullet "._SERVIZI."
$bullet "._LINK."
$bullet"._CIRCO."
"; if ($nrcirco){ echo "$bullet "._SEDE."
"; if ($nrsede){ echo "$bullet "._SEZIONE."
"; } } if ($genere!=4) { //gestisce gruppi if ($tipo_cons!=8){ $genere!=2 and echo "$bullet "._GRUPPO."
"; } if ($genere>2 or $genere==1){ ####prova if ($genere==4 or $nrgruppo){ // or $tipo_cons==10 or $tipo_cons==11){ echo " $bullet "._LISTA."
"; if ($genere>2){ ####prova if ($nrlista){ echo "$bullet"._CANDIDATO."
"; }else{ echo "$bullet "._CANDIDATO." "; } } }else{ echo " $bullet"._LISTA."
"; echo "$bullet "._CANDIDATO."
"; } } echo "
"._OPER." "; if ($op!='consultazione' and $perms>0 and $nrcirco and ($nrlista or $nrgruppo)) { echo "$bullet "._GEST." "._SPOGLIO."
"; if ($nraff) { echo "$bullet "._STATO." "._AFFLUENZE."
"; }else{ echo " "._STATO." "._AFFLUENZE."
"; } if ($nrvoti) { echo "$bullet "._STATO." "._VOTI."
"; }else{ echo " "._STATO." "._VOTI."
"; } } echo "
$bullet"._CAMBIOPWD."
"; echo "$bullet "._ESCI.""; echo "
"; // continua la tabella su ele.voti con le sezioni // altrimenti inizia la tabella centrale if ($op!="voti") echo "
"; } switch ($op){ case "ele": ele(); global $language; include("language/$language/ele.html"); echo"
"; include("footer.php"); break; } ?>