= 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= "";
$currentlang=$_SESSION['lang'];
echo "";
echo " ";
echo $otable1;
echo "";
// continua la tabella su ele.voti con le sezioni
// altrimenti inizia la tabella centrale
if ($op!="voti")
echo " |
| ";
}
switch ($op){
case "ele":
ele();
echo" |
";
include("footer.php");
break;
}
?>