Index: trunk/admin/modules/Elezioni/ele_associazioni.php
===================================================================
--- trunk/admin/modules/Elezioni/ele_associazioni.php	(revision 254)
+++ trunk/admin/modules/Elezioni/ele_associazioni.php	(revision 256)
@@ -71,5 +71,4 @@
      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"; 
@@ -124,5 +123,4 @@
 	echo "<table width=\"100%\" border=\"3\">";
 	echo "<tr align=\"center\"><td bgcolor=\"$bgcolor1\"><b>"._CONSULTA."</b></td>";
-#	echo "<td bgcolor=\"$bgcolor1\"><b>"._COLLEGI."</b></td>";
 	echo "<td bgcolor=\"$bgcolor1\"><b>"._DEFCOMUNE."</b></td>";
 	echo "<td width=\"10%\" bgcolor=\"$bgcolor1\"><b>"._PREFERENZE."</b></td>";
@@ -135,18 +133,8 @@
 	echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._ASOLO_GRUPPO."</b></td>";
 	echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._DISGIUNTO."</b></td>";
-#	echo "<input type=\"hidden\" name=\"pag_cons\" value=\"admin.php?op=associazioni&amp;id_cons_gen=\">";
 	echo "</tr>";
 	echo "<tr align=\"center\"><td>";
 	echo "<input type=\"hidden\" name=\"op\" value=\"associazioni\">";
 	echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">$descr_cons</td>";
-#	$ressede = mysql_query("SELECT id_collegio, descrizione from ".$prefix."_ele_collegi where id_cons_gen='$id_cons_gen' order by descrizione desc", $dbi);
-#	if ($num_coll=mysql_num_rows($ressede)){
-#		echo "<td><select name=\"id_collegio\">";
-#		while(list($id,$descr_coll)=mysql_fetch_row($ressede)){
-#			$sel= ($id == $id_collegio) ? "selected":"";
-#			echo "<option value=\"$id\" $sel>$descr_coll";
-#		}
-#		echo "</select></td>";
-#	} else echo "<td></td>";
 	$rescomu = mysql_query("SELECT id_comune, descrizione from ".$prefix."_ele_comuni order by descrizione asc", $dbi);
 	echo "<td>";
@@ -241,5 +229,4 @@
 		echo "<input type=\"submit\" id=\"add\" name=\"add\" value=\""._MODIFY."\" ></td></tr>";
 		echo "<tr><td colspan=\"5\"><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{
@@ -249,8 +236,6 @@
 	$i=0;
 	echo "</td></tr></table></form>";
-############
 	echo "<hr><br><table width=\"100%\" border=\"3\">";
 	echo "<tr align=\"center\"><td width=\"15%\" bgcolor=\"$bgcolor1\"><b>"._CONSULTA."TEST:$id_cons_comu</b></td>";
-#	echo "<td bgcolor=\"$bgcolor1\"><b>"._COLLEGI."</b></td>";
 	echo "<td width=\"20%\" bgcolor=\"$bgcolor1\"><b>"._DEFCOMUNE."</b></td>";
 	echo "<td width=\"10%\" bgcolor=\"$bgcolor1\"><b>"._PREFERENZE."</b></td>";
@@ -263,11 +248,6 @@
 	echo "<td width=\"10%\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._ASOLO_GRUPPO."</b></td>";
 	echo "<td width=\"10%\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._DISGIUNTO."</b></td>";
-#	echo "<td width=\"10%\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._SG."</b></td>";
-	echo "<td width=\"10\" bgcolor=\"$bgcolor1\"><b>&nbsp;"._FUNZIONI."</td></tr>";
-###############
-
-#	if ($num_coll>0)
-#	$resmod = mysql_query("SELECT t1.id_collegio,t1.id_comune,t2.descrizione as descr,t1.id_cons, t3.descrizione, t4.chiusa,t4.id_conf FROM ".$prefix."_ele_comu_collegi as t1, ".$prefix."_ele_collegi as t2, ".$prefix."_ele_comuni as t3, ".$prefix."_ele_cons_comune as t4 where t1.id_cons_gen='$id_cons_gen' and t1.id_collegio=t2.id_collegio and t1.id_comune=t3.id_comune and t1.id_comune=t4.id_comune and t2.id_cons_gen=t4.id_cons_gen order by t2.descrizione, t3.descrizione", $dbi);
-#	else
+	echo "<td width=\"10\" bgcolor=\"$bgcolor1\"><b>&nbsp;"._FUNZIONI."</b></td></tr>";
+
 	$resmod = mysql_query("SELECT '',t1.id_comune,'',t1.id_cons, t2.descrizione, t1.chiusa, t1.id_conf, preferenze,t1.id_fascia,t1.vismf,t1.solo_gruppo,t1.disgiunto FROM ".$prefix."_ele_cons_comune as t1, ".$prefix."_ele_comuni as t2 where t1.id_cons_gen='$id_cons_gen' and t1.id_comune=t2.id_comune order by t2.descrizione", $dbi);
 	while (list($id_collegio,$id_comune2,$descr_coll,$id_cons_comu,$descr_comu, $chiusa,$id_conf,$preferenze2,$fasciacom,$vismf2,$sg2,$disgiunto2) = mysql_fetch_row($resmod)){ //elenco dei modelli inseriti
@@ -276,9 +256,35 @@
 		$i++;
 		$bgcolor1=($bgcolor1==$_SESSION['bgcolor1'])?$_SESSION['bgcolor2']:$_SESSION['bgcolor1'];
-		if($tipo_cons==3) echo "<tr><td colspan=\"8\">"; else echo "<tr><td colspan=\"8\">";
+		echo "<tr align=\"center\" bgcolor=\"$bgcolor1\">";
+		echo "<td><b>$descr_cons</b></td>";
+		echo "<td><b>$descr_comu</b></td>";
+		echo "<td><b>$preferenze2</b></td>";
+		$stato['0']=_ATTIVA;
+		$stato['1']=_CHIUSA;
+		$stato['2']=_NULLA;
+		echo "<td><b>".$stato[$chiusa]."</b></td>";
+		if($tipo_cons==3){
+			echo "<td><b>".$descr_conf."</b></td>";
+			$rescomu = mysql_query("SELECT id_fascia,abitanti from ".$prefix."_ele_fasce where id_conf='$id_conf'", $dbi);
+			$inffascia=0;
+			if (mysql_num_rows($rescomu)==0) echo "<td></td>";
+			while(list($id,$abitanti)=mysql_fetch_row($rescomu)){
+				$sel='';
+				if ($id == $fasciacom) 
+					echo "<td>$inffascia - $abitanti</td>";
+				$inffascia=$abitanti;
+			}
+
+		}
+		if ($vismf2==0) $sel=_NO; else $sel=_SI;
+		echo "<td>$sel</td>";
+		if ($sg2==0) $sel=_NO; else $sel=_SI;
+		echo "<td>$sel</td>";
+		if ($disgiunto2==0) $sel=_NO; else $sel=_SI;
+		echo "<td>$sel</td>";
+		echo "<td>";
 		echo "<form name=\"modello$i\" action=\"admin.php\">"
-			."<input type=\"hidden\" name=\"op\" value=\"associazioni\">";
-//		echo "<input type=\"hidden\" name=\"do\" value=\"update\">";
-#		echo "<input type=\"hidden\" name=\"id_collegio\" value=\"$id_collegio\">";
+		."<input type=\"hidden\" name=\"op\" value=\"associazioni\">";
+		echo "<input type=\"hidden\" name=\"id_conf\" value=\"$id_conf\">";
 		echo "<input type=\"hidden\" name=\"idcomune\" value=\"$id_comune2\">";
 		echo "<input type=\"hidden\" name=\"id_cons_comu\" value=\"$id_cons_comu\">";
@@ -287,39 +293,9 @@
 		echo "<input type=\"hidden\" name=\"preferenze\" value=\"$preferenze2\">";
 		echo "<input type=\"hidden\" name=\"chiusa\" value=\"$chiusa\">";
-		echo "<table width=\"100%\"><tr align=\"center\" bgcolor=\"$bgcolor1\">";
-		echo "<td width=\"15%\"><b>$descr_cons</b></td>";
-		echo "<td width=\"20%\"><b>$descr_comu</b></td>";
-		echo "<td width=\"10%\"><b>$preferenze2</b></td>";
-		$stato['0']=_ATTIVA;
-		$stato['1']=_CHIUSA;
-		$stato['2']=_NULLA;
-		echo "<td  width=\"10%\"><b>".$stato[$chiusa]."</b></td>";
-		if($tipo_cons==3){
-			echo "<td width=\"20%\"><input type=\"hidden\" name=\"id_conf\" value=\"$id_conf\"><b>".$descr_conf."</b></td>";
-			$rescomu = mysql_query("SELECT id_fascia,abitanti from ".$prefix."_ele_fasce where id_conf='$id_conf'", $dbi);
-			$inffascia=0;
-			while(list($id,$abitanti)=mysql_fetch_row($rescomu)){
-				$sel='';
-				if ($id == $fasciacom) 
-					echo "<td width=\"20%\">$inffascia - $abitanti</td>";
-				$inffascia=$abitanti;
-			}
-
-		}
-		if ($vismf2==0) $sel=_NO; else $sel=_SI;
-		echo "<td width=\"10%\">$sel</td>";
-		if ($sg2==0) $sel=_NO; else $sel=_SI;
-		echo "<td width=\"10%\">$sel</td>";
-		if ($disgiunto2==0) $sel=_NO; else $sel=_SI;
-		echo "<td width=\"10%\">$sel</td>";
-#		if ($sg==0) $sel=_NO; else $sel=_SI;
-#		echo "<td width=\"10%\">$sel</td>";
-		echo "<td width=\"10\"><input type=\"hidden\" name=\"ok\" value=0><input type=\"submit\" name=\"edit$i\" value=\""._EDIT."\">"
-			."</td></tr></table></form></td></tr>\n";
-	}
-		echo "</table></td></tr>";
-		echo "</table></td></tr>";
+		echo "<input type=\"hidden\" name=\"ok\" value=0><input type=\"submit\" name=\"edit$i\" value=\""._EDIT."\">"
+			."</form></td></tr>\n";
+	}
+		echo "</table></td></tr></table>";
 	CloseTable();
-#	echo "</div>";
 	}
 
@@ -386,5 +362,4 @@
 
 
-#	die ("do:$do - id_cons:$id_cons_comu - idcomune:$id_comune - new: $idcomunenew");
 	
 //****************************
