ppeasy/public/pdfcreation/headercertificatetable.php
2025-01-21 10:23:49 +01:00

63 lines
2.4 KiB
PHP

<?php
$citytitle = html_entity_decode($citytitle);
$citytitleb = utf8_decode($citytitle);
//invoice contacts
// ***start with invoice address
$kindcont = 'headercertificate';
// parse contacts data with variable kindofcontacts
$contactsinfo = mysqli_query($cmctrfdb, "SELECT * FROM contacts LEFT JOIN countries ON countries.idcountries=contacts.country WHERE contacts.idtrf='$idtrf' AND contacts.kindofcontacts=
'$kindcont'");
$contactsinfoData = mysqli_fetch_assoc($contactsinfo);
$companyname = $contactsinfoData['companyname'];
$pdf->SetFont('Arial', '', 8);
$pdf->SetFont('', 'B', '10');
$pdf->Cell(190, 6, $headercertpdf, 1, 0, 'C');
$pdf->Ln();
$pdf->SetFont('', '', 8);
$pdf->Cell(40, 6, $companypdf, 1, 0, 'L');
$pdf->SetFillColor(232, 242, 255);
$companyname = html_entity_decode($companyname);
$companyname = iconv('UTF-8', 'windows-1252', $companyname);
$pdf->Cell(150, 6, $companyname, 1, 0, 'L', TRUE);
$pdf->Ln();
$pdf->Cell(40, 6, $addresspdf, 1, 0, 'L');
$contactsaddress = html_entity_decode($contactsinfoData['address']);
$contactsaddress = mb_convert_encoding($contactsaddress, 'ISO-8859-1', 'UTF-8'); // Conversione diretta
$contactsaddress = iconv('ISO-8859-1', 'windows-1252//TRANSLIT', $contactsaddress);
$pdf->Cell(150, 6, $contactsaddress, 1, 0, 'L', TRUE);
$pdf->Ln();
$pdf->Cell(40, 6, $citytitleb, 1, 0, 'L');
$pdf->Cell(55, 6, $contactsinfoData['city'], 1, 0, 'L', TRUE);
$pdf->Cell(40, 6, $zippdf, 1, 0, 'L');
$pdf->Cell(55, 6, $contactsinfoData['cap'], 1, 0, 'L', TRUE);
$pdf->Ln();
$pdf->Cell(40, 6, $vatpdf, 1, 0, 'L');
$pdf->Cell(55, 6, $contactsinfoData['piva'], 1, 0, 'L', TRUE);
$pdf->Cell(40, 6, $countrypdf, 1, 0, 'L');
$pdf->Cell(55, 6, $contactsinfoData['namecountry'], 1, 0, 'L', TRUE);
$pdf->Ln();
$pdf->Cell(40, 6, $phonepdf, 1, 0, 'L');
$pdf->Cell(55, 6, $contactsinfoData['telephone'], 1, 0, 'L', TRUE);
$pdf->Cell(40, 6, $emailpdf, 1, 0, 'L');
$pdf->Cell(55, 6, $contactsinfoData['email'], 1, 0, 'L', TRUE);
$pdf->Ln();
$pdf->Cell(40, 6, $contactnamepdf, 1, 0, 'L');
$pdf->Cell(55, 6, $contactsinfoData['contactname'], 1, 0, 'L', TRUE);
$pdf->Cell(40, 6, $contactsurnamepdf, 1, 0, 'L');
$pdf->Cell(55, 6, $contactsinfoData['contactsurname'], 1, 0, 'L', TRUE);
$namecertificatecontact = $contactsinfoData['contactname'];
$surnamecertificatecontact = $contactsinfoData['contactsurname'];
$namesurnamecertcontact = $namecertificatecontact . ' ' . $surnamecertificatecontact;
$pdf->Ln();
?>