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

Last change on this file since 144 was 80, checked in by roby, 15 years ago

client - correzione per consultazione predefinita
admin - eliminati altri notice, modificata la funzione di visualizzazione della barra di elenco delle sezioni, aggiunti help per Scarica liste e Importa liste, corrette alcune incompatibilità con xhtml

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
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($_GET['help'])) $help=intval($_GET['help']);
32if (isset($param['fase'])) $fase=intval($param['fase']); else $fase=0;
33if (isset($param['id_cons_gen2'])) $id_cons_gen2=intval($param['id_cons_gen2']); else $id_cons_gen2='';
34if (isset($param['indirizzoweb'])) get_magic_quotes_gpc() ? $indirizzoweb=$param['indirizzoweb']:$indirizzoweb=addslashes($param['indirizzoweb']); else $indirizzoweb='http://www.eleonline.it/moduli/eleonline2/client/';
35if (isset($param['id_comune2'])) $id_comune2=intval($param['id_comune2']); else $id_comune2='';
36
37/******************************************************/
38/*Funzione di visualizzazione globale */
39/*****************************************************/
40function all() {
41 global $prefix, $dbi,$id_cons_gen,$id_comune,$indirizzoweb,$id_cons_gen2,$id_comune2,$fase,$help,$language;
42 if (isset($help)) include("language/$language/ele_scarica.html");
43
44$bgcolor1=$_SESSION['bgcolor1'];
45$bgcolor2=$_SESSION['bgcolor2'];
46
47if ($fase=='0'){
48
49 echo "<form name=\"import\" action=\"admin.php\">";
50 echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">";
51 echo "<td><b>"._INDIRIZZOWEB1."</b></td>";
52 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>";
53 echo "<td><input type=\"submit\" name=\"add\" value=\""._OK."\"></td>";
54echo "</tr></table><br>";
55 echo "</form>";
56}elseif ($fase=='1'){
57$rem_cons="<script type=\"text/javascript\" src=\"$indirizzoweb/file.php?fase=1\"></script>";
58
59 echo "<form name=\"import\" action=\"admin.php\">";
60 echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">";
61 echo "<td><b>"._INDIRIZZOWEB1."</b></td>";
62 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>";
63 echo "<tr><td><b>"._SCARICACONS."</b></td>";
64
65 echo "<td>$rem_cons</td></tr>";
66
67 echo "<tr><td><input type=\"submit\" name=\"add\" value=\""._OK."\"></td>";
68
69echo "</tr></table><br>";
70 echo "</form>";
71 }elseif($fase=='2'){
72
73$res = mysql_query("SELECT descrizione from ".$prefix."_ele_consultazione WHERE id_cons_gen=$id_cons_gen2",$dbi);
74list($descrcons) = mysql_fetch_row($res);
75$rem_cons="<script type=\"text/javascript\" src=\"$indirizzoweb/file.php?fase=2&id_cons_gen2=$id_cons_gen2\"></script>";
76
77 echo "<form name=\"import\" action=\"admin.php\">";
78 echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">";
79 echo "<td><b>"._INDIRIZZOWEB1."</b></td>";
80 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>";
81$cons_rem=$_GET[($id_cons_gen2)];
82echo "<tr><td><b>"._CONSULTA.":</b></td><td>$cons_rem</td></tr>";
83 echo "<tr><td><b>"._SCELTACOMUNE."</b></td><td>$rem_cons</td></tr>";
84
85 echo "<tr><td><input type=\"submit\" name=\"add\" value=\""._OK."\"></td>";
86
87echo "</tr></table><br>";
88 echo "</form>";
89
90 }elseif ($fase=='3'){
91
92$id_cons_gen2=$_GET['id_cons_gen2'];
93$id_comune2=$_GET['id_comune2'];
94Header("Location: $indirizzoweb/modules.php?op=backup&id_cons_gen=$id_cons_gen2&id_comune=$id_comune2");
95
96 }
97}
98
99if ($fase!='3') ele();
100all();
101echo"</td></tr></table>";
102include("footer.php");
103
104
105
106
107?>
Note: See TracBrowser for help on using the repository browser.