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

Last change on this file since 257 was 257, checked in by roby, 5 years ago
File size: 2.3 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 = $dbi->prepare("$sql");
32 $res->execute();
33 list($stemma) = $res->fetch(PDO::FETCH_NUM);
34}elseif ($id_gruppo){
35 $sql = "select stemma from ".$prefix."_ele_gruppo where id_gruppo=".$id_gruppo;
36 $res = $dbi->prepare("$sql");
37 $res->execute();
38 list($stemma) = $res->fetch(PDO::FETCH_NUM);
39}elseif ($id_sede){
40 $sql = "select mappa from ".$prefix."_ele_sede where id_sede=".$id_sede;
41 $res = $dbi->prepare("$sql");
42 $res->execute();
43 list($stemma) = $res->fetch(PDO::FETCH_NUM);
44}elseif ($id_comune2){
45 $sql = "select stemma from ".$prefix."_ele_comuni where id_comune=".$id_comune2;
46 $res = $dbi->prepare("$sql");
47 $res->execute();
48 list($stemma) = $res->fetch(PDO::FETCH_NUM);
49}else{
50return;
51}
52
53
54// nessuno stemma immagine vuota
55if ($stemma==""){
56
57$sql = "select stemma from ".$prefix."_ele_comuni where id_comune='0'";
58$res = $dbi->prepare("$sql");
59$res->execute();
60if($res->rowCount())
61 {
62 $dati = $res->fetch(PDO::FETCH_BOTH);
63 $stemma = $dati['stemma'];
64 }
65}
66echo $stemma;
67?>
Note: See TracBrowser for help on using the repository browser.