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

Last change on this file since 404 was 364, checked in by roby, 3 years ago

adeguamento di alcune query alla direttiva sql_mode=only_full_group_by di mysql, sistemazione di alcuni bug.

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
[257]15global $dbi;
[2]16$aid=$_SESSION['aid'];
17$prefix=$_SESSION['prefix'];
[344]18$language=$_SESSION['lang'];
[2]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
25include("modules/Elezioni/funzionidata.php");
26include("modules/Elezioni/ele.php");
27
[80]28if (isset($_GET['help'])) $help=intval($_GET['help']);
[2]29if (isset($param['fase'])) $fase=intval($param['fase']); else $fase=0;
[284]30if (isset($param['id_cons_gen2'])) $id_cons_gen2=intval($param['id_cons_gen2']); else $id_cons_gen2='0';
[360]31if (isset($param['indirizzoweb'])) $indirizzoweb=addslashes($param['indirizzoweb']); else $indirizzoweb='https://www.eleonline.it/client/';
[284]32if (isset($param['id_comune2'])) $id_comune2=intval($param['id_comune2']); else $id_comune2='0';
[360]33# htmlentities($param['indirizzoweb'], ENT_COMPAT, 'UTF-8')
[2]34/******************************************************/
35/*Funzione di visualizzazione globale */
36/*****************************************************/
37function all() {
[80]38 global $prefix, $dbi,$id_cons_gen,$id_comune,$indirizzoweb,$id_cons_gen2,$id_comune2,$fase,$help,$language;
39 if (isset($help)) include("language/$language/ele_scarica.html");
[2]40
[360]41 $bgcolor1=$_SESSION['bgcolor1'];
42 $bgcolor2=$_SESSION['bgcolor2'];
43 if ($fase=='0'){
44 echo "<form name=\"import\" action=\"admin.php\">";
45 echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">";
46 echo "<td><b>"._INDIRIZZOWEB1."</b></td>";
47 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>";
48 echo "<td><input type=\"submit\" name=\"add\" value=\""._OK."\"></td>";
49 echo "</tr></table><br>";
50 echo "</form>";
51 }elseif ($fase=='1'){
52 $urlrem="$indirizzoweb/file.php?fase=1";
[364]53 $rem_cons="<script type=\"text/javascript\" src=\"$urlrem\"></script>";
[360]54 echo "<form name=\"import\" action=\"admin.php\">";
55 echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">";
56 echo "<td><b>"._INDIRIZZOWEB1."</b></td>";
57 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>";
58 echo "<tr><td><b>"._SCARICACONS."</b></td>";
59 echo "<td>".$rem_cons."</td></tr>";
[2]60 echo "<tr><td><input type=\"submit\" name=\"add\" value=\""._OK."\"></td>";
[360]61 echo "</tr></table><br>";
62 echo "</form>";
[2]63 }elseif($fase=='2'){
[360]64 $sql="SELECT descrizione from ".$prefix."_ele_consultazione WHERE id_cons_gen=$id_cons_gen2";
65 $res = $dbi->prepare("$sql");
66 $res->execute();
67 list($descrcons) = $res->fetch(PDO::FETCH_NUM);
68 $rem_cons="<script type=\"text/javascript\" src=\"$indirizzoweb/file.php?fase=2&id_cons_gen2=$id_cons_gen2\"></script>";
69 echo "<form name=\"import\" action=\"admin.php\">";
70 echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">";
71 echo "<td><b>"._INDIRIZZOWEB1."</b></td>";
72 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>";
73 $cons_rem=addslashes($_GET[($id_cons_gen2)]);
74 echo "<tr><td><b>"._CONSULTA.":</b></td><td>$cons_rem</td></tr>";
75 echo "<tr><td><b>"._SCELTACOMUNE."</b></td><td>$rem_cons</td></tr>";
[2]76 echo "<tr><td><input type=\"submit\" name=\"add\" value=\""._OK."\"></td>";
[360]77 echo "</tr></table><br>";
78 echo "</form>";
[2]79 }elseif ($fase=='3'){
[360]80 $id_cons_gen2=$_GET['id_cons_gen2'];
81 $id_comune2=$_GET['id_comune2'];
82 Header("Location: $indirizzoweb/modules.php?op=backup&id_cons_gen=$id_cons_gen2&id_comune=$id_comune2");
[2]83 }
84}
85
86if ($fase!='3') ele();
87all();
88echo"</td></tr></table>";
89include("footer.php");
90
91
92
93
94?>
Note: See TracBrowser for help on using the repository browser.