<?php ob_start();
error_reporting(0);
require("../../config/koneksi.php");
require("../../config/function.php");
require("../../config/crud.php");
session_start();
if (!isset($_SESSION['id_user'])) {
    die('Anda tidak diijinkan mengakses langsung');
}
$ids=$_GET['ids'];
$tp=date('Y');
$tpk=$tp-1;
$siswa = fetch($koneksi, 'siswa', ['id_siswa' => $ids]);

	

?>
<!DOCTYPE html>
<html>

<head>
    <meta charset='utf-8'>

    <title>Cover_Rapor_<?= $siswa['nama'] ?></title>

  <link rel="stylesheet" href="../../plugins/bootstrap/dist/css/bootstrap.min.css">



</head>

<body style="font-size: 12px;">
    <br><br><br><br>
   <center>
        <h6>LAPORAN</h6>
		<h6>HASIL CAPAIAN KOMPETENSI PESERTA DIDIK</h6>
		<h6><?= $setting['jenjang'] ?></h6>
    </center>
    <br>
    <br>
        
    <div class="col-md-12">
	
               <center><img src="../../dist/img/tutwuri.png" width="30%"></center>
         
        <br><br><br>
 <center>Nama Peserta Didik</center>
    <br>
            <table style="margin-left: 70px;margin-right:50px;" border ="1" width="100%">
                    <tr style="text-align: center;font-size: 18px;">
                        <td><b><?php echo ucfirst($siswa['nama']); ?></b></td>
                    </tr>
					</table>
					<br><br><br>
 <center>No. Induk / NISN</center>
    <br>
	<table style="margin-left: 70px;margin-right:50px;" border ="1" width="100%">
                    <tr style="text-align: center;font-size: 14px;">
                        <td><?php echo $siswa['nis']; ?> / <?php echo $siswa['nisn']; ?></td>
                    </tr>
					</table>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
   <center>
        <h6>KEMENTRIAN PENDIDIKAN DAN KEBUDAYAAN</h6>
		<h6>REPUBLIK INDONESIA</h6>
		
    </center>
    <br>
					
					
			 <br><br><br><br><br><br><br><br>
   <center>
        <h6>KEMENTERIAN PENDIDIKAN DAN KEBUDAYAAN</h6>
		<h6>REPUBLIK INDONESIA</h6>
		
    </center>
    <br>
    <br>
        
    <div class="col-md-12">
	
        <br><br><br><br><br>
 <center><h6>R A P O R</h6></center>
 <center><h6>PESERTA DIDIK</h6></center>
 <center><h6><?= $grades ?></h6></center>
    <br><br><br><br><br>
            <table style="margin-left: 70px;margin-right:50px;"  width="100%">
                    <tr style="font-size: 14px;">
                        <td>Nama Sekolah</td>
						<td>:</td>
						<td><?= $setting['sekolah'] ?></td>
                    </tr>
					<tr style="font-size: 14px;">
                        <td>N P S N</td>
						<td>:</td>
						<td><?= $setting['npsn'] ?></td>
					</tr>
					<tr style="font-size: 14px;">
                        <td>Kelurahan/Desa</td>
						<td>:</td>
						<td><?= $setting['desa'] ?></td>
					</tr>
					<tr style="font-size: 14px;">
                        <td>Kecamatan</td>
						<td>:</td>
						<td><?= $setting['kecamatan'] ?></td>
					</tr>
					<tr style="font-size: 14px;">
                        <td>Kabupaten/Kota</td>
						<td>:</td>
						<td><?= $setting['kabupaten'] ?></td>
					</tr>
					<tr style="font-size: 14px;">
                        <td>Provinsi</td>
						<td>:</td>
						<td><?= $setting['propinsi'] ?></td>
					</tr>
					<tr style="font-size: 14px;">
                        <td>Website</td>
						<td>:</td>
						<td><?= $setting['web'] ?></td>
					</tr>
					<tr style="font-size: 14px;">
                        <td>Email</td>
						<td>:</td>
						<td><?= $setting['email'] ?></td>
					</tr>
					</table>
					<br><br><br>
 
    <br>
	
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
   <center>
        
		
    </center>
    <br>		
					
					
                </body>
</html>
<?php

$html = ob_get_clean();
require_once '../../vendors/autoload.php';

use Dompdf\Dompdf;

$dompdf = new Dompdf();
$dompdf->loadHtml($html);
$dompdf->setPaper('A4', 'portrait');
$dompdf->render();
$dompdf->stream("Raport_" . $siswa['nama'] . ".pdf", array("Attachment" => false));
exit(0);
?>