<?php $this->load->view('report_pdf/pdf_header'); ?>
<?php
$this->load->helper('report');
$from_barcode = isset($from_barcode) ? $from_barcode : '';
$to_barcode = isset($to_barcode) ? $to_barcode : '';
$itype = isset($itype) ? $itype : '';
$itype_label = isset($itype_label) && $itype_label !== '' ? $itype_label : $itype;
$columns = isset($columns) && is_array($columns) ? $columns : array();
$show_title = !isset($show_title) ? true : (bool) $show_title;
if ($show_title) { ?>
<p style="text-align:center;font-size:14px;margin:5px 0;">
    <b>BARCODE RANGE REPORT</b><br>
    <span style="font-size:12px;">
        <?php if ($itype_label !== '') { ?>
            Item Type: <?php echo htmlspecialchars((string) $itype_label); ?><br>
        <?php } ?>
        From <?php echo htmlspecialchars((string) $from_barcode); ?>
        To <?php echo htmlspecialchars((string) $to_barcode); ?>
    </span>
</p>

<p style="text-align:right;font-size:13px;margin:5px 0;">
    Date: <?php echo date("d/m/Y", strtotime($today)); ?>
</p>

<p style="text-align:left ;font-size:13px;margin:5px 0 5px;">
    Total Records : <?php echo report_pdf_total_rows(isset($report) ? $report : array(), isset($pdf_total_rows) ? $pdf_total_rows : null); ?>
</p>
<?php } ?>
<div id="content" style="margin-top: 10px;">
<?php if (empty($columns)) { ?>
<p>No columns to display.</p>
<?php } else { ?>
<table style="border-collapse: collapse;width:100%;text-align:left;margin-bottom: 20px;" border="1" class="table">
        <tr style="text-align: center;">
            <?php foreach ($columns as $label => $key) { ?>
            <th><?php echo htmlspecialchars($label); ?></th>
            <?php } ?>
        </tr>
        <?php foreach ($report as $row) { ?>
            <tr>
                <?php foreach ($columns as $label => $key) { ?>
                <td><?php echo htmlspecialchars((string) report_cell($row, $key)); ?></td>
                <?php } ?>
            </tr>
        <?php } ?>
    </table>
<?php } ?>
</div>
