<?php
  session_start();
  error_reporting(1);
  include '../assets/config/koneksi.php';
  if(empty($_SESSION))
  {
    header("Location: ../login");
  }
?>
<!DOCTYPE html>
<html> <!-- Bagian halaman HTML yang akan konvert -->
<head>
    <meta charset='UTF-8'>
    <title><?php $i = mysqli_fetch_array(mysqli_query($koneksi, "SELECT * FROM identitas LIMIT 1"));  echo "$i[nama] "; ?></title>
  <link rel="shortcut icon" href="../assets/img/logo/<?php echo "$i[gambar] "; ?>">
<style>
        img {
            width: 100%;
            height: auto;
        }
        body {
            width: 8.59cm;
            height: 5.4cm;
            margin: 0;
            padding: 0;
        }
* {
  box-sizing: border-box;
}

/* Create two equal columns that floats next to each other */
.column {
  float: left;
  width: 50%;
  padding: 10px;
}

/* Clear floats after the columns */
.row:after {
  content: "";
  display: table;
  clear: both;
}

</style>

</head>

<body onload='window.print()' style="font-family: arial;font-size: 12px;">
        <?php 

                $a=mysqli_fetch_array(mysqli_query($koneksi, "SELECT * FROM identitas 
                    INNER JOIN kelurahan ON identitas.id_kel= kelurahan.id_kel
                    INNER JOIN kabupaten ON identitas.id_kab= kabupaten.id_kab 
                    INNER JOIN kecamatan ON identitas.id_kec= kecamatan.id_kec 
                    INNER JOIN provinsi ON identitas.id_prov= provinsi.id_prov WHERE id = '1'"));
            $id=$_POST['selector'];
            $N = count($id);
            for($i=0; $i < $N; $i++)
            {
                $data=mysqli_query($koneksi, "SELECT * FROM user 
                    INNER JOIN kelurahan ON user.id_kel= kelurahan.id_kel
                    INNER JOIN kabupaten ON user.id_kab= kabupaten.id_kab 
                    INNER JOIN kecamatan ON user.id_kec= kecamatan.id_kec 
                    INNER JOIN provinsi ON user.id_prov= provinsi.id_prov 
                    WHERE id='$id[$i]'");
            while($r=mysqli_fetch_array($data))
            {
                $t = date("d - m - Y", strtotime($r['tgl_lhr']));
                $tgl = date("dmY", strtotime($r['tgl_lhr']));
                $blangko=mysqli_fetch_array(mysqli_query($koneksi, "SELECT * FROM blangko WHERE id = '2'"));
        ?>
                <div style="width: 420px;height: 260px;margin-bottom: -12px;padding:; background-image: url('../assets/img/blangko/<?php echo $blangko["gambar"];?>');">            
            
            <p style="letter-spacing: 2px; margin-left: 200px; padding-top: 70px; width: 240px; text-align: left; font-size: 14px;">
  <h3><center>KETENTUAN</center></h3>
</p>

<ol style="margin-right: 5px;margin-left: 5px; font-family: arial; font-size: 11px; text-align: justify;">
  <li>Kartu ini berlaku selama pemegang menjadi siswa di SMK YAPPI Wonosari</li>
  <li>Jika kartu ini hilang/rusak, harap segera melapor ke sekolah.</li>
  <li>Terima Kasih bagi yang menemukan kartu ini, mohon dikembalikan ke SMK YAPPI Wonosari</li>
</ol>
<div class="row">
  <div class="column ">

            <img style="border-radius: 2px;border:4px solid #fff;margin-left: 15px;font-family: arial;font-size: 10px;text-align: justify;width: 70px;margin-top: -5px;position: absolute;" src="../assets/img/qrcode/<?php echo $r["qrcode"];?>">
  </div>

  <div class="column">
    <p style="margin-left: 90px; margin-top: -5px;font-family: arial; font-size: 10px; text-align: justify;">Mengetahui,<br>Kepala Sekolah</p>
    <img src="../assets/img/tandatangan/<?php echo $blangko["ttd"];?>"style="width: 110%;margin-left: 10px;margin-top: -15px">
    <p style="margin-left: 75px; margin-top: -15px;font-family: arial; font-size: 10px; text-align: justify;">Isnain Aminudin, S.Pd</p>
  </div>
</div>




</body>
</html>
<?php }}?>
