Index: trunk/client/modules/Elezioni/blocchi/00_affluenze.php
===================================================================
--- trunk/client/modules/Elezioni/blocchi/00_affluenze.php	(revision 278)
+++ trunk/client/modules/Elezioni/blocchi/00_affluenze.php	(revision 279)
@@ -45,5 +45,5 @@
         	$tot_v_m=0;$tot_v_d=0;$tot_t=0;
 	
-  		$sql="select t3.*  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 ";
+  		$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();
@@ -66,6 +66,6 @@
 else
   	$sql="select sum(t3.voti_complessivi),0,0  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";
-$resl = $dbi->prepare("$sql");
-$resl->execute();
+$res1 = $dbi->prepare("$sql");
+$res1->execute();
 
 #fine modifica
Index: trunk/client/modules/Elezioni/blocchi/01_votanti.php
===================================================================
--- trunk/client/modules/Elezioni/blocchi/01_votanti.php	(revision 278)
+++ trunk/client/modules/Elezioni/blocchi/01_votanti.php	(revision 279)
@@ -69,10 +69,9 @@
 else
         $numero=0;
-$sql="select t3.* from ".$prefix."_ele_voti_".$tab." 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' $circos group by t3.id_sez ";
-	$res_sez = $dbi->prepare("$sql");
-	$res_sez->execute();
+#$sql="select t3.* from ".$prefix."_ele_voti_".$tab." 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' $circos group by t3.id_sez ";
+#	$res_sez = $dbi->prepare("$sql");
+#	$res_sez->execute();
 
-$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";
+$sql="select t1.id_sez 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";
 	$res_sez = $dbi->prepare("$sql");
 	$res_sez->execute();
Index: trunk/client/modules/Elezioni/blocchi/bar_affluenze.php
===================================================================
--- trunk/client/modules/Elezioni/blocchi/bar_affluenze.php	(revision 278)
+++ trunk/client/modules/Elezioni/blocchi/bar_affluenze.php	(revision 279)
@@ -32,5 +32,5 @@
 	
 
-  		$sql="select t3.*  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 ";
+  		$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();
Index: trunk/client/modules/Elezioni/blocchi/gom_affluenze.php
===================================================================
--- trunk/client/modules/Elezioni/blocchi/gom_affluenze.php	(revision 278)
+++ trunk/client/modules/Elezioni/blocchi/gom_affluenze.php	(revision 279)
@@ -33,5 +33,5 @@
 	
 
-  		$sql="select t3.*  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 ";
+  		$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();
@@ -51,6 +51,6 @@
 else
   	$sql="select sum(t3.voti_complessivi),0,0  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";
-$resl = $dbi->prepare("$sql");
-$resl->execute();
+$res1 = $dbi->prepare("$sql");
+$res1->execute();
 
 #fine modifica
Index: trunk/client/modules/Elezioni/blocchi/pie_affluenze.php
===================================================================
--- trunk/client/modules/Elezioni/blocchi/pie_affluenze.php	(revision 278)
+++ trunk/client/modules/Elezioni/blocchi/pie_affluenze.php	(revision 279)
@@ -39,5 +39,5 @@
 	
 
-  		$sql="select t3.*  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 ";
+  		$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();
@@ -54,11 +54,11 @@
 #modifica del 26giugno 09 per gestione circoscrizionali
 if($genere==0)	{	$sql="select sum(t1.voti_complessivi), t2.num_gruppo , t2.id_gruppo from ".$prefix."_ele_voti_parziale as t1 left join ".$prefix."_ele_gruppo as t2 on (t1.id_gruppo=t2.id_gruppo) where t1.id_cons='$id_cons' and t1.orario='$orario' and t1.data='$data' group by t2.num_gruppo,t2.id_gruppo order by t2.num_gruppo " ;
-	$resl = $dbi->prepare("$sql");
-	$resl->execute();
+	$res1 = $dbi->prepare("$sql");
+	$res1->execute();
 
 		}else{
   		$sql="select sum(t3.voti_complessivi),0,0  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";
-	$resl = $dbi->prepare("$sql");
-	$resl->execute();
+	$res1 = $dbi->prepare("$sql");
+	$res1->execute();
 		}
 #fine modifica
Index: trunk/client/modules/Elezioni/funzioni.php
===================================================================
--- trunk/client/modules/Elezioni/funzioni.php	(revision 278)
+++ trunk/client/modules/Elezioni/funzioni.php	(revision 279)
@@ -259,10 +259,10 @@
       
   
-	$sql="select *  from ".$prefix."_$tab where id_cons='$id_cons' group by id_sez ";
+	$sql="select id_cons from ".$prefix."_$tab where id_cons='$id_cons' group by id_sez ";
 	$res = $dbi->prepare("$sql");
 	$res->execute();
 
 	
-	if ($res) $numero=$res->rowCount();else $numero=0;
+	$numero=$res->rowCount();
 	$sql="select t2.*  from ".$prefix."_ele_sezioni as t2, ".$prefix."_ele_sede as t1 where t2.id_cons='$id_cons' and t1.id_sede=t2.id_sede $circondt1";
 	$res = $dbi->prepare("$sql");
Index: trunk/client/modules/Elezioni/index.php
===================================================================
--- trunk/client/modules/Elezioni/index.php	(revision 278)
+++ trunk/client/modules/Elezioni/index.php	(revision 279)
@@ -713,5 +713,5 @@
 		$numero_l=$res_num_list->rowCount();
 		// verifica delle sezioni in relazione ai candidati (comuni >=15000)  non c'e' il voto di lista e quindi ci metto se scrutinate le preferenze sulla lista [$numero_c] - 5/5/2009
-		$sql="select *  from ".$prefix."_ele_voti_candidati where id_cons='$id_cons' group by id_sez ";
+		$sql="select id_sez from ".$prefix."_ele_voti_candidati where id_cons='$id_cons' group by id_sez ";
 	$res_num_list = $dbi->prepare("$sql");
 	$res_num_list->execute();
