<?php
include("sess_check.php");

$id_ktp = $_POST['id_ktp'];
$id_penduduk = $_POST['id_penduduk'];
$id_kelurahan = $_POST['id_kelurahan'];
$keterangan = $_POST['keterangan'];
$tanggal = $_POST['tanggal'];

$sql = "INSERT INTO ktp(id_ktp,id_penduduk, id_kelurahan, keterangan, tanggal)VALUES('$id_ktp','$id_penduduk', '$id_kelurahan', '$keterangan', '$tanggal')";
$ress = mysqli_query($conn, $sql);
if ($ress) {
	echo "<script>alert('Tambah Surat Pengambilan KTP Berhasil!');</script>";
	echo "<script type='text/javascript'> document.location = 'skktp.php'; </script>";
} else {
	echo ("Error description: " . mysqli_error($conn));
	echo "<script>alert('Ops, terjadi kesalahan. Silahkan coba lagi.');</script>";
	echo "<script type='text/javascript'> document.location = 'skktp_tambah.php'; </script>";
}
