<?Php
	$id_pengumuman = $_GET['id'];
	$id_jurusan = $_GET['ij'];

	$detail_pengumuman = mysqli_query($conn,"SELECT 
								a.id,a.kd_semester,a.kd_tahun_ajar,a.kd_semester,a.keterangan,
								a.tgl_input,a.gambar,a.dibaca,b.tahun_ajaran,c.semester,a.keydata
							FROM
								t_pengumuman a
								INNER JOIN t_tahun_ajaran b ON a.kd_tahun_ajar=b.id
								INNER JOIN m_semester c ON a.kd_semester=c.kd_semester
								INNER JOIN sys_setting d ON a.keydata=d.keydata
							WHERE
								a.kd_jurusan = '$id_jurusan' AND a.id = '$id_pengumuman'
							");
	$dp = mysqli_fetch_array($detail_pengumuman);
	$view = $dp[dibaca]+1;
	mysql_query("UPDATE  t_pengumuman SET dibaca = '$view' WHERE id = '$dp[id]'")
?>
<header id="fh5co-header" class="fh5co-cover fh5co-cover-sm" role="banner" style="background-image:url(admin/foto_pengumuman/<?Php echo"$dp[gambar]";?>);" data-stellar-background-ratio="0.5">
	<div class="overlay"></div>
	<div class="container">
		<div class="row">
			<div class="col-md-8 col-md-offset-2 text-center">
				<div class="display-t">
					<div class="display-tc animate-box" data-animate-effect="fadeIn">
						<h1>Pengumuman</h1>
						<h2><?Php echo"$dp[tahun_ajaran] - $dp[semester] </br> $dp[keterangan]";?></h2>
					</div>
				</div>
			</div>
		</div>
	</div>
</header>

<div id="fh5co-blog">
	<div class="container">
		<div class="row">
			<div class="col-lg-12 col-md-4">
				<div class="fh5co-blog animate-box">
				<?Php
				if($dp[keydata]=='kode_pmb_akper' || $dp[keydata]=='kode_pmb_akbid'){

				$tampil = mysqli_query($conn,"SELECT 
												a.kd_tahun_ajar,a.kd_semester,a.no_registrasi,a.lulus,a.generate,
												b.fupload,b.nama_lengkap,c.tahun_ajar,d.semester,e.jurusan 
											FROM 
												hasil_sipensimaru a 
												inner join calon_mahasiswa b on a.no_registrasi = b.no_registrasi
												inner join m_tahun_ajar c on a.kd_tahun_ajar=c.kd_tahun_ajar 
												inner join m_semester d on a.kd_semester=d.kd_semester 
												inner join m_jurusan e on b.kd_jurusan=e.kd_jurusan 
											WHERE b.kd_jurusan = '$id_jurusan'
											ORDER BY a.no_registrasi ASC");
			    echo "
					<table class='table'>
			        <thead>
			          <tr>
			            <th data-toggle='true' data-name='id'>No.Registrasi</th>
			            <th data-hide='phone'>Foto</th>
			            <th data-hide='phone'>Nama Lengkap</th>
			            <th data-hide='phone,tablet'>Jurusan</th>
			            <th data-hide='phone'>Tahun Ajar</th>
			            <th data-hide='phone'>Lulus</th>
			          </tr>
			        </thead>
			        <tbody>"; 

			    $no=1;
			    $i=0;
			    while ($r=mysqli_fetch_array($tampil)){
			    	switch($r[lulus]){
			    		case 0:
			    			$lulus = "Tidak Lulus";
			    		break;
			    		case 1:
			    			$lulus = "Lulus";
			    		break;
			    	}
			       echo "
						<form method='POST' action='$aksi?module=penilaian_peserta_sipensimaru&act=input_lulus_sipensimaru'>
			       		<tr class='odd gradeX'>
							<td>$r[no_registrasi]</td>
							<td>
					";
							if(empty($r[fupload])){
								echo"";
							}else{
								echo"<img src='admin/foto_mahasiswa/small_$r[fupload]' class='img-responsive rounded'> ";
							}
					echo"
							</td>
							<td>$r[nama_lengkap]</td>
							<td>$r[jurusan]</td>
							<td>$r[tahun_ajar] </br> $r[semester]</td>
					        <td>$lulus</td>
						</tr>";
			      $no++;
			      $i++;
			    }
			    echo "</tbody>
			        </table>
			          ";
			    }else{
			    }
				?>		 
				</div>
			</div>
		</div>
	</div>
</div>