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


if (isset($_GET['ktp'])) {
	$sql = "SELECT * FROM penduduk WHERE id_penduduk='" . $_GET['ktp'] . "'";
	$ress = mysqli_query($conn, $sql);
	$data = mysqli_fetch_array($ress);
}
// deskripsi halaman
$pagedesc = "penduduk";
$menuparent = "penduduk";
include("layout_top.php");
$tanggal = date('Y-m-d');
?>
<!-- top of file -->
<!-- Page Content -->
<div id="page-wrapper">
	<div class="container-fluid">
		<div class="row">
			<div class="col-lg-12">
				<h1 class="page-header">Surat Keterangan Pengambilan KTP</h1>
			</div><!-- /.col-lg-12 -->
		</div><!-- /.row -->

		<div class="row">
			<div class="col-lg-12"><?php include("layout_alert.php"); ?></div>
		</div>

		<div class="row">
			<div class="col-lg-12">
				<form class="form-horizontal" action="skktp_insert.php" method="POST" enctype="multipart/form-data">
					<div class="panel panel-default">
						<div class="panel-heading">
							<h3>Tambah Surat Keterangan Pengambilan KTP</h3>
						</div>
						<div class="panel-body">

							<div class="form-group">
								<label class="control-label col-sm-3">Id Penduduk</label>
								<div class="col-sm-4">
									<input type="text" name="id_penduduk" class="form-control" placeholder="nik" value="<?php echo $data['id_penduduk'] ?>" required>
									
								</div>
							</div>

							<div class="form-group">
								<label class="control-label col-sm-3">Nik</label>
								<div class="col-sm-4">
									<input type="text" name="nik" class="form-control" placeholder="" value="<?php echo $data['nik'] ?>" required>
								</div>
							</div>

							<div class="form-group">
								<label class="control-label col-sm-3">Nama Lengkap</label>
								<div class="col-sm-4">
									<input type="text" name="nama_lengkap" class="form-control" placeholder="Nama Lengkap" value="<?php echo $data['nama_lengkap'] ?>" required>
								</div>
							</div>

							<div class="form-group">
								<label class="control-label col-sm-3">Keterangan</label>
								<div class="col-sm-4">
								<textarea class="form-control" id="exampleFormControlTextarea1" rows="3" name="keterangan"></textarea>
								</div>
							</div>

							<div class="form-group">
								<label class="control-label col-sm-3">Nama Pejabat</label>
								<div class="col-sm-4">
									<select name="id_kelurahan" id="keterangan" class="form-control" required>
										<option value="">==== Pilih Nama Pejabat ====</option>
										<?php
										$sql_brg = "SELECT * from kelurahan order by id_kelurahan asc";
										$ress_brg = mysqli_query($conn, $sql_brg);
										while ($li = mysqli_fetch_array($ress_brg)) {
											echo '<option value="' . $li['id_kelurahan'] . '">' . $li['nama_pejabat'] . '</option>';
										}
										?>
									</select>
								</div>
							</div>

							<div class="form-group">
								<label class="control-label col-sm-3">Tanggal Permohonan</label>
								<div class="col-sm-4">
								<input type="text" name="tanggal" class="form-control" placeholder="Nama Lengkap" value="<?php echo $tanggal; ?>" required>
								</div>
							</div>
						</div>
						<div class="panel-footer">
							<button type="submit" name="simpan" class="btn btn-success">Simpan</button>
						</div>
					</div><!-- /.panel -->
				</form>
			</div><!-- /.col-lg-12 -->
		</div><!-- /.row -->
	</div><!-- /.container-fluid -->
</div><!-- /#page-wrapper -->
<!-- bottom of file -->
<?php
include("layout_bottom.php");
?>