<div class="card card-inverse card-info">
  <div class="card-header">
    <h4 class="mb-10">Slip / Printer Settings</h4>
    <h6 class="card-subtitle">Configure printer, logo & footer</h6>
  </div>
  <div class="col-sm-12 p-4">
    <?= form_open_multipart('admin/slipsettings/save'); ?>
    
    <!-- Printer Name -->
    <div class="form-group">
      <label>Printer Name</label>
      <input type="text" name="printer_name" class="form-control"
             value="<?= !empty($SlipSettings->printer_name) ? html_escape($SlipSettings->printer_name) : '' ?>">
      <small class="text-muted">Exact name from QZ-Tray / Windows printer list</small>
    </div>

    <!-- Footer / Thank-you Message -->
    <div class="form-group">    
      <label>Thank-you / Footer Message</label>
      <input type="text" name="slip_footer" class="form-control"
             value="<?= !empty($SlipSettings->slip_footer) ? html_escape($SlipSettings->slip_footer) : '' ?>">
    </div>

    <!-- Slip Logo Upload -->
    <div class="form-group row">
      <div class="col-md-8">
        <label>Slip Logo (Icon.bmp)</label>
        <input type="file" name="slip_logo" class="form-control">
        <small class="text-muted">Upload only BMP file named Icon.bmp</small>
      </div>
      <div class="col-md-4">
        <?php if (!empty($SlipSettings->slip_logo)): ?>
          <div class="mt-2">
            <img src="<?= base_url('uploads/settings/' . $SlipSettings->slip_logo) . '?v=' . time() ?>"
     alt="Slip Logo" style="max-height:60px; max-width:100%;">
          </div>
        <?php else: ?>
          <div class="mt-2 text-muted small">No logo uploaded yet</div>
        <?php endif; ?>
      </div>
    </div>

    <button type="submit" class="btn btn-primary mt-3">Save Settings</button>
    <?= form_close(); ?>

    <!-- QZ-Tray Download -->
    <div class="mt-4">
      <a href="https://qz.io/download/" target="_blank" class="btn btn-success">
        <i class="fas fa-download"></i> Download QZ-Tray (Official Site)
      </a>
    </div>
  </div>
</div>