source: trunk/admin/modules/Elezioni/foto.php@ 254

Last change on this file since 254 was 254, checked in by roby, 6 years ago

adeguata la funzione di installazione al php7

File size: 2.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 visualizzazione immagini blob */
9/* Amministrazione */
10/************************************************************************/
11
12if (!defined('ADMIN_FILE')) {
13 die ("You can't access this file directly...");
14}
15//session_start();
16$aid=$_SESSION['aid'];
17if (!$aid) return;
18
19$param=strtolower($_SERVER['REQUEST_METHOD']) == 'get' ? $_GET : $_POST;
20
21if (isset($param['id_lista'])) $id_lista=intval($param['id_lista']); else $id_lista='';
22if (isset($param['id_gruppo'])) $id_gruppo=intval($param['id_gruppo']); else $id_gruppo='';
23if (isset($param['id_sede'])) $id_sede=intval($param['id_sede']); else $id_sede='';
24if (isset($param['id_comune'])) $id_comune2=intval($param['id_comune']); else $id_comune2='';
25if (isset($param['prefix'])) $prefix=$param['prefix'];
26
27
28
29if ($id_lista){
30 $sql = "select stemma from ".$prefix."_ele_lista where id_lista=".$id_lista;
31 $res = mysql_query($sql,$dbi);
32 list($stemma) = mysql_fetch_row($res);
33}elseif ($id_gruppo){
34 $sql = "select stemma from ".$prefix."_ele_gruppo where id_gruppo=".$id_gruppo;
35 $res = mysql_query($sql,$dbi);
36 list($stemma) = mysql_fetch_row($res);
37}elseif ($id_sede){
38 $sql = "select mappa from ".$prefix."_ele_sede where id_sede=".$id_sede;
39 $res = mysql_query($sql,$dbi);
40 list($stemma) = mysql_fetch_row($res);
41}elseif ($id_comune2){
42 $sql = "select stemma from ".$prefix."_ele_comuni where id_comune=".$id_comune2;
43 $res = mysql_query($sql,$dbi);
44 list($stemma) = mysql_fetch_row($res);
45}else{
46return;
47}
48
49
50// nessuno stemma immagine vuota
51if ($stemma==""){
52
53$sql = "select stemma from ".$prefix."_ele_conf where id_com='0'";
54$res = mysql_query($sql,$dbi);
55if($res)
56 {
57 $dati = mysql_fetch_array($res);
58 $stemma = $dati['stemma'];
59 }
60}
61echo $stemma;
62?>
Note: See TracBrowser for help on using the repository browser.