Changeset 104 for trunk/client/modules/Elezioni/crea_pagina.php
- Timestamp:
- May 29, 2011, 1:20:58 AM (13 years ago)
- Location:
- trunk/client
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client
-
Property svn:ignore
set to
config.php
-
Property svn:ignore
set to
-
trunk/client/modules/Elezioni/crea_pagina.php
r74 r104 15 15 die ("You can't access this file directly..."); 16 16 } 17 17 global $name; 18 18 19 19 function crea_tabella($ar) { 20 20 21 21 22 global $prefix,$dbi,$pdf,$csv,$xls,$lang,$descr_cons,$prefix,$dbi,$id_comune,$descrizione,$siteistat,$ pagina,$min,$offset,$minsez,$offsetsez,$datipdf;22 global $prefix,$dbi,$pdf,$csv,$xls,$lang,$descr_cons,$prefix,$dbi,$id_comune,$descrizione,$siteistat,$min,$offset,$minsez,$offsetsez,$datipdf; 23 23 $res = mysql_query("SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ", $dbi); 24 24 list($descr_com) = mysql_fetch_row($res); 25 25 26 27 28 29 30 26 31 $datipdf=stripslashes($datipdf); 32 27 33 $data=date("d-m-y G:i"); 28 34 29 35 if ($xls==1) { 30 31 $nomefile="export.xls"; 36 $nomefile=strip_tags(str_replace(" ", "_", $datipdf).".xls"); 37 32 38 header ("Content-Type: application/vnd.ms-excel"); 33 39 header ("Content-Disposition: inline; filename=$nomefile"); … … 38 44 $cella=str_replace("</b>"," ",$cella); 39 45 $cella=str_replace("<br />"," ",$cella); 46 40 47 41 48 echo "$datipdf"; … … 56 63 $cella=str_replace("<b>"," ",$cella); 57 64 $cella=str_replace("</b>"," ",$cella); 65 $cella=str_replace("<br>"," ",$cella); 58 66 $cella=str_replace("<br />"," ",$cella); 59 67 $cella=str_replace("<span class=\"red\"><i>"," - ",$cella); 60 68 $cella=str_replace("</span>%</i>","%",$cella); 69 $cella=str_replace("</i></span>","",$cella); 61 70 $cella=str_replace("_CIRCOS","Circoscrizione ",$cella); 62 71 $cella=str_replace("_SEZIONI","Sezione ",$cella); … … 73 82 74 83 echo"\n\n\nPowered by Eleonline http://www.eleonline.it \t \n"; 75 echo"by l .apolito & r.gigli - stampato: $data \t \n";84 echo"by luciano apolito & roberto gigli - stampato: $data \t \n"; 76 85 die(); 77 86 … … 137 146 if ($pdf!="1" && $csv=="1"){ 138 147 $html .="<br/><span class=\"copy\"><i>Stampato: $data</i></span>"; 139 $html .="<br/><span class=\"copy\"><i>Eleonline by l . apolito & r.gigli - www.eleonline.it</i></span>";148 $html .="<br/><span class=\"copy\"><i>Eleonline by luciano apolito & roberto gigli - www.eleonline.it</i></span>"; 140 149 $html .="</td></tr></table>"; 141 150 } … … 148 157 }else{ 149 158 150 #pdf 151 /* 152 require('inc/pdf/html2fpdf.php'); 153 //Istanzio la classe 154 $fpdf=new HTML2FPDF('L','mm','A4'); 155 156 //Creo la pagina 157 $fpdf->AddPage(); 158 159 //Per leggere il file html usare fread 160 $content = "<b>Testo in neretto</b>"; 161 $fpdf->Image('modules/Elezioni/images/logo.jpg',10,10,10,0,'','http://www.eleonline.it'); 162 //Scrivo l'html nel file pdf 163 $fpdf->WriteHTML($html); 164 //Scrivo il file sample.pdf 165 $fpdf->Output(); 166 167 //include("modules/Elezioni/printpdf.php"); 168 //PrintPage($html); 169 */ 170 $style =" 171 <style type=\"text/css\"> 172 <!-- 173 .table-docs { 174 font-size: 10px; 175 padding: 1px; 176 color: #000000; 177 /* margin: 4px 4px 40px;*/ 178 border: solid #666666; 179 text-align:center; 180 } 181 .bggray { 182 background: #d2d2d2; 183 FONT-SIZE: 13px; 184 FONT-FAMILY: Helvetica; 185 border: 1px; 186 } 187 188 .bggray2 { 189 background: #EFEFEF; 190 FONT-SIZE: 13px; 191 FONT-FAMILY: Helvetica; 192 border: 1px; 193 } 194 195 bggray3 { 196 background: #EFEFEF; 197 FONT-SIZE: 10px; 198 FONT-FAMILY: Helvetica; 199 text-align: left 200 } 201 202 .bgw { 203 background: #ffffff; 204 FONT-SIZE: 13px; 205 FONT-FAMILY: Helvetica; 206 border: 1px; 207 208 } 209 .td-130 { 210 float: right; 211 margin: 0px 0 0 1px; 212 width: 130px; 213 border: none; 214 background-color: #d2d2d2; 215 padding: 0px; 216 217 } 218 .td-130c { 219 float: right; 220 text-align:left; 221 margin: 0px 0 0 1px; 222 width: 130px; 223 border: none; 224 padding: 0px; 225 } 226 227 td { 228 border: .2px; 229 } 230 .red { 231 BACKGROUND: none; 232 COLOR: #ff0000; 233 FONT-SIZE: 12px; 234 FONT-FAMILY: Helvetica 235 } 236 .copy { 237 background: #d2d2d2; 238 FONT-SIZE: 8px; 239 FONT-FAMILY: Helvetica; 240 border: 1px; 241 } 242 .cen { 243 margin: 10px auto 0 auto; 244 } 245 --> 246 </style>"; 247 248 249 250 251 252 253 254 $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> "; 255 256 $style .= "<td border=0>$datipdf</td></tr></table><br/><br/>"; 257 $style .=$html; 258 $style .= "<table style=\"margin: auto;\" cellspace=0 border=0 cellpadding=0><tr><td border=0>"; 259 260 $data=date("d-m-y G:i"); 261 $style .="<br/><span class=\"copy\"><i>Stampato il $data</i></span>"; 262 $style .="<br/><span class=\"copy\"><i>Eleonline by lucianoapolito & roberto gigli - www.eleonline.it</i></span>"; 263 $style .="</td></tr></table>"; 264 // conversion HTML => PDF 265 require_once('inc/hpdf/html2pdf.class.php'); 266 $html2pdf = new HTML2PDF('L','A4', 'it'); 267 $html2pdf->WriteHTML($style, isset($_GET['vuehtml'])); 268 $html2pdf->Output(); 159 $style =" 160 <style type=\"text/css\"> 161 <!-- 162 .table-docs { 163 font-size: 10px; 164 padding: 1px; 165 color: #000000; 166 /* margin: 4px 4px 40px;*/ 167 border: solid #666666; 168 text-align:center; 169 } 170 .bggray { 171 background: #d2d2d2; 172 FONT-SIZE: 13px; 173 FONT-FAMILY: Helvetica; 174 border: 1px; 175 } 176 177 .bggray2 { 178 background: #EFEFEF; 179 FONT-SIZE: 13px; 180 FONT-FAMILY: Helvetica; 181 border: 1px; 182 } 183 184 bggray3 { 185 background: #EFEFEF; 186 FONT-SIZE: 10px; 187 FONT-FAMILY: Helvetica; 188 text-align: left 189 } 190 191 .bgw { 192 background: #ffffff; 193 FONT-SIZE: 13px; 194 FONT-FAMILY: Helvetica; 195 border: 1px; 196 197 } 198 .td-130 { 199 float: right; 200 margin: 0px 0 0 1px; 201 width: 130px; 202 border: none; 203 background-color: #d2d2d2; 204 padding: 0px; 205 206 } 207 .td-130c { 208 float: right; 209 text-align:left; 210 margin: 0px 0 0 1px; 211 width: 130px; 212 border: none; 213 padding: 0px; 214 } 215 216 td { 217 border: .2px; 218 } 219 .red { 220 BACKGROUND: none; 221 COLOR: #ff0000; 222 FONT-SIZE: 12px; 223 FONT-FAMILY: Helvetica 224 } 225 .copy { 226 background: #d2d2d2; 227 FONT-SIZE: 8px; 228 FONT-FAMILY: Helvetica; 229 border: 1px; 230 } 231 .cen { 232 margin: 10px auto 0 auto; 233 } 234 --> 235 </style>"; 236 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> "; 244 245 $style .= "<td border=0>$datipdf</td></tr></table><br/><br/>"; 246 $style .= "<table style=\"margin: auto;\"><tr><td>$html</td></tr></table>"; 247 $style .= "<table style=\"margin: auto;\" cellspace=0 border=0 cellpadding=0><tr><td border=0>"; 248 249 $data=date("d-m-y G:i"); 250 $style .="<br/><span class=\"copy\"><i>Stampato il $data</i></span>"; 251 $style .="<br/><span class=\"copy\"><i>Eleonline by luciano apolito & roberto gigli - www.eleonline.it</i></span>"; 252 $style .="</td></tr></table>"; 253 $nomefile=strip_tags($datipdf).".pdf"; 254 $nomefile=str_replace(" ", "_",$nomefile); 255 // conversion HTML => PDF 256 257 require_once('inc/hpdf/html2pdf.class.php'); 258 $html2pdf = new HTML2PDF('L','A4', 'it'); 259 $html2pdf->WriteHTML($style, isset($_GET['vuehtml'])); 260 $html2pdf->Output($nomefile); 269 261 270 262
Note:
See TracChangeset
for help on using the changeset viewer.