mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-10 00:34:17 -04:00
- Add esc() for dynamic output in HTML attributes and URLs - Cast numeric values to int for CSS properties - Fix invalid 'borderspacing' CSS property to 'border-spacing' - Add quotes around class attribute Closes #4487 Co-authored-by: Ollama <ollama@steganos.dev>
42 lines
1.5 KiB
PHP
42 lines
1.5 KiB
PHP
<?php
|
|
/**
|
|
* @var array $barcode_config
|
|
* @var array $items
|
|
*/
|
|
|
|
use App\Libraries\Barcode_lib;
|
|
|
|
$barcode_lib = new Barcode_lib();
|
|
?>
|
|
|
|
<!doctype html>
|
|
<html lang="<?= current_language_code() ?>">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title><?= esc(lang('Items.generate_barcodes')) ?></title>
|
|
<link rel="stylesheet" href="<?= esc(base_url('css/barcode_font.css'), 'url') ?>">
|
|
<style>
|
|
.barcode svg {
|
|
height: <?= (int) $barcode_config['barcode_height'] ?>px;
|
|
width: <?= (int) $barcode_config['barcode_width'] ?>px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body class="<?= esc('font_' . $barcode_lib->get_font_name($barcode_config['barcode_font']), 'attr') ?>" style="font-size: <?= (int) $barcode_config['barcode_font_size'] ?>px;">
|
|
<table style="border-spacing: <?= (int) $barcode_config['barcode_page_cellspacing'] ?>px; width: <?= (int) $barcode_config['barcode_page_width'] ?>%;">
|
|
<tr>
|
|
<?php
|
|
$count = 0;
|
|
foreach ($items as $item) {
|
|
if ($count % $barcode_config['barcode_num_in_row'] == 0 && $count != 0) {
|
|
echo '</tr><tr>';
|
|
}
|
|
echo '<td>' . $barcode_lib->display_barcode($item, $barcode_config) . '</td>';
|
|
$count++;
|
|
}
|
|
?>
|
|
</tr>
|
|
</table>
|
|
</body>
|
|
</html>
|