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

Last change on this file since 280 was 265, checked in by roby, 6 years ago
File size: 2.6 KB
RevLine 
[2]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'];
[99]21if (isset($param['pdfvis'])) $pdf=$param['pdfvis'];
[2]22
23if ($id_lista){
[254]24 $sql = "select stemma from ".$prefix."_ele_lista where id_lista='$id_lista'";
[265]25 $res = $dbi->prepare("$sql");
26 $res->execute();
27
28 list($stemma) = $res->fetch(PDO::FETCH_NUM);
[2]29}elseif ($id_gruppo){
[254]30 $sql = "select programma,stemma from ".$prefix."_ele_gruppo where id_gruppo='$id_gruppo'";
[265]31 $res = $dbi->prepare("$sql");
32 $res->execute();
33
34 list($programma,$stemma) = $res->fetch(PDO::FETCH_NUM);
[254]35 if(isset($pdf)) $stemma = $programma;
[2]36}elseif ($id_sede){
[254]37 $sql = "select mappa from ".$prefix."_ele_sede where id_sede='$id_sede'";
[265]38 $res = $dbi->prepare("$sql");
39 $res->execute();
40
41 list($stemma) = $res->fetch(PDO::FETCH_NUM);
[2]42}elseif ($id_comune){
[254]43 $sql = "select stemma from ".$prefix."_ele_comuni where id_comune='$id_comune'";
[265]44 $res = $dbi->prepare("$sql");
45 $res->execute();
46
47 list($stemma) = $res->fetch(PDO::FETCH_NUM);
[2]48}else{
49die();
50}
51
52
53// nessuno stemma immagine vuota
[20]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' ) );}
[99]56if(isset($pdf))
57{
[171]58 if (strstr($_SERVER['HTTP_USER_AGENT'],"MSIE"))
[99]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
[2]70echo $stemma;
71?>
Note: See TracBrowser for help on using the repository browser.