<div class="content-header">
  <h4>Data Pasien</h4>
  <a href="<?= site_url('pasien/tambah');?>" class="btn btn-primary mb-3">
    <i class="fas fa-plus"></i> Tambah Pasien
  </a>
</div>

<div class="card">
  <div class="card-header">Filter</div>
  <div class="card-body">
    <form method="get">
      <div class="form-row">
        <div class="col"><input type="text" name="rme_no" value="<?= $this->input->get('rme_no');?>" class="form-control" placeholder="No RME"></div>
        <div class="col"><input type="text" name="nama_lengkap" value="<?= $this->input->get('nama_lengkap');?>" class="form-control" placeholder="Nama"></div>
        <div class="col"><input type="date" name="tanggal_lahir" value="<?= $this->input->get('tanggal_lahir');?>" class="form-control"></div>
        <div class="col"><input type="text" name="nik" value="<?= $this->input->get('nik');?>" class="form-control" placeholder="NIK"></div>
        <div class="col"><button class="btn btn-success"><i class="fas fa-search"></i></button></div>
      </div>
    </form>
  </div>
</div>

<div class="card">
  <div class="card-body">
    <table class="table table-bordered table-striped">
      <thead>
        <tr>
          <th>No RME</th>
          <th>Nama</th>
          <th>Tanggal Lahir</th>
          <th>NIK</th>
          <th>Aksi</th>
        </tr>
      </thead>
      <tbody>
        <?php foreach($pasien as $p): ?>
        <tr>
          <td><?= $p->rme_no; ?></td>
          <td><?= $p->nama_lengkap; ?></td>
          <td><?= $p->tanggal_lahir; ?></td>
          <td><?= $p->nik; ?></td>
          <td>
            <a href="<?= site_url('pasien/detail/'.$p->pasien_id);?>" class="btn btn-info btn-sm">Detail</a>
            <a href="<?= site_url('pasien/edit/'.$p->pasien_id);?>" class="btn btn-warning btn-sm">Edit</a>
          </td>
        </tr>
        <?php endforeach; ?>
      </tbody>
    </table>
    <div><?= $links; ?></div>
  </div>
</div>
