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

if (isset($_GET['penduduk'])) {
	$sql = "SELECT * FROM penduduk WHERE id_penduduk='" . $_GET['penduduk'] . "'";
	$ress = mysqli_query($conn, $sql);
	$data = mysqli_fetch_array($ress);
}
// deskripsi halaman
$pagedesc = "penduduk";
$menuparent = "penduduk";
include("layout_top.php");
?>
<!-- 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">Penduduk</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="penduduk_update.php" method="POST" enctype="multipart/form-data">
					<div class="panel panel-default">
						<div class="panel-heading">
							<h3>Edit Data</h3>
						</div>
						<div class="panel-body">

							<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="nik" value="<?php echo $data['nik'] ?>" required>
									<input type="hidden" name="penduduk" class="form-control" placeholder="ID" value="<?php echo $data['id_penduduk'] ?>" 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">Tempat Lahir</label>
								<div class="col-sm-4">
									<input type="text" name="tempat_lahir" class="form-control" placeholder="tempat_lahir" value="<?php echo $data['tempat_lahir'] ?>" required>
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-sm-3">Tgl Lahir</label>
								<div class="col-sm-4">
									<input type="date" name="tgl_lahir" class="form-control" placeholder="" value="<?php echo $data['tgl_lahir']; ?>" required>
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-sm-3">Warga Negara</label>
								<div class="col-sm-4">
									<input type="text" name="warga_negara" class="form-control" placeholder="warga_negara" value="<?php echo $data['warga_negara'] ?>" required>
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-sm-3">Jenis kelamin</label>
								<div class="col-sm-4">
									<input type="text" name="jenis_kelamin" class="form-control" placeholder="jenis_kelamin" value="<?php echo $data['jenis_kelamin'] ?>" required>
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-sm-3">Pekerjaan</label>
								<div class="col-sm-4">
									<input type="text" name="pekerjaan" class="form-control" placeholder="pekerjaan" value="<?php echo $data['pekerjaan'] ?>" required>
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-sm-3">Agama</label>
								<div class="col-sm-4">
									<input type="text" name="agama" class="form-control" placeholder="agama" value="<?php echo $data['agama'] ?>" required>
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-sm-3">Pendidikan</label>
								<div class="col-sm-4">
									<input type="text" name="pendidikan" class="form-control" placeholder="pendidikan" value="<?php echo $data['pendidikan'] ?>" required>
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-sm-3">No KK</label>
								<div class="col-sm-4">
									<input type="text" name="no_kk" class="form-control" placeholder="no_kk" value="<?php echo $data['no_kk'] ?>" required>
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-sm-3">Kepala Keluarga</label>
								<div class="col-sm-4">
									<input type="text" name="kepala_keluarga" class="form-control" placeholder="kepala_keluarga" value="<?php echo $data['kepala_keluarga'] ?>" required>
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-sm-3">Desa</label>
								<div class="col-sm-4">
									<input type="text" name="desa" class="form-control" placeholder="desa" value="<?php echo $data['desa'] ?>" required>
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-sm-3">Jalan</label>
								<div class="col-sm-4">
									<input type="text" name="jalan" class="form-control" placeholder="jalan" value="<?php echo $data['jalan'] ?>" required>
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-sm-3">RT</label>
								<div class="col-sm-4">
									<input type="text" name="rt" class="form-control" placeholder="rt" value="<?php echo $data['rt'] ?>" required>
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-sm-3">RW</label>
								<div class="col-sm-4">
									<input type="text" name="rw" class="form-control" placeholder="rw" value="<?php echo $data['rw'] ?>" required>
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-sm-3">Kabupaten</label>
								<div class="col-sm-4">
									<input type="text" name="kabupaten" class="form-control" placeholder="kabupaten" value="<?php echo $data['kabupaten'] ?>" required>
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-sm-3">Kecamatan</label>
								<div class="col-sm-4">
									<input type="text" name="kecamatan" class="form-control" placeholder="kecamatan" value="<?php echo $data['kecamatan'] ?>" required>
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-sm-3">Provinsi</label>
								<div class="col-sm-4">
									<input type="text" name="provinsi" class="form-control" placeholder="provinsi" value="<?php echo $data['provinsi'] ?>" required>
								</div>
							</div>

						</div>
						<div class="panel-footer">
							<button type="submit" name="perbarui" class="btn btn-success">Update</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");
?>