[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 |
|
---|
| 9 | if (!defined('MODULE_FILE')) {
|
---|
| 10 | die ("You can't access this file directly...");
|
---|
| 11 | }
|
---|
| 12 |
|
---|
[347] | 13 | require_once('inc/hpdf5/autoload.php');
|
---|
| 14 | use Spipu\Html2Pdf\Html2Pdf;
|
---|
| 15 | use Spipu\Html2Pdf\Exception\Html2PdfException;
|
---|
| 16 | use Spipu\Html2Pdf\Exception\ExceptionFormatter;
|
---|
[2] | 17 |
|
---|
| 18 | if (isset($param['id_cons_gen'])) $id_cons_gen=intval($param['id_cons_gen']); else $id_cons_gen='';
|
---|
| 19 | if (isset($param['num_ref'])) $num_ref=intval($param['num_ref']);
|
---|
| 20 | if (isset($param['num_refs'])) $num_refs=intval($param['num_refs']);
|
---|
| 21 | if (isset($param['id_comune'])) $id_comune=intval($param['id_comune']);
|
---|
| 22 | if (isset($param['xls'])) $xls=intval($param['xls']);
|
---|
[117] | 23 | if (isset($param['pdf'])) $pdf=intval($param['pdf']);
|
---|
[265] | 24 | $sql="SELECT t1.tipo_cons,t3.genere,t2.id_cons FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2, ".$prefix."_ele_tipo as t3 where t1.tipo_cons=t3.tipo_cons and t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen='$id_cons_gen' and t2.id_comune='$id_comune'";
|
---|
| 25 | $res = $dbi->prepare("$sql");
|
---|
| 26 | $res->execute();
|
---|
| 27 | list($tipo_cons,$genere,$id_cons) = $res->fetch(PDO::FETCH_NUM);
|
---|
[2] | 28 | global $lang,$circo,$id_circ;
|
---|
| 29 |
|
---|
| 30 | if (isset($circo) and $circo) $circos="and t2.id_circ='$id_circ'";
|
---|
| 31 | else $circos='';
|
---|
| 32 |
|
---|
| 33 | # testata
|
---|
| 34 | include_once("modules/Elezioni/language/lang-$lang.php");
|
---|
| 35 | if($csv==1){
|
---|
| 36 | include_once("modules/Elezioni/funzioni.php");
|
---|
| 37 |
|
---|
[265] | 38 | $sql="SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ";
|
---|
| 39 | $res = $dbi->prepare("$sql");
|
---|
| 40 | $res->execute();
|
---|
| 41 | list($descr_com) = $res->fetch(PDO::FETCH_NUM);
|
---|
[2] | 42 | $descr_com =stripslashes($descr_com);
|
---|
| 43 | $datipdf .= "<div style=\"margin:0px auto; text-align:center;\">";
|
---|
| 44 | $siteistat=$id_comune;
|
---|
[117] | 45 | # salva sull'hardisk lo stemma del comune
|
---|
| 46 | $logo=verificasimbolo();
|
---|
| 47 | $immagine= "<img src=\"modules/Elezioni/images/$logo\" alt=\"logo\" align=\"left\"/>";
|
---|
| 48 |
|
---|
| 49 | if($xls!=1) $datipdf .= "<table><tr><td>$immagine</td><td>";
|
---|
| 50 |
|
---|
| 51 | $datipdf .= ""._COMUNE." $descr_com <br />
|
---|
| 52 | "._RISULTA." "._CONSULTA."<br/ >";
|
---|
| 53 | $datipdf .= "$descr_cons<br />"._DISCLAIMER."
|
---|
| 54 | <br /><b>"._DETTAGLIO." "._AFFLUENZE."</b>";
|
---|
[2] | 55 | if($xls!=1) $datipdf .= "</td></tr></table>";
|
---|
[117] | 56 | $datipdf .="</div>";
|
---|
[2] | 57 |
|
---|
| 58 | $html = "<style type=\"text/css\">
|
---|
| 59 | <!--
|
---|
| 60 |
|
---|
| 61 | .td-89 {
|
---|
| 62 | width: 89%;
|
---|
| 63 | border: 1px;
|
---|
| 64 | text-align: left;
|
---|
| 65 | }
|
---|
| 66 | .td-vuoto {
|
---|
| 67 |
|
---|
| 68 | width: 100%;
|
---|
| 69 | border: 1px;
|
---|
| 70 | text-align: left;
|
---|
| 71 |
|
---|
| 72 | }
|
---|
| 73 |
|
---|
| 74 |
|
---|
| 75 | .td-5 {
|
---|
| 76 |
|
---|
| 77 | margin: 0px 0 0 0px;
|
---|
| 78 | width: 5%;
|
---|
| 79 | /*border: none;*/
|
---|
| 80 | padding: 0px;
|
---|
| 81 |
|
---|
| 82 | text-align: center;
|
---|
| 83 | }
|
---|
| 84 |
|
---|
| 85 |
|
---|
| 86 |
|
---|
| 87 | .bggray {
|
---|
| 88 | background: #ffffff;
|
---|
| 89 | FONT-SIZE: 13px;
|
---|
| 90 | FONT-FAMILY: Helvetica;
|
---|
| 91 | border: 1px;
|
---|
| 92 | }
|
---|
| 93 |
|
---|
| 94 | .bggray2 {
|
---|
| 95 | background: #EFEFEF;
|
---|
| 96 | FONT-SIZE: 13px;
|
---|
| 97 | FONT-FAMILY: Helvetica;
|
---|
| 98 | border: 1px;
|
---|
| 99 | }
|
---|
| 100 | -->
|
---|
| 101 | </style>";
|
---|
| 102 |
|
---|
| 103 |
|
---|
| 104 |
|
---|
| 105 |
|
---|
| 106 | }
|
---|
| 107 |
|
---|
| 108 |
|
---|
| 109 |
|
---|
| 110 |
|
---|
| 111 |
|
---|
| 112 |
|
---|
| 113 |
|
---|
| 114 | // referendum
|
---|
| 115 |
|
---|
[121] | 116 | $posref='';
|
---|
[2] | 117 | if (!IsSet($num_ref)) {
|
---|
| 118 | $num_ref=1;
|
---|
[265] | 119 | $sql="SELECT id_gruppo from ".$prefix."_ele_gruppo where id_cons='$id_cons'";
|
---|
| 120 | $resg = $dbi->prepare("$sql");
|
---|
| 121 | $resg->execute();
|
---|
| 122 | $num_refs= $resg->rowCount(); //quante pagine?
|
---|
[2] | 123 | }
|
---|
| 124 | if($genere=='0'){
|
---|
[265] | 125 | $sql="SELECT id_gruppo from ".$prefix."_ele_gruppo where id_cons='$id_cons' and num_gruppo='$num_ref'";
|
---|
| 126 | $resg = $dbi->prepare("$sql");
|
---|
| 127 | $resg->execute();
|
---|
| 128 | list($id_gruppo)=$resg->fetch(PDO::FETCH_NUM);
|
---|
[121] | 129 | $posref="&num_ref=$num_ref&num_refs=$num_refs";
|
---|
[2] | 130 |
|
---|
| 131 | }
|
---|
| 132 | // icone stampa e grafici
|
---|
| 133 |
|
---|
| 134 | if (!$csv){
|
---|
| 135 | if(!isset($html)) $html='';
|
---|
| 136 | $html .= "<div>
|
---|
| 137 | <a href=\"modules.php?name=Elezioni&file=index&id_cons_gen=$id_cons_gen&id_comune=$id_comune&op=affluenze_graf\">
|
---|
| 138 | "._VER_GRAF." <img class=\"image\" src=\"modules/Elezioni/images/grafici.png\" alt=\"\" /></a>
|
---|
[121] | 139 | <a href=\"modules.php?name=Elezioni&op=come&file=index&id_cons_gen=$id_cons_gen&id_comune=$id_comune&info=affluenze_sez$posref&csv=1\">"._VER_STAMPA."
|
---|
[2] | 140 | <img class=\"image\" src=\"modules/Elezioni/images/printer.png\" alt=\"\" /></a>
|
---|
[121] | 141 | <a href=\"modules.php?name=Elezioni&op=come&file=index&id_cons_gen=$id_cons_gen&id_comune=$id_comune&info=affluenze_sez$posref&csv=1&xls=1\">
|
---|
[2] | 142 | <img class=\"image\" src=\"modules/Elezioni/images/csv.gif\" alt=\"\" /></a>
|
---|
[121] | 143 | <a href=\"modules.php?name=Elezioni&op=come&file=index&id_cons_gen=$id_cons_gen&id_comune=$id_comune&info=affluenze_sez$posref&csv=1&pdf=1\">
|
---|
[117] | 144 | <img class=\"image\" src=\"modules/Elezioni/images/pdf.gif\" alt=\"\" /></a>
|
---|
[2] | 145 |
|
---|
| 146 | </div>
|
---|
| 147 |
|
---|
| 148 | <h2><b>"._DETTAGLIO." "._AFFLUENZE."</b></h2>";
|
---|
| 149 | }
|
---|
| 150 |
|
---|
| 151 | // descrizione
|
---|
| 152 | if ($genere==0){
|
---|
[265] | 153 | $sql="select descrizione from ".$prefix."_ele_gruppo where id_gruppo='$id_gruppo'";
|
---|
| 154 | $des = $dbi->prepare("$sql");
|
---|
| 155 | $des->execute();
|
---|
| 156 | list($descrizione)=$des->fetch(PDO::FETCH_NUM);
|
---|
[2] | 157 | if(!isset($html)) $html='';
|
---|
| 158 | $html .= "<div><h4>$descrizione</h4></div>";
|
---|
| 159 | }
|
---|
| 160 |
|
---|
| 161 |
|
---|
| 162 | $cond= $genere==0 ? "and t3.id_gruppo='$id_gruppo'" : "";
|
---|
| 163 | $i=1;
|
---|
| 164 |
|
---|
| 165 |
|
---|
[265] | 166 | $sql="SELECT num_sez,id_sez,t1.id_sede, t2.id_circ,maschi,femmine,(maschi+femmine) as elettori FROM ".$prefix."_ele_sezioni as t1, ".$prefix."_ele_sede as t2 where t1.id_cons='$id_cons' and t1.id_sede=t2.id_sede $circos order by num_sez";
|
---|
| 167 | $res = $dbi->prepare("$sql");
|
---|
| 168 | $res->execute();
|
---|
| 169 | while ($linka[$i++] = $res->fetch(PDO::FETCH_BOTH));
|
---|
[2] | 170 | # while (list($appo) = mysql_fetch_array($res)) {$i=$appo['num_sez']; $linka[$i] = $appo;echo "\nnum:$i:".$linka[$i]['num_sez'];}die();
|
---|
[265] | 171 | $num_sez = $res->rowCount(); //numero totale delle sezioni
|
---|
[337] | 172 | if (isset($linka[1]['num_sez'])) $sez_da=$linka[1]['num_sez']; else $sez_da=0;
|
---|
[2] | 173 | $sez_a=$sez_da+$num_sez-1;
|
---|
| 174 | $tot_compl=0;$tot_u=0;$tot_d=0;
|
---|
| 175 | // $ar['riga1'][0]="<hr>";
|
---|
| 176 | $tot= array();
|
---|
| 177 | $ar[0][0]="<b>TOTALI</b>";
|
---|
| 178 | $ar['perc'][0]="Perc.";
|
---|
| 179 | // $ar['riga2'][0]="<hr>";
|
---|
| 180 | # foreach($linka['num_sez'] as $i)
|
---|
| 181 | $y=1;
|
---|
| 182 | for ($i=$sez_da;$i<=$sez_a;$i++,$y++) {
|
---|
| 183 | # $ar[$i]['numsez']=$i;
|
---|
[337] | 184 | if(!isset($linka[$y]['num_sez'])) { $linka[$y]['num_sez']=0; $linka[$y]['elettori']=0;}
|
---|
[82] | 185 | $z=$linka[$y]['num_sez'];
|
---|
| 186 | $ar[$z]['numsez']=$linka[$y]['num_sez'];
|
---|
| 187 | $ar[$z]['elettori']=number_format($linka[$y]['elettori'],0,',','.');
|
---|
[2] | 188 | $tot_compl+=$linka[$y]['elettori'];
|
---|
| 189 | $tot_u+=$linka[$y]['maschi'];
|
---|
| 190 | $tot_d+=$linka[$y]['femmine'];
|
---|
[82] | 191 |
|
---|
| 192 |
|
---|
[2] | 193 | }
|
---|
| 194 | $ar[0][1]="<b>".number_format($tot_compl,0,',','.')."</b>";
|
---|
| 195 |
|
---|
| 196 | $ar['perc'][1]=" ";
|
---|
| 197 |
|
---|
| 198 | $perc_u=0;$perc_d=0;$perc_c=0;
|
---|
[265] | 199 | $sql="SELECT t1.data,t1.orario FROM ".$prefix."_ele_rilaff as t1 left join ".$prefix."_ele_voti_parziale as t2 on t2.data=t1.data and t2.orario=t1.orario left join ".$prefix."_ele_cons_comune as t3 on t3.id_cons_gen=t1.id_cons_gen where t1.id_cons_gen='$id_cons_gen' and t3.id_cons=t2.id_cons group by t1.data,t1.orario order by t1.data,t1.orario";
|
---|
| 200 | $resril = $dbi->prepare("$sql");
|
---|
| 201 | $resril->execute();
|
---|
| 202 | $num_ril= $resril->rowCount(); //numero delle rilevazioni previste
|
---|
[2] | 203 | if(!isset($html)) $html='';
|
---|
| 204 | $html .= "<table class=\"td-89\">";
|
---|
| 205 | $html .= "<tr class=\"bggray\"><td class=\"\">"._SEZIONI."</td><td>"._ISCR_SEZ."</td>";
|
---|
[64] | 206 |
|
---|
[265] | 207 | $sql="SELECT orario,data FROM ".$prefix."_ele_rilaff where id_cons_gen=$id_cons_gen order by data desc,orario desc limit 0,1";
|
---|
| 208 | $resuo = $dbi->prepare("$sql");
|
---|
| 209 | $resuo->execute();
|
---|
| 210 | list($ultora,$ultdata)=$resuo->fetch(PDO::FETCH_NUM);
|
---|
[64] | 211 |
|
---|
| 212 |
|
---|
[265] | 213 | $sql="select t3.data,t3.orario,sum(t3.voti_complessivi),sum(t3.voti_uomini),sum(t3.voti_donne) from ".$prefix."_ele_voti_parziale as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t3.id_cons='$id_cons' $circos $cond group by t3.data,t3.orario,t3.id_gruppo order by t3.data,t3.orario";
|
---|
| 214 | $ressomma = $dbi->prepare("$sql");
|
---|
| 215 | $ressomma->execute();
|
---|
[64] | 216 |
|
---|
[265] | 217 |
|
---|
[71] | 218 | $perc_u=array(); $perc_d=array(); $perc_c=array();
|
---|
[265] | 219 | while (list($data,$ora,$somma,$votiu,$votid) = $ressomma->fetch(PDO::FETCH_NUM)) {
|
---|
[71] | 220 | $perc_u[$data.$ora]=0;
|
---|
| 221 | $perc_d[$data.$ora]=0;
|
---|
| 222 | $perc_c[$data.$ora]=0;
|
---|
| 223 | if($votiu or $votid)
|
---|
| 224 | # if(($data==$ultdata) and ($ora==$ultora))
|
---|
[2] | 225 | {
|
---|
[352] | 226 | $tot[$data.$ora]="<table class=\"td-89\"><tr class=\"bggray2\"><td class=\"td-30\">
|
---|
[2] | 227 | <b>".number_format($votiu,0,',','.')."</b></td><td class=\"td-30\">
|
---|
| 228 | <b>".number_format($votid,0,',','.')."</b></td><td>
|
---|
| 229 | <b>".number_format($somma,0,',','.')."</b></td>
|
---|
| 230 | </tr></table>";
|
---|
[71] | 231 | $perc_u[$data.$ora]=number_format($votiu*100/$tot_u,2);
|
---|
| 232 | $perc_d[$data.$ora]=number_format($votid*100/$tot_d,2);
|
---|
| 233 | $perc_c[$data.$ora]=number_format($somma*100/$tot_compl,2);
|
---|
[2] | 234 | }
|
---|
| 235 | else
|
---|
| 236 | $tot[$data.$ora]=$somma;
|
---|
| 237 | }
|
---|
| 238 | $ud=0;$ora_rif="";
|
---|
[265] | 239 | while (list($data1,$ora1) = $resril->fetch(PDO::FETCH_NUM))
|
---|
[2] | 240 | {
|
---|
| 241 | $ud++;
|
---|
| 242 | list($hour, $minute, $second) = explode(":", $ora1);
|
---|
| 243 | $ora_ril=$hour.":".$minute;
|
---|
| 244 | $html .= "<td";
|
---|
[71] | 245 | if ($ud==$num_ril and ($perc_u[$data1.$ora1] or $perc_d[$data1.$ora1])) {$ora_rif="$data1.$ora1";}
|
---|
[2] | 246 | $html .= ">";
|
---|
| 247 | $data_a=form_data($data1);
|
---|
| 248 | $html .= "".$data_a."<br />"._ORE." ".$ora_ril;
|
---|
[265] | 249 | $sql="SELECT count(data) FROM ".$prefix."_ele_voti_parziale as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t1.id_cons='$id_cons' and data='$data1' and orario='$ora_ril' $circos group by t3.id_gruppo";
|
---|
| 250 | $resaff = $dbi->prepare("$sql");
|
---|
| 251 | $resaff->execute();
|
---|
| 252 | list($num_scr) = $resaff->fetch(PDO::FETCH_NUM); //numero delle sezioni inserite
|
---|
[2] | 253 | $html .= "<br />"._SEZIONI." $num_scr "._SU." $num_sez";
|
---|
[71] | 254 | ## if ($ud==$num_ril and ($perc_u or $perc_d)) $html .= "<br />
|
---|
| 255 | if (($perc_u[$data1.$ora1] or $perc_d[$data1.$ora1])) $html .= "<br />
|
---|
[2] | 256 |
|
---|
[347] | 257 | <table style=\"width:180px;\"><tr class=\"bggray\">
|
---|
| 258 | <th style=\"width:28%;text-align:center;\">"._UOMINI."</th>
|
---|
| 259 | <th style=\"width:28%;text-align:center;\">"._DONNE."</th>
|
---|
| 260 | <th style=\"width:28%;text-align:center;\">"._COMPLESSIVI."</th>
|
---|
[2] | 261 | </tr></table>";
|
---|
| 262 |
|
---|
| 263 | $html .= "</td>";
|
---|
| 264 |
|
---|
| 265 | if (isset($tot[$data1.$ora1])){
|
---|
[71] | 266 | ## if ($ora_rif=="$data1.$ora1")
|
---|
| 267 | if (($perc_u[$data1.$ora1] or $perc_d[$data1.$ora1])) {
|
---|
[347] | 268 | $ar['perc'][$data1.$ora1]="<table style=\"width:180px;\"><tr class=\"bggray2\">
|
---|
| 269 | <td style=\"width:33%;text-align:center;\"><b><i><span class=\"red\">".$perc_u[$data1.$ora1]."%</span></i></b></td>
|
---|
| 270 | <td style=\"width:33%;text-align:center;\"><b><i><span class=\"red\">".$perc_d[$data1.$ora1]."%</span></i></b></td>
|
---|
| 271 | <td style=\"width:33%;text-align:center;\" ><span class=\"red\"><b><i>".$perc_c[$data1.$ora1]."%</i></b></span></td>
|
---|
[2] | 272 | </tr></table>";
|
---|
| 273 | $ar[0][$data1.$ora1]=$tot[$data1.$ora1];
|
---|
| 274 | }
|
---|
| 275 | else
|
---|
| 276 | {
|
---|
| 277 | $ar['perc'][$data1.$ora1]="<b><span class=\"red\"><i>
|
---|
| 278 | ".number_format($tot[$data1.$ora1]*100/$tot_compl,2)."%</i></span></b>";
|
---|
| 279 | $ar[0][$data1.$ora1]="<b>".(number_format($tot[$data1.$ora1],0,',','.'))."</b>";
|
---|
| 280 | }
|
---|
| 281 |
|
---|
[17] | 282 | if (intval(preg_match('/[1-9]/',$tot[$data1.$ora1]))>0) {
|
---|
[2] | 283 | #foreach($ar[['num_sez'] as $i)
|
---|
[82] | 284 | ##########
|
---|
[265] | 285 | $sql="select t1.num_sez from ".$prefix."_ele_sezioni as t1 left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t2.id_cons='$id_cons' $circos order by t1.num_sez ";
|
---|
| 286 | $resvoti = $dbi->prepare("$sql");
|
---|
| 287 | $resvoti->execute();
|
---|
| 288 |
|
---|
[82] | 289 | ###########
|
---|
| 290 | # for ($i=$sez_da;$i<=$sez_a;$i++)
|
---|
[265] | 291 | while (list($i)=$resvoti->fetch(PDO::FETCH_NUM))
|
---|
[2] | 292 | {
|
---|
| 293 | $ar[$i][$data1.$ora1]="<span style=\"color: rgb(255, 0, 0);\">non rilevata</span>";
|
---|
| 294 | }
|
---|
| 295 | }
|
---|
| 296 | }
|
---|
| 297 | }
|
---|
[265] | 298 | $sql="select t3.data,t3.orario,t1.num_sez,voti_uomini, voti_donne, voti_complessivi from ".$prefix."_ele_voti_parziale as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t3.id_cons='$id_cons' $circos $cond order by data,orario,t1.num_sez ";
|
---|
| 299 | $resvoti = $dbi->prepare("$sql");
|
---|
| 300 | $resvoti->execute();
|
---|
[2] | 301 | $ud=0;
|
---|
[265] | 302 | while (list($data,$ora,$numsez,$uomini,$donne,$complessivi) = $resvoti->fetch(PDO::FETCH_NUM)) {
|
---|
[71] | 303 | # if ($ora_rif=="$data.$ora")
|
---|
| 304 | if(($uomini+$donne)>0)
|
---|
[347] | 305 | $ar[$numsez][$data.$ora]="<table style=\"width:180px;\"><tr class=\"bggray2\">
|
---|
| 306 | <td style=\"width:33%;text-align:center;\">$uomini</td>
|
---|
| 307 | <td style=\"width:33%;text-align:center;\">$donne</td>
|
---|
| 308 | <td style=\"width:33%;text-align:center;\">$complessivi</td>
|
---|
[2] | 309 | </tr></table>";
|
---|
| 310 | else
|
---|
| 311 | $ar[$numsez][$data.$ora]=$complessivi;
|
---|
| 312 | }
|
---|
| 313 | $html .= "</tr>";
|
---|
| 314 |
|
---|
| 315 | foreach ($ar as $i => $arr) {
|
---|
| 316 | $html .= "<tr class=\"bggray2\">";
|
---|
| 317 | foreach ($arr as $valore)
|
---|
| 318 | {
|
---|
| 319 |
|
---|
[347] | 320 | $html .= "<td class=\"bggray2\" style=\"text-align:center;\">$valore</td>";
|
---|
[2] | 321 | }
|
---|
| 322 | $html .= "</tr>";
|
---|
| 323 | }
|
---|
| 324 |
|
---|
| 325 |
|
---|
| 326 |
|
---|
| 327 | $html .= "</table>";
|
---|
| 328 |
|
---|
| 329 | if($genere==0){ //se e' referendum
|
---|
| 330 | #'Pagina precedente' e 'Pagina Successiva'
|
---|
[120] | 331 | if ($xls!='1' && $pdf!='1' && $csv!='1'){
|
---|
[2] | 332 | $html .= "<div class=\"modulo\">";
|
---|
| 333 | $cur=$num_ref;
|
---|
| 334 | if ($cur>1) {
|
---|
| 335 |
|
---|
| 336 | $num_ref--;
|
---|
| 337 | $html .= "<a href=\"modules.php?name=Elezioni&op=come&info=affluenze_sez&id_cons_gen=$id_cons_gen&num_ref=$num_ref&num_refs=$num_refs&id_comune=$id_comune\">";
|
---|
| 338 | $html .= "[ <b>"._PREV_MATCH."</b> ] </a>";
|
---|
| 339 | }
|
---|
| 340 | if ($cur<$num_refs) {
|
---|
| 341 | $cur++;
|
---|
| 342 | $html .= "<a href=\"modules.php?name=Elezioni&op=come&info=affluenze_sez&id_cons_gen=$id_cons_gen&num_ref=$cur&num_refs=$num_refs&id_comune=$id_comune\">";
|
---|
| 343 | $html .= "[ <b>"._NEXT_MATCH."</b> ] </a>";
|
---|
| 344 | }
|
---|
| 345 | $html .= "</div>";
|
---|
| 346 | }
|
---|
[117] | 347 | }
|
---|
[2] | 348 |
|
---|
| 349 | if(!isset($style)) $style='';
|
---|
| 350 | if($csv==1){
|
---|
| 351 | $data=date("d-m-y G:i");
|
---|
| 352 | $style .="\t\t\n<br/><br/><br/><div style=\"margin:0px auto;text-align:center;\"><i>Stampato: $data</i></div>";
|
---|
[350] | 353 | $style .="<br/><div style=\"text-align:center;\"><i>Eleonline by luciano apolito e roberto gigli - www.eleonline.it</i></div>";
|
---|
[2] | 354 | $style .= "<br/> ";
|
---|
| 355 |
|
---|
| 356 | }
|
---|
[117] | 357 | //$html .= "</div>";
|
---|
[2] | 358 |
|
---|
| 359 |
|
---|
| 360 | ############### stampa
|
---|
[117] | 361 | if ($xls!='1' && $pdf!='1'){
|
---|
[2] | 362 | echo "$datipdf $html $style";
|
---|
[117] | 363 |
|
---|
| 364 | }elseif($xls=="1"){
|
---|
| 365 | $nomefile="affluenze.xls";
|
---|
[2] | 366 | header ("Content-Type: application/vnd.ms-excel");
|
---|
| 367 | header ("Content-Disposition: inline; filename=$nomefile");
|
---|
| 368 | echo "$datipdf";
|
---|
| 369 | echo "$html \t\n $style";
|
---|
[117] | 370 | }elseif($pdf=='1'){
|
---|
| 371 | $nomefile="$descr_cons affluenze.pdf";
|
---|
| 372 |
|
---|
| 373 | $stampa ="$datipdf $html $style";
|
---|
| 374 |
|
---|
[347] | 375 | $html2pdf = new Html2Pdf('P','A4', 'it');
|
---|
[117] | 376 | $html2pdf->WriteHTML($stampa, isset($_GET['vuehtml']));
|
---|
| 377 | $html2pdf->Output($nomefile);
|
---|
[2] | 378 | }
|
---|
| 379 |
|
---|
| 380 |
|
---|
| 381 | if($csv!=1 ) include ("footer.php");
|
---|
| 382 |
|
---|
| 383 | ?>
|
---|