<?php
// koneksi ke database

include 'hari.php';
session_start();
$con=mysqli_connect('localhost','tapa8991_resto','resto@1305','tapa8991_dbrest');

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
<title>Absen</title>
	
    <link rel="stylesheet" type="text/css" href="css/stylesheet.css">
    <link rel="stylesheet" type="text/css" href="css/easyui.css">
    <link rel="stylesheet" type="text/css" href="css/icon.css">
	<link rel="stylesheet" type="text/css" href="css/jquery-ui-1.css">
    <link rel="stylesheet" type="text/css" href="css/jquery_notification.css">
    <link rel="stylesheet" type="text/css" href="css/jquery.autocomplete.css"/>
    <link rel="stylesheet" type="text/css" href="css/jpaging.css">
    <link rel="stylesheet" type="text/css" href="css/ui.datepicker.css"/>
    <link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
	
	
	

	<link type="text/css" href="js/themes/base/ui.all.css" rel="stylesheet" /> 
	<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
	<script type="text/javascript" src="js/ui.core.js"></script>
	<script type="text/javascript" src="js/ui.datepicker.js"></script>



<script type="text/javascript"> 
      $(document).ready(function(){
        $("#dari").datepicker({
		dateFormat  : "yy-mm-dd", 
          changeMonth : true,
          changeYear  : true
		  
        });
      });
	  
    </script>
<script type="text/javascript"> 
      $(document).ready(function(){
        $("#sampai").datepicker({
		dateFormat  : "yy-mm-dd", 
          changeMonth : true,
          changeYear  : true
		  
        });
      });
	  
    </script>
<script type="text/javascript">    
    //fungsi displayTime yang dipanggil di bodyOnLoad dieksekusi tiap 1000ms = 1detik
    function tampilkanwaktu(){
        //buat object date berdasarkan waktu saat ini
        var waktu = new Date();
        //ambil nilai jam, 
        //tambahan script + "" supaya variable sh bertipe string sehingga bisa dihitung panjangnya : sh.length
        var sh = waktu.getHours() + ""; 
        //ambil nilai menit
        var sm = waktu.getMinutes() + "";
        //ambil nilai detik
        var ss = waktu.getSeconds() + "";
        //tampilkan jam:menit:detik dengan menambahkan angka 0 jika angkanya cuma satu digit (0-9)
        document.getElementById("clock").innerHTML = (sh.length==1?"0"+sh:sh) + "." + (sm.length==1?"0"+sm:sm) + "." + (ss.length==1?"0"+ss:ss);
    }
</script>	

</head>

<body onload="tampilkanwaktu();setInterval('tampilkanwaktu()', 1000);">

<div class="panel-header" fit="true" style="height:20px;padding-top:8px;padding-right:15px;padding-left:15px;width=90%">
		
		<div style="float:left;"   color="#fff">
		
		<?php

$hari = date('l');
/*$new = date('l, F d, Y', strtotime($Today));*/
if ($hari=="Sunday") {
	echo "Minggu, ";
	$hariindo="Minggu";
}elseif ($hari=="Monday") {
	echo "Senin, ";
	$hariindo="SENIN";
}elseif ($hari=="Tuesday") {
	echo "Selasa, ";
	$hariindo="SELASA";
}elseif ($hari=="Wednesday") {
	echo "Rabu, ";
	$hariindo="RABU";
}elseif ($hari=="Thursday") {
	echo("Kamis, ");
	$hariindo="KAMIS";
}elseif ($hari=="Friday") {
    echo "Jum'at, ";
	$hariindo="JUMAT";
}elseif ($hari=="Saturday") {
	echo "Sabtu, ";
	$hariindo="SABTU";
}

$tgl =date('d-m-Y : ');
echo $tgl;

$listagen=mysqli_query($con,"select userid,name from userinfo;"); 

?>
<span id="clock"></span> 

</div>
</div>


<div class="container" style="height:40px;padding-top:35px;padding-right:1px;width=40%;">

<form id="fftgpelamar" method="POST" action="detailnip.php">

<fieldset>
    <legend><font size='4'><b>Laporan Absensi</b></font></legend>
   <table cellpadding="10">
          <tr>
             <td>Bulan</td>
             <td>:</td>
			 <td>
			 <select name="bln" data-options="formatter:myformatter,parser:myparser" style="width:200px;height:25px">
				<option selected="selected">Bulan</option>
				<?php
					$bulan=array("Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember");
					$jlh_bln=count($bulan);
					for($c=0; $c<$jlh_bln; $c+=1){
						$bl=$c+1;
						echo"<option value=$bl> $bulan[$c] </option>";
					}
				?>
			</select>
			 </td>
          </tr>
         <tr>
             <td>Tahun</td>
             <td>:</td>
             <td>
			 <?php
				$now=date('Y');
					echo "<select name='tahun'>";
					for ($a=2022;$a<=$now;$a++)
						{
						echo "<option value='$a'>$a</option>";
						}
					echo "</select>";
			?></td>
         </tr>
         
		  <tr>
             <td>NIP</td>
             <td>:</td>
             <td>
			 <select name="id" data-options="formatter:myformatter,parser:myparser" style="width:200px;height:25px">
			 <option>Nama Karyawan</option>
				<?php
				if (mysqli_num_rows($listagen) > 0) { ?>
				<?php while ($row=mysqli_fetch_array($listagen)) { ?>
				<option value=<?php echo $row['userid'] ?>> <?php echo $row['name'] ?></option>
				<?php } ?>
				<?php } ?>
			 </select>
			 </td>
         </tr>
		  
         <tr>
             <td>&nbsp;</td>
             <td>&nbsp;</td>
			<td><input class="easyui-linkbutton c1" type="submit" name="Submit"  value="Proses" style="width:100px;height:30px">			
			
        </tr>
        </table>
     </fieldset>
</form>
</div>
</body>
</html> 