<?php 
	// koneksi database
	include "../koneksi.php";

	// menangkap data yang di kirim dari form
	if (isset($_POST['Simpan'])) {
		$NIK 		= $_POST['NIK'];
		$NAMA 		= $_POST['NAMA'];
		$TGLJOIN	= $_POST['TGL_AWAL_KONTRAK'];
		$TGLAKHIR	= $_POST['TGL_AKHIR_KONTRAK'];
		$POSISI 	= $_POST['POSISI_KERJA'];
		$PT 		= $_POST['PERUSAHAAN'];
		$LOKASI 	= $_POST['LOKASI_KERJA'];
		$DEPART 	= $_POST['DEPARTEMENT'];
		$EMAIL 		= $_POST['EMAIL'];
		$PASS 		= $_POST['PASS'];
		$STATUS 	= $_POST['STATUS'];
		
		$a=mysqli_query($koneksi,"INSERT INTO personal VALUES ('$NIK','$NIK','$NAMA','$TGLJOIN','','$TGLAKHIR','$POSISI','$PT','$LOKASI','$DEPART','','','','','','','','','','','','','','','','','','','','','','','','','','$EMAIL','$STATUS')")or die(mysqli_error($koneksi));

		$b=mysqli_query($koneksi,"INSERT INTO masuk VALUES ('$NIK','$NAMA','$NIK','$PASS','$EMAIL','$STATUS')")or die(mysqli_error($koneksi));
		$c=mysqli_query($koneksi,"INSERT INTO bpjs VALUES ('$NIK','$NAMA','','','')")or die(mysqli_error($koneksi));
		$d=mysqli_query($koneksi,"INSERT INTO bank VALUES ('$NIK','$NAMA','','','','')")or die(mysqli_error($koneksi));

			if(!$a){
				echo '<meta http-equiv="refresh" content="3;url=index.php">';
			}else{
				echo '<div class="alert alert-success alert-dismissible fade in" role="alert">
				<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<strong> Sukses..!</strong> Data Berhasil Tersimpan.!
				<br>
				</div>';
				
				echo '<meta http-equiv="refresh" content="3;url=Pages-Personal-Info.php?NIK='.$_POST['NIK'].'">';
			}
	}




















?>