<div class="row" id="filter-content" style="display:none">
  <div class="col-md-12">
    <div class="portlet light">
      <div class="portlet-title">
        <div class="caption">
          <i class="fa fa-filter"></i>Filter Data
        </div>
      </div>
      <div class="portlet-body form">
        <form id="form-filter" class="horizontal-form">
          <div class="form-body">
            <div class="row">
              <div class="col-md-4">
                <div class="form-group" id="form_no_reg">
                  <label for="no_reg" class="control-label">No Registrasi</label>
                  <input type="text" id="no_reg" name="no_reg" class="form-control" placeholder="Nomor Registrasi">
                </div>
              </div>
              <div class="col-md-4">
                <div class="form-group" id="form_no_rekam_medis">
                  <label for="no_rekam_medis" class="control-label">No. Rekam Medis</label>
                  <input type="text" id="no_rekam_medis" name="no_rekam_medis" class="form-control" placeholder="Nomor Rekam Medis">
                </div>
              </div>
              <div class="col-md-4">
                <div class="form-group" id="form_nama_pasien">
                  <label for="nama_pasien" class="control-label">Nama Pasien</label>
                  <input type="text" id="nama_pasien" name="nama_pasien" class="form-control" placeholder="Nama Pasien">
                </div>
              </div>
            </div>
          </div>
          <div class="form-actions right">
            <a class="btn yellow-lemon btn-sm" id="reset-filter">
              <i class="fa fa-refresh"></i> Reset Filter
            </a>
            <button class="btn green-jungle btn-sm" id="tampilkan">
              <i class="fa fa-search"></i> Tampilkan
            </button>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>

<div class="row" id="portlet-content">
  <div class="col-md-12">
    <div class="portlet light" style="position:relative">
      <div class="portlet-title col-md-2">
        <div class="caption">
          <i class="fa fa-th-list"></i>Data <?= $judul ?>
        </div>
      </div>
      <div class="col-md-10" id="tombol-added" style="margin-bottom:5px; padding:0px; border-bottom:0px" id="tombol-action" style="display:none">
        <div style="float:right; overflow:hidden; margin-top:5px;">
          <a class="btn red-soft btn-sm" id="filter">
            <i class="fa fa-filter"></i> Filter Data
          </a>
          <a class="btn green btn-sm" target="_Blank" href="<?=site_url()?>/front_office/reg_dir/registrasi/whole_print">
            <i class="fa fa-print"></i> Print
          </a>     
        </div>
      </div>
      <div class="portlet-body" id="page-content" style="display:none">
        <div class="table-responsive">
          <table id="<?= $controller ?>_table" class="table table-bordered table-striped table-hover" style="width:100%; font-size:11px !important">
            <thead>
              <tr>
                <th class="text-center" style="font-size:10px !important">No</th>
                <th class="text-center" style="font-size:10px !important">No. Registrasi</th>
                <th class="text-center" style="font-size:10px !important">No. Rekam Medis</th>
                <th class="text-center" style="font-size:10px !important">Nama Pasien</th>
                <th class="text-center" style="font-size:10px !important">Type Pasien</th>
                <th class="text-center" style="font-size:10px !important">Aksi</th>
              </tr>
            </thead>
            <tbody>
              <tr align="center">   
                <td class="col-md-1">1</td>
                <td class="col-md-2">000001</td>
                <td class="col-md-2">BBMC-0000031</td>
                <td class="col-md-3">I KETUT KARDIKA</td>
                <td class="col-md-2">UMUM</td>
                <td class="col-md-2">
                  <a data-toggle="tooltip" data-placement="top" title="Detail Rekam Medis" href="<?= site_url('front_office/reg_dir/rekam_medis/buka_rekam_medis') ?>"><i class="fa fa-folder-open"></i></a> &nbsp;
                  <a data-toggle="tooltip" data-placement="top" title="Tambah Rekam Medis" href="<?= site_url('front_office/reg_dir/rekam_medis/tambah_rekam_medis') ?>"><i class="fa fa-plus-square"></i></a> &nbsp;                
                  <a data-toggle="tooltip" data-placement="top" title="Ubah Rekam Medis" href="<?= site_url('front_office/reg_dir/rekam_medis/edit_rekam_medis') ?>"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></a> &nbsp;
                  <a data-toggle="tooltip" data-placement="top" title="Hapus Rekam Medis" href="<?= site_url('front_office/reg_dir/rekam_medis/hapus_rekam_medis') ?>"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a>
                </td>
              </tr>
              <tr align="center">   
                <td class="col-md-1">2</td>
                <td class="col-md-2">000001</td>
                <td class="col-md-2">BBMC-0000031</td>
                <td class="col-md-3">I KETUT KARDIKA</td>
                <td class="col-md-2">UMUM</td>
                <td class="col-md-2">
                  <a data-toggle="tooltip" data-placement="top" title="Buka Rekam Medis" href="<?= site_url('front_office/reg_dir/rekam_medis/buka_rekam_medis') ?>"><i class="fa fa-folder-open"></i></a> &nbsp;
                  <a data-toggle="tooltip" data-placement="top" title="Tambah Rekam Medis" href="<?= site_url('front_office/reg_dir/rekam_medis/tambah_rekam_medis') ?>"><i class="fa fa-plus-square"></i></a> &nbsp;                  
                  <a data-toggle="tooltip" data-placement="top" title="Ubah Rekam Medis" href="<?= site_url('front_office/reg_dir/rekam_medis/edit_rekam_medis') ?>"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></a> &nbsp;
                  <a data-toggle="tooltip" data-placement="top" title="Hapus Rekam Medis" href="<?= site_url('front_office/reg_dir/rekam_medis/hapus_rekam_medis') ?>"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a>
                </td>
              </tr>
              <tr align="center">   
                <td class="col-md-1">3</td>
                <td class="col-md-2">000001</td>
                <td class="col-md-2">BBMC-0000031</td>
                <td class="col-md-3">I KETUT KARDIKA</td>
                <td class="col-md-2">UMUM</td>
                <td class="col-md-2">
                  <a data-toggle="tooltip" data-placement="top" title="Buka Rekam Medis" href="<?= site_url('front_office/reg_dir/rekam_medis/buka_rekam_medis') ?>"><i class="fa fa-folder-open"></i></a> &nbsp;
                  <a data-toggle="tooltip" data-placement="top" title="Tambah Rekam Medis" href="<?= site_url('front_office/reg_dir/rekam_medis/tambah_rekam_medis') ?>"><i class="fa fa-plus-square"></i></a> &nbsp;                 
                  <a data-toggle="tooltip" data-placement="top" title="Ubah Rekam Medis" href="<?= site_url('front_office/reg_dir/rekam_medis/edit_rekam_medis') ?>"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></a> &nbsp;
                  <a data-toggle="tooltip" data-placement="top" title="Hapus Rekam Medis" href="<?= site_url('front_office/reg_dir/rekam_medis/hapus_rekam_medis') ?>"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a>
                </td>
              </tr>
              <tr align="center">   
                <td class="col-md-1">4</td>
                <td class="col-md-2">000001</td>
                <td class="col-md-2">BBMC-0000031</td>
                <td class="col-md-3">I KETUT KARDIKA</td>
                <td class="col-md-2">UMUM</td>
                <td class="col-md-2">
                  <a data-toggle="tooltip" data-placement="top" title="Buka Rekam Medis" href="<?= site_url('front_office/reg_dir/rekam_medis/buka_rekam_medis') ?>"><i class="fa fa-folder-open"></i></a> &nbsp;
                  <a data-toggle="tooltip" data-placement="top" title="Tambah Rekam Medis" href="<?= site_url('front_office/reg_dir/rekam_medis/tambah_rekam_medis') ?>"><i class="fa fa-plus-square"></i></a> &nbsp;
                  <a data-toggle="tooltip" data-placement="top" title="Ubah Rekam Medis" href="<?= site_url('front_office/reg_dir/rekam_medis/edit_rekam_medis') ?>"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></a> &nbsp;
                  <a data-toggle="tooltip" data-placement="top" title="Hapus Rekam Medis" href="<?= site_url('front_office/reg_dir/rekam_medis/hapus_rekam_medis') ?>"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a>
                </td>
              </tr>
              <tr align="center">   
                <td class="col-md-1">5</td>
                <td class="col-md-2">000001</td>
                <td class="col-md-2">BBMC-0000031</td>
                <td class="col-md-3">I KETUT KARDIKA</td>
                <td class="col-md-2">UMUM</td>
                <td class="col-md-2">
                  <a data-toggle="tooltip" data-placement="top" title="Buka Rekam Medis" href="<?= site_url('front_office/reg_dir/rekam_medis/buka_rekam_medis') ?>"><i class="fa fa-folder-open"></i></a> &nbsp;
                  <a data-toggle="tooltip" data-placement="top" title="Tambah Rekam Medis" href="<?= site_url('front_office/reg_dir/rekam_medis/tambah_rekam_medis') ?>"><i class="fa fa-plus-square"></i></a> &nbsp;                
                  <a data-toggle="tooltip" data-placement="top" title="Ubah Rekam Medis" href="<?= site_url('front_office/reg_dir/rekam_medis/edit_rekam_medis') ?>"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></a> &nbsp;
                  <a data-toggle="tooltip" data-placement="top" title="Hapus Rekam Medis" href="<?= site_url('front_office/reg_dir/rekam_medis/hapus_rekam_medis') ?>"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a>
                </td>
              </tr>              
            </tbody>
            <tfoot>
              <tr>
                <th class="text-center" style="font-size:10px !important">No</th>
                <th class="text-center" style="font-size:10px !important">No Registrasi</th>
                <th class="text-center" style="font-size:10px !important">No. Rekam Medis</th>
                <th class="text-center" style="font-size:10px !important">Nama Pasien</th>
                <th class="text-center" style="font-size:10px !important">Type Pasien</th>
                <th class="text-center" style="font-size:10px !important">Aksi</th>
              </tr>
            </tfoot>
          </table>
        </div>
      </div>
      <?php $this->load->view('front_office/include/loading'); ?>
    </div>
  </div>
</div>
<script>
  $(document).ready(function() {
   var table=$('#<?=$controller?>_table').DataTable({
      "order": [[ 0, 'asc' ]],
      "processing": false,
      "serverSide": false,
      "searching": true,
      "language": {
            "url": "<?=base_url('media/assets/global/plugins/datatables/media/js')?>/indonesian.json"
       },
      "columnDefs": [
        {"targets": [0],"bSortable": false}
      ],
      "fnInitComplete": function(oSettings, json) {
        $('.dataTables_processing').css('display','none');
        $( "#loading-content" ).fadeOut( "fast", function() {
          $( "#tombol-action" ).fadeIn("fast");
          $( "#page-content" ).fadeIn("fast");
        });
      }
    });

  });

    $("#type_pasien").select2({
      placeholder: "Pilih Type Pasien",
      closeOnSelect: false,
      language: "id"
    });  

    $("#jk").select2({
      placeholder: "Pilih Jenis Kelamin",
      closeOnSelect: false,
      language: "id"
    });   

    $('#filter').click(function() {
      $( "#filter-content" ).slideToggle('fast');
    });

  $('.hapusdata').click(function(){
    if(confirm("Apakah kamu yakin menghapus entry ini?")){
      return true;
    }
    else{
      return false;
    }
  });
</script>
<?php $this->load->view('front_office/script/hapus_data');?>
