<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title><?php echo $title_pdf;?></title>
		<style>
			body {
			  background-image: url('<?php echo base_url();?>assets/images/bg_pdf.png');
			  background-repeat: no-repeat;
			  background-attachment: fixed;
			  background-position: center;
			}
			.kemenag {
			  background-image: url('<?php echo base_url();?>assets/images/kemenag.png');
			  background-repeat: no-repeat;
			  background-position: 3% 50%;
			  background-size: contain;
			}
		</style>
    </head>
    <body>
		<table style="border-collapse: collapse; width:700px;">
			<tr>
				<td style="width:5%;">&nbsp;</td>
				<td style="width:25%;">&nbsp;</td>
				<td style="width:20%;">&nbsp;</td>
				<td style="width:20%;">&nbsp;</td>
				<td style="width:15%;">&nbsp;</td>
				<td style="width:15%;">&nbsp;</td>
			</tr>
			<tr>
				<td colspan="6" class="kemenag">
					<center>
						<br>
						PANITIA PENERIMAAN PESERTA DIDIK BARU<br>
						<strong>MADRASAH ALIYAH NEGERI 1 MAGELANG</strong><br>
						<span style="font-size:12px;">Jl. Sunan Bonang No.17 Telp/Fax (0293) 362928 PO Box 141 Magelang 56123</span><br>
						<span style="font-size:12px;">website : www.man1magelang.sch.id &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;email : mankabma@yahoo.co.id</span>
					</center>
				</td>
			</tr>
			<tr>
				<td colspan="6">
					<hr style="background-color:#000000; height:3px;">
				</td>
			</tr>
			<tr>
				<td colspan="6">
					<center>
						<?php
							$tahun2 = (int)$tahun+1;
						?>
						HASIL TES WAWANCARA<br>
						PPDB MAN 1 MAGELANG<br>
						Tahun Pelajaran <?php echo $tahun."-".$tahun2;?>
					</center>
				</td>
			</tr>
			<tr>
				<td colspan="6">&nbsp;</td>
			</tr>
			<tr>
				<td colspan="2">Nama</td>
				<td colspan="4">: <?php echo $calon_siswa->nama;?></td>
			</tr>
			<tr>
				<td colspan="2">No. Pendaftaran</td>
				<td colspan="4">: <?php echo $calon_siswa->nomor_pendaftaran;?></td>
			</tr>
			<tr>
				<td colspan="2">Skor Wawancara</td>
				<td colspan="4">: 
					<strong>
						<?php 
							$nilai = 0;
							foreach($jawaban as $j)
							{
								$nilai = $nilai + $j['nilai'];
							}
							echo $nilai;
						?>
					</strong>
				</td>
			</tr>
			<tr>
				<td colspan="2">Tanggal Wawancara</td>
				<td colspan="4">: 
					<?php
						$month 	= array("","Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember");
						$pecah 	= explode(" ",$calon_siswa->admin_update);
						$pecah2 = explode("-",$pecah[0]);
						$tahun 	= $pecah2[0];
						$sasi	= (int)$pecah2[1];
						$bulan 	= $month[$sasi];
						$tanggal= $pecah2[2];
						echo $tanggal." ".$bulan." ".$tahun;
					?>
				</td>
			</tr>
			<tr>
				<td colspan="2">Hasil Akhir </td>
				<td colspan="4">: <?php echo $calon_siswa->hasil_wawancara;?></td>
			</tr>
			<tr>
				<?php
					if($calon_siswa->hasil_wawancara == "Diterima")
					{
						?>
						<td colspan="2">Jurusan Yang Diterima</td>
						<?php
					}
					else if($calon_siswa->hasil_wawancara == "Tidak Diterima")
					{
						?>
						<td colspan="2">Jurusan Yang Dipilih</td>
						<?php
					}
				?>
				<td colspan="4">: 
					<?php
						foreach($jurusan as $j)
						{
							if($j['id_jurusan'] == $calon_siswa->id_jurusan_diterima)
							{
								echo $j['jurusan'];
							}
						}
					?>
				</td>
			</tr>
			<tr>
				<td colspan="6">&nbsp;</td>
			</tr>
			<tr>
				<td colspan="6"><strong>Pertanyaan dan Jawaban</strong></td>
			</tr>
			<?php
				$x = 0;
				foreach($pertanyaan as $p)
				{
					$x++;
					?>
					<tr>
						<td colspan="6">
							<div class="form-group">
								<label class="col-sm-12">
									<?php echo $x.". ".$p['pertanyaan'];?>
								</label>
								<?php
									foreach($pilihan_jawaban as $pj)
									{
										if($pj['id_pertanyaan'] == $p['id_pertanyaan'])
										{
											$checked = "";
											foreach($jawaban as $j)
											{
												if($pj['id_pilihan_jawaban'] == $j['id_pilihan_jawaban'])
												{
													$checked = "checked";
												}
											}
											?>
											<div class="col-sm-12">
												<input type="radio" name="jawaban<?php echo $x;?>" value="<?php echo $p['id_pertanyaan']."-".$pj['id_pilihan_jawaban'];?>" <?php echo $checked;?> required> <?php echo $pj['pilihan_jawaban'];?>
											</div>
											<?php
										}
									}
								?>
							</div>
						</td>
					</tr>
					<tr>
						<td colspan="6">&nbsp;</td>
					</tr>
					<?php
				}
			?>
			<tr>
				<td>&nbsp;</td>
				<td colspan="2">
					<img src="<?php echo base_url();?>assets/images/no_korupsi.jpeg" height="94px" width="94px">
				</td>
				<td>&nbsp;</td>
				<td colspan="2">
					Magelang, <?php echo $today;?><br>
					Ketua Panitia,<br>
					<img src="<?php echo base_url();?>assets/images/ttd_nobg.png" height="56px" width="56px"><br>
					Endang Widyawati, S.Pd.<br>
					NIP. 197511302005012002
			</td>
			</tr>
		</table>
    </body>
</html>