<div class="content-wrapper">
  <!-- Content -->

  <div class="container-xxl flex-grow-1 container-p-y pt-0">
    <h4 class="fw-bold py-3 mb-0 d-none d-sm-block"><span class="text-muted fw-light">Daftar Ulang/</span> Unduhan</h4>
    <div class="alert alert-info" role="alert">
      Dicetak di kertas ukuran Folio / F4
    </div>
    <?php if ($this->session->flashdata('alert') == !"") {
      $data = $this->session->flashdata('alert');
      echo '<div class="alert alert-' . $data['tipe'] . ' alert-dismissible" role="alert">' . $data['isi'] . '<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button></div>';
    };
    ?>
    <style>
      @media screen and (max-width: 480px) {
      * {
        --ubah: scale(0.5) !important;
      }
    }
      @media (min-width: 300px) {
        .preview {
          height: 80vh;
          --ubah: scale(0.5) !important;
        }
      }

      @media (min-width: 700px) {
        .preview {
          height: 100vh;
          --ubah: scale(1) !important;
        }
      }
    </style>
    <div class="row">
      <div class="col-xl-9 col-md-8 col-12 mb-md-0">
        <div class="card overflow-hidden mb-4 preview">
          <div class="card-body m-0 p-0 d-flex align-content-center" id="both-scrollbars">
            <!-- <div class="spinner-grow text-primary m-auto" style="position: relative;" role="status">
              <span class="visually-hidden">Loading...</span>
            </div> -->
            <?php if ($tombol == 0) {
              echo '<object style="position: absolute;" data="' . base_url() . 'aksi/preview/' . $this->session->userdata('nisn') . '/ayah" width="100%" height="100%"></object>';
            } else if ($tombol == 1) {
              echo '<object style="position: absolute;" data="' . base_url() . 'aksi/preview/' . $this->session->userdata('nisn') . '/ibu" width="100%" height="100%"></object>';
            } else echo '<object style="position: absolute;" data="' . base_url() . 'aksi/preview/' . $this->session->userdata('nisn') . '/wali" width="100%" height="100%"></object>';
            ?>
          </div>
        </div>
      </div>
      <div class="col-xl-3 col-md-4 col-12 invoice-actions p-1 sticky-bottom">
        <div class="card">
          <div class="card-body d-flex flex-column p-3">
            <?php if ($tombol == 0) {
              echo '<a onClick="showLoading()" class="btn btn-primary btn-page-block-custom d-grid w-100 mb-1" href="' . base_url() . 'aksi/unduh/' . $this->session->userdata('nisn') . '/ayah">Unduh</a>';
            } else if ($tombol == 1) {
              echo '<a class="btn btn-primary btn-page-block-custom d-grid w-100 mb-1" href="' . base_url() . 'aksi/unduh/' . $this->session->userdata('nisn') . '/ibu">Unduh</a>';
            } else echo '<a class="btn btn-primary btn-page-block-custom d-grid w-100 mb-1" href="' . base_url() . 'aksi/unduh/' . $this->session->userdata('nisn') . '/wali">Unduh</a>'; ?>
            <div class="p-1">
              <a href="../formunduhan" class="btn btn-label-primary d-grid w-100 mb-1">Ubah</a>
              <a href="../" class="btn btn-label-secondary d-grid w-100">Edit Data Diri</a>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <script type="text/javascript">
    document.title = "Unduhan data <?= $this->session->userdata('nama') ?>";
    document.getElementById("menu1").classList.add("active", "open");
    document.getElementById("m1-2").classList.add("active");
  </script>
  <link rel="stylesheet" href="../../assets/vendor/libs/spinkit/spinkit.css" />
  <script src="../../assets/vendor/libs/block-ui/block-ui.js"></script>