Index: trunk/admin/modules/Elezioni/scarica.php
===================================================================
--- trunk/admin/modules/Elezioni/scarica.php	(revision 344)
+++ trunk/admin/modules/Elezioni/scarica.php	(revision 360)
@@ -29,7 +29,7 @@
 if (isset($param['fase'])) $fase=intval($param['fase']); else $fase=0;
 if (isset($param['id_cons_gen2'])) $id_cons_gen2=intval($param['id_cons_gen2']); else $id_cons_gen2='0';
-if (isset($param['indirizzoweb'])) $indirizzoweb=addslashes($param['indirizzoweb']); else $indirizzoweb='http://www.eleonline.it/client/';
+if (isset($param['indirizzoweb'])) $indirizzoweb=addslashes($param['indirizzoweb']); else $indirizzoweb='https://www.eleonline.it/client/';
 if (isset($param['id_comune2'])) $id_comune2=intval($param['id_comune2']); else $id_comune2='0';
-
+# htmlentities($param['indirizzoweb'], ENT_COMPAT, 'UTF-8')
 /******************************************************/
 /*Funzione di visualizzazione globale                 */
@@ -39,58 +39,46 @@
 	if (isset($help)) include("language/$language/ele_scarica.html");
 
-$bgcolor1=$_SESSION['bgcolor1'];
-$bgcolor2=$_SESSION['bgcolor2'];
-
-if ($fase=='0'){
-
-	echo "<form name=\"import\" action=\"admin.php\">";
-	echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">";
-	echo "<td><b>"._INDIRIZZOWEB1."</b></td>";
-	echo "<td><input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"><input type=\"hidden\" name=\"op\" value=\"scarica\"><input type=\"hidden\" name=\"fase\" value=\"1\"><input type=\"text\" name=\"indirizzoweb\" size=\"50\" value=\"".$indirizzoweb."\"></td></tr>";
-	echo "<td><input type=\"submit\" name=\"add\" value=\""._OK."\"></td>";
-echo "</tr></table><br>";
-	echo "</form>";
-}elseif ($fase=='1'){
-$rem_cons="<script type=\"text/javascript\" src=\"$indirizzoweb/file.php?fase=1\"></script>";
-
-	echo "<form name=\"import\" action=\"admin.php\">";
-	echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">";
-	echo "<td><b>"._INDIRIZZOWEB1."</b></td>";
-	echo "<td><input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"><input type=\"hidden\" name=\"op\" value=\"scarica\"><input type=\"hidden\" name=\"fase\" value=\"2\"><input type=\"hidden\" name=\"indirizzoweb\" value=\"$indirizzoweb\">$indirizzoweb</td></tr>";
-	echo "<tr><td><b>"._SCARICACONS."</b></td>";
-
-	echo "<td>$rem_cons</td></tr>";
-
+	$bgcolor1=$_SESSION['bgcolor1'];
+	$bgcolor2=$_SESSION['bgcolor2'];
+	if ($fase=='0'){
+		echo "<form name=\"import\" action=\"admin.php\">";
+		echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">";
+		echo "<td><b>"._INDIRIZZOWEB1."</b></td>";
+		echo "<td><input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"><input type=\"hidden\" name=\"op\" value=\"scarica\"><input type=\"hidden\" name=\"fase\" value=\"1\"><input type=\"text\" name=\"indirizzoweb\" size=\"50\" value=\"".$indirizzoweb."\"></td></tr>";
+		echo "<td><input type=\"submit\" name=\"add\" value=\""._OK."\"></td>";
+		echo "</tr></table><br>";
+		echo "</form>";
+	}elseif ($fase=='1'){
+		$urlrem="$indirizzoweb/file.php?fase=1";
+		$rem_cons="<script type=\"text/javascript\" src=\"$urlrem\" crossorigin=\"anonymous\"></script>";
+		echo "<form name=\"import\" action=\"admin.php\">";
+		echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">";
+		echo "<td><b>"._INDIRIZZOWEB1."</b></td>";
+		echo "<td><input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"><input type=\"hidden\" name=\"op\" value=\"scarica\"><input type=\"hidden\" name=\"fase\" value=\"2\"><input type=\"hidden\" name=\"indirizzoweb\" value=\"$indirizzoweb\">$indirizzoweb</td></tr>";
+		echo "<tr><td><b>"._SCARICACONS."</b></td>";
+		echo "<td>".$rem_cons."</td></tr>";
 		echo "<tr><td><input type=\"submit\" name=\"add\" value=\""._OK."\"></td>";
-
-echo "</tr></table><br>";
-	echo "</form>";
+		echo "</tr></table><br>";
+		echo "</form>";
 	}elseif($fase=='2'){
-
-$sql="SELECT descrizione from ".$prefix."_ele_consultazione WHERE id_cons_gen=$id_cons_gen2";
-$res = $dbi->prepare("$sql");
-$res->execute();
-list($descrcons) = $res->fetch(PDO::FETCH_NUM);
-$rem_cons="<script type=\"text/javascript\" src=\"$indirizzoweb/file.php?fase=2&id_cons_gen2=$id_cons_gen2\"></script>";
-
-	echo "<form name=\"import\" action=\"admin.php\">";
-	echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">";
-	echo "<td><b>"._INDIRIZZOWEB1."</b></td>";
-	echo "<td><input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"><input type=\"hidden\" name=\"op\" value=\"scarica\"><input type=\"hidden\" name=\"fase\" value=\"3\"><input type=\"hidden\" name=\"indirizzoweb\" value=\"$indirizzoweb\">$indirizzoweb</td></td></tr>";
-$cons_rem=addslashes($_GET[($id_cons_gen2)]);
-echo "<tr><td><b>"._CONSULTA.":</b></td><td>$cons_rem</td></tr>";
-	echo "<tr><td><b>"._SCELTACOMUNE."</b></td><td>$rem_cons</td></tr>";
-
+		$sql="SELECT descrizione from ".$prefix."_ele_consultazione WHERE id_cons_gen=$id_cons_gen2";
+		$res = $dbi->prepare("$sql");
+		$res->execute();
+		list($descrcons) = $res->fetch(PDO::FETCH_NUM);
+		$rem_cons="<script type=\"text/javascript\" src=\"$indirizzoweb/file.php?fase=2&id_cons_gen2=$id_cons_gen2\"></script>";
+		echo "<form name=\"import\" action=\"admin.php\">";
+		echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">";
+		echo "<td><b>"._INDIRIZZOWEB1."</b></td>";
+		echo "<td><input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"><input type=\"hidden\" name=\"op\" value=\"scarica\"><input type=\"hidden\" name=\"fase\" value=\"3\"><input type=\"hidden\" name=\"indirizzoweb\" value=\"$indirizzoweb\">$indirizzoweb</td></td></tr>";
+		$cons_rem=addslashes($_GET[($id_cons_gen2)]);
+		echo "<tr><td><b>"._CONSULTA.":</b></td><td>$cons_rem</td></tr>";
+		echo "<tr><td><b>"._SCELTACOMUNE."</b></td><td>$rem_cons</td></tr>";
 		echo "<tr><td><input type=\"submit\" name=\"add\" value=\""._OK."\"></td>";
-
-echo "</tr></table><br>";
-	echo "</form>";
-
+		echo "</tr></table><br>";
+		echo "</form>";
 	}elseif ($fase=='3'){
-
-$id_cons_gen2=$_GET['id_cons_gen2'];
-$id_comune2=$_GET['id_comune2'];
-Header("Location: $indirizzoweb/modules.php?op=backup&id_cons_gen=$id_cons_gen2&id_comune=$id_comune2");
-
+		$id_cons_gen2=$_GET['id_cons_gen2'];
+		$id_comune2=$_GET['id_comune2'];
+		Header("Location: $indirizzoweb/modules.php?op=backup&id_cons_gen=$id_cons_gen2&id_comune=$id_comune2");
 	} 
 }
