Index: /trunk/admin/modules/Elezioni/ele_associazioni.php
===================================================================
--- /trunk/admin/modules/Elezioni/ele_associazioni.php	(revision 198)
+++ /trunk/admin/modules/Elezioni/ele_associazioni.php	(revision 199)
@@ -183,5 +183,5 @@
 				list($fasciacom)=mysql_fetch_row($rescomu);
 		} else $fasciacom=0;
-		$rescomu = mysql_query("SELECT id_conf, descrizione from ".$prefix."_ele_conf order by descrizione asc", $dbi);
+		$rescomu = mysql_query("SELECT id_conf, descrizione from ".$prefix."_ele_conf order by id_conf desc", $dbi);
 		echo "<td><select name=\"id_conf\" id=\"id_conf\" onchange=\"javascript:showdate('modules/Elezioni/ele_desc_fasce.php?fascia=$fasciacom&id_conf=' + model.id_conf.options[model.id_conf.selectedIndex].value,'fasceconf');\">";
 		echo "<option value=\"0\"> ";
Index: /trunk/admin/modules/Elezioni/ele_voti.php
===================================================================
--- /trunk/admin/modules/Elezioni/ele_voti.php	(revision 198)
+++ /trunk/admin/modules/Elezioni/ele_voti.php	(revision 199)
@@ -40,4 +40,5 @@
 if (isset($param['prev_sez'])) $prev_sez=intval($param['prev_sez']); else $prev_sez='';
 if (isset($param['id_gruppo'])) $id_gruppo=intval($param['id_gruppo']); else $id_gruppo='';
+if (isset($param['update'])) $update=intval($param['update']); else $update='';
 include("modules/Elezioni/funzionidata.php");
 include("modules/Elezioni/ele.php");
@@ -455,5 +456,19 @@
    		if ($ops == 1) {
      			votanti($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops,$ov,$mv,$gv,$msv,$av);
-   		}
+   		}else{
+############# Controllo flag per cancellazione consultazione
+	echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n" 
+     ."//-->\n"; 
+     echo "function del_dati() {\n"; 
+     echo "if (document.getElementById('pwd3').checked==false) {\n"; 
+     echo "document.getElementById('update').value=\""._OK."\" \n"; 
+     echo "document.getElementById('do').value=\"0\" \n"; 
+     echo "}else{\n"; 
+     echo "document.getElementById('update').value=\""._DELETE."\" \n"; 
+     echo "document.getElementById('do').value=\"1\" \n"; 
+     echo "} \n"; 
+     echo "} \n"; 
+     echo "</script>\n"; 
+		}
 	/*
    		if ($ops == 2) {
@@ -597,5 +612,6 @@
 		."<input type=\"hidden\" name=\"id_sede\" value=\"$id_sede\">"
 		."<input type=\"hidden\" name=\"tabella\" value=\"$tab\">"
-		."<input type=\"hidden\" name=\"id_lista\" value=\"$id_lista\">\n";
+		."<input type=\"hidden\" name=\"id_lista\" value=\"$id_lista\">\n"
+		."<input type=\"hidden\" name=\"do\" id=\"do\" value=\"0\">\n";
 		echo "<table class=\"table-menu\" style=\"width: 90%; color: black\">";
 		echo "<tr><td bgcolor=\"$bgcolor1\" align=\"left\" width=\"32\">";
@@ -696,6 +712,12 @@
 
 	}
-		echo "<tr><td></td><td></td><td align=\"center\"><input type=\"submit\" name=\"update\" value=\" "._OK. "\"></td>";
-		echo "</tr></table></form></tr></table>";
+		echo "<tr>";
+		echo "<td></td><td></td>";
+		echo "<td align=\"center\"><input type=\"submit\" id=\"update\" name=\"update\" value=\""._OK."\"></td>";
+		echo "</tr></table></form></tr>";
+		if(chisei()>=64){
+			echo "<td></td><td> <input type=\"checkbox\" id=\"pwd3\" name=\"pwd3\" value=\"\" onclick=\"javascript:del_dati()\">"._DELETE."</td>";
+		}
+		echo "</table>";
 		echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n"
 		."document.sezioni.voti1.focus()\n"
@@ -716,5 +738,5 @@
 
 function rec_voti() {
-	global $prefix, $dbi,$aid,$id_cons,$ops,$genere,$votog,$fileout,$id_comune,$limite;
+	global $prefix, $dbi,$aid,$id_cons,$ops,$genere,$votog,$fileout,$id_comune,$limite,$update;
 	$sqlcomu="select id_fascia from ".$prefix."_ele_cons_comune where id_cons='$id_cons'";
 	$res = mysql_query($sqlcomu);
@@ -735,4 +757,5 @@
 	$tab = $arg[5];
 	$id_lista = intval($arg[6]);
+	$do= intval($arg[7]);
 	if ($tab=="_ele_voti_candidati") {
 		$condizione="id_cand";
@@ -742,5 +765,11 @@
 	if ((($genere==3) OR ($genere==5)) and !$id_lista and !$votog and ($fascia>$limite)) $y = (count($arg)-4);
 	else $y=count($arg);
-	for($i=7,$y--;$i< $y;$i++) {
+	if($do==1) {
+			mysql_query("delete from ".$prefix."_ele_voti_lista where id_cons='$id_cons' and id_sez='$id_sez'", $dbi);
+			mysql_query("delete from ".$prefix."_ele_voti_candidati where id_cons='$id_cons' and id_sez='$id_sez'", $dbi);
+			mysql_query("update  ".$prefix."_ele_sezioni set validi_lista='',contestati_lista='',voti_nulli_lista='',solo_gruppo='' where id_cons='$id_cons' and id_sez='$id_sez'", $dbi);
+	
+	}else{
+	for($i=8,$y--;$i< $y;$i++) {
 		$voti = intval($arg[$i++]);
 		$id_cand = intval($arg[$i]);
@@ -788,5 +817,5 @@
 	   }	
 	}
-
+	}
 	
 //	$ops = $arg[$argc];
@@ -1182,11 +1211,12 @@
 	echo "<td></td></tr></table>";
 	if ($validi+$nulli+$bianchi+$contestati+$votinulli>0 or $genere==0) {
-    echo "<form name=\"sezioni\" action=\"admin.php\">";
+    echo "<table class=\"table-menu\" style=\"width: 60%; color: black\"><tr><td colspan=\"3\"><form name=\"sezioni\" action=\"admin.php\">";
    	echo "<input type=\"hidden\" name=\"op\" value=\"rec_voti_gruppi\">"
     ."<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">"
     ."<input type=\"hidden\" name=\"id_sez\" value=\"$id_sez\">"
     ."<input type=\"hidden\" name=\"id_circ\" value=\"$id_circ\">"
-     ."<input type=\"hidden\" name=\"id_sede\" value=\"$id_sede\">";
-	echo "<br><br> <table  class=\"table-menu\" style=\"width: 60%; color: black\"><tr align=\"center\" bgcolor=\"$bgcolor1\">"
+    ."<input type=\"hidden\" name=\"id_sede\" value=\"$id_sede\">"
+    ."<input type=\"hidden\" name=\"do\" id=\"do\" value=\"0\">";
+	echo "<br><br> <table  class=\"table-menu\" style=\"width: 100%; color: black\"><tr align=\"center\" bgcolor=\"$bgcolor1\">"
 	."<td width=\"3%\"><b>"._NUM."</b></td>"
     ."<td width=\"50%\"><b>"._GRUPPO."</b></td>";
@@ -1265,7 +1295,12 @@
 	}
 
-   echo "<tr><td></td><td></td><td align=\"center\"><input type=\"submit\" name=\"update\" value=\" "._OK. "\"></td>";
-
-    echo "</tr></table></form><br><br> ";
+   echo "<tr><td></td><td></td><td align=\"center\"><input type=\"submit\" name=\"update\" id=\"update\" value=\" "._OK. "\"></td>";
+
+    echo "</tr></table></form></td></tr>";
+		if(chisei()>=64){
+			echo "<tr><td><input type=\"checkbox\" id=\"pwd3\" name=\"pwd3\" value=\"\" onclick=\"javascript:del_dati()\">"._DELETE."";
+		}
+
+	echo "</td></tr></table>";
 	}
     if ($genere!=0){
@@ -1295,5 +1330,14 @@
 $id_circ = intval($arg[3]);
 $id_sede = intval($arg[4]);
-$y=count($arg)-1;
+$do = intval($arg[5]);
+$y=count($arg)-1; 
+	if($do==1) {
+			mysql_query("delete from ".$prefix."_ele_voti_gruppo where id_cons='$id_cons' and id_sez='$id_sez'", $dbi);
+			mysql_query("delete from ".$prefix."_ele_voti_lista where id_cons='$id_cons' and id_sez='$id_sez'", $dbi);
+			mysql_query("delete from ".$prefix."_ele_voti_candidati where id_cons='$id_cons' and id_sez='$id_sez'", $dbi);
+			mysql_query("update  ".$prefix."_ele_sezioni set validi_lista='',contestati_lista='',voti_nulli_lista='',solo_gruppo='',solo_lista='' where id_cons='$id_cons' and id_sez='$id_sez'", $dbi);
+	
+	}else{
+
 if ($genere==0) {
 	$tab="_ele_voti_ref";
@@ -1306,5 +1350,5 @@
 }
 
-for($i=5;$i< $y;) {
+for($i=6;$i< $y;) {
 	$id_gruppo = intval($arg[$i++]);
 	$testval=0;
@@ -1367,4 +1411,5 @@
 
 }
+}
 //$ops = $arg[$argc];
 if ($fileout) fclose($fp);
Index: /trunk/admin/versione.php
===================================================================
--- /trunk/admin/versione.php	(revision 198)
+++ /trunk/admin/versione.php	(revision 199)
@@ -1,3 +1,3 @@
 <?php
-$versione="2.0 rev 198";
+$versione="2.0 rev 199";
 ?> 
Index: /trunk/client/modules/Elezioni/consiglieri.php
===================================================================
--- /trunk/client/modules/Elezioni/consiglieri.php	(revision 198)
+++ /trunk/client/modules/Elezioni/consiglieri.php	(revision 199)
@@ -47,11 +47,10 @@
 $res = mysql_query("SELECT t1.tipo_cons,t2.id_cons,t2.id_fascia,t2.id_conf FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen='$id_cons_gen' and t2.id_comune='$id_comune'" , $dbi);
 if (mysql_num_rows($res)){
-#	list($tipo_cons,$id_cons,$fascia,$conf) = mysql_fetch_row($res);
+	list($tipo_cons,$id_cons,$fascia,$conf) = mysql_fetch_row($res);
 	$result = mysql_query("select capoluogo from ".$prefix."_ele_comuni where id_comune='$id_comune'", $dbi);
 	list($capoluogo) = mysql_fetch_row($result);
-	if($fascia<6 and $capoluogo) {
-	$resfascia = mysql_query("SELECT fascia_capoluogo from ".$prefix."_ele_conf where id_conf=$id_conf", $dbi);
-	list ($fascia)= mysql_fetch_row($resfascia);
-	}
+	$result = mysql_query("select fascia_capoluogo from ".$prefix."_ele_conf where id_conf='$conf'", $dbi);
+	list($fascia2) = mysql_fetch_row($result);
+	if($fascia<$fascia2 and $capoluogo) $fascia=$fascia2;
 
 		$result = mysql_query("SELECT seggi from ".$prefix."_ele_fasce where id_fascia='$fascia' and id_conf=$id_conf",$dbi);
Index: /trunk/client/versione.php
===================================================================
--- /trunk/client/versione.php	(revision 198)
+++ /trunk/client/versione.php	(revision 199)
@@ -1,3 +1,3 @@
 <?php
-$versione="2.0 rev 198";
+$versione="2.0 rev 199";
 ?> 
Index: /trunk/install/sql/eleonline.sql
===================================================================
--- /trunk/install/sql/eleonline.sql	(revision 198)
+++ /trunk/install/sql/eleonline.sql	(revision 199)
@@ -325,4 +325,5 @@
 (5, 'Legge Italiana 267/2000 con riduzione 2011', 3, '1', 67, 3, 60, 3, '1', '1', 40, 40, '0', '0', '0', '0', '0', 7),
 (6, 'Legge Italiana 267/2000 con riduzione 2012', 3, '1', 67, 3, 60, 3, '1', '1', 40, 40, '0', '0', '0', '0', '0', 7);
+(7, 'Legge Italiana 267/2000 con modifiche 2014', 3, '1', 67, 3, 60, 3, '1', '1', 40, 40, '0', '0', '0', '0', '0', 6);
 UNLOCK TABLES;
 /*!40000 ALTER TABLE `soraldo_ele_conf` ENABLE KEYS */;
@@ -434,24 +435,4 @@
 (8, 1000000, 50, 1),
 (9, 100000000, 60, 1),
-(1, 3000, 9, 5),
-(2, 5000, 9, 5),
-(3, 10000, 12, 5),
-(4, 15000, 16, 5),
-(5, 30000, 16, 5),
-(6, 100000, 24, 5),
-(7, 250000, 32, 5),
-(8, 500000, 36, 5),
-(9, 1000000, 40, 5),
-(10, 100000000, 48, 5),
-(1, 3000, 6, 6),
-(2, 5000, 7, 6),
-(3, 10000, 10, 6),
-(4, 15000, 16, 6),
-(5, 30000, 16, 6),
-(6, 100000, 24, 6),
-(7, 250000, 32, 6),
-(8, 500000, 36, 6),
-(9, 1000000, 40, 6),
-(10, 100000000, 48, 6),
 (1, 3000, 12, 2),
 (2, 10000, 16, 2),
@@ -482,5 +463,34 @@
 (8, 500000, 36, 4),
 (9, 1000000, 40, 4),
-(10, 100000000, 48, 4);
+(10, 100000000, 48, 4),
+(1, 3000, 9, 5),
+(2, 5000, 9, 5),
+(3, 10000, 12, 5),
+(4, 15000, 16, 5),
+(5, 30000, 16, 5),
+(6, 100000, 24, 5),
+(7, 250000, 32, 5),
+(8, 500000, 36, 5),
+(9, 1000000, 40, 5),
+(10, 100000000, 48, 5),
+(1, 3000, 6, 6),
+(2, 5000, 7, 6),
+(3, 10000, 10, 6),
+(4, 15000, 16, 6),
+(5, 30000, 16, 6),
+(6, 100000, 24, 6),
+(7, 250000, 32, 6),
+(8, 500000, 36, 6),
+(9, 1000000, 40, 6),
+(10, 100000000, 48, 6),
+(1, 3000, 10, 7),
+(2, 10000, 12, 7),
+(3, 15000, 16, 7),
+(4, 30000, 16, 7),
+(5, 100000, 24, 7),
+(6, 250000, 32, 7),
+(7, 500000, 36, 7),
+(8, 1000000, 40, 7),
+(9, 100000000, 48, 7);
 /*!40000 ALTER TABLE `soraldo_ele_fasce` ENABLE KEYS */;
 UNLOCK TABLES;
Index: /trunk/sql/aggiornamento-2.0_2014-04-22.sql
===================================================================
--- /trunk/sql/aggiornamento-2.0_2014-04-22.sql	(revision 199)
+++ /trunk/sql/aggiornamento-2.0_2014-04-22.sql	(revision 199)
@@ -0,0 +1,112 @@
+-- phpMyAdmin SQL Dump
+-- version 4.1.6
+-- http://www.phpmyadmin.net
+--
+-- Host: 127.0.0.1
+-- Generation Time: Apr 22, 2014 alle 23:11
+-- Versione del server: 5.6.16
+-- PHP Version: 5.5.9
+
+SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
+SET time_zone = "+00:00";
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+
+--
+-- Database: `eleonline`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Struttura della tabella `soraldo_ele_fasce`
+--
+
+CREATE TABLE IF NOT EXISTS `soraldo_ele_fasce` (
+  `id_fascia` int(2) NOT NULL,
+  `abitanti` int(11) NOT NULL,
+  `seggi` int(4) NOT NULL,
+  `id_conf` int(11) DEFAULT '1',
+  KEY `id_fascia` (`id_fascia`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+--
+-- Dump dei dati per la tabella `soraldo_ele_fasce`
+--
+
+INSERT INTO `soraldo_ele_fasce` (`id_fascia`, `abitanti`, `seggi`, `id_conf`) VALUES
+(1, 3000, 12, 1),
+(2, 10000, 16, 1),
+(3, 15000, 20, 1),
+(4, 30000, 20, 1),
+(5, 100000, 30, 1),
+(6, 250000, 40, 1),
+(7, 500000, 46, 1),
+(8, 1000000, 50, 1),
+(9, 100000000, 60, 1),
+(1, 3000, 12, 2),
+(2, 10000, 16, 2),
+(3, 15000, 20, 2),
+(4, 30000, 20, 2),
+(5, 100000, 30, 2),
+(6, 250000, 40, 2),
+(7, 500000, 46, 2),
+(8, 1000000, 50, 2),
+(9, 100000000, 60, 2),
+(1, 3000, 9, 3),
+(2, 5000, 9, 3),
+(4, 15000, 16, 3),
+(3, 10000, 12, 3),
+(5, 30000, 16, 3),
+(6, 100000, 24, 3),
+(7, 250000, 32, 3),
+(8, 500000, 36, 3),
+(9, 1000000, 40, 3),
+(10, 100000000, 48, 3),
+(1, 3000, 6, 4),
+(2, 5000, 7, 4),
+(3, 10000, 12, 4),
+(4, 15000, 16, 4),
+(5, 30000, 16, 4),
+(6, 100000, 24, 4),
+(7, 250000, 32, 4),
+(8, 500000, 36, 4),
+(9, 1000000, 40, 4),
+(10, 100000000, 48, 4),
+(1, 3000, 9, 5),
+(2, 5000, 9, 5),
+(3, 10000, 12, 5),
+(4, 15000, 16, 5),
+(5, 30000, 16, 5),
+(6, 100000, 24, 5),
+(7, 250000, 32, 5),
+(8, 500000, 36, 5),
+(9, 1000000, 40, 5),
+(10, 100000000, 48, 5),
+(1, 3000, 6, 6),
+(2, 5000, 7, 6),
+(3, 10000, 10, 6),
+(4, 15000, 16, 6),
+(5, 30000, 16, 6),
+(6, 100000, 24, 6),
+(7, 250000, 32, 6),
+(8, 500000, 36, 6),
+(9, 1000000, 40, 6),
+(10, 100000000, 48, 6),
+(1, 3000, 10, 7),
+(2, 10000, 12, 7),
+(3, 15000, 16, 7),
+(4, 30000, 16, 7),
+(5, 100000, 24, 7),
+(6, 250000, 32, 7),
+(7, 500000, 36, 7),
+(8, 1000000, 40, 7),
+(9, 100000000, 48, 7);
+
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
