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

Last change on this file since 2 was 2, checked in by root, 15 years ago

importo il progetto

File size: 5.0 KB
RevLine 
[2]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
15
16$aid=$_SESSION['aid'];
17$dbi=$_SESSION['dbi'];
18$prefix=$_SESSION['prefix'];
19$currentlang=$_SESSION['lang'];
20$param=strtolower($_SERVER['REQUEST_METHOD']) == 'get' ? $_GET : $_POST;
21$id_cons_gen=intval($param['id_cons_gen']);
22$perms=ChiSei($id_cons_gen);
23if ($perms<32 or !$id_cons_gen) die("Non hai i permessi per inserire dati, o non hai scelto la consultazione!");
24$id_comune=$_SESSION['id_comune'];
25//$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);
26//list($tipo_cons,$id_cons) = mysql_fetch_row($res);
27
28include("modules/Elezioni/funzionidata.php");
29include("modules/Elezioni/ele.php");
30
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;
41
42$bgcolor1=$_SESSION['bgcolor1'];
43$bgcolor2=$_SESSION['bgcolor2'];
44
45if ($fase=='0'){
46
47 echo "<form name=\"import\" action=\"admin.php\">";
48 echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">";
49 echo "<td><b>"._INDIRIZZOWEB1."</b></td>";
50 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>";
51 echo "<td><input type=\"submit\" name=\"add\" value=\""._OK."\"></td>";
52echo "</tr></table><br>";
53 echo "</form>";
54}elseif ($fase=='1'){
55$rem_cons="<script type=\"text/javascript\" src=\"$indirizzoweb/file.php?fase=1\"></script>";
56
57 echo "<form name=\"import\" action=\"admin.php\">";
58 echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">";
59 echo "<td><b>"._INDIRIZZOWEB1."</b></td>";
60 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>";
61 echo "<tr><td><b>"._SCARICACONS."</b></td>";
62
63 echo "<td>$rem_cons</td></tr>";
64
65 echo "<tr><td><input type=\"submit\" name=\"add\" value=\""._OK."\"></td>";
66
67echo "</tr></table><br>";
68 echo "</form>";
69 }elseif($fase=='2'){
70
71$res = mysql_query("SELECT descrizione from ".$prefix."_ele_consultazione WHERE id_cons_gen=$id_cons_gen2",$dbi);
72list($descrcons) = mysql_fetch_row($res);
73$rem_cons="<script type=\"text/javascript\" src=\"$indirizzoweb/file.php?fase=2&id_cons_gen2=$id_cons_gen2\"></script>";
74
75 echo "<form name=\"import\" action=\"admin.php\">";
76 echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">";
77 echo "<td><b>"._INDIRIZZOWEB1."</b></td>";
78 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>";
79$cons_rem=$_GET[($id_cons_gen2)];
80echo "<tr><td><b>"._CONSULTA.":</b></td><td>$cons_rem</td></tr>";
81 echo "<tr><td><b>"._SCELTACOMUNE."</b></td><td>$rem_cons</td></tr>";
82
83 echo "<tr><td><input type=\"submit\" name=\"add\" value=\""._OK."\"></td>";
84
85echo "</tr></table><br>";
86 echo "</form>";
87
88 }elseif ($fase=='3'){
89
90$id_cons_gen2=$_GET['id_cons_gen2'];
91$id_comune2=$_GET['id_comune2'];
92Header("Location: $indirizzoweb/modules.php?op=backup&id_cons_gen=$id_cons_gen2&id_comune=$id_comune2");
93
94 }
95}
96
97if ($fase!='3') ele();
98all();
99echo"</td></tr></table>";
100include("footer.php");
101
102
103
104
105?>
Note: See TracBrowser for help on using the repository browser.