Index: trunk/admin/modules/Elezioni/ele_colora_sez.php
===================================================================
--- trunk/admin/modules/Elezioni/ele_colora_sez.php	(revision 341)
+++ trunk/admin/modules/Elezioni/ele_colora_sez.php	(revision 342)
@@ -1,11 +1,11 @@
 <?php
 if (!isset($_SESSION['aid'])) die ("You can't access this file directly..."); 
-global $id_cons,$id_circ,$id_sez,$dbi,$prefix,$genere,$id_cons_gen,$circo;
+global $id_cons,$id_circ,$id_sez,$dbi,$prefix,$genere,$id_cons_gen;
 
-if ($circo) $iscirco="and id_circ=$id_circ"; else $iscirco=''; 
-$sql="SELECT t1.voto_c FROM ".$prefix."_ele_tipo as t1 left join ".$prefix."_ele_consultazione as t2 on t1.tipo_cons=t2.tipo_cons where id_cons_gen='$id_cons_gen'";
+$sql="SELECT t1.voto_c,circo FROM ".$prefix."_ele_tipo as t1 left join ".$prefix."_ele_consultazione as t2 on t1.tipo_cons=t2.tipo_cons where id_cons_gen='$id_cons_gen'";
 $res = $dbi->prepare("$sql");
 $res->execute();
-list($votoc)=$res->fetch(PDO::FETCH_NUM);
+list($votoc,$circo)=$res->fetch(PDO::FETCH_NUM);
+if ($circo) $iscirco="and id_circ=$id_circ"; else $iscirco=''; 
 $sql="select * from ".$prefix."_ele_controlli where id_cons='$id_cons' and id_sez='$id_sez'";
 $resc = $dbi->prepare("$sql");
@@ -33,8 +33,11 @@
 		$sql="UPDATE ".$prefix."_ele_sezioni set colore='#99CC33' where id_cons='$id_cons' and id_sez='$id_sez'"; #VERDE
 		$res = $dbi->prepare("$sql");
-		$res->execute();		
+		$res->execute();	
 	}
 	if(!$sezstat) { #liste
-		$sql="SELECT id_lista FROM ".$prefix."_ele_voti_lista where id_cons='$id_cons' and id_sez='$id_sez'";
+		if($genere==2)
+			$sql="SELECT id_gruppo FROM ".$prefix."_ele_voti_gruppo where id_cons='$id_cons' and id_sez='$id_sez'";
+		else
+			$sql="SELECT id_lista FROM ".$prefix."_ele_voti_lista where id_cons='$id_cons' and id_sez='$id_sez'";
 		$res = $dbi->prepare("$sql");
 		$res->execute();
Index: trunk/admin/modules/Elezioni/ele_voti.php
===================================================================
--- trunk/admin/modules/Elezioni/ele_voti.php	(revision 341)
+++ trunk/admin/modules/Elezioni/ele_voti.php	(revision 342)
@@ -298,20 +298,19 @@
 	// Menu spoglio
 	//************************************
-     		$sql="select id_cons,id_sez,id_sede,num_sez, maschi, femmine  from ".$prefix."_ele_sezioni where id_cons='$id_cons' and id_sez='$id_sez'";
-$result = $dbi->prepare("$sql");
-$result->execute();
-
-
-     		list($id_cons2,$id_sez2,$id_sede,$num_sez, $maschi, $femmine) = $result->fetch(PDO::FETCH_NUM);
-
-                echo "<hr><table><tr><td  width=\"200\"><font size =\"4\" color=\"black\" align=\"left\"><b>Sezione N. $num_sez</b></font></td><td><table><tr>";
-                echo "\n<td bgcolor=\"$bgcolor1\" align=\"center\"><p style=\"margin-left:10px;margin-right:10px;\"><b><a href=\"admin.php?op=voti&amp;id_cons_gen=$id_cons_gen&amp;id_sez=$id_sez&amp;id_circ=$id_circ&amp;id_sede=$id_sede&amp;do=spoglio&amp;ops=1\">"._AFFLUENZE."</a></b></p></td>\n";
-                if(!($genere==4) and !($votog)){ //if(!($genere==4) and !($tipo_cons==10 or $tipo_cons==11)){
-                        echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><p style=\"margin-left:10px;margin-right:10px;\"><b><a href=\"admin.php?op=voti&amp;id_cons_gen=$id_cons_gen&amp;id_sez=$id_sez&amp;id_circ=$id_circ&amp;id_sede=$id_sede&amp;do=spoglio&amp;ops=4\">"._GRUPPO."</a></b></p></td>\n";
-                }
-                if(($genere>2 or $votog)){ //if(($genere>2 or $tipo_cons==10 or $tipo_cons==11)){
-                        echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><p style=\"margin-left:10px;margin-right:10px;\"><b><a href=\"admin.php?op=voti&amp;id_cons_gen=$id_cons_gen&amp;id_sez=$id_sez&amp;id_circ=$id_circ&amp;id_sede=$id_sede&amp;do=spoglio&amp;ops=3\">"._LISTA."</a></b></p></td>\n";
-                }
-                echo "</tr></table></td></tr></table><hr>\n";
+    $sql="select id_cons,id_sez,id_sede,num_sez, maschi, femmine  from ".$prefix."_ele_sezioni where id_cons='$id_cons' and id_sez='$id_sez'";
+	$result = $dbi->prepare("$sql");
+	$result->execute();
+	list($id_cons2,$id_sez2,$id_sede,$num_sez, $maschi, $femmine) = $result->fetch(PDO::FETCH_NUM);
+	echo "<hr><table><tr><td  width=\"200\"><font size =\"4\" color=\"black\" align=\"left\"><b>Sezione N. $num_sez</b></font></td><td><table><tr>";
+	echo "\n<td bgcolor=\"$bgcolor1\" align=\"center\"><p style=\"margin-left:10px;margin-right:10px;\"><b><a href=\"admin.php?op=voti&amp;id_cons_gen=$id_cons_gen&amp;id_sez=$id_sez&amp;id_circ=$id_circ&amp;id_sede=$id_sede&amp;do=spoglio&amp;ops=1\">"._AFFLUENZE."</a></b></p></td>\n";
+	if(!($genere==4) and !($votog)){ //if(!($genere==4) and !($tipo_cons==10 or $tipo_cons==11)){
+			echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><p style=\"margin-left:10px;margin-right:10px;\"><b><a href=\"admin.php?op=voti&amp;id_cons_gen=$id_cons_gen&amp;id_sez=$id_sez&amp;id_circ=$id_circ&amp;id_sede=$id_sede&amp;do=spoglio&amp;ops=4\">"._GRUPPO."</a></b></p></td>\n";
+	}
+	if($genere==2 and $votog)
+		echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><p style=\"margin-left:10px;margin-right:10px;\"><b><a href=\"admin.php?op=voti&amp;id_cons_gen=$id_cons_gen&amp;id_sez=$id_sez&amp;id_circ=$id_circ&amp;id_sede=$id_sede&amp;do=spoglio&amp;ops=4\">"._GRUPPO."</a></b></p></td>\n";
+	elseif(($genere>2 or $votog)){ //if(($genere>2 or $tipo_cons==10 or $tipo_cons==11)){
+		echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><p style=\"margin-left:10px;margin-right:10px;\"><b><a href=\"admin.php?op=voti&amp;id_cons_gen=$id_cons_gen&amp;id_sez=$id_sez&amp;id_circ=$id_circ&amp;id_sede=$id_sede&amp;do=spoglio&amp;ops=3\">"._LISTA."</a></b></p></td>\n";
+	}
+	echo "</tr></table></td></tr></table><hr>\n";
 
 #############
@@ -322,14 +321,10 @@
 	} else{
 		$sql="SELECT data, orario from ".$prefix."_ele_rilaff where id_cons_gen=$id_cons_gen order by data desc,orario desc limit 0,1";
-$res = $dbi->prepare("$sql");
-$res->execute();
-
-
+		$res = $dbi->prepare("$sql");
+		$res->execute();
 		list($data,$orario)=$res->fetch(PDO::FETCH_NUM);
 		$sql="SELECT voti_complessivi from ".$prefix."_ele_voti_parziale where id_sez='$id_sez' and orario='$orario' and data='$data'";
-$res = $dbi->prepare("$sql");
-$res->execute();
-
-
+		$res = $dbi->prepare("$sql");
+		$res->execute();
         list($voti) = $res->fetch(PDO::FETCH_NUM);
 		if (!$voti) $ops=1;
@@ -337,8 +332,6 @@
 			if($genere<4){
 				$sql="SELECT sum(voti) from ".$prefix."_ele_voti_gruppo where id_sez='$id_sez'";
-$res = $dbi->prepare("$sql");
-$res->execute();
-
-
+				$res = $dbi->prepare("$sql");
+				$res->execute();
         		list($voti) = $res->fetch(PDO::FETCH_NUM);
 				if ($voti==0 or $genere<3) $ops=4;
Index: trunk/admin/versione.php
===================================================================
--- trunk/admin/versione.php	(revision 341)
+++ trunk/admin/versione.php	(revision 342)
@@ -1,7 +1,7 @@
 <?php
 
-$versione = "3.0 rev 340";
+$versione = "3.0 rev 342";
 $version_number = $versione;
-$datarel = "14 novembre 2020";
+$datarel = "18 novembre 2020";
 $version = "Eleonline $version_number (<i>Data Release: $datarel</i>)";
 
