Index: trunk/client/temi/Futura2/index.php
===================================================================
--- trunk/client/temi/Futura2/index.php	(revision 407)
+++ 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();
