Index: trunk/admin/modules/Elezioni/ele_permessi.php
===================================================================
--- trunk/admin/modules/Elezioni/ele_permessi.php	(revision 365)
+++ trunk/admin/modules/Elezioni/ele_permessi.php	(revision 366)
@@ -200,7 +200,29 @@
 	if ($perms>32 and $permessi<$perms and $aid2) {
 		if ($do == "autorizza") {
-			$sql="insert into ".$prefix."_ele_operatori (id_cons,id_sede,id_comune,permessi,aid,id_sez) values ('$id_cons','$id_sede','$id_comune','$permessi','$aid2','$id_sez')";
+			$sql="select num_sez from ".$prefix."_ele_sezioni where id_sez='$id_sez'";
 			$res = $dbi->prepare("$sql");
-			$res->execute();				
+			$res->execute();
+			list ($num_sez)=$res->fetch(PDO::FETCH_NUM);			
+			$sql="select data_inizio from ".$prefix."_ele_consultazione where id_cons_gen='$id_cons_gen'";
+			$compl = $dbi->prepare("$sql");
+			$compl->execute();
+			list ($datarif)= $compl->fetch(PDO::FETCH_NUM);			
+			$sql="select id_cons from ".$prefix."_ele_cons_comune where id_comune='$id_comune' and id_cons_gen in (select id_cons_gen from ".$prefix."_ele_consultazione where data_inizio='$datarif')";
+			$compl = $dbi->prepare("$sql");
+			$compl->execute();
+			while(list ($id_cons)= $compl->fetch(PDO::FETCH_NUM)){
+				$sql="select id_sez, id_sede from ".$prefix."_ele_sezioni where id_cons='$id_cons' and num_sez='$num_sez'";
+				$res = $dbi->prepare("$sql");
+				$res->execute();
+				if(!$res->rowCount()) continue;
+				list ($id_sez,$id_sede)=$res->fetch(PDO::FETCH_NUM);			
+				$sql="select aid from ".$prefix."_ele_operatori where id_cons='$id_cons' and aid='$aid2'";
+				$res = $dbi->prepare("$sql");
+				$res->execute();
+				if($res->rowCount()) continue;
+				$sql="insert into ".$prefix."_ele_operatori (id_cons,id_sede,id_comune,permessi,aid,id_sez) values ('$id_cons','$id_sede','$id_comune','$permessi','$aid2','$id_sez')";
+				$res = $dbi->prepare("$sql");
+				$res->execute();
+			}
 			Header("Location: admin.php?op=permessi&id_cons_gen=$id_cons_gen");
 		} elseif ($do == "update") {
Index: trunk/admin/modules/Elezioni/ele_spoglio.php
===================================================================
--- trunk/admin/modules/Elezioni/ele_spoglio.php	(revision 365)
+++ trunk/admin/modules/Elezioni/ele_spoglio.php	(revision 366)
@@ -961,9 +961,10 @@
 					$res = $dbi->prepare("$sql");
 					$res->execute();
+					$numpro=$res->rowCount();
 					$pro= $res->fetch(PDO::FETCH_BOTH);
 					echo "<tr><td colspan=\"6\">&nbsp;</td></tr>";
-					if ($pro['si']+$pro['no']!=$pro['validi'] or ($pro['validi']+$pro['nulli']+$pro['bianchi']+$pro['contestati']!=$tot and $pro['validi']+$pro['nulli']+$pro['bianchi']+$pro['contestati']!=0)){
+					if ($numpro and ($pro['si']+$pro['no']!=$pro['validi'] or ($pro['validi']+$pro['nulli']+$pro['bianchi']+$pro['contestati']!=$tot and $pro['validi']+$pro['nulli']+$pro['bianchi']+$pro['contestati']!=0))){
 						echo "<tr style=\"background-color: rgb(255, 0, 0); text-align:center\">";
-					}elseif($pro['validi']+$pro['nulli']+$pro['bianchi']+$pro['contestati']!=0)
+					}elseif($numpro and ($pro['validi']+$pro['nulli']+$pro['bianchi']+$pro['contestati']!=0))
 						echo "<tr style=\"background-color:#99CC33; text-align:center\">"; 
 					else 
Index: trunk/admin/modules/Elezioni/salva_ref.php
===================================================================
--- trunk/admin/modules/Elezioni/salva_ref.php	(revision 365)
+++ trunk/admin/modules/Elezioni/salva_ref.php	(revision 366)
@@ -62,4 +62,5 @@
 		while(list($i,$idgruppo)=$resultg->fetch(PDO::FETCH_BOTH)) {
 			$gruv="id_gruppo$i";$siv="si$i";$nov="no$i";$valv="val$i";$biav="bia$i";$conv="con$i";$nulv="nul$i";
+			if($_GET[$siv]=='' and $_GET[$nov]=='' and $_GET[$biav]=='' and $_GET[$conv]=='' and $_GET[$nulv]=='') continue;
 			if (isset($_GET[$gruv])) $id_gruppo[$i]=intval($_GET[$gruv]); else $id_gruppo[$i]='0';
 			if (isset($_GET[$siv])) $si[$i]=intval($_GET[$siv]); else $si[$i]='0';
Index: trunk/admin/versione.php
===================================================================
--- trunk/admin/versione.php	(revision 365)
+++ trunk/admin/versione.php	(revision 366)
@@ -1,9 +1,8 @@
 <?php
 
-$versione = "3.0 rev 365";
+$versione = "3.0 rev 366";
 $version_number = $versione;
-$datarel = "09 aprile 2022";
+$datarel = "15 maggio 2022";
 $version = "Eleonline $version_number (<i>Data Release: $datarel</i>)";
 
 ?> 
-
Index: trunk/client/versione.php
===================================================================
--- trunk/client/versione.php	(revision 365)
+++ trunk/client/versione.php	(revision 366)
@@ -1,7 +1,7 @@
 <?php
 
-$versione = "3.0 rev 365";
+$versione = "3.0 rev 366";
 $version_number = $versione;
-$datarel = "09 aprile 2022";
+$datarel = "15 maggio 2022";
 $version = "Eleonline $version_number (<i>Data Release: $datarel</i>)";
 
