<?php 

ob_start(); 

?>

<html>
<head>
  <title>Cetak Sertifikat</title>
    
   <style>
   table {border-collapse:collapse; table-layout:fixed;width: 630px;}
   table td {word-wrap:break-word;width: 20%;}
   .style2 {font-size: 12px}
   .style3 {font-size: medium; }
   .style4 {font-weight: bold}
   .style5 {font-size: 18px; font-weight: bold;}
   .style6 {font-weight: bold; font-size: 14px; }
   </style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body tracingsrc="" tracingopacity="100">
<p>&nbsp;</p>


<table width="750" border="0">

<?php
// Load file konekshi.php
include "config.php";

if(isset($_GET['id'])):
     
     $res = $conn->query("SELECT * FROM peserta JOIN kegiatan ON peserta.kodeseminar = kegiatan.kode
							WHERE id=".$_GET['id']);
     $row = $res->fetch_assoc();

?>
<?php
endif;
?>
  <tr>  
    <td colspan="3" class="style2"><div align="center" class="style4"><img src="images/logo iai.JPG" width="100" height="100"></div></td>
  </tr>
  
<tr>  
    <td colspan="3" class="style2"><div align="center" class="style5">IKATAN APOTEKER INDONESIA</div></td>
  </tr>
  <tr>
    <td colspan="3" class="style2"><div align="center" class="style6">PENGURUS CABANG KOTA BANDAR LAMPUNG</div></td>
  </tr>
  <tr>
    <td colspan="3" class="style2"><div align="center" class="style4"><h1>SERTIFIKAT</h1></div></td>
  </tr>
  <tr>
    <td colspan="3"><div align="center">Nomor : <?php echo $row["sertifikat"]?> </div></td>
  </tr>
  <tr>
    <td width="250">&nbsp;</td>
    <td width="250">&nbsp;</td>
    <td width="250">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3"><div align="center" class="style3">diberikan kepada </div></td>
  </tr>
  <tr>
    <td colspan="3"><div align="center">Nama : <?php echo $row["namapeserta"] ?></div></td>
  </tr>
  <tr>
    <td colspan="3"><div align="center">Nomor KTA : <?php echo $row["kta"] ?></div></td>
  </tr>
  <tr>
    <td colspan="3"><div align="center"> atas peran sertanya sebagai : <strong>P E S E R T A</strong></div></td>
  </tr>
  <tr>
    <td width="250">&nbsp;</td>
    <td width="250">&nbsp;</td>
    <td width="250">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3"><div align="center">dalam kegiatan </div></td>
  </tr>
  <tr>
    <td colspan="3"><div align="center">Nama Kegiatan : <?php echo $row["nama"] ?></div></td>
  </tr>
  <tr>
    <td colspan="3"><div align="center">Tempat : <?php echo $row["tempat"] ?></div></td>
  </tr>
  <tr>
    <td colspan="3"><div align="center">Tanggal : <?php echo $row["tgl"] ?></div></td>
  </tr>
  <tr>
    <td colspan="3"><div align="center">Jumlah SKP : <?php echo $row["skp"] ?></div></td>
  </tr>
  <tr>
    <td colspan="3"><div align="center">sesuai dengan SK Nomor : <?php echo $row["skpenetapan"] ?></div></td>
  </tr>
  <tr>
    <td colspan="3"><div align="center">Bandar Lampung,  <?php echo $row["tgl"] ?></div></td>
  </tr>
  <tr>
    <td><div align="center">Ketua PC Bandar Lampung </div></td>
    <td>&nbsp;</td>
    <td><div align="center">Ketua Panitia </div></td>
  </tr>
 
  <tr>
    <td height="23"><div align="center"><img src="images/ttdketuapc.gif" width="200" height="50">&nbsp;</div></td>
    <td height="23"><div align="center"><img src="images/cap_pc.png" width="85" height="100">&nbsp;</div></td>
    <td height="23"><div align="center"><img src="images/ttdketuapanitia.jpg" width="75" height="50">&nbsp;</div></td>
  </tr>
  
  <tr>
    <td height="23"><div align="center">NINIEK AMBARWATI, S.Si., Apt </div></td>
    <td>&nbsp;</td>
    <td><div align="center">AHMAD JUNAIDI, S.Si., Apt </div></td>
  </tr>
  <tr>
    <td height="23">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  
</table>
<h3 style="text-align: center;">&nbsp;</h3>


<table border="0" width="100%">

</table>
</body>
</html>

<?php
$html = ob_get_contents();
ob_end_clean();
require_once('html2pdf/html2pdf.class.php');
$pdf = new HTML2PDF('P','A4','en');
$pdf->WriteHTML($html);
$pdf->Output('$sertifikat.pdf', 'D');
?>

