codice:
if ($sezione = "targhe"){
mysql_select_db($database_conn, $conn);
$query_targhe = sprintf("SELECT * FROM targhe");
$targhe = mysql_query($query_targhe, $conn) or die(mysql_error());
$row_targhe = mysql_fetch_assoc($targhe);
$totalRows_targhe = mysql_num_rows($targhe);
$uno = $row_targhe['id'];
$due = $row_targhe['cmq'];
$tre = $row_targhe['neutro'];
$quattro = $row_targhe['base'];
$cinque = $row_targhe['rigoinpiu'];
$pdf=new FPDF();
$pdf->AddPage();
$pdf->AliasNbPages();
$pdf->SetFont('Arial','B',6);
$pdf->Image("../../layout/logopdf.jpg",10,10,190,12);
//$pdf->SetDrawColor(0,90,173); // colore linea
//$pdf->Line(0, 30, 210, 30); // Crea una linae orizzontale
if ($colore == "vinile") {
$pdf->SetFillColor(10,78,149); // colore fondo
$pdf->SetTextColor(255,255,255); // colore testo
} elseif ($colore == "serigrafia") {
$pdf->SetFillColor(0,90,173); // colore fondo
$pdf->SetTextColor(255,255,255); // colore testo
} elseif ($colore == "timbri") {
$pdf->SetFillColor(180,34,107); // colore fondo
$pdf->SetTextColor(255,255,255); // colore testo
}elseif ($colore == "targhe") {
$pdf->SetFillColor(236,146,36); // colore fondo
$pdf->SetTextColor(255,255,255); // colore testo
};
$pdf->SetFillColor(10,78,149); // colore fondo
$pdf->SetTextColor(0,0,0); // colore testo
$pdf->SetXY(0, 30);
$sezione = strtoupper($sezione);
$pdf->MultiCell(0,0,"LISTINO IN CONCESSIONE A $cliente STAMPATO IN DATA $data - SEZIONE: $sezione", 0, 'C',0);
$pdf->SetXY(60, 40); // CMQ
$pdf->SetFillColor(0,90,173); // colore fondo
$pdf->SetTextColor(255,255,255); // colore testo
$pdf->Cell(30, 5,'CMQ',0,0,'C',1);
$pdf->SetXY(90, 40); // BASE
$pdf->SetFillColor(0,90,173); // colore fondo
$pdf->SetTextColor(255,255,255); // colore testo
$pdf->Cell(30, 5,'BASE',0,0,'C',1);
$pdf->SetXY(120, 40); // RIGO IN PIU'
$pdf->SetFillColor(0,90,173); // colore fondo
$pdf->SetTextColor(255,255,255); // colore testo
$pdf->Cell(30, 5,'RIGO IN PIU',0,0,'C',1);
do {
//ORDINO I VALORI
$pdf->SetXY(60, 46); // RIGO IN PIU'
$pdf->SetFillColor(220,218,218); // colore fondo
$pdf->SetTextColor(0,0,0); // colore testo
$pdf->Cell(30, 2,$due,0,0,'C',1);
$pdf->SetXY(90, 46); // RIGO IN PIU'
$pdf->SetFillColor(220,218,218); // colore fondo
$pdf->SetTextColor(0,0,0); // colore testo
$pdf->Cell(30, 2,$quattro,0,0,'C',1);
$pdf->SetXY(120, 46); // RIGO IN PIU'
$pdf->SetFillColor(220,218,218); // colore fondo
$pdf->SetTextColor(0,0,0); // colore testo
$pdf->Cell(30, 2,$cinque,0,0,'C',1);
} while($row_targhe = mysql_fetch_assoc($targhe));
mkdir("../../public/pdf/$cliente", 0777);
$title='MECCANICA';
$pdf->SetTitle($title);
$pdf->SetAuthor('ciao');
$pdf->Output("../../public/pdf/$cliente/$cliente - $categoria - $data.pdf");
$pdf->Output();