source: trunk/client/modules/Elezioni/foto.php@ 354

Last change on this file since 354 was 265, checked in by roby, 5 years ago
File size: 2.6 KB
Line 
1<?php
2/************************************************************************/
3/* Eleonline - Raccolta e diffusione dei dati elettorali */
4/* by Luciano Apolito & Roberto Gigli */
5/* http://www.eleonline.it */
6/* info@eleonline.it luciano@aniene.net rgigli@libero.it */
7/************************************************************************/
8
9if (!defined('MODULE_FILE')) {
10 die ("You can't access this file dirrectly...");
11}
12
13
14$param=strtolower($_SERVER['REQUEST_METHOD']) == 'get' ? $_GET : $_POST;
15
16if (isset($param['id_lista'])) $id_lista=intval($param['id_lista']); else $id_lista='';
17if (isset($param['id_gruppo'])) $id_gruppo=intval($param['id_gruppo']); else $id_gruppo='';
18if (isset($param['id_sede'])) $id_sede=intval($param['id_sede']); else $id_sede='';
19if (isset($param['id_comune'])) $id_comune=intval($param['id_comune']); else $id_comune='';
20if (isset($param['prefix'])) $prefix=$param['prefix'];
21if (isset($param['pdfvis'])) $pdf=$param['pdfvis'];
22
23if ($id_lista){
24 $sql = "select stemma from ".$prefix."_ele_lista where id_lista='$id_lista'";
25 $res = $dbi->prepare("$sql");
26 $res->execute();
27
28 list($stemma) = $res->fetch(PDO::FETCH_NUM);
29}elseif ($id_gruppo){
30 $sql = "select programma,stemma from ".$prefix."_ele_gruppo where id_gruppo='$id_gruppo'";
31 $res = $dbi->prepare("$sql");
32 $res->execute();
33
34 list($programma,$stemma) = $res->fetch(PDO::FETCH_NUM);
35 if(isset($pdf)) $stemma = $programma;
36}elseif ($id_sede){
37 $sql = "select mappa from ".$prefix."_ele_sede where id_sede='$id_sede'";
38 $res = $dbi->prepare("$sql");
39 $res->execute();
40
41 list($stemma) = $res->fetch(PDO::FETCH_NUM);
42}elseif ($id_comune){
43 $sql = "select stemma from ".$prefix."_ele_comuni where id_comune='$id_comune'";
44 $res = $dbi->prepare("$sql");
45 $res->execute();
46
47 list($stemma) = $res->fetch(PDO::FETCH_NUM);
48}else{
49die();
50}
51
52
53// nessuno stemma immagine vuota
54if ($stemma=="" && is_readable('modules/Elezioni/images/vuoto.jpg')){
55 $stemma = fread( fopen( 'modules/Elezioni/images/vuoto.jpg', 'r' ), filesize( 'modules/Elezioni/images/vuoto.jpg' ) );}
56if(isset($pdf))
57{
58 if (strstr($_SERVER['HTTP_USER_AGENT'],"MSIE"))
59 {
60 header('Cache-Control: public');
61 header("Content-Type: application/pdf");
62 header("Content-Transfer-Encoding: binary");
63 header("Content-Disposition: attachment; filename=Programma.pdf");
64 }else{
65 header("Content-type: application/pdf");
66 header("Content-Disposition: attachment; filename=Programma.pdf");
67 }
68}
69
70echo $stemma;
71?>
Note: See TracBrowser for help on using the repository browser.