Ersetzen der FPDF-Library durch TCPDF und Code-Formatierung
This commit is contained in:
@@ -1,43 +1,48 @@
|
||||
<?php
|
||||
$pdf->SetFont('Helvetica', 'B', 10);
|
||||
$pdf->Cell(10, 4, "Pos.", 'B');
|
||||
$pdf->Cell(10, 4, "Anz.", 'B');
|
||||
$pdf->Cell(160, 4, "Beschreibung", 'B', 1);
|
||||
|
||||
$pdf->SetFont('Helvetica', '', 10);
|
||||
$pdf_type = "liefer";
|
||||
$Gesamtpreis = 0;
|
||||
while ($ntp = $resultp->fetch_assoc()) {
|
||||
$pdf->Cell(10, 4, $ntp['Position']);
|
||||
$pdf->Cell(10, 4, $ntp['Anzahl']);
|
||||
$pdf->MultiCell(160, 4, $ntp['Bezeichnung'], 0, 'L');
|
||||
if (("" != $_SESSION['Firma']['Feld1_Name']) AND (preg_match("/".$pdf_type.",/", $_SESSION['Firma']['Feld1'])) AND ("" != $ntp['Feld1'])) {
|
||||
$pdf->SetFont('Helvetica', '', 8);
|
||||
$pdf->SetX(40);
|
||||
$pdf->MultiCell(160, 4, $ntp['Feld1'], 0, 'L');
|
||||
}
|
||||
if (("" != $_SESSION['Firma']['Feld2_Name']) AND (preg_match("/".$pdf_type.",/", $_SESSION['Firma']['Feld2'])) AND ("" != $ntp['Feld2'])) {
|
||||
$pdf->SetFont('Helvetica', 'I', 8);
|
||||
$pdf->SetX(40);
|
||||
$pdf->MultiCell(160, 4, $_SESSION['Firma']['Feld2_Name'].": ".$ntp['Feld2'], 0, 'L');
|
||||
}
|
||||
if (("" != $_SESSION['Firma']['Feld3_Name']) AND (preg_match("/".$pdf_type.",/", $_SESSION['Firma']['Feld3'])) AND ("" != $ntp['Feld3'])) {
|
||||
$pdf->SetFont('Helvetica', 'I', 8);
|
||||
$pdf->SetX(40);
|
||||
$pdf->MultiCell(160, 4, $_SESSION['Firma']['Feld3_Name'].": ".$ntp['Feld3'], 0, 'L');
|
||||
}
|
||||
if (("" != $_SESSION['Firma']['Feld4_Name']) AND (preg_match("/".$pdf_type.",/", $_SESSION['Firma']['Feld4'])) AND ("" != $ntp['Feld4'])) {
|
||||
$pdf->SetFont('Helvetica', 'I', 8);
|
||||
$pdf->SetX(40);
|
||||
$pdf->MultiCell(160, 4, $_SESSION['Firma']['Feld4_Name'].": ".$ntp['Feld4'], 0, 'L');
|
||||
}
|
||||
if ((("" != $_SESSION['Firma']['Feld5_Name']) AND ("Intern" != $_SESSION['Firma']['Feld5_Name'])) AND (preg_match("/".$pdf_type.",/", $_SESSION['Firma']['Feld5'])) AND ("" != $ntp['Feld5'])) {
|
||||
$pdf->SetFont('Helvetica', 'I', 8);
|
||||
$pdf->SetX(40);
|
||||
$pdf->MultiCell(160, 4, $_SESSION['Firma']['Feld5_Name'].": ".$ntp['Feld5'], 0, 'L');
|
||||
}
|
||||
$pdf->SetFont('Helvetica', '', 10);
|
||||
$y = $pdf->GetY();
|
||||
$pdf->Line(20,$y,200,$y);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$pdf->SetFont('Helvetica', 'B', 10);
|
||||
$pdf->Cell(10, 4, "Pos.", 'B');
|
||||
$pdf->Cell(10, 4, "Anz.", 'B');
|
||||
$pdf->Cell(160, 4, "Beschreibung", 'B', 1);
|
||||
|
||||
$pdf->SetFont('Helvetica', '', 10);
|
||||
$pdf_type = "liefer";
|
||||
$Gesamtpreis = 0;
|
||||
while ($ntp = $resultp->fetch_assoc())
|
||||
{
|
||||
$pdf->Cell(10, 4, $ntp['Position']);
|
||||
$pdf->Cell(10, 4, $ntp['Anzahl']);
|
||||
$pdf->MultiCell(160, 4, $ntp['Bezeichnung'], 0, 'L');
|
||||
if (("" != $_SESSION['Firma']['Feld1_Name']) AND (preg_match("/" . $pdf_type . ",/", $_SESSION['Firma']['Feld1'])) AND ("" != $ntp['Feld1']))
|
||||
{
|
||||
$pdf->SetFont('Helvetica', '', 8);
|
||||
$pdf->SetX(40);
|
||||
$pdf->MultiCell(160, 4, $ntp['Feld1'], 0, 'L');
|
||||
}
|
||||
if (("" != $_SESSION['Firma']['Feld2_Name']) AND (preg_match("/" . $pdf_type . ",/", $_SESSION['Firma']['Feld2'])) AND ("" != $ntp['Feld2']))
|
||||
{
|
||||
$pdf->SetFont('Helvetica', 'I', 8);
|
||||
$pdf->SetX(40);
|
||||
$pdf->MultiCell(160, 4, $_SESSION['Firma']['Feld2_Name'] . ": " . $ntp['Feld2'], 0, 'L');
|
||||
}
|
||||
if (("" != $_SESSION['Firma']['Feld3_Name']) AND (preg_match("/" . $pdf_type . ",/", $_SESSION['Firma']['Feld3'])) AND ("" != $ntp['Feld3']))
|
||||
{
|
||||
$pdf->SetFont('Helvetica', 'I', 8);
|
||||
$pdf->SetX(40);
|
||||
$pdf->MultiCell(160, 4, $_SESSION['Firma']['Feld3_Name'] . ": " . $ntp['Feld3'], 0, 'L');
|
||||
}
|
||||
if (("" != $_SESSION['Firma']['Feld4_Name']) AND (preg_match("/" . $pdf_type . ",/", $_SESSION['Firma']['Feld4'])) AND ("" != $ntp['Feld4']))
|
||||
{
|
||||
$pdf->SetFont('Helvetica', 'I', 8);
|
||||
$pdf->SetX(40);
|
||||
$pdf->MultiCell(160, 4, $_SESSION['Firma']['Feld4_Name'] . ": " . $ntp['Feld4'], 0, 'L');
|
||||
}
|
||||
if ((("" != $_SESSION['Firma']['Feld5_Name']) AND ("Intern" != $_SESSION['Firma']['Feld5_Name'])) AND (preg_match("/" . $pdf_type . ",/", $_SESSION['Firma']['Feld5'])) AND ("" != $ntp['Feld5']))
|
||||
{
|
||||
$pdf->SetFont('Helvetica', 'I', 8);
|
||||
$pdf->SetX(40);
|
||||
$pdf->MultiCell(160, 4, $_SESSION['Firma']['Feld5_Name'] . ": " . $ntp['Feld5'], 0, 'L');
|
||||
}
|
||||
$pdf->SetFont('Helvetica', '', 10);
|
||||
$y = $pdf->GetY();
|
||||
$pdf->Line(20, $y, 200, $y);
|
||||
}
|
||||
Reference in New Issue
Block a user