I'm trying to customize my report in FPDF
, it's a system that generates discount tickets, where they are printed in batches, for example batch of 50 units.
Tickets on this lot will have the same profile where it can be 10%, 20% and 30% off.
I would like to customize the background according to the profile.
I would like to know the profile of only one of the ticket's to make the comparison since the profile is the same for all of the lot
$result_tickets = "SELECT * FROM vouchers WHERE serial_lote = '112027511417'";
$resultado = mysqli_query($conn, $result_tickets);
$registros = mysqli_num_rows($resultado);
////ME VEIO ESTA IDEIA, PORÉM NÃO ESTÁ FUNCIONANDO..
$perfil_desconto = $resultado['desconto'];
if ($perfil_desconto == '10%') {
$template_background = "template-10.jpg";
} elseif ($perfil_desconto == '20%') {
$template_background = "template-20.jpg";
} elseif ($perfil_desconto == '30%') {
$template_background = "template-30.jpg";
} elseif ($perfil_desconto == '50%') {
$template_background = "template-50.jpg";
}
$pdf = new Fpdf ('p','mm','A4');
$pdf->SetAutoPageBreak(false);
$pdf->SetFont('Arial','','10');
$pdf->AddPage();
$pdf->Image("$template_background", 0,0,210,295);
Remembering that While has yet to pull all the data from the database and inserts it into the PDF, but I did not find it necessary to insert it here.