Changeset 105 for trunk/client/modules/Elezioni
- Timestamp:
- May 29, 2011, 7:05:03 PM (13 years ago)
- Location:
- trunk/client/modules/Elezioni
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/modules/Elezioni/confronti.php
r98 r105 318 318 $per3=urlencode($per3); 319 319 320 $logo=verificasimbolo(); 320 321 321 322 echo "<table><tr><td> 322 <img src='modules/Elezioni/grafici/raffrontivoto.php?altro=$altro&desc=$desc&grp1=$grp1&grp2=$grp2&grp3=$grp3&ar1=$ars1&ar2=$ars2&ar3=$ars3&tot=$tot&titvoti=$titolovoti ' alt=\"Grafico\" /></td></tr></table>";323 <img src='modules/Elezioni/grafici/raffrontivoto.php?altro=$altro&desc=$desc&grp1=$grp1&grp2=$grp2&grp3=$grp3&ar1=$ars1&ar2=$ars2&ar3=$ars3&tot=$tot&titvoti=$titolovoti&logo=$logo' alt=\"Grafico\" /></td></tr></table>"; 323 324 324 325 echo "<table><tr><td> 325 <img src='modules/Elezioni/grafici/raffrontiperc.php?altro=$altro&desc=$desc&grp1=$grp1&grp2=$grp2&grp3=$grp3&percg1=$per1&percg2=$per2&percg3=$per3&perctot=$perctot&titperc=$titoloperc ' alt=\"Grafico\" /></td></tr></table>";326 <img src='modules/Elezioni/grafici/raffrontiperc.php?altro=$altro&desc=$desc&grp1=$grp1&grp2=$grp2&grp3=$grp3&percg1=$per1&percg2=$per2&percg3=$per3&perctot=$perctot&titperc=$titoloperc&logo=$logo' alt=\"Grafico\" /></td></tr></table>"; 326 327 327 328 -
trunk/client/modules/Elezioni/crea_pagina.php
r104 r105 21 21 22 22 global $prefix,$dbi,$pdf,$csv,$xls,$lang,$descr_cons,$prefix,$dbi,$id_comune,$descrizione,$siteistat,$min,$offset,$minsez,$offsetsez,$datipdf; 23 $res = mysql_query("SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ", $dbi);24 list($descr_com ) = mysql_fetch_row($res);23 $res = mysql_query("SELECT descrizione,simbolo,stemma FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ", $dbi); 24 list($descr_com,$simbolo,$stemma) = mysql_fetch_row($res); 25 25 26 26 … … 236 236 237 237 238 239 240 241 242 243 $style .="<table style=\"margin: auto;\" cellspace=0 border=0 cellpadding=0><tr><td border=0> <img src=\"modules/Elezioni/images/logo.gif\" align=\"left\" /></td> ";238 # salva sull'hardisk lo stemma del comune 239 $logo=verificasimbolo(); 240 $immagine= "<img src=\"modules/Elezioni/images/$logo\" alt=\"logo\" align=\"left\"/>"; 241 242 243 $style .="<table style=\"margin: auto;\" cellspace=0 border=0 cellpadding=0><tr><td border=0>$immagine</td> "; 244 244 245 245 $style .= "<td border=0>$datipdf</td></tr></table><br/><br/>"; … … 254 254 $nomefile=str_replace(" ", "_",$nomefile); 255 255 // conversion HTML => PDF 256 257 require_once('inc/hpdf /html2pdf.class.php');256 //$nomefile="elezioni_tabelle.pdf"; 257 require_once('inc/hpdf403/html2pdf.class.php'); 258 258 $html2pdf = new HTML2PDF('L','A4', 'it'); 259 259 $html2pdf->WriteHTML($style, isset($_GET['vuehtml'])); -
trunk/client/modules/Elezioni/funzioni.php
r101 r105 424 424 } 425 425 426 426 427 function arrayperc($temp,$sevaltot) 427 428 { 429 428 430 $temp2tot=0;$temp2=array();$temp3=array(); 429 431 while (list($key,$voti)= each($temp)) { … … 451 453 return($temp3); 452 454 453 } 455 456 } 457 458 # ritorna l'estensione del file 459 function file_extension($filename) 460 { 461 $path_info = pathinfo($filename); 462 return $path_info['extension']; 463 } 464 465 466 # verifica stemma e lo salva come file per pdf e grafici 467 function verificasimbolo() 468 { 469 global $prefix,$dbi,$id_comune,$ins_logo; 470 if($ins_logo=="0"){ 471 $logo="vuoto.jpg"; //var nel config.php 472 }else{ 473 474 $res = mysql_query("SELECT simbolo,stemma FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ", $dbi); 475 list($simbolo,$stemma) = mysql_fetch_row($res); 476 if($simbolo!=''){ 477 if (!file_exists("modules/Elezioni/images/$simbolo")) { 478 479 if(!is_writeable("modules/Elezioni/images")) 480 die("la dir modules/Elezioni/images non ha i permessi di scrittura. Correggere per continuare"); 481 482 $filename=$simbolo; 483 $file=fopen("modules/Elezioni/images/$filename",'w'); 484 if (fwrite($file,$stemma)); 485 $close = fclose($file); 486 } 487 $logo=$simbolo; 488 }else{ 489 $logo="logo.gif"; 490 } 491 492 }return $logo; 493 } 494 454 495 ?> -
trunk/client/modules/Elezioni/grafici.php
r69 r105 165 165 if (isset($param['anim'])) $anim=intval($param['anim']); else $anim=''; 166 166 if ($siteistat==$id_comune) $logo="$siteistat"; else $logo=''; // logo per il comune 167 167 $logo=verificasimbolo(); // carica_logo da funzioni.php 168 168 // menu 169 169 if (!$csv && $anim!=1){ $anim=1;$versione=_VER_HTML; … … 309 309 echo "<h1>"._PERCE." "._VOTIE."</h1>"; 310 310 if ($genere==0) echo " "._GRUPPO." $num_gruppo"; 311 312 $logo=verificasimbolo(); // carica_logo da funzioni.php 311 313 312 314 if ((!$csv && $flash!=1 || $anim!=1) and ($tour!=1)){ # rotazione x tour marzo 2009 a.l. … … 336 338 global $admin, $bgcolor1, $bgcolor5, $prefix, $dbi, $offset, $min,$descr_cons,$genere,$votog,$votol,$votoc,$circo, $id_cons,$id_cons_gen,$id_comune,$id_circ,$tipo_cons,$w,$l,$op,$siteistat,$flash,$visgralista; 337 339 if ($siteistat==$id_comune) $logo=$siteistat; else $logo=''; // logo per il comune 338 340 $logo=verificasimbolo(); // carica_logo da funzioni.php 339 341 if (!$id_circ and $circo){ 340 342 $res_sez = mysql_query("SELECT id_circ from ".$prefix."_ele_circoscrizione where id_cons=$id_cons order by num_circ limit 0,1",$dbi); … … 519 521 if (isset($copy)) $copy=urlencode($copy); else $copy=''; 520 522 $descr_cons=urlencode($descr_cons); 521 if ($genere==4){$w= 700;$l=300;}else{$w=500;$l=180;}523 if ($genere==4){$w=800;$l=250;}else{$w=750;$l=220;} 522 524 523 525 … … 616 618 function graf_candidato(){ 617 619 global $bgcolor1, $bgcolor5,$bgcolor5, $prefix, $dbi, $offset, $min,$descr_cons, $id_cons,$tipo_cons,$copy,$id_comune,$id_istat,$genere,$votog,$votol,$votoc,$circo,$siteistat; 618 if ($siteistat==$id_comune) $logo='1'; else $logo=''; // logo per il comune 619 620 621 $logo=verificasimbolo(); // carica_logo da funzioni.php 620 622 621 623 $tab="ele_voti_candidati"; -
trunk/client/modules/Elezioni/grafici/barre.php
r64 r105 41 41 $right = 40; 42 42 $graph->Set90AndMargin($left,$right,$top,$bottom); 43 #if(isset($logo)) $graph->SetBackgroundImage("../images/".$logo.".png",BGIMG_COPY); 44 #else 45 //$graph->SetBackgroundImage("../images/vuoto.jpg",BGIMG_COPY); 46 // Nice shadow 43 //$graph->SetBackgroundImage("../images/$logo",BGIMG_COPY); 44 47 45 $graph->SetShadow(); 48 $graph->SetBackgroundGradient('white','yellow',GRAD_HOR,BGRAD_MARGIN); 46 $graph->SetBackgroundGradient('yellow','white',GRAD_HOR,BGRAD_MARGIN); 47 //$graph->SetBackgroundImage("../images/$logo",BGIMG_COPY); 49 48 // Setup title 50 49 $graph->title->Set("$titolo"); … … 118 117 // Now create a bar pot 119 118 $bplot = new BarPlot($datay); 120 $bplot->SetFillColor(" orange");119 $bplot->SetFillColor("red"); 121 120 $bplot->SetShadow(); 122 121 … … 126 125 // We want to display the value of each bar at the top 127 126 $bplot->value->Show(); 128 $bplot->value->SetFont(CURFONT1,FS_BOLD,1 2);127 $bplot->value->SetFont(CURFONT1,FS_BOLD,14); 129 128 $bplot->value->SetAlign('left','center'); 130 $bplot->value->SetColor(" black","darkred");129 $bplot->value->SetColor("red","yellow"); 131 130 $bplot->value->SetFormat("%.2f %%"); # %"); 132 131 -
trunk/client/modules/Elezioni/grafici/raffrontiperc.php
r2 r105 8 8 $altro=$_GET['altro']; 9 9 $desc=$_GET['desc']; 10 $logo=$_GET['logo']; 10 11 $grp1=$_GET['grp1'];$grp2=$_GET['grp2'];$grp3=$_GET['grp3']; 11 12 … … 37 38 //$graph->Set3DPerspective(SKEW3D_RIGHT,650,470,true); 38 39 39 $graph->SetBackgroundImage("../images/ logo.jpg",BGIMG_COPY);40 $graph->SetBackgroundImage("../images/$logo",BGIMG_COPY); 40 41 //$graph->SetBackgroundCountryFlag('ital',BGIMG_COPY,20); 41 42 -
trunk/client/modules/Elezioni/grafici/raffrontivoto.php
r2 r105 7 7 $altro=$_GET['altro']; 8 8 $desc=$_GET['desc']; 9 $logo=$_GET['logo']; 9 10 $grp1=$_GET['grp1'];$grp2=$_GET['grp2'];$grp3=$_GET['grp3']; 10 11 … … 33 34 $graph->legend->Pos(0.03,0.2,"right","center"); 34 35 35 36 $graph->SetBackgroundImage("../images/logo.jpg",BGIMG_COPY);36 $graph->SetBackgroundImage("../images/$logo",BGIMG_COPY); 37 //$graph->SetBackgroundImage("../images/logo.jpg",BGIMG_COPY); 37 38 //$graph->SetBackgroundCountryFlag('ital',BGIMG_COPY,20); 38 39 -
trunk/client/modules/Elezioni/grafici/votanti_graf.php
r2 r105 23 23 $graph->title->Set($titolo); 24 24 $graph->title->SetFont(FF_FONT1,FS_BOLD); 25 $graph ->legend->Pos( 0.05,0.75,"left" ,"center"); 26 /* 27 if(isset($logo)){ 28 if (file_exists("../images/".$logo.".png")) { 29 $graph->SetBackgroundImage("../images/".$logo.".png",BGIMG_COPY); 30 }else{ 31 else $graph->SetBackgroundImage("../images/vuoto.jpg",BGIMG_COPY); 32 } 33 */ 34 // testo 35 /* 36 $txt =new Text("$cop"); 37 $txt->SetFont(FF_FONT1,FS_BOLD); 38 //$txt->Pos(0.5,0.97,'center','bottom'); 39 $txt->SetBox('yellow','black'); 40 $txt->Pos( 2,2,'center'); 41 $txt->SetColor( "black"); 25 $graph ->legend->Pos( 0.55,0.75,"left" ,"center"); 42 26 43 $graph-> AddText( $txt);27 $graph->SetBackgroundImage("../images/$logo",BGIMG_COPY); 44 28 45 */ 46 $graph->SetBackgroundGradient('white','yellow',GRAD_HOR,BGRAD_MARGIN); 29 $graph->SetBackgroundGradient('red','yellow',GRAD_HOR,BGRAD_MARGIN); 47 30 48 31 $p1 = new PiePlot($data); … … 50 33 $p1->value->Show(); 51 34 $p1->SetLegends($legend); 52 $p1->SetCenter(0.4 ,0.5);35 $p1->SetCenter(0.45,0.5); 53 36 54 37 $graph->Add($p1); -
trunk/client/modules/Elezioni/grafici/voti_graf.php
r2 r105 24 24 $graph->title->Set($titolo); 25 25 $graph->title->SetFont(FF_FONT1,FS_BOLD); 26 $graph ->legend->Pos( 0.52,0. 50,"left" ,"center");26 $graph ->legend->Pos( 0.52,0.70,"left" ,"center"); 27 27 $graph->SetBackgroundGradient('white','yellow',GRAD_HOR,BGRAD_MARGIN); 28 28 29 /* 30 $txt =new Text("$cop"); 31 //$txt =new Text("$siteistat"); 32 $txt->Pos( 2,180); 33 $txt->SetColor( "red"); 34 $graph->AddText( $txt); 35 */ 36 if(isset($logo)){ 37 //if (file_exists("modules/Elezioni/images/".$logo.".png")) { 38 // $graph->SetBackgroundImage("../images/".$logo.".png",BGIMG_COPY); 39 } 40 /* 41 else{ 42 else $graph->SetBackgroundImage("../images/vuoto.jpg",BGIMG_COPY); 43 } 44 */ 29 30 //$graph->SetBackgroundImagePos(1, 100); 31 $graph->SetBackgroundImage("../images/$logo",BGIMG_COPY); 32 45 33 // black-white 46 34 //$graph->AdjBackgroundImage(0.4,0.3,-1); … … 50 38 $p1->value->Show(); 51 39 $p1->SetLegends($legend); 52 $p1->SetCenter(0.25,0. 4);40 $p1->SetCenter(0.25,0.65); 53 41 $graph->Add($p1); 54 42 $graph->Stroke(); -
trunk/client/modules/Elezioni/gruppo.php
r104 r105 356 356 echo "<input type=\"hidden\" name=\"pag2\" value=\"modules.php?name=Elezioni&op=$op&id_cons_gen=$id_cons_gen&id_comune=$id_comune&csv=1&orvert=$orvert&min=$min&offset=$offset&minsez=$minsez&offsetsez=$offsetsez&perc=$perc&id_lista=\"></input>"; 357 357 358 echo " <input type=\"submit\" name=\"update\" value=\""._RICARICA."\"></input></p></div> ";358 echo " <input type=\"submit\" name=\"update\" value=\""._RICARICA."\"></input></p></div></form>"; 359 359 360 360 … … 405 405 # verificare la stampa sulle circoscrizioni 406 406 echo "<div style=\"text-align:right;width:900px;margin-left:10px;margin-right:20px;font-size:12px \">"._ESPORTA."<br />"; 407 if($circo) echo "<a href=\" ".$_SERVER['PHP_SELF']."?name=Elezioni&op=$op&id_cons_gen=$id_cons_gen&id_comune=$id_comune&csv=1&orvert=$orvert&min=$min&offset=$offset&minsez=$minsez&offsetsez=$offsetsez&perc=$perc&id_lista=$id_lista&id_circ=$id_circ&datipdf=$datipdf\" ><img class=\"image\" src=\"modules/Elezioni/images/printer.gif\" alt=\"Stampa\" /></a>";407 if($circo) echo "<a href=\"modules.php?name=Elezioni&op=$op&id_cons_gen=$id_cons_gen&id_comune=$id_comune&csv=1&orvert=$orvert&min=$min&offset=$offset&minsez=$minsez&offsetsez=$offsetsez&perc=$perc&id_lista=$id_lista&id_circ=$id_circ&datipdf=$datipdf\" ><img class=\"image\" src=\"modules/Elezioni/images/printer.gif\" alt=\"Stampa\" /></a>"; 408 408 else{ 409 echo "<a href=\" ".$_SERVER['PHP_SELF']."?name=Elezioni&op=$op&id_cons_gen=$id_cons_gen&id_comune=$id_comune&csv=1&orvert=$orvert&min=$min&offset=$offset&minsez=$minsez&offsetsez=$offsetsez&perc=$perc&id_lista=$id_lista&datipdf=$datipdf\" ><img class=\"image\" src=\"modules/Elezioni/images/printer.gif\" alt=\"Stampa\" /></a>";410 echo "<a href=\" ".$_SERVER['PHP_SELF']."?name=Elezioni&op=$op&id_cons_gen=$id_cons_gen&id_comune=$id_comune&csv=1&orvert=$orvert&min=$min&offset=$offset&minsez=$minsez&offsetsez=$offsetsez&perc=$perc&id_lista=$id_lista&xls=1&datipdf=$datipdf\" ><img class=\"image\" src=\"modules/Elezioni/images/csv.gif\" alt=\"Export Csv\" /></a>";411 echo "<a href=\" ".$_SERVER['PHP_SELF']."?name=Elezioni&op=$op&id_cons_gen=$id_cons_gen&id_comune=$id_comune&csv=1&orvert=$orvert&min=$min&offset=$offset&minsez=$minsez&offsetsez=$offsetsez&perc=$perc&id_lista=$id_lista&pdf=1&datipdf=$datipdf\" ><img class=\"image\" src=\"modules/Elezioni/images/pdf.gif\" alt=\"Export Pdf\" /></a>";412 } 413 echo "</div> </form>";409 echo "<a href=\"modules.php?name=Elezioni&op=$op&id_cons_gen=$id_cons_gen&id_comune=$id_comune&csv=1&orvert=$orvert&min=$min&offset=$offset&minsez=$minsez&offsetsez=$offsetsez&perc=$perc&id_lista=$id_lista&datipdf=$datipdf\" ><img class=\"image\" src=\"modules/Elezioni/images/printer.gif\" alt=\"Stampa\" /></a>"; 410 echo "<a href=\"modules.php?name=Elezioni&op=$op&id_cons_gen=$id_cons_gen&id_comune=$id_comune&csv=1&orvert=$orvert&min=$min&offset=$offset&minsez=$minsez&offsetsez=$offsetsez&perc=$perc&id_lista=$id_lista&xls=1&datipdf=$datipdf\" ><img class=\"image\" src=\"modules/Elezioni/images/csv.gif\" alt=\"Export Csv\" /></a>"; 411 echo "<a href=\"modules.php?name=Elezioni&op=$op&id_cons_gen=$id_cons_gen&id_comune=$id_comune&csv=1&orvert=$orvert&min=$min&offset=$offset&minsez=$minsez&offsetsez=$offsetsez&perc=$perc&id_lista=$id_lista&pdf=1&datipdf=$datipdf\" ><img class=\"image\" src=\"modules/Elezioni/images/pdf.gif\" alt=\"Export Pdf\" /></a>"; 412 } 413 echo "</div>"; 414 414 /* 415 415 if (!$circo) … … 421 421 422 422 } 423 423 424 if (!$csv){ 424 425 echo "<div style=\"text-align:right;width:900px;margin-left:10px;margin-right:2px;font-size:12px \"><h5> Sezioni scrutinate"; … … 426 427 echo "</h5> </div>"; 427 428 } 429 428 430 $y=1; 429 431 $ar[0][0]=$tipo2; … … 446 448 for ($z=1;$z<=($offsetsez-$ominsez);$z++) { 447 449 $res=mysql_fetch_row($res_numsez); 450 448 451 ##############inserimento percentuale di scrutinio nella sezione 449 452 $scruvalidi=0; … … 467 470 #$valar[$z]=array(); 468 471 } 472 473 469 474 if (!isset($pos)) $pos[0]=0; 470 475 $minpos=min($pos); 471 476 $maxpos=max($pos); 472 477 //////////////////////////////////////////////////////////////////// 478 473 479 if ($res_voti) 474 480 while (list($num_circ,$desc_circ,$num_cand,$nome,$voti,$sevalidi,$senulli,$sebianchi,$secontestati,$sevonulli) = mysql_fetch_row($res_voti)){
Note:
See TracChangeset
for help on using the changeset viewer.