Index: /trunk/admin/modules/Elezioni/ele_associazioni.php
===================================================================
--- /trunk/admin/modules/Elezioni/ele_associazioni.php	(revision 86)
+++ /trunk/admin/modules/Elezioni/ele_associazioni.php	(revision 87)
@@ -57,25 +57,27 @@
 $prefix=$_SESSION['prefix'];
 ############# Controllo flag per cancellazione consultazione
-	echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n"
-	."//-->\n";
-	echo "function del_cons() {\n";
-	echo "if (document.model.pwd3.checked==false) {\n";
-	echo "document.model.chiusa.options[3].selected=false \n";
-	echo "document.model.pwd4.checked=false \n";
-	echo "document.getElementById('trspunta').style.visibility='hidden' \n";
-	echo "} \n";
-	echo "else document.getElementById('trspunta').style.visibility='visible' \n";
-	echo "if (document.model.chiusa.options[3].selected==false) {
-	 \n";
-	echo "document.model.add.value=\""._MODIFY."\" \n";
-	echo "document.model.do.value=\"update\" \n";
-	echo "}else{\n";
-    echo "if (document.model.pwd4.checked==false) \n";
-	echo "document.model.add.value=\""._DELETE." "._DATI."\" \n";
-	echo "else document.model.add.value=\""._DELETE." "._CONSULTA."\" \n";
-	echo "document.model.do.value=\"delete\" \n";
-	echo "} \n";	
-	echo "} \n";
-	echo "</script>\n";
+	echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n" 
+     ."//-->\n"; 
+     echo "function del_cons() {\n"; 
+     echo "if (document.getElementById('pwd3').checked==false) {\n"; 
+     echo "if (document.getElementById('chiusa').selectedIndex==3) document.getElementById('chiusa').options[0].selected=true \n"; 
+     echo "document.getElementById('pwd4').checked=false \n"; 
+     echo "document.getElementById('trspunta').style.visibility='hidden' \n"; 
+     echo "} \n"; 
+     echo "else document.getElementById('trspunta').style.visibility='visible' \n"; 
+#     echo "if (document.getElementById('chiusa').options[3].selected==false) { \n"; 
+     echo "if (document.getElementById('chiusa').selectedIndex!=3) { \n"; 
+     echo "document.getElementById('add').value=\""._MODIFY."\" \n"; 
+     echo "document.getElementById('do').value=\"update\" \n"; 
+     echo "}else{\n"; 
+     echo "if (document.getElementById('pwd4').checked==false) \n"; 
+     echo "document.getElementById('add').value=\""._DELETE." "._DATI."\" \n"; 
+     echo "else document.getElementById('add').value=\""._DELETE." "._CONSULTA."\" \n"; 
+     echo "document.getElementById('do').value=\"delete\" \n"; 
+     echo "} \n";     
+     echo "} \n"; 
+     echo "</script>\n"; 
+  
+
 #########################
 	if (isset($help)) include("language/$language/ele_associazioni.html");
@@ -131,5 +133,5 @@
 	$selez['3']='';
 	$selez[$chiusa]="selected";
-	echo "<td><select name=\"chiusa\" onChange=\"del_cons()\">";
+	echo "<td><select name=\"chiusa\" id=\"chiusa\" onChange=\"javascript:del_cons()\">";
 		echo "<option value=\"0\" ".$selez[0].">"._ATTIVA;
 		echo "<option value=\"1\" ".$selez[1].">"._CHIUSA;
@@ -153,9 +155,10 @@
 	echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">";
 	if ($idcomune) {
-		echo "<input type=\"hidden\" name=\"do\" value=\"update\">";
+		echo "<input type=\"hidden\" id=\"do\" name=\"do\" value=\"update\">";
 		echo "<input type=\"hidden\" name=\"idcomune\" value=\"$idcomune\">";
-		echo "<input type=\"submit\" name=\"add\" value=\""._MODIFY."\" ></td></tr>";
-		echo "<tr><td colspan=\"4\"><fieldset><legend>"._SPUNTALABEL1."</legend><label id=\"prov1\">"._SPUNTAELIMINA." <input type=\"checkbox\" name=\"pwd3\" value=\"\" onchange=\"del_cons()\"></label></fieldset></td></tr>";
-		echo "<tr id=\"trspunta\" style=\"visibility:hidden\"><td colspan=\"4\"><fieldset><legend>"._SPUNTALABEL2."</legend><label id=\"prov\">"._VIASPUNTAELIMINA." <input type=\"checkbox\" name=\"pwd4\" value=\"1\" onchange=\"del_cons()\"></label></fieldset>";
+		echo "<input type=\"submit\" id=\"add\" name=\"add\" value=\""._MODIFY."\" ></td></tr>";
+		echo "<tr><td colspan=\"4\"><fieldset><legend>"._SPUNTALABEL1."</legend><label id=\"prov1\">"._SPUNTAELIMINA." <input type=\"checkbox\" id=\"pwd3\" name=\"pwd3\" value=\"\" onclick=\"javascript:del_cons()\"></label></fieldset></td></tr>";
+# <div  id=\"trspunta\" style=\"visibility:hidden\">   </div>
+		echo "<tr id=\"trspunta\" style=\"visibility:hidden\"><td colspan=\"4\"><fieldset><legend>"._SPUNTALABEL2."</legend><label id=\"prov\">"._VIASPUNTAELIMINA." <input type=\"checkbox\" id=\"pwd4\" name=\"pwd4\" value=\"1\" onclick=\"javascript:del_cons()\"></label></fieldset>";
 	}else{
 		echo "<input type=\"hidden\" name=\"do\" value=\"add\">";
@@ -209,5 +212,5 @@
 		echo "</table></td></tr>";
 	CloseTable();
-	echo "</div>";
+#	echo "</div>";
 	}
 
@@ -275,2 +278,3 @@
 ?>
 
+
Index: /trunk/admin/modules/Elezioni/ele_candidato.php
===================================================================
--- /trunk/admin/modules/Elezioni/ele_candidato.php	(revision 86)
+++ /trunk/admin/modules/Elezioni/ele_candidato.php	(revision 87)
@@ -239,5 +239,5 @@
 				ele();
 				echo "<center><br><br>"._DOMCANCELLA." "._CANDIDATO." $cognome $nome ?<br>";
-				echo "[ <a href=\"admin.php?op=candidato&amp;id_cons_gen=$id_cons_gen\">"._NO."</a> ] - [<a href=\"admin.php?op=candidato&amp;do=delete&amp;id_cand=$id_cand&amp;id_gruppo=$id_gruppo&amp;id_cons=$id_cons&amp;id_circ=$id_circ&amp;ok=1&amp;id_cons_gen=$id_cons_gen&amp;id_lista=$id_lista&amp;id_comune=$id_comune\">"._YES."</a> ]";
+				echo "[ <a href=\"admin.php?op=candidato&amp;id_cons_gen=$id_cons_gen\">"._NO."</a> ] - [<a href=\"admin.php?op=candidato&amp;do=delete&amp;id_cand=$id_cand&amp;id_gruppo=$id_gruppo&amp;id_cons=$id_cons&amp;id_circ=$id_circ&amp;ok=1&amp;id_cons_gen=$id_cons_gen&amp;id_lista=$id_lista&amp;id_comune=$id_comune&amp;min=$min\">"._YES."</a> ]";
  	    		}else{
 				$pro= mysql_fetch_array($res, MYSQL_ASSOC);
@@ -245,5 +245,5 @@
 				mysql_query("insert into ".$prefix."_ele_log values ('$id_cons','$id_sez','$username','$data','$tempo','DELETE:id_lista:$pro[id_lista],cognome:$pro[cognome],nome:$pro[nome]','','".$prefix."_ele_candidati')", $dbi);
 				if (!$result)return;
-				Header("Location: admin.php?op=candidato&id_cons=$id_cons&id_cons_gen=$id_cons_gen&id_comune=$id_comune&id_circ=$id_circ&id_lista=$id_lista");
+				Header("Location: admin.php?op=candidato&id_cons=$id_cons&id_cons_gen=$id_cons_gen&id_comune=$id_comune&id_circ=$id_circ&id_lista=$id_lista&min=$min");
 			}
 		}elseif ($do == "add") {
@@ -261,10 +261,10 @@
 				mysql_query("insert into ".$prefix."_ele_log values ('$id_cons','$id_sez','$username','$data','$tempo','','ADD:id_lista:$id_lista,cognome:$cognome,nome:$nome','".$prefix."_ele_candidati')", $dbi);
 					if (!$result) return;
-					Header("Location: admin.php?op=candidato&id_cons=$id_cons&id_lista=$id_lista&id_cons_gen=$id_cons_gen&id_comune=$id_comune&id_circ=$id_circ");
+					Header("Location: admin.php?op=candidato&id_cons=$id_cons&id_lista=$id_lista&id_cons_gen=$id_cons_gen&id_comune=$id_comune&id_circ=$id_circ&min=$min");
 			} else {
 				ele();
 				OpenTable();
 				echo "<center>"._GESTIONE." "._CANDIDATO." ";
-				echo "<br><br><a href=\"admin.php?op=candidato&amp;id_cons=$id_cons&amp;id_lista=$id_lista&amp;id_cons_gen=$id_cons_gen&amp;id_comune=$id_comune&amp;id_circ=$id_circ\">"._IMM." "._CANDIDATO."</a></center>";
+				echo "<br><br><a href=\"admin.php?op=candidato&amp;id_cons=$id_cons&amp;id_lista=$id_lista&amp;id_cons_gen=$id_cons_gen&amp;id_comune=$id_comune&amp;id_circ=$id_circ&amp;min=$min\">"._IMM." "._CANDIDATO."</a></center>";
 				CloseTable();exit;
 			}
@@ -280,5 +280,5 @@
 		mysql_query("insert into ".$prefix."_ele_log values ('$id_cons','$id_sez','$username','$data','$tempo','UPDATE:id_lista:$pro[id_lista],cognome:$pro[cognome],nome:$pro[nome],num_cand:$pro[num_cand]','id_lista:$id_lista,cognome:$cognome,nome:$nome,num_cand:$num_cand','".$prefix."_ele_candidati')", $dbi);
 		if (!$result) return;
-		Header("Location: admin.php?op=candidato&id_cons=$id_cons&id_lista=$id_lista&id_cons_gen=$id_cons_gen&id_comune=$id_comune&id_circ=$id_circ");
+		Header("Location: admin.php?op=candidato&id_cons=$id_cons&id_lista=$id_lista&id_cons_gen=$id_cons_gen&id_comune=$id_comune&id_circ=$id_circ&min=$min");
 	}
 
Index: /trunk/admin/modules/Elezioni/ele_consultazioni.php
===================================================================
--- /trunk/admin/modules/Elezioni/ele_consultazioni.php	(revision 86)
+++ /trunk/admin/modules/Elezioni/ele_consultazioni.php	(revision 87)
@@ -133,5 +133,5 @@
 		$resdel = mysql_query("SELECT * FROM ".$prefix."_ele_cons_comune where id_cons_gen='$id_cons_gen'", $dbi);
 		if(mysql_num_rows($resdel)==0)
-			echo "<td><fieldset><legend>Abilita la cancellazione</legend><label id=\"prov\">"._SPUNTAELIMINA." <input type=\"checkbox\" name=\"pwd3\" value=\"\" onchange=\"del_cons()\"></label></fieldset></td>";
+			echo "<td><fieldset><legend>"._SPUNTALABEL1."</legend><label id=\"prov\">"._VIASPUNTAELIMINA." <input type=\"checkbox\" name=\"pwd3\" value=\"\" onchange=\"del_cons()\"></label></fieldset></td>";
 		else echo "<td></td>";
 		echo "<td><input type=\"submit\" name=\"update\" value=\""._MODIFY."\">"
@@ -222,4 +222,6 @@
 if ($perms>=128) {
 		if ($do == "delete") { 
+				$result = mysql_query("delete from ".$prefix."_ele_rilaff where id_cons_gen='$id_cons_gen'", $dbi);
+				if (!$result) return;
 				$result = mysql_query("delete from ".$prefix."_ele_consultazione where id_cons_gen='$id_cons_gen'", $dbi);
 				if (!$result) return;
@@ -284,3 +286,2 @@
 
 ?>
-
Index: /trunk/admin/modules/Elezioni/ele_gruppo.php
===================================================================
--- /trunk/admin/modules/Elezioni/ele_gruppo.php	(revision 86)
+++ /trunk/admin/modules/Elezioni/ele_gruppo.php	(revision 87)
@@ -169,5 +169,5 @@
 				ele();
 				echo "<center><br><br>"._DOMCANCELLA." "._GRUPPO." $descr_gruppo ?<br>";
-				echo "[ <a href=\"admin.php?op=gruppo&amp;id_cons_gen=$id_cons_gen&amp;id_circ=$id_circ\">"._NO."</a> ] - [<a href=\"admin.php?op=gruppo&amp;do=delete&amp;id_gruppo=$id_gruppo&amp;id_cons_gen=$id_cons_gen&amp;id_comune=$id_comune&amp;ok=1\">"._YES."</a> ]";exit;
+				echo "[ <a href=\"admin.php?op=gruppo&amp;id_cons_gen=$id_cons_gen&amp;id_circ=$id_circ\">"._NO."</a> ] - [<a href=\"admin.php?op=gruppo&amp;do=delete&amp;id_gruppo=$id_gruppo&amp;id_cons_gen=$id_cons_gen&amp;id_comune=$id_comune&amp;min=$min&amp;ok=1\">"._YES."</a> ]";exit;
      			}else{
 				$result = mysql_query("delete from ".$prefix."_ele_gruppo where id_gruppo='$id_gruppo'", $dbi);
@@ -209,5 +209,5 @@
         			OpenTable();
 				echo "<center>"._GESTIONE." "._GRUPPO." ";
-        			echo "<br><br><a href=\"admin.php?op=gruppo&amp;id_cons_gen=$id_cons_gen\">"._IMM." "._GRUPPO."</a></center>";
+        			echo "<br><br><a href=\"admin.php?op=gruppo&amp;id_cons_gen=$id_cons_gen&amp;min=$min\">"._IMM." "._GRUPPO."</a></center>";
 				CloseTable();
      			}
Index: /trunk/admin/modules/Elezioni/ele_lista.php
===================================================================
--- /trunk/admin/modules/Elezioni/ele_lista.php	(revision 86)
+++ /trunk/admin/modules/Elezioni/ele_lista.php	(revision 87)
@@ -209,5 +209,5 @@
 			$result = mysql_query("delete from ".$prefix."_ele_lista where id_lista='$id_lista'", $dbi);
 			if (!$result)return;
-			Header("Location: admin.php?op=lista&id_circ=$id_circ&id_cons_gen=$id_cons_gen");
+			Header("Location: admin.php?op=lista&id_circ=$id_circ&id_cons_gen=$id_cons_gen&min=$min");
 		}
 	}elseif ($do == "add") {
Index: /trunk/client/modules/Elezioni/index.php
===================================================================
--- /trunk/client/modules/Elezioni/index.php	(revision 86)
+++ /trunk/client/modules/Elezioni/index.php	(revision 87)
@@ -894,6 +894,6 @@
 		
 		echo "<img src=\"modules.php?name=Elezioni&amp;file=foto&amp;id_lista=$id_lista\" width=\"50\" heigth=\"50\" align=\"middle\"><h2> $descr_lista</h2><br />";
-		if ($voti_lista OR $perc_lista){ echo "<h5>
-		Voti: <font color=\"red\">$voti_lista</font> "._PERC.": <font color=\"red\">$perc_lista %</font><br /></h5>";
+		if ($voti_lista OR $perc_lista){ echo "<h5>";
+		echo _VOTI.": <font color=\"red\">$voti_lista</font> "._PERC.": <font color=\"red\">$perc_lista %</font><br /></h5>";
 		}
 		echo "<center>"._GRUPPO."<h1> $descr_gruppo</h1>";
@@ -914,5 +914,5 @@
 		$res_candi = mysql_query("SELECT id_cand , cognome, nome, num_cand  FROM ".$prefix."_ele_candidati 
 		where id_lista='$id_lista'  and id_cons='$id_cons' order by num_cand" , $dbi);
-		echo "<tr bgcolor=\"#EAEAEA\"><td >Numero</td><td>Candidato</td></tr>";
+		echo "<tr bgcolor=\"#EAEAEA\"><td >"._NUM."</td><td>"._CANDIDATO."</td></tr>";
 		while(list($id_cand,$cognome,$nome, $num) = mysql_fetch_row($res_candi)) {
 			
@@ -920,5 +920,5 @@
 		}
 		}else{	
-		echo "<tr bgcolor=\"#EAEAEA\"><td >Numero</td><td>"._CANDIDATO."</td><td>"._PREFERENZE."</td></tr>";
+		echo "<tr bgcolor=\"#EAEAEA\"><td >"._NUM."</td><td>"._CANDIDATO."</td><td>"._PREFERENZE."</td></tr>";
 		while(list($id_cand,$cognome,$nome, $num,$id_cand, $somma) = mysql_fetch_row($res_candi)) {
 			
@@ -952,5 +952,7 @@
 	$res = mysql_query("select *  from ".$prefix."_ele_sezioni where id_cons='$id_cons' $circos ",$dbi);
 	$sezioni=mysql_num_rows($res);
-	if ($numero!=0) 
+	$res = mysql_query("select chiusa  from ".$prefix."_ele_cons_comuni where id_cons='$id_cons' $circos ",$dbi);
+	$chiusa=mysql_num_rows($res);
+	if ($numero!=0 and $chiusa==0) 
 	echo "<div><h2>"._SEZSCRU." $numero "._SU." $sezioni</h2></div>";
 	
