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

$id_kk = $_POST['id_kk'];
$id_penduduk = $_POST['id_penduduk'];
$id_kelurahan = $_POST['id_kelurahan'];
$keperluan = $_POST['keperluan'];
$keterangan_lain = $_POST['keterangan_lain'];
$tanggal = $_POST['tanggal'];

$sql = "INSERT INTO kartu_keluarga(id_kk,id_penduduk, id_kelurahan, keperluan, keterangan_lain, tanggal)VALUES('$id_kk','$id_penduduk','$id_kelurahan','$keperluan','$keterangan_lain','$tanggal')";
$ress = mysqli_query($conn, $sql);
if ($ress) {
	echo "<script>alert('Tambah Surat Kartu Keluarga Berhasil!');</script>";
	echo "<script type='text/javascript'> document.location = 'skkk.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 = 'skkk_tambah.php'; </script>";
}
