<?php
include "koneksi.php";
if (!isset($_SESSION["UserID"])) {
	header("location:login.php?p=3");
}


?>
<!DOCTYPE html>
<link rel="stylesheet" type="text/css" href="style.css">
<html>

	<head>
		<title> PT. MULTI HIDRACHROME BALIKPAPAN </title>
		<link rel="icon" type="image/png" href="images/mhb.jpeg">
		<?php
				include "part/menu2.php";
				?>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<?php
		include "part/jss.php";
		?>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Popup With Modal</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
  <!-- SweetAlert2 -->
  <link rel="stylesheet" href="plugins/sweetalert2-theme-bootstrap-4/bootstrap-4.min.css">
  <!-- Toastr -->
  <link rel="stylesheet" href="plugins/toastr/toastr.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="dist/css/adminlte.min.css">
  <!-- Google Font: Source Sans Pro -->
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">

	</head>

	<body>

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

			
				<div class="alert alert-info" style='background-color:#F8F8FF' 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" align='center' >
					<h3>MONITORING SURAT KEPUTUSAN USULAN MUTASI</h3>
					<h5>menampilkan data usulan karyawan mutasi yang telah di SETUJUI</h5>
					<?php
					if (isset($_GET["p"])) {
						$p = $_GET["p"];
						if ($p == "1") {
						?>
						<div class="alert alert-primary">
							KARYAWAN BERHASIL MUTASI!
						</div>
						<?php
						} else if ($p == "2") {
						?>
							<div class="alert alert-danger">
								KARYAWAN BERHASIL MUTASI!
							</div>
						<?php
						} else if ($p == "3") {
						?>
							<div class="alert alert-danger">
								 KARYAWAN GAGAL MUTASI!
							</div>
						<?php
						} 
					}
					?>
					<?php
					$z = 1;
					?>
					
					
					
					<table class="table table-bordered">
						<thead>
							<tr>
							    <th>
									NO 
								</th>
								<th>
									NIK 
								</th>
								<th>
									NAMA & JABATAN
								</th>
								<th>
									TANGGAL PERMINTAAN
								</th>
								<th>
									TANGGAL DISETUJUI
								</th>
								<th>
									
								</th>
								<th>
									
								</th>
								<th>
									
								</th>
							</tr>
						</thead>
						<tbody>
							<?php
							$status = '2';
							$q = "SELECT * FROM data_promosi WHERE status=".$status;
							$res = mysqli_query($conn, $q);
							while ($row = mysqli_fetch_assoc($res)) {
							?>
								<tr>
									<td>
									     <?php
									         echo $z;
									         $z = $z + 1;
									     ?>
								    </td>
									<td>
										<?php
										echo $row["nik"];
										?>
									</td>
									<td>
										<?php
										echo $row["nama"];
										echo " ";
										echo $row["jabatan_lama"];
										?>
									</td>
									
								
									<td>
										<?php
										echo $row["tanggal_pengajuan"];
										?>
									</td>	
									
									<td>
										<?php
										echo $row["tanggal_disetujui"];
										?>
									</td>
									
						            <td>	
										<a href="detailMutasi.php?id=<?php echo $row["id"]; ?>"    type="button" class="btn btn-primary"   >Detail</a>
                                    </td>
									
									  <td>	
										<a href="mutasiPDF.php?id=<?php echo $row["id"]; ?>"    type="button" class="btn btn-danger"   >Print</a>
                                    </td>
									
									</td>
									<td>
										<a<button type="button" class="btn btn-info">DI SETUJUI</button></a>
									</td>
								</tr>
							<?php
							}
							?>
							
						</tbody>
						
					</table>

				</div>

		<center><h5 class="form-signin">Copyright &copy; <a href="#" data-toggle="modal" data-target="#contact">SatrioPringgondani</a></h5></center>  
	</body>
</html>

<script>
$(document).ready(function()
{
	 $('.table-bordered').DataTable();
});
</script>