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 <?php
require_once("../config.inc.php");
require('../fpdf186/fpdf.php'); require('../fpdf186/fpdf.php');
require_once('../fpdf186/FPDI-master/src/autoload.php'); require_once('../fpdf186/FPDI-master/src/autoload.php');
use setasign\Fpdi\Fpdi; use setasign\Fpdi\Fpdi;
@ -9,24 +10,35 @@ $pdf = new FPDI();
#$pdf->SetFont('Arial','B',16); #$pdf->SetFont('Arial','B',16);
#$pdf->Cell(40,10,'Hello World!'); #$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++) $pages_count = $pdf->setSourceFile("$row[filename]");
{
$pdf->AddPage();
$tplIdx = $pdf->importPage($i); for($i = 1; $i <= $pages_count; $i++)
{
$pdf->useTemplate($tplIdx, 0, 0); $pdf->AddPage();
if($i == 1){ $tplIdx = $pdf->importPage($i);
$pdf->SetFont('Arial','B',20);
$pdf->SetY(5); $pdf->useTemplate($tplIdx, 0, 0);
$pdf->Cell( 0, 10, '1', 0, 0, 'R' );
if($i == 1){
$pdf->SetFont('Arial','B',26);
$pdf->SetY(3);
$pdf->Cell( 0, 10, "$row[liednr]", 0, 0, 'R' );
}
} }
} }
$pdf->Output(); $pdf->Output();
?> ?>

Binary file not shown.