<script type="text/javascript">
$(document).ready(function() {
    $(function() {
        $("#theList tr:even").addClass("stripe1");
        $("#theList tr:odd").addClass("stripe2");

        $("#theList tr").hover(
            function() {
                $(this).toggleClass("highlight");
            },
            function() {
                $(this).toggleClass("highlight");
            }
        );
    });
});
</script>

<?php
include '../../inc/inc.koneksi.php';

$tglaw= $_GET['tgl_awal'];
$tglak= $_GET['tgl_akhir'];

echo "<table id='theList' width='100%'>
		<tr>
			<th>No.</th>
			<th>NIK</th>
			<th>Nama Karyawan</th>
			<th>Jabatan</th>
			<th>Sakit</th>
			<th>Ijin</th>
			<th>Alpa</th>
		</tr>";
			
		$sql = "SELECT nik,nama,jabatan,sum(sakit) as jsakit,sum(ijin) as jijin,sum(alpa) as jalpa FROM gaji WHERE tanggal BETWEEN '$tglaw' AND '$tglak' GROUP BY nik";
		$query = mysql_query($sql);
		$no=0;
		
		while($r_data=mysql_fetch_array($query)){
			$no++;
			echo "<tr>
					<td align='center'>$no</td>
					<td>$r_data[nik]</td>
					<td>$r_data[nama]</td>
					<td>$r_data[jabatan]</td>
					<td align='center'>$r_data[jsakit]</td>
					<td align='center'>$r_data[jijin]</td>
					<td align='center'>$r_data[jalpa]</td>
				</tr>";
		}
		echo "</table>";
?>