<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Cari Pasien</title>
  <!-- Favicon -->
  <link rel="shortcut icon" href="{{url('design/img/svg/Logo_Original.png')}}">
  <!-- Bootstrap -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
  <!-- Fontawesome -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
  <!-- Custom styles -->
  <link rel="stylesheet" href="{{url('design/css/style.min.css')}}">
  <link rel="stylesheet" href="{{url('design/fonts/stylesheet.css')}}">
  <!-- Froala -->
  <link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />
  <!-- Project Style -->
  <link rel="stylesheet" href="{{url('design/css/project-style.css')}}">
  <!-- Flatpicker -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">

</head>

<body>
  <div class="layer"></div>
  <!-- ! Body -->
  <div class="page-flex">
    <!-- ! Sidebar -->
    @include('component.sidebar')
    <div class="main-wrapper">
      <!-- ! Main nav -->
      @include('component.navbar')
      <!-- ! Main -->
      <main class="main users chart-page" id="skip-target">
        <div class="container">
          <h2 class="main-title">Cari Pasien</h2>
          <div class="row justify-content-center">
            <div class="col-lg-8">
              <div class="white-block">
                <p class="stat-cards-info__num mb-3" style="font-size: 22px;">Cari Data Pasien</p>
                <div class="search-wrapper">
                  <i data-feather="search" aria-hidden="true"></i>
                  <input class="w-100" type="text" id="search" placeholder="Masukan Kata Kunci ..." required>
                </div>
                <span class="mt-1" style="font-size: 14px;color: gray;">Cari : Nama / No.Rek.Medis / Alamat</span>
              </div>
              <div class="position-relative">
                <div class="preloader">
                  <div class="loading">
                    <div class="spinner-border" role="status">
                      <span class="sr-only">Loading...</span>
                    </div>
                  </div>
                </div>
                <div class="list-data_pasien">
                  @foreach ($dataPasien as $dp)
                  <a href="{{url('pendaftaran/pemeriksaan/'.$dp->dp_id)}}">
                    <div class="card-data_pasien white-block">
                      <div class="row">
                        <div class="col-12 mb-3">
                          <p class="data-pasien_lama mb-1">{{$dp->dp_nama}}</p>
                          <p class="sub-pasien_lama mb-2" style="color: black;">
                            <?php
                            $usia = date_diff(date_create($dp->dp_tgl_lahir), date_create('now'))->y;
                            echo $usia . " tahun";
                            ?>
                            / {{$dp->dp_jenis_kelamin}}</p>
                          <p class="sub-pasien_lama">No. KTP</p>
                          <p class="data-pasien_lama">{{$dp->dp_no_ktp}}</p>
                        </div>
                        <div class="col-6">
                          <p class="sub-pasien_lama">No. Rekam Medis</p>
                          <p class="data-pasien_lama-2">{{$dp->dp_no_rm}}</p>
                        </div>
                        <div class="col-6">
                          <p class="sub-pasien_lama">No. BPJS</p>
                          <p class="data-pasien_lama-2">{{$dp->dp_no_bpjs}}</p>
                        </div>
                        <div class="col-12 mt-3">
                          <p class="sub-pasien_lama">Alamat</p>
                          <p class="data-pasien_lama-alamat"><?php echo $dp->dp_alamat ?></p>
                        </div>
                      </div>
                    </div>
                  </a>
                  @endforeach
                </div>
              </div>
            </div>
          </div>
        </div>
      </main>
      <!-- ! Footer -->
      @include('component.footer')
    </div>
  </div>
  <!-- jQuery -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
  <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js" integrity="sha256-DI6NdAhhFRnO2k51mumYeDShet3I8AKCQf/tf7ARNhI=" crossorigin="anonymous"></script>
  <!-- JavaScript Bundle with Popper -->
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
  <!-- Chart library -->
  <script src="{{url('design/plugins/chart.min.js')}}"></script>
  <!-- Icons library -->
  <script src="{{url('design/plugins/feather.min.js')}}"></script>
  <!-- Custom scripts -->
  <script src="{{url('design/js/script.js')}}"></script>
  <!-- Flatpicker -->
  <script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
  <!-- Notiflix -->
  <script src="https://cdn.jsdelivr.net/npm/notiflix@3.0.1/dist/notiflix-aio-3.0.1.min.js"></script>

  <script>
    $("#pendaftaran").addClass("active");

    $(document).ready(function() {
      $(".preloader").fadeOut(400);

      $(".list-data_pasien .card-data_pasien").hide();
      $("#search").on("keyup", function() {
        var value = $(this).val().toLowerCase();
        $(".list-data_pasien .card-data_pasien").filter(function() {
          $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
        });
        if (!value.trim()) {
          $(".list-data_pasien .card-data_pasien").hide();
        }
      });
    });
  </script>

  @include('component.notif')

</body>

</html>