<?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";
	?>
	
  </head>
  <body>
	
	<div style="width:1280px; height:100px" 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>Data Anak Karyawan</h3>
			 <h5>"menampilkan data anak 1-4 dari setiap karyawan dan dapat mengupdate sesuai kebutuhan"</h5>
			 <?php
			if (isset($_GET["p"]))
				{
					$p=mysqli_real_escape_string($conn,$_GET["p"]);
					if ($p=="3")
					{
						?>
							<div class="alert alert-primary" role="alert">
							  gagal dihapus!
							</div>
						<?php
					}
					else if ($p=="2")
					{
						?>
							<div class="alert alert-primary" role="alert">
							  berhasil dihapus!
							</div>
						<?php
					}
					else if ($p=="1")
					{
						?>
							<div class="alert alert-primary" role="alert">
							  berhasil diupdate!
							</div>
						<?php
					}
				}
			?>
			 <h4>Anak Ke 1</h4>
			 <table class="table table-bordered">
			    <thead>
				  <tr>
				    <th>
					   Nik Karyawan :
					</th>
				    <th>
					   Nama Karyawan :
					</th>
					<th>
						Nama :
					</th>
					<th>
						Jenis Kelamin :
					</th>
					<th>
						Tempat Lahir :
					</th>
					<th>
						Tanggal Lahir :
					</th>
					<th>
						Nik :
					</th>
					<th>
						Pilihan :
					</th>
					
					
				  </tr>
				</thead>
				<tbody>
				    <?php
						$q="SELECT * FROM data_karyawan";
						$res=mysqli_query($conn,$q);
						while ($row=mysqli_fetch_assoc($res))
						{
							?>
							  <tr>
							    <td>
								  <?php
									echo $row["nik"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["nama_karyawan"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["nama_anak1"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["jenis_kelamin_anak1"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["tempat_lahir_anak1"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["tanggal_lahir_anak1"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["nik_anak1"];
								  ?>
								</td>


								<td>
								  <a href="updatedataanak.php?id=<?php echo $row["id"];?>">Update</a>
							
								</td>
							  </tr>
							<?php
						}
					?>
				</tbody>
			 </table>
			 <h4>Anak Ke 2</h4>
			 <table class="table table-bordered">
			    <thead>
				  <tr>
				  <th>
					   Nik Karyawan :
					</th>
				    <th>
					   Nama Karyawan :
					</th>
					<th>
						Nama :
					</th>
					<th>
						Jenis Kelamin :
					</th>
					<th>
						Tempat Lahir :
					</th>
					<th>
						Tanggal Lahir :
					</th>
					<th>
						Nik :
					</th>
					<th>
						Pilihan :
					</th>
					
					
				  </tr>
				</thead>
				<tbody>
				    <?php
						$q="SELECT * FROM data_karyawan";
						$res=mysqli_query($conn,$q);
						while ($row=mysqli_fetch_assoc($res))
						{
							?>
							  <tr>
							  <td>
								  <?php
									echo $row["nik"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["nama_karyawan"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["nama_anak2"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["jenis_kelamin_anak2"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["tempat_lahir_anak2"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["tanggal_lahir_anak2"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["nik_anak2"];
								  ?>
								</td>



								<td>
								  <a href="updatedataanak.php?id=<?php echo $row["id"];?>">Update</a>
								  
								 
								   
								</td>
							  </tr>
							<?php
						}
					?>
				</tbody>
			 </table>

			 <h4>Anak Ke 3</h4>
			 <table class="table table-bordered">
			    <thead>
				  <tr>
				  <th>
					   Nik Karyawan :
					</th>
				    <th>
					   Nama Karyawan :
					</th>
					<th>
						Nama :
					</th>
					<th>
						Jenis Kelamin :
					</th>
					<th>
						Tempat Lahir :
					</th>
					<th>
						Tanggal Lahir :
					</th>
					<th>
						Nik :
					</th>
					<th>
						Pilihan :
					</th>
					
					
				  </tr>
				</thead>
				<tbody>
				    <?php
						$q="SELECT * FROM data_karyawan";
						$res=mysqli_query($conn,$q);
						while ($row=mysqli_fetch_assoc($res))
						{
							?>
							  <tr>
							  <td>
								  <?php
									echo $row["nik"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["nama_karyawan"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["nama_anak3"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["jenis_kelamin_anak3"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["tempat_lahir_anak3"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["tanggal_lahir_anak3"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["nik_anak3"];
								  ?>
								</td>



								<td>
								  <a href="updatedataanak.php?id=<?php echo $row["id"];?>">Update</a>
								  
								  
								</td>
							  </tr>
							<?php
						}
					?>
				</tbody>
			 </table>

			 <h4>Anak Ke 4</h4>
			 <table class="table table-bordered">
			    <thead>
				  <tr>
				  <th>
					   Nik Karyawan :
					</th>
				    <th>
					   Nama Karyawan :
					</th>
					<th>
						Nama :
					</th>
					<th>
						Jenis Kelamin :
					</th>
					<th>
						Tempat Lahir :
					</th>
					<th>
						Tanggal Lahir :
					</th>
					<th>
						Nik :
					</th>
					<th>
						Pilihan :
					</th>
					
					
				  </tr>
				</thead>
				<tbody>
				    <?php
						$q="SELECT * FROM data_karyawan";
						$res=mysqli_query($conn,$q);
						while ($row=mysqli_fetch_assoc($res))
						{
							?>
							  <tr>
							  <td>
								  <?php
									echo $row["nik"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["nama_karyawan"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["nama_anak4"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["jenis_kelamin_anak4"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["tempat_lahir_anak4"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["tanggal_lahir_anak4"];
								  ?>
								</td>
								<td>
								  <?php
									echo $row["nik_anak4"];
								  ?>
								</td>



								<td>
								  <a href="updatedataanak.php?id=<?php echo $row["id"];?>">Update</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>  
	</div>
	 <script>
    $(document).ready(function()
	{
		 $('.table-bordered').DataTable();
	});
    </script>
  
  </body>
</html>




