source: trunk/admin/modules/Elezioni/scarica.php@ 282

Last change on this file since 282 was 257, checked in by roby, 6 years ago
File size: 5.2 KB
Line 
1<?php
2/************************************************************************/
3/* Eleonline - Raccolta e diffusione dei dati elettorali */
4/* by Roberto Gigli & Luciano Apolito */
5/* http://www.eleonline.it */
6/* info@eleonline.it luciano@aniene.net rgigli@libero.it */
7/************************************************************************/
8/* Modulo gruppo */
9/* Amministrazione */
10/************************************************************************/
11if (!defined('ADMIN_FILE')) {
12 die ("You can't access this file directly...");
13}
14
15global $dbi;
16$aid=$_SESSION['aid'];
17$prefix=$_SESSION['prefix'];
18$currentlang=$_SESSION['lang'];
19$param=strtolower($_SERVER['REQUEST_METHOD']) == 'get' ? $_GET : $_POST;
20$id_cons_gen=intval($param['id_cons_gen']);
21$perms=ChiSei($id_cons_gen);
22if ($perms<32 or !$id_cons_gen) die("Non hai i permessi per inserire dati, o non hai scelto la consultazione!");
23$id_comune=$_SESSION['id_comune'];
24//$res = mysql_query("SELECT t1.tipo_cons,t2.id_cons 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);
25//list($tipo_cons,$id_cons) = mysql_fetch_row($res);
26
27include("modules/Elezioni/funzionidata.php");
28include("modules/Elezioni/ele.php");
29
30if (isset($_GET['help'])) $help=intval($_GET['help']);
31if (isset($param['fase'])) $fase=intval($param['fase']); else $fase=0;
32if (isset($param['id_cons_gen2'])) $id_cons_gen2=intval($param['id_cons_gen2']); else $id_cons_gen2='';
33if (isset($param['indirizzoweb'])) get_magic_quotes_gpc() ? $indirizzoweb=$param['indirizzoweb']:$indirizzoweb=addslashes($param['indirizzoweb']); else $indirizzoweb='http://www.eleonline.it/moduli/eleonline2/client/';
34if (isset($param['id_comune2'])) $id_comune2=intval($param['id_comune2']); else $id_comune2='';
35
36/******************************************************/
37/*Funzione di visualizzazione globale */
38/*****************************************************/
39function all() {
40 global $prefix, $dbi,$id_cons_gen,$id_comune,$indirizzoweb,$id_cons_gen2,$id_comune2,$fase,$help,$language;
41 if (isset($help)) include("language/$language/ele_scarica.html");
42
43$bgcolor1=$_SESSION['bgcolor1'];
44$bgcolor2=$_SESSION['bgcolor2'];
45
46if ($fase=='0'){
47
48 echo "<form name=\"import\" action=\"admin.php\">";
49 echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">";
50 echo "<td><b>"._INDIRIZZOWEB1."</b></td>";
51 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>";
52 echo "<td><input type=\"submit\" name=\"add\" value=\""._OK."\"></td>";
53echo "</tr></table><br>";
54 echo "</form>";
55}elseif ($fase=='1'){
56$rem_cons="<script type=\"text/javascript\" src=\"$indirizzoweb/file.php?fase=1\"></script>";
57
58 echo "<form name=\"import\" action=\"admin.php\">";
59 echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">";
60 echo "<td><b>"._INDIRIZZOWEB1."</b></td>";
61 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>";
62 echo "<tr><td><b>"._SCARICACONS."</b></td>";
63
64 echo "<td>$rem_cons</td></tr>";
65
66 echo "<tr><td><input type=\"submit\" name=\"add\" value=\""._OK."\"></td>";
67
68echo "</tr></table><br>";
69 echo "</form>";
70 }elseif($fase=='2'){
71
72$sql="SELECT descrizione from ".$prefix."_ele_consultazione WHERE id_cons_gen=$id_cons_gen2";
73$res = $dbi->prepare("$sql");
74$res->execute();
75list($descrcons) = $res->fetch(PDO::FETCH_NUM);
76$rem_cons="<script type=\"text/javascript\" src=\"$indirizzoweb/file.php?fase=2&id_cons_gen2=$id_cons_gen2\"></script>";
77
78 echo "<form name=\"import\" action=\"admin.php\">";
79 echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">";
80 echo "<td><b>"._INDIRIZZOWEB1."</b></td>";
81 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>";
82$cons_rem=intval($_GET[($id_cons_gen2)]);
83echo "<tr><td><b>"._CONSULTA.":</b></td><td>$cons_rem</td></tr>";
84 echo "<tr><td><b>"._SCELTACOMUNE."</b></td><td>$rem_cons</td></tr>";
85
86 echo "<tr><td><input type=\"submit\" name=\"add\" value=\""._OK."\"></td>";
87
88echo "</tr></table><br>";
89 echo "</form>";
90
91 }elseif ($fase=='3'){
92
93$id_cons_gen2=$_GET['id_cons_gen2'];
94$id_comune2=$_GET['id_comune2'];
95Header("Location: $indirizzoweb/modules.php?op=backup&id_cons_gen=$id_cons_gen2&id_comune=$id_comune2");
96
97 }
98}
99
100if ($fase!='3') ele();
101all();
102echo"</td></tr></table>";
103include("footer.php");
104
105
106
107
108?>
Note: See TracBrowser for help on using the repository browser.