diff --git a/dashboard/print.php b/dashboard/print.php index 03333b7..b480071 100644 --- a/dashboard/print.php +++ b/dashboard/print.php @@ -1,4 +1,5 @@ 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()){ -for($i = 1; $i <= $pages_count; $i++) -{ - $pdf->AddPage(); + $pages_count = $pdf->setSourceFile("$row[filename]"); - $tplIdx = $pdf->importPage($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' ); + for($i = 1; $i <= $pages_count; $i++) + { + $pdf->AddPage(); + + $tplIdx = $pdf->importPage($i); + + $pdf->useTemplate($tplIdx, 0, 0); + + if($i == 1){ + $pdf->SetFont('Arial','B',26); + $pdf->SetY(3); + $pdf->Cell( 0, 10, "$row[liednr]", 0, 0, 'R' ); + } } - } $pdf->Output(); -?> +?> \ No newline at end of file diff --git a/dashboard/test.pdf b/dashboard/test.pdf deleted file mode 100644 index 000370a..0000000 Binary files a/dashboard/test.pdf and /dev/null differ diff --git a/media/file_upload/noten/20230725_110732_Rechnung_Noten_Jugendchor.pdf b/media/file_upload/noten/20230725_110732_Rechnung_Noten_Jugendchor.pdf deleted file mode 100644 index 3d37693..0000000 Binary files a/media/file_upload/noten/20230725_110732_Rechnung_Noten_Jugendchor.pdf and /dev/null differ