Files
thetool/Layout/default/WarehouseArticle/LABEL_BULK.php
2025-12-29 11:36:50 +01:00

55 lines
2.1 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: 63mm;
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: 63mm; height: 25mm;">
<tr>
<td style="width: 24mm; height: 25mm; position: relative;">
<img src="<?php echo $qrCodeBase64; ?>" style="width: 21mm; height: 21mm; position: absolute; top: 50%; left: 50%; margin-top: -10.5mm; margin-left: -10.5mm;">
</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: 0 auto 1mm auto;">
<div style="font-size: 11px; font-weight: bold; color: #000; text-align: center;"><?php echo htmlspecialchars($article->articleNumber); ?></div>
<div style="font-size: 9px; 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>