<?php
include "koneksi.php";
if (!isset($_SESSION["UserID"])) {
	header("location:login.php?p=3");
}
$id = mysqli_real_escape_string($conn, $_GET["id"]);
$q = "SELECT * FROM data_karyawan WHERE id='$id'";
//echo "query karyyawan : " . $q .  "</br>";
$res = mysqli_query($conn, $q);
$data = mysqli_fetch_assoc($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>
	<?php
				include "part/menu2.php";
				?>
	 <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>
			<div class="alert alert-info">
				<h3 align="center">Cuti 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="simpancuti.php?id=<?php echo $id; ?>">
					<div class="form-group">
						<h3 align="left">Data Karyawan</h3>
						
					    	
						
						<label for="exampleInputPassword1">NIK</label>
						<input type="text" readonly class="form-control" value="<?php echo $data["nik"]; ?>" name="nik" placeholder="">

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

						<label for="exampleInputPassword1">STATUS PEGAWAI</label>
						<input type="text" readonly class="form-control" value="<?php echo $data["status_kepegawaian"]; ?>" name="status_kepegawaian" placeholder="">

						<label for="exampleInputPassword1">JABATAN</label>
						<input type="text" readonly class="form-control" value="<?php echo $data["jabatan"]; ?>" name="status_kepegawaian" placeholder="">


						<label for="exampleInputPassword1">DEPARTEMENT</label>
						<input type="text" readonly class="form-control" value="<?php echo $data["departement"]; ?>" name="departement" placeholder="">

						<label for="exampleInputPassword1">SISA CUTI TAHUN INI</label>
						<input type="text" readonly class="form-control" value="<?php echo $data["sisa_cuti_tahun"]; ?>" name="sisa_cuti_tahun" placeholder="">

						<label for="exampleInputPassword1">TANGGAL MULAI KERJA</label>
						<input type="text" readonly class="form-control" value="<?php echo $data["tanggal_masuk"]; ?>" name="akhir_kontrak" placeholder="">

				

                        <h3 align="left">Data Cuti Karyawan</h3>
						
						<label for="exampleInputPassword1">ALAMAT CUTI</label>
						<input type="text" class="form-control" name="alamatcuti" placeholder="">
						
						<label for="exampleInputPassword1">JENIS CUTI</label>
					    <select class="form-control" name="jeniscuti">
							<?php

							$b = "SELECT *
							FROM jenis_cuti";

							$res = mysqli_query($conn, $b);
							while ($row = mysqli_fetch_assoc($res)) {
								$selected = "";
								if ($row["id"] == $data["id_departemen"]) {
									$selected = "selected";
								}
								echo "selected : " . $row["id"] . "" . $data["id_departemen"];
							?>
								<option <?php echo $selected; ?> value="<?php echo $row["id"]; ?>">
									<?php
									echo $row["nama"];
									?>
								</option>
							<?php
							}
							?>
						</select>
						<?php
                        
						?>
						
						<label for="exampleInputPassword1">MULAI CUTI TANGGAL</label>
					    <input type="date" class="form-control" name="mulaicutitanggal" placeholder="">
						
						<label for="exampleInputPassword1">ALASAN</label>
						<textarea rows="7" cols="1000" name="alasan"></textarea><br/>
						
						<label for="exampleInputPassword1">CUTI BERAPA HARI</label>
						<input type="text" class="form-control" name="cutiberapahari" placeholder="tahunan & diluar tanggungan wajib diisi">
					    
						
						<label for="exampleInputPassword1">MASUK KEMBALI TANGGAL</label>
					    <input type="date" class="form-control" name="masukkembalitanggal" placeholder="">
						
						<label for="exampleInputPassword1">TANGGAL LAPOR</label>
					    <input type="date" class="form-control" name="tanggallapor" placeholder="">
						
						<label for="exampleInputPassword1">TANGGAL PENGAJUAN CUTI</label>
						<input type="text" readonly class="form-control" value="<?php echo date('d / M / yy'); ?>" name="tanggalpengajuancuti" 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>