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


if (isset($_GET['pindah'])) {
	$sql = "SELECT * FROM penduduk WHERE id_penduduk='" . $_GET['pindah'] . "'";
	$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 Kehilangan</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="skpindah_insert.php" method="POST" enctype="multipart/form-data">
					<div class="panel panel-default">
						<div class="panel-heading">
							<h3>Tambah Surat Pindah</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">Desa Baru</label>
								<div class="col-sm-4">
									<input type="text" name="desa_baru" class="form-control" placeholder="" required>
								</div>
							</div>

							<div class="form-group">
								<label class="control-label col-sm-3">Jalan Baru</label>
								<div class="col-sm-4">
									<input type="text" name="jalan_baru" class="form-control" placeholder="" required>
								</div>
							</div>
							
							<div class="form-group">
								<label class="control-label col-sm-3">Rt Baru</label>
								<div class="col-sm-4">
									<input type="text" name="rt_baru" class="form-control" placeholder="" required>
								</div>
							</div>

							<div class="form-group">
								<label class="control-label col-sm-3">Rw Baru</label>
								<div class="col-sm-4">
									<input type="text" name="rw_baru" class="form-control" placeholder="" required>
								</div>
							</div>

							<div class="form-group">
								<label class="control-label col-sm-3">Kecamatan Baru</label>
								<div class="col-sm-4">
									<input type="text" name="kecamatan_baru" class="form-control" placeholder="" required>
								</div>
							</div>

							<div class="form-group">
								<label class="control-label col-sm-3">Kabupaten Baru</label>
								<div class="col-sm-4">
									<input type="text" name="kabupaten_baru" class="form-control" placeholder="" required>
								</div>
							</div>

							<div class="form-group">
								<label class="control-label col-sm-3">Provinsi Baru</label>
								<div class="col-sm-4">
									<input type="text" name="provinsi_baru" class="form-control" placeholder="" required>
								</div>
							</div>

							<div class="form-group">
										<label class="control-label col-sm-3">Keterangan Pindah</label>
										<div class="col-sm-4">
											<textarea name="keterangan_pindah" class="form-control" placeholder="Detail Keterangan Pindah" rows="3" required></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</label>
								<div class="col-sm-4">
									<input type="date" name="tanggal" class="form-control" placeholder="Tanggal" 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");
?>