<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>ABSENSI</title>
<style type="text/css">
<!--
.style1 {font-size: 9px}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>

<body>
<?
	include "connect.php";
	session_start();
$id=1;

$hasil = mysqli_query($koneksi,"select * from tset where idset ='$id'");
$row=mysqli_fetch_array($hasil);
$ta = $row[2];
//cek apakah user sudah login


//cek level user
if($_SESSION['Level']=="baak" || $_SESSION['Level']=="admin"){

	$seleksi = "";

if (isset($_POST['ctingkat']))
{
   $tingkat = $_POST['tingkat'];
   if (empty($seleksi))
   {
		$seleksi .= "tingkat LIKE '$tingkat'";
   }
}

if (isset($_POST['ckelas']))
{
   $kelas = $_POST['kelas'];
   if (empty($seleksi))
   {
		$seleksi .= "kelas LIKE '%$kelas%'";
   }
   else
   {
        $seleksi .= " AND kelas LIKE '%$kelas%'";
   }
}
if (isset($_POST['csemester']))
{
   $semester = $_POST['semester'];
   if (empty($seleksi))
   {
		$seleksi .= "semester LIKE '%$semester%'";
   }
   else
   {
        $seleksi .= " AND semester LIKE '%$semester%'";
   }
}



//$kelas=$_POST['kelas'];
//$tingkat=$_POST['tingkat'];

setcookie("kelas",$kelas);
setcookie("tingkat",$tingkat);
setcookie("semester",$semester);

?>
<table width="900" border="0" cellpadding="0" style="border-collapse:collapse;" >
  <tr>
    <td colspan="2"><div align="center"><strong><font size="-1">DAFTAR HADIR MAHASISWA </strong></div></td>
  </tr>
  <tr>
    <td colspan="2"><div align="center"><strong><font size="-1">TINGKAT <? echo $tingkat; ?> <? echo $kelas; ?> SEMESTER <? echo $semester; ?> TA. <? echo $ta; ?></strong></div></td>
  </tr>
  <tr>
    <td colspan="2"><div align="center"><strong><font size="-1">STIKes BHAKTI HUSADA CIKARANG</strong></div></td>
  </tr>
    <tr>
    <td colspan="2"><div align="center"><strong><font size="-1">PRODI D3 KEBIDANAN</strong></div></td>
  </tr>
  <tr>
    <td width="153">&nbsp;</td>
    <td width="747">&nbsp;</td>
  </tr>
  <tr>
    <td><font size="-1">MATA KULIAH </td>
    <td>:</td>
  </tr>
  <tr>
    <td><font size="-1">PENEMPATAN</td>
    <td>:</td>
  </tr>
</table>
<p></p>
<table width="885" height="122" border="1" cellpadding="0" style="border-collapse:collapse;" >
    <tr>
      <td width="32" rowspan="2"><div align="center"><strong><font size="-1">NO</strong></div></td>
      <td width="90" rowspan="2"><div align="center"><strong><font size="-1">NIM</strong></div></td>
      <td width="337" rowspan="2"><div align="center"><strong><font size="-1">NAMA</strong></div></td>
      <td height="23" colspan="6"><div align="center"><strong><font size="-1">TANGGAL</strong></div></td>
    </tr>
    <tr>
      <td width="66" height="23"><div align="center"></div></td>
      <td width="66"><div align="center"></div></td>
      <td width="68"><div align="center"></div></td>
      <td width="66"><div align="center"></div></td>
      <td width="71"><div align="center"></div></td>
      <td width="64"><div align="center"></div></td>
    </tr>
	<?php
	//$tampil="select * from mhs where $seleksi ORDER BY nim ASC";
	$hasil= mysqli_query($koneksi,"select * from krs,mhs where krs.nim=mhs.nim 
 	AND krs.semester = '$semester' AND krs.ta='$ta' AND mhs.kelas='$kelas' GROUP BY mhs.nim ORDER BY mhs.nim ASC");
	//$hasil=mysql_query($tampil);
	$total= mysqli_num_rows($hasil);
	
 $no=1;
 if ($total){
		while ($row=mysqli_fetch_array($hasil))
		{
?>
    <tr>
      <td height="17" align="center"><font size="-1"><? echo $no; ?></td>
      <td align="center"><font size="-1"><? echo $row[0]; ?></td>
      <td><font size="-1">&nbsp<? echo $row['nm_mhs']; ?></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
	  <?php
$no++;
}
}
?>
    <tr>
      <td height="17" colspan="3" align="center"><font size="-1">JUMLAH KEHADIRAN MHS </td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td height="17" colspan="3" align="center"><font size="-1">PARAF DOSEN </td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  


</table>
<?php
} else {
    die("Anda bukan admin");
}
?>


  <table width="900" border="0">
    <tr>
      <td width="657">&nbsp;</td>
      <td width="253"><div align="center"><font size="-1">Bekasi, .................................... </div></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><div align="center"><font size="-1">Koordinator MA </div></td>
    </tr>
    <tr>
      <td height="59">&nbsp;</td>
      <td><div align="center">
        <p>&nbsp;</p>
        <p>(......................................................)</p>
      </div></td>
    </tr>
  </table>
</div>
</body>
</html>
