dashboard/print.php angepasst

This commit is contained in:
aschwarz 2023-08-24 14:21:16 +02:00
parent 3f9a0b1cc4
commit abeff9f557
3 changed files with 26 additions and 14 deletions

View File

@ -1,4 +1,5 @@
<?php
require_once("../config.inc.php");
require('../fpdf186/fpdf.php');
require_once('../fpdf186/FPDI-master/src/autoload.php');
use setasign\Fpdi\Fpdi;
@ -9,9 +10,20 @@ $pdf = new FPDI();
#$pdf->SetFont('Arial','B',16);
#$pdf->Cell(40,10,'Hello World!');
$zsid= 4;
$query = "SELECT liednr, filename, originalname, CONVERT(liednr,DECIMAL)
FROM jumi_noten_daten a, jumi_noten_uploads b, jumi_noten_zusammenstellung_zuord c
WHERE b.jndid=c.jndid
AND a.jndid=b.jndid
AND c.zsid=4
ORDER BY CAST(liednr AS UNSIGNED), liednr";
$result = $db->query ($query)
or die ("Cannot execute query");
$pages_count = $pdf->setSourceFile('./test.pdf');
while ($row = $result->fetch_array()){
$pages_count = $pdf->setSourceFile("$row[filename]");
for($i = 1; $i <= $pages_count; $i++)
{
@ -22,11 +34,11 @@ for($i = 1; $i <= $pages_count; $i++)
$pdf->useTemplate($tplIdx, 0, 0);
if($i == 1){
$pdf->SetFont('Arial','B',20);
$pdf->SetY(5);
$pdf->Cell( 0, 10, '1', 0, 0, 'R' );
$pdf->SetFont('Arial','B',26);
$pdf->SetY(3);
$pdf->Cell( 0, 10, "$row[liednr]", 0, 0, 'R' );
}
}
}
$pdf->Output();
?>

Binary file not shown.