55 lines
2.0 KiB
PHP
55 lines
2.0 KiB
PHP
<?php
|
|
use chillerlan\QRCode\QRCode;
|
|
use chillerlan\QRCode\QROptions;
|
|
|
|
// QR code options - small padding, high quality
|
|
$options = new QROptions([
|
|
'outputType' => QRCode::OUTPUT_IMAGE_PNG,
|
|
'scale' => 10,
|
|
'quietzoneSize' => 1,
|
|
]);
|
|
$qrcode = new QRCode($options);
|
|
?>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<style>
|
|
* { margin: 0; padding: 0; }
|
|
html, body { margin: 0; padding: 0; }
|
|
body { font-family: Arial, sans-serif; color: #000; }
|
|
table { border-collapse: collapse; }
|
|
.label-page {
|
|
height: 25mm;
|
|
width: 50mm;
|
|
overflow: hidden;
|
|
page-break-after: always;
|
|
}
|
|
/* Last page should not have a break if possible, but wkhtmltopdf handles it fine usually */
|
|
.label-page:last-child {
|
|
page-break-after: auto;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<?php foreach($articles as $article):
|
|
$qrData = "WA:" . $article->id . ":" . $article->articleNumber;
|
|
$qrCodeBase64 = $qrcode->render($qrData);
|
|
?>
|
|
<div class="label-page">
|
|
<table cellpadding="0" cellspacing="0" border="0" style="width: 50mm; height: 25mm;">
|
|
<tr>
|
|
<td style="width: 22mm; height: 25mm; vertical-align: middle; text-align: center;">
|
|
<img src="<?php echo $qrCodeBase64; ?>" style="width: 21mm; height: 21mm;">
|
|
</td>
|
|
<td style="height: 25mm; vertical-align: middle; padding-left: 1mm; padding-right: 1mm;">
|
|
<img src="<?php echo BASEDIR; ?>/public/assets/images/xinon-full-transparent.png" style="width: 24mm; height: auto; display: block; margin-bottom: 1mm;">
|
|
<div style="font-size: 10px; font-weight: bold; color: #000; text-align: center;"><?php echo htmlspecialchars($article->articleNumber); ?></div>
|
|
<div style="font-size: 7px; color: #000; margin-top: 1px; word-wrap: break-word; overflow: hidden; text-align: center;"><?php echo htmlspecialchars($article->title); ?></div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</body>
|
|
</html>
|