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

$id_skck = $_POST['id_skck'];
$id_penduduk = $_POST['id_penduduk'];
$id_kelurahan = $_POST['id_kelurahan'];
$keperluan = $_POST['keperluan'];
$keterangan_lain = $_POST['keterangan_lain'];
$tgl_berlaku = $_POST['tgl_berlaku'];
$tgl_berakhir = $_POST['tgl_berakhir'];

$sql = "INSERT INTO skck(id_skck,id_penduduk, id_kelurahan, keperluan, keterangan_lain, tgl_berlaku, tgl_berakhir)VALUES('$id_skck','$id_penduduk','$id_kelurahan','$keperluan','$keterangan_lain','$tgl_berlaku','$tgl_berakhir')";
$ress = mysqli_query($conn, $sql);
if ($ress) {
	echo "<script>alert('Tambah Surat SKCK Berhasil!');</script>";
	echo "<script type='text/javascript'> document.location = 'skskck.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 = 'skskck_tambah.php'; </script>";
}
