<?php
$this->load->view('partials/report_start', $this->data);
$report = isset($report) ? $report : array();
$subject = isset($subject) ? $subject : '';
?>
<form method="post">
  <div class="row filter-row align-items-end mb-3">
    <div class="col-md-5">
      <div class="form-group mb-0">
        <label>Subject</label>
        <input type="text" class="form-control" name="subject" value="<?php echo htmlspecialchars($subject); ?>" required placeholder="Enter subject keyword">
      </div>
    </div>
    <div class="col-md-4">
      <p class="mb-0 text-muted small mt-4">Books (BK) matching MARC subject (650$a).</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) for subject <strong><?php echo htmlspecialchars($subject); ?></strong></p>
  <?php $this->load->view('partials/report_exports'); ?>
</div>
  <?php
  $this->load->view('partials/report_datatable', array(
      'columns' => array(
          'S.No' => 'S_No',
          'Date' => 'Date',
          'Acc No' => 'Accession_Number',
          'Author 1' => 'Author_1',
          'Author 2' => 'Author_2',
          'Title' => 'Title',
          'Sub Title' => 'Sub_Title',
          'Edition' => 'Edition',
          'Subject' => 'Subject',
          'Publisher' => 'Publisher',
          'Place' => 'Place_of_Pub',
          'Year' => 'Year',
          'ISBN' => 'ISBN',
          'Pages' => 'Pages',
          'Vol' => 'Vol',
          'Enc Mat' => 'Enc_Mat',
          'Supplier' => 'Book_Supplier_Name',
          'Invoice No' => 'Invoice_No',
          'Invoice Date' => 'Invoice_Date',
          'Curr Code' => 'Curr_Code',
          'Price' => 'Price',
          'Price INR' => 'Price_INR',
          'Dis%' => 'Dis',
          'Location' => 'Location',
          'Nature' => 'Nature',
          'Status' => 'Status',
          'Remarks' => 'Remarks',
      ),
      'rows' => $report,
      'table_id' => 'subjectWiseTable',
  ));
  ?>
<?php } ?>
</form>
<?php $this->load->view('partials/report_end'); ?>
