<?php
$this->load->view('partials/report_start', $this->data);
$this->load->helper('report');
$report = isset($report) ? $report : array();
$year = isset($year) ? $year : date('Y');
$columns = report_catalogue_columns('book');
?>
<form method="post">
  <div class="row filter-row align-items-end mb-3">
    <div class="col-md-3">
      <div class="form-group mb-0">
        <label>Accession Year</label>
        <input type="number" class="form-control" name="year" value="<?php echo htmlspecialchars($year); ?>" required min="1900" max="2100">
      </div>
    </div>
    <div class="col-md-6">
      <p class="mb-0 text-muted small mt-4">Same columns as Barcode Range Book report, filtered by year of accession.</p>
    </div>
    <div class="col-md-3">
      <?php $this->load->view('partials/report_actions'); ?>
    </div>
  </div>
<?php if (!empty($searched)) { ?>
  <div class="report-results-toolbar">
  <p class="report-summary mb-0"><strong><?php echo count($report); ?></strong> item(s) accessioned in <strong><?php echo htmlspecialchars($year); ?></strong></p>
  <?php $this->load->view('partials/report_exports'); ?>
</div>
  <?php
  $this->load->view('partials/report_datatable', array(
      'columns' => $columns,
      'rows' => $report,
      'table_id' => 'accessionYearTable',
  ));
  ?>
<?php } ?>
</form>
<?php $this->load->view('partials/report_end'); ?>
