Index: trunk/client/temi/Futura2/function_theme.php
===================================================================
--- trunk/client/temi/Futura2/function_theme.php	(revision 424)
+++ trunk/client/temi/Futura2/function_theme.php	(revision 426)
@@ -191,5 +191,5 @@
 	$res->execute();
 	if ($circo){
-		$sql="select t1.*  from ".$prefix."_ele_voti_gruppo as t1, ".$prefix."_ele_gruppo as t2 where t1.id_gruppo=t2.id_gruppo and t1.id_cons='$id_cons' and t2.id_circ=$id_circ group by t1.id_sez ";
+		$sql="select t1.id_sez  from ".$prefix."_ele_voti_gruppo as t1, ".$prefix."_ele_gruppo as t2 where t1.id_gruppo=t2.id_gruppo and t1.id_cons='$id_cons' and t2.id_circ=$id_circ group by t1.id_sez ";
 		$res = $dbi->prepare("$sql");
 		$res->execute();
@@ -216,10 +216,14 @@
 		if ($genere!=0){
 		// tot voti
-			if (!$circo) 
+			if (!$circo) {
 				$sql="select sum(voti)  from ".$prefix."_$tab where id_cons=$id_cons ";
-			if ($votog) 
+				$restotv = $dbi->prepare("$sql");
+				$restotv->execute();
+			}	
+			if ($votog) { 
 				$sql="select sum(voti)  from ".$prefix."_ele_voti_lista where id_cons=$id_cons ";	
-			$restotv = $dbi->prepare("$sql");
-			$restotv->execute();
+				$restotv = $dbi->prepare("$sql");
+				$restotv->execute();
+			}	
 			list($tot)  = $restotv->fetch(PDO::FETCH_NUM);
 			
@@ -237,5 +241,5 @@
 				and t2.id_lista=t3.id_lista
 				and t1.id_gruppo=t3.id_gruppo
-				group by t1.id_gruppo
+				group by t1.id_gruppo, t1.num_gruppo, t1.descrizione
 				order by somma desc";
 				$cosa='id_gruppo';
@@ -466,17 +470,23 @@
 function graf_liste_mob(){
 
-global $id_cons,$id_cons_gen,$prefix,$dbi,$min,$offset,$op,$tipo_cons,$prev,$next,$votog,$votol,$circo,$genere,$id_comune,$colortheme;
+global $id_cons,$id_cons_gen,$prefix,$dbi,$min,$offset,$op,$tipo_cons,$prev,$next,$votog,$votol,$circo,$genere,$id_comune,$colortheme,$id_circ;
 
 $offset=10000;
 if (!isset($min)) $min=0;
 
-// numero sezioni scrutinate sul gruppo
-	if ($circo) $circos = "and id_circ=$id_circ" ; else $circos='';
-	if ($genere==0) $tab="ref"; else $tab="gruppo";
+// numero sezioni scrutinate 
+	if ($genere==0) $tab="ref"; else $tab="lista";
+	if ($circo and $id_circ) 
+	{
+		$circos = "and id_$tab in (select id_$tab from soraldo_ele_$tab where id_circ=$id_circ)" ;
+		$circos2 = "and id_sede in (select id_sede from soraldo_ele_sede where id_circ=$id_circ)";
+		$circos3 = "and id_circ=$id_circ";
+	}
+	else {$circos=''; $circos2='';$circos3 = '';}
 	$sql="select id_sez from ".$prefix."_ele_voti_".$tab." where id_cons='$id_cons'  $circos group by id_sez ";
 	$res = $dbi->prepare("$sql");
 	$res->execute();
 	$numero=$res->rowCount();
-	$sql="select *  from ".$prefix."_ele_sezioni where id_cons='$id_cons' $circos ";
+	$sql="select *  from ".$prefix."_ele_sezioni where id_cons='$id_cons' $circos2 ";
 	$res = $dbi->prepare("$sql");
 	$res->execute();
@@ -496,5 +506,5 @@
 	
 	// tot liste
-		$sql="SELECT *  FROM ".$prefix."_ele_lista where id_cons='$id_cons'  ";
+		$sql="SELECT *  FROM ".$prefix."_ele_lista where id_cons='$id_cons' $circos3 ";
  				$res = $dbi->prepare("$sql");
 				$res->execute();
@@ -502,10 +512,10 @@
 		
 		// tot voti liste
-		$sql="select sum(voti)  from ".$prefix."_ele_voti_lista where id_cons='$id_cons'";
+		$sql="select sum(voti)  from ".$prefix."_ele_voti_lista where id_cons='$id_cons' $circos";
 				$res_lista_tutti = $dbi->prepare("$sql");
 				$res_lista_tutti->execute();
 		list($voti_lista_tutti) = $res_lista_tutti->fetch(PDO::FETCH_NUM);
 		
-    		$sql="select id_cons ,id_lista ,id_gruppo, num_lista, descrizione  from ".$prefix."_ele_lista where id_cons='$id_cons'  ORDER BY num_lista  LIMIT $min,$offset";
+    		$sql="select id_cons ,id_lista ,id_gruppo, num_lista, descrizione  from ".$prefix."_ele_lista where id_cons='$id_cons' $circos3 ORDER BY num_lista  LIMIT $min,$offset";
  				$result = $dbi->prepare("$sql");
 				$result->execute();
@@ -562,15 +572,24 @@
 
 function graf_candidato_mob(){
-global $dbi,$bgcolor1, $bgcolor5,$bgcolor5, $prefix, $offset, $min,$descr_cons, $id_cons,$tipo_cons,$copy,$id_comune,$id_istat,$genere,$votog,$votol,$votoc,$circo,$siteistat;
+global $dbi,$bgcolor1, $bgcolor5,$bgcolor5, $prefix, $offset, $min,$descr_cons, $id_cons,$tipo_cons,$copy,$id_comune,$id_istat,$genere,$votog,$votol,$votoc,$circo,$siteistat,$id_circ;  
 if ($siteistat==$id_comune) $logo='1'; else $logo=''; // logo per il  comune
 $bgcolor1="";	
+		if($circo)
+			$circos="and id_cand in (select id_cand from ".$prefix."_ele_candidati where id_lista in (select id_lista from ".$prefix."_ele_lista where id_circ=$id_circ))";
+		else 
+			$circos='';
 
 		$tab="ele_voti_candidati";
 
-		$sql="select id_sez  from ".$prefix."_ele_voti_candidati where id_cons='$id_cons' group by id_sez ";
-		$res = $dbi->prepare("$sql");
+		$sql="select id_sez  from ".$prefix."_ele_voti_candidati where id_cons='$id_cons' $circos group by id_sez ";
+	$res = $dbi->prepare("$sql");
 		$res->execute();
 		$numero=$res->rowCount();
-		$sql="select *  from ".$prefix."_ele_sezioni where id_cons='$id_cons'";
+		if($circo)
+			$circos="and id_sede in (select id_sede from ".$prefix."_ele_sede where id_circ=$id_circ)";
+		else 
+			$circos='';
+
+		$sql="select *  from ".$prefix."_ele_sezioni where id_cons='$id_cons' $circos";
 		$res = $dbi->prepare("$sql");
 		$res->execute();
@@ -587,6 +606,10 @@
 		
 			// tot voti
+			if($circo)
+				$circos="and id_cand in (select id_cand from ".$prefix."_ele_candidati where id_lista in (select id_lista from ".$prefix."_ele_lista where id_circ=$id_circ))";
+			else 
+				$circos='';
 			$sql="
-			select sum(voti)  from ".$prefix."_ele_voti_candidati where id_cons=$id_cons ";
+			select sum(voti)  from ".$prefix."_ele_voti_candidati where id_cons=$id_cons $circos"; 
 			$res = $dbi->prepare("$sql");
 			$res->execute();
@@ -601,47 +624,51 @@
 			}
 			$i=0;
-			$sql="select t1.id_lista,  t1.id_cand, t1.nome , t1.cognome, sum(t2.voti) as somma
-				from ".$prefix."_ele_candidati as t1
-        		left join ".$prefix."_ele_voti_candidati as t2 on (t1.id_cand=t2.id_cand)
-				left join ".$prefix.$scelta."
-				where t1.id_cons='$id_cons'
-				group by t1.id_lista, t1.id_cand, t1.nome, t1.cognome
-				order by somma desc";
-			$res = $dbi->prepare("$sql");
-			$res->execute();
-			$n_candi=$res->rowCount();
-			
-			while (list($id_lista,$id_cand,$nome,$cognome,$voti)  = $res->fetch(PDO::FETCH_NUM)){
-             			$candidato[$i]=$cognome;
-				$pro[$i]=number_format($voti*100/$tot,2);
-				// sviluppo tabella dati
-				$e=$i+1;
-				echo "<li><table style=\"text-align:left;border : 1px solid Black;width:100%;\">"; // inizio tabella dati
-				echo "<tr><td>".$e."Â°</td><td><b><img alt=\"$nome $cognome\" src=\"modules.php?name=Elezioni&amp;file=foto&amp;id_lista=$id_lista\" align=\"middle\" width=\"30\"></b></td>
-                		<td width=\"70%\" bgcolor=\"$bgcolor1\"><b>$nome $cognome</b><br/>
-				"._VOTI.": <b>$voti </b>
-				( <span style=\"color:#ff0000;\">$pro[$i]%</span> )</td></tr>";
-				echo "</table></li>"; // fine tabella dati
-				/* tolto il conteggio
-				if ($e=='5000' || $e==$n_candi){ 
-					
-					
-					
-					
-					
-					//include("footer.php");
-					exit;
-				}
-	
-				*/
-
-				$i++;
-			
-			       
-			
-			
+		if($circo)
+			$circos="and id_circ=$id_circ";
+		else 
+			$circos='';
+		$sql="select t1.id_lista,  t1.id_cand, t1.nome , t1.cognome, sum(t2.voti) as somma
+			from ".$prefix."_ele_candidati as t1
+			left join ".$prefix."_ele_voti_candidati as t2 on (t1.id_cand=t2.id_cand)
+			left join ".$prefix.$scelta."
+			where t1.id_cons='$id_cons' $circos
+			group by t1.id_lista, t1.id_cand, t1.nome, t1.cognome
+			order by somma desc";
+		$res = $dbi->prepare("$sql");
+		$res->execute();
+		$n_candi=$res->rowCount();
+		
+		while (list($id_lista,$id_cand,$nome,$cognome,$voti)  = $res->fetch(PDO::FETCH_NUM)){
+					$candidato[$i]=$cognome;
+			$pro[$i]=number_format($voti*100/$tot,2);
+			// sviluppo tabella dati
+			$e=$i+1;
+			echo "<li><table style=\"text-align:left;border : 1px solid Black;width:100%;\">"; // inizio tabella dati
+			echo "<tr><td>".$e."Â°</td><td><b><img alt=\"$nome $cognome\" src=\"modules.php?name=Elezioni&amp;file=foto&amp;id_lista=$id_lista\" align=\"middle\" width=\"30\"></b></td>
+					<td width=\"70%\" bgcolor=\"$bgcolor1\"><b>$nome $cognome</b><br/>
+			"._VOTI.": <b>$voti </b>
+			( <span style=\"color:#ff0000;\">$pro[$i]%</span> )</td></tr>";
+			echo "</table></li>"; // fine tabella dati
+			/* tolto il conteggio
+			if ($e=='5000' || $e==$n_candi){ 
+				
+				
+				
+				
+				
+				//include("footer.php");
+				exit;
 			}
-          
-        }
+
+			*/
+
+			$i++;
+		
+			   
+		
+		
+		}
+	  
+	}
 
 }
@@ -1096,11 +1123,10 @@
 	if (isset($circo) and $circo) $circos="and t2.id_circ='$id_circ'";
 	else $circos=''; 
-	$circos='';
 	// numero sezioni scrutinate
-	$sql="select t1.*  from ".$prefix."_ele_sezioni as t1 left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t1.id_cons='$id_cons'";
+	$sql="select t1.*  from ".$prefix."_ele_sezioni as t1 left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t1.id_cons='$id_cons' $circos";
 	$res2 = $dbi->prepare("$sql");
 	$res2->execute();
 	$sezioni=$res2->rowCount();
-    $sql="select orario,data  from ".$prefix."_ele_voti_parziale where id_cons='$id_cons' order  by data desc,orario desc limit 1";
+    $sql="select orario,data  from ".$prefix."_ele_voti_parziale where id_cons='$id_cons' order  by data desc,orario desc limit 0,1";
 	$res = $dbi->prepare("$sql");
 	$res->execute();
@@ -1110,5 +1136,5 @@
 			list ($anno,$mese,$giorno)=explode('-',$data);
 			$tot_v_m=0;$tot_v_d=0;$tot_t=0;
-			$sql="select t3.id_sez from ".$prefix."_ele_voti_parziale as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t3.id_cons='$id_cons' and t3.data='$data' and t3.orario='$orario' group by t3.id_sez ";
+			$sql="select t3.id_sez from ".$prefix."_ele_voti_parziale as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t3.id_cons='$id_cons' and t3.data='$data' and t3.orario='$orario' $circos group by t3.id_sez ";
 			$res1 = $dbi->prepare("$sql");
 			$res1->execute();
@@ -1120,5 +1146,5 @@
 			$res1->execute();
 			while(list($voti_t, $num_gruppo,$id_gruppo) = $res1->fetch(PDO::FETCH_NUM)) {
-				$query="select sum(t3.voti_complessivi)  from ".$prefix."_ele_voti_parziale as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t3.id_cons='$id_cons' and t3.data='$data' and t3.orario='$orario' $circos";		
+				$query="select sum(t3.voti_complessivi)  from ".$prefix."_ele_voti_parziale as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t3.id_cons='$id_cons' and t3.data='$data' and t3.orario='$orario' $circos";
 				if ($genere==0){$query.=" and t3.id_gruppo=$id_gruppo";}						
 				$res_aff = $dbi->prepare("$query");
@@ -1126,5 +1152,5 @@
 				$voti_numero=$res_aff->rowCount();					
 	#			$query="select sum(t1.maschi+t1.femmine)  from ".$prefix."_ele_voti_parziale as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t3.id_cons='$id_cons' and t3.data='$data' and t3.orario='$orario' ";	
-				$query="SELECT sum(maschi+femmine) FROM ".$prefix."_ele_sezioni as t1, ".$prefix."_ele_sede as t2 where t1.id_cons='$id_cons' and t1.id_sede=t2.id_sede ";				
+				$query="SELECT sum(maschi+femmine) FROM ".$prefix."_ele_sezioni as t1, ".$prefix."_ele_sede as t2 where t1.id_cons='$id_cons' and t1.id_sede=t2.id_sede $circos";
 				//if ($genere==0){$query.=" and t3.id_gruppo=$id_gruppo";}
 				$tot='';
@@ -1185,5 +1211,5 @@
 	if (isset($circo) and $circo) $circos="and t2.id_circ='$id_circ'";
 	else $circos=''; 
-	$circos='';
+#	$circos='';
 	//if ($genere==0) $tab="ref";elseif($genere=='4' || $votog) $tab="lista";
 	if($genere=='4' || $votog) $tab="lista";
Index: trunk/client/temi/Futura2/index.php
===================================================================
--- trunk/client/temi/Futura2/index.php	(revision 424)
+++ trunk/client/temi/Futura2/index.php	(revision 426)
@@ -30,5 +30,5 @@
 ####################################
 
-global $op,$tema,$dbi,$nometema,$file,$bgcolor,$sitename,$prefix,$blocco,$lang,$siteistat,$id_cons_gen,$descr_cons,$minsez,$offsetsez,$multicomune,$id_comune,$multicomune,$rss,$colortheme,$descr_com;
+global $op,$tema,$dbi,$nometema,$file,$bgcolor,$sitename,$prefix,$blocco,$lang,$siteistat,$id_cons_gen,$descr_cons,$minsez,$offsetsez,$multicomune,$id_comune,$multicomune,$rss,$colortheme,$descr_com,$circo,$id_circ;
 
 include("temi/$tema/function_theme.php");
@@ -80,9 +80,9 @@
 echo ' <div data-role="navbar">
 	<ul>
-	<li><a href="modules.php?id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'?" data-icon="home"   data-theme="'.$colortheme.'" '.$active_home.' >Home</a></li>
-	<li><a href="modules.php?op=informazioni&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-icon="file"  data-theme="'.$colortheme.'" '.$active_info.' >Info</a></li>
-	<li><a href="modules.php?op=risultati&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-icon="list"  data-theme="'.$colortheme.'" '.$active_ris.' >Risultati</a></li>
-	<li><a href="modules.php?op=grafica_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'"" data-icon="th-large"  data-theme="'.$colortheme.'" '.$active_graf.'>Grafica</a></li>
-	<li><a href="modules.php?op=conf_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-icon="cogs"  data-theme="'.$colortheme.'" '.$active_conf.' >Opzioni</a></li>
+	<li><a href="modules.php?id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'?" data-icon="home"   data-theme="'.$colortheme.'" '.$active_home.' >Home</a></li>
+	<li><a href="modules.php?op=informazioni&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'" data-icon="file"  data-theme="'.$colortheme.'" '.$active_info.' >Info</a></li>
+	<li><a href="modules.php?op=risultati&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'" data-icon="list"  data-theme="'.$colortheme.'" '.$active_ris.' >Risultati</a></li>
+	<li><a href="modules.php?op=grafica_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'"" data-icon="th-large"  data-theme="'.$colortheme.'" '.$active_graf.'>Grafica</a></li>
+	<li><a href="modules.php?op=conf_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'" data-icon="cogs"  data-theme="'.$colortheme.'" '.$active_conf.' >Opzioni</a></li>
 	</ul>
    </div>
@@ -109,5 +109,5 @@
       		<input type=\"hidden\" name=\"prima\" value=\"1\" />
 		<select name=\"id_cons_gen\" id=\"select-choice-a\" 
-		onchange=\"javascript:top.location.href='modules.php?op=gruppo&amp;name=Elezioni&amp;id_comune=$id_comune&amp;file=index&amp;id_cons_gen='+this.options[this.options.selectedIndex].value\">";
+		onchange=\"javascript:top.location.href='modules.php?op=gruppo&amp;name=Elezioni&amp;id_comune=$id_comune&amp;id:circ=$id_circ&amp;file=index&amp;id_cons_gen='+this.options[this.options.selectedIndex].value\">";
 	
 	    while(list($id,$descrizione) = $res->fetch(PDO::FETCH_NUM)) {
@@ -117,5 +117,24 @@
 	    }
  
-	    echo '</select></label></form>
+	    echo '</select></label>';
+#####
+		if($circo)
+		{ 
+			$sql="SELECT t1.id_circ,t1.descrizione FROM ".$prefix."_ele_circoscrizione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons=t2.id_cons and t2.id_cons_gen=$id_cons_gen and t2.id_comune='$id_comune' order by t1.num_circ"; 
+			$rescirc = $dbi->prepare("$sql");
+			$rescirc->execute();
+			$esistecirc=$rescirc->rowCount();
+			echo "<label forcirc=\"circoscrizione\">		
+			<select name=\"id_circ\" id=\"select-choice-b\" 
+			onchange=\"javascript:top.location.href='modules.php?op=gruppo&amp;name=Elezioni&amp;id_comune=$id_comune&amp;file=index&amp;id_cons_gen=$id_cons_gen&amp;id_circ='+this.options[this.options.selectedIndex].value\">";		
+			while(list($idc,$desc_circ) = $rescirc->fetch(PDO::FETCH_NUM)) {
+	#		$descrizione=substr(str_replace("+"," ",$descrizione),0,30);
+				$sel = ($idc == $id_circ) ? "selected=\"selected\"":"";		
+				echo "<option style=\"font-size:12px;\" value=\"$idc\" $sel >$desc_circ</option>";
+			}	 
+			echo '</select></label>';	
+			}
+#####		
+		echo '</form>
 
 	</div>';
@@ -151,5 +170,5 @@
 
 function footer_mon(){
-global $id_comune,$id_cons_gen,$tema,$colortheme,$rss,$prefix,$dbi;
+global $id_comune,$id_cons_gen,$tema,$colortheme,$rss,$prefix,$dbi,$id_circ;
 
 $sql="SELECT tema FROM `".$prefix."_config`";
@@ -166,5 +185,5 @@
 if($tema=="Futura2")
 	//echo'<a href="backtoapp.html" data-rel="external" data-ajax="false">Chiudi</a>'; // per l'app precedente non piu usata
-	echo '&nbsp;<a href="modules.php?name=Elezioni&tema='.$deftema.'&nocell=1&op=gruppo&id_cons_gen='.$id_cons_gen.'" data-rel="external" data-ajax="false" >Versione Desktop</a>';
+	echo '&nbsp;<a href="modules.php?name=Elezioni&tema='.$deftema.'&nocell=1&op=gruppo&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'" data-rel="external" data-ajax="false" >Versione Desktop</a>';
 else 
 	echo '&nbsp;<a href="modules.php?name=Elezioni&tema=facebook&desktop=1&op=gruppo" data-rel="external" data-ajax="false" >Versione Desktop</a>';
@@ -182,11 +201,11 @@
 ############################ menu home page
 function home(){ 
-global $id_comune,$id_cons_gen,$tema,$colortheme;
+global $id_comune,$id_cons_gen,$tema,$colortheme,$id_circ;
 //include("temi/$tema/config.php");
 
 echo '<div data-role="content" data-theme="a">
-<a href="modules.php?op=informazioni&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Informazioni Elettorali</a>
-<!-- <a href="modules.php?op=affluenze&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="heart">Ultima Affluenza</a> -->
-<a href="modules.php?op=risultati&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'"  data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Risultati Elettorali</a>
+<a href="modules.php?op=informazioni&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Informazioni Elettorali</a>
+<!-- <a href="modules.php?op=affluenze&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'" data-role="button" data-theme="'.$colortheme.'" data-icon="heart">Ultima Affluenza</a> -->
+<a href="modules.php?op=risultati&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'"  data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Risultati Elettorali</a>
 </div>';
 echo '<ul data-role="listview" data-inset="true" data-divider-theme="'.$colortheme.'">';
@@ -203,14 +222,14 @@
 ############################### menu informazioni
 function info(){
-global $id_comune,$id_cons_gen,$colortheme;
+global $id_comune,$id_cons_gen,$colortheme,$id_circ;
 echo '
 <div data-role="content" data-theme="a">
-<a href="modules.php?op=dati_generali&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">
+<a href="modules.php?op=dati_generali&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">
 Dati Generali</a>
-<a href="modules.php?op=come_si_vota&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">
+<a href="modules.php?op=come_si_vota&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">
 Come si Vota</a>
-<a href="modules.php?op=numeri_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">
+<a href="modules.php?op=numeri_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">
 Numeri Utili</a>
-<a href="modules.php?op=servizi_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">
+<a href="modules.php?op=servizi_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">
 Servizi Utili</a>			
 </div>
@@ -221,14 +240,14 @@
 ####################################### menu risultati
 function risultati(){ 
-global $id_comune,$id_cons_gen,$genere,$tipo_cons,$colortheme,$votoc;
+global $id_comune,$id_cons_gen,$genere,$tipo_cons,$colortheme,$votoc,$id_circ;
 echo '<div data-role="content" data-theme="'.$colortheme.'">
-<a href="modules.php?op=affluenze_all&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Affluenze</a>
-<a href="modules.php?op=votanti_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Votanti</a>
-<a href="modules.php?op=gruppo_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'"  data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">'._GRUPPO.'</a>';
+<a href="modules.php?op=affluenze_all&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Affluenze</a>
+<a href="modules.php?op=votanti_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Votanti</a>
+<a href="modules.php?op=gruppo_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'"  data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">'._GRUPPO.'</a>';
 
 	if($genere==3  OR $genere==5) 
-		echo '<a href="modules.php?op=liste_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" " data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">'._LISTA.'</a>';
+		echo '<a href="modules.php?op=liste_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'" " data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">'._LISTA.'</a>';
         if(($genere==3 OR $genere==5) and !$votoc) 
-		echo '<a href="modules.php?op=candidato_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" " data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">'._CANDIDATO.'</a>';
+		echo '<a href="modules.php?op=candidato_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'" " data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">'._CANDIDATO.'</a>';
 
 
@@ -240,11 +259,11 @@
 ####################################### menu grafica
 function grafica_mob(){ 
-global $id_comune,$id_cons_gen,$genere,$tipo_cons,$colortheme;
+global $id_comune,$id_cons_gen,$genere,$tipo_cons,$colortheme,$id_circ;
 echo '<div data-role="content" data-theme="'.$colortheme.'">
 
-<a href="modules.php?op=grafsezione&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'"  data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Elenco Sezioni scrutinate</a>
-
-<a href="modules.php?op=affluenze&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Grafica Affluenze</a>
-<a href="modules.php?op=grafvotanti_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Grafica Votanti</a>';
+<a href="modules.php?op=grafsezione&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'"  data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Elenco Sezioni scrutinate</a>
+
+<a href="modules.php?op=affluenze&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Grafica Affluenze</a>
+<a href="modules.php?op=grafvotanti_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'&id_circ='.$id_circ.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Grafica Votanti</a>';
 /*
 <a href="modules.php?op=grafgruppo&grafica=0&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'"  data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">'._GRUPPO.'</a>';
@@ -269,5 +288,5 @@
 # affluenza unica x grafica
 function affluenze(){
-	global $tema; 
+	global $tema;
         affluenza_unica();
 	grafica_mob();
