<?php
include "koneksi.php";
if (!isset($_SESSION["UserID"])) {
	header("location:login.php?p=3");
}
$scan = mysqli_real_escape_string($conn, $_GET["scan"]);
$q = 
"SELECT absensi1.att_log.pin AS pin, data_karyawan_mhb.data_karyawan.nama_karyawan AS nama FROM absensi1.att_log INNER JOIN data_karyawan_mhb.data_karyawan ON absensi1.att_log.pin = data_karyawan_mhb.data_karyawan.nik";


$d = "SELECT * FROM att_log WHERE scan_date = '$scan'";
$resi = mysqli_query($conn2, $d);
//$row1 = mysqli_fetch_array($resi);
//echo $d;
$row1 = mysqli_fetch_array($resi);

	$pin = $row1['pin'];
$s = "SELECT * FROM data_karyawan WHERE nik = '$pin'";
$res = mysqli_query($conn, $s);
$row = mysqli_fetch_array($res);
//echo $scan;
//SELECT database1.namatabel1.namafieldtabel1,
 //      database1.namatabel1.namafieldtabel2 
//FROM   database1.namatabel1 
 //      INNER JOIN database2.namatabel2 ON 
   //          database1.namatabel1.fieldkunci = 
     //        database2.namatabel2.fieldkunci

//inner join
//"SELECT *
//FROM TABEL1 tbl1 INNER JOIN TABEL2 tbl2 ON idtbl1 = idtbl2;
//WHERE opsionalnya";



//echo "query karyyawan : " . $q .  "</br>";
$res = mysqli_query($conn3, $q);
$data = mysqli_fetch_array($res);
//$ids=mysqli_real_escape_string($conn,$_GET["ids"]);
?>
<!DOCTYPE html>
<link rel="stylesheet" type="text/css" href="style.css">
<html>

<head>
	<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
	<title> PT. MULTI HYDRACHROM BALIKPAPAN </title>
	 <link rel=”stylesheet” href=”http://aplikasikita.com/styles/style.css&#8221; type=”text/css” />
    <link rel=”icon” href=”mhb.jpg”>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<?php
	include "part/jss.php";
	?>

</head>

<body>

	<div style="width:1280px; height:100px" class="container">

		
			<div class="alert alert-info" style='color:#FFD700' href="#">
            <div style="display: block; margin-left: auto; margin-right: auto; width: 1000px;  height:100px;"><img style="width: 1000px;  height:180px;" src="images/hd.jpg"></div>
            <div>
                <center>
                    <h1>PT. MULTI HIDRACHROM BALIKPAPAN</h1>
                </center>
            </div>
            <div>
                <center>
                    <h4>PROFESIONAL INFORMATION SYSTEM</h4>
                </center>
            </div>
        </div>

			<?php
			include "part/menu.php";
			?>


			<div class="alert alert-info">
				<h3 align="center">Data Izin Karyawan</h3>

				<?php
				if (isset($_GET["p"])) {
					$p = mysqli_real_escape_string($conn, $_GET["p"]);
					if ($p == "1") {
				?>
						<div class="alert alert-primary" role="alert">
							Kendaraan Tidak Boleh Kosong!
						</div>
					<?php
					} else if ($p == "2") {
					?>
						<div class="alert alert-primary" role="alert">
							Kendaraan sudah ada!
						</div>
				<?php
					}
				}
				?>

				<form method="POST" action="simpanizin.php?scan=<?php echo $scan; ?>">
					<div class="form-group" style="margin-bottom: 30px;">
						
						
					    	
						
						<label for="exampleInputPassword1">NIK</label>
						<input type="text/css" readonly class="form-control" value="<?php echo $row1['pin']; ?>" name="nik" placeholder="">

						<label for="exampleInputPassword1">NAMA KARYAWAN</label>
						<input type="text/css" readonly class="form-control" value="<?php echo $row["nama_karyawan"]; ?>" name="nama_karyawan" placeholder="">
						
						

				

                        <h3 align="left">Alasan Izin</h3>
						
						<label for="exampleInputPassword1">Alasan</label>
						<input type="text/css" class="form-control" name="alasan" placeholder="">
						

					</div>
					<input type="submit" value="Simpan" class="btn btn-primary"></input>
					| <a href="cuti.php"><button type="button" class="btn btn-danger">Kembali</button></a>


				</form>
			</div>


</body>

</html>