<?php
include('../ro-databases/koneksi.php');
$dokumen='BACKUP DATA PPDB'; //Nama Dokumen
define('_MPDF_PATH','../ro-plugins/mpdf/'); //letak folder mpdf
include(_MPDF_PATH . "mpdf.php"); //panggil mpdf.php
$mpdf=new mPDF('utf-8', 'A4'); // Create new mPDF Document
ob_start();
?>
<!--Koding mulai, Anda bisa jalankan kode php,html, css pada baris ini.-->
<?php

$query="SELECT*FROM ro_formulir where pendidikan_ibu='lateng'";
$perintah=mysqli_query ($koneksi,$query) or die ("Gagal melakukan koneksi".mysqli_error());


?>
<html>
<head>
<style>
body {font-family: sans-serif;
  font-size: 9pt;
  background: transparent url(\'bgbarcode.png\') repeat-y scroll left top;
}
h5, p { margin: 0pt;
}
table.items {
  font-size: 9pt; 
  border-collapse: collapse;
  border: 3px solid #880000; 
}
td { vertical-align: top; 
}
table thead td { background-color: #EEEEEE;
  text-align: center;
}
table tfoot td { background-color: #AAFFEE;
  text-align: center;
}
.barcode {
  padding: 1.5mm;
  margin: 0;
  vertical-align: top;
  color: #000000;
}
.barcodecell {
  text-align: center;
  vertical-align: middle;
  padding: 0;
}
</style>
</head>
<body>
<div style="text-align: center;">
<img src="../ro-content/head.PNG" width="100%" height="auto"/><br/>
</div><br/>
<div style="text-align: center;">
<h3>DATA SEMUA SISWA DITERIMA</h3><br/>
</div>
<table class="items" width="100%" cellpadding="8" border="1">
<thead>
<tr>
<td>NAMA</td>
<td>NISN</td>
<td>ASAL SEKOLAH</td>
<td>NO.HP</td>
</tr>
</thead>
<tbody> 
<?php while($data=mysqli_fetch_array($perintah)){

 ?>    
<tr>  
<td><?php echo $data['nama_siswa'];?></td>
<td><?php echo $data['nisn'];?></td>
<td><?php echo $data['nama_sekolah'];?></td>
<td><?php echo $data['hp_siswa'];?></td>
</tr>
<?php }?>           
</tbody>           
</table>

            </body>
            </html>
<?php
//batas kodingan 
$html = ob_get_contents(); //Proses untuk mengambil hasil dari OB..
ob_end_clean();
//Here convert the encode for UTF-8, if you prefer the ISO-8859-1 just change for $mpdf->WriteHTML($html);

$mpdf->WriteHTML($stylesheet,1);
$mpdf->WriteHTML(utf8_encode($html));
$mpdf->Output($dokumen.".pdf" ,'I');
exit;
?>