<div class="content-wrapper">
        <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
            TAMBAH DATA PENDUDUK KELUAR
      </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
            <li><a href="#">Pristiwa</a></li>
            <li class="active">Mutasi Keluar</li>
        </ol>
    </section>

        <!-- Main content -->
    <section class="content">

    <div class="row">      
              <!-- TABS -->
        <div class="col-md-12">
            <div class="nav-tabs-custom">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#pemohon" data-toggle="tab">Data Pemohon</a></li>
                    <li><a href="#tujuan" data-toggle="tab">Alamat Tujuan dan Keterangan</a></li>
                    <li><a href="#pengikut" data-toggle="tab">Data Pengikut</a></li>
            </ul>
                <div class="tab-content">
                    
                    <div class="active tab-pane" id="pemohon">
                    <!-- Post -->
                        <div class="post">
                            <div class="box">
                                <div class="box-header">
								
                                </div><!-- /.box-header -->
                                <div class="box-body">
									<form name="form" action="" method="post" enctype="multipart/form-data">
											<div class="form-group">
                                                <label for="JenisPindah" class="col-sm-2 control-label">Jenis Pindah</label>
                                                    <div class="col-sm-6">
                                                        <select class="form-control" name="JenisPindah">
															<option value=""></option>
															<option value="AntarDesa">Antar Desa Dalam Satu Kecamatan</option>
															<option value="AntarKecamatan">Antar Kecamatan Dalam Satu Kabupaten</option>
															<option value="AntarKabupaten">Antar Kabupaten/Kota Atau Antar Provinsi</option>
                                                        </select>
                                                    </div>
                                            </div>
                                            <br><br>
                                            <div class="form-group">
												<label for="" class="col-sm-2 control-label">Nama</label>
												<div class="col-lg-6">
													<div class="input-group">
														<input type="text" class="form-control" placeholder="Cari Nama" id="Nama" name="Nama" >
														<span class="input-group-btn">
															<button class="btn btn-default" type="button" data-toggle="modal" data-target="#CariNama">Cari</button>
														</span>
													</div>
												</div>
											</div> 
											<br><br>
                                            <div class="form-group">
                                                <label for="NIKPemohon" class="col-sm-2 control-label">NIK Pemohon</label>
                                                <div class="col-sm-6">
                                                  <input type="text" class="form-control" id="NoKTP" placeholder="NIK Pemohon" name="NoKTP">
                                                </div>
                                            </div>
                                            <br><br>
                                            <div class="form-group">
                                                <label for="JenKel" class="col-sm-2 control-label">Jenis Kelamin</label>
                                                    <div class="col-sm-6">
                                                        <select class="form-control" name="JenKel" id="JenKel">
															<option value=""></option>
															<option value="Laki-laki">Laki-laki</option>
															<option value="Perempuan">Perempuan</option>
                                                        </select>
                                                    </div>
                                            </div>
                                            <br><br>
                                            <div class="form-group">
                                                <label for="TempatLahir" class="col-sm-2 control-label">Tempat Lahir</label>
                                                <div class="col-sm-6">
                                                    <input type="text" class="form-control" id="TempatLahir" placeholder="Tempat Lahir" name="TempatLahir">
                                                </div>
                                            </div>
                                            <br><br>
                                            <div class="form-group">
                                                <label for="TglLahir" class="col-sm-2 control-label">Tanggal Lahir</label>
                                                <div class="col-sm-3">
                                                    <input type="date" class="form-control" id="TglLahir" placeholder="" name="TglLahir">
                                                </div>
                                            </div>
                                            <br><br>
                                            <div class="form-group">
                                                <label for="inputName" class="col-sm-2 control-label">Golongan Darah</label>
                                                    <div class="col-sm-6">
                                                      <select class="form-control" name="GolDar" id="GolDar">
                                                        <option value=""></option>
                                                        <option value="A">A</option>
                                                        <option value="B">B</option>
                                                        <option value="O">O</option>
                                                        <option value="AB">AB</option>
                                                        <option value="A+">A+</option>
                                                        <option value="A-">A-</option>
                                                        <option value="B+">B+</option>
                                                        <option value="O+">O+</option>
                                                        <option value="O-">O-</option>
                                                        <option value="AB+">AB+</option>
                                                        <option value="AB-">AB-</option>
                                                        <option value="Tidak Tahu">Tidak Tahu</option>
                                                      </select>
                                                    </div>
                                            </div>
                                            <br><br>
                                            <div class="form-group">
                                                <label for="Agama" class="col-sm-2 control-label">Agama</label>
                                                    <div class="col-sm-6">
														<select class="form-control" name="Agama" id="Agama">
															<option value=""></option>
															<option value="Islam">Islam</option>
															<option value="Kristen">Kristen</option>
															<option value="Katolik">Katolik</option>
															<option value="Hindu">Hindu</option>
															<option value="Budha">Budha</option>
															<option value="Lainnya">Lainnya</option>
														</select>
                                                    </div>
                                            </div>
                                            <br><br>
                                            <div class="form-group">
                                                <label for="StatusNikah" class="col-sm-2 control-label">Status Nikah</label>
                                                    <div class="col-sm-6">
                                                      <select class="form-control" name="S_Nikah" id="S_Nikah">
                                                        <option value=""></option>
														<option value="Lajang">Lajang</option>
														<option value="Menikah">Menikah</option>
														<option value="Duda">Duda</option>
														<option value="Janda">Janda</option>
                                                      </select>
                                                    </div>
                                            </div>
                                            <br><br>
                                            <div class="form-group">
                                                <label for="SHDK" class="col-sm-2 control-label">SHDK</label>
                                                    <div class="col-sm-6">
                                                      <select class="form-control" id="SHDK" name="SHDK">
														<option value=""></option>
														<option value="Kepala Keluarga">Kepala Keluarga</option>
														<option value="Suami">Suami</option>
														<option value="Istri">Istri</option>
														<option value="Anak">Anak</option>
														<option value="Menantu">Menantu</option>
														<option value="Cucu">Cucu</option>
														<option value="Orang Tua">Orang Tua</option>
														<option value="Mertua">Mertua</option>
														<option value="Famili Lain">Famili Lain</option>
														<option value="Pembantu">Pembantu</option>
														<option value="Lainnya">Lainnya</option>
													</select>
                                                    </div>
                                            </div>
                                            <br><br>
                                            <div class="form-group">
                                                <label for="Pendidikan" class="col-sm-2 control-label">Pendidikan</label>
                                                    <div class="col-sm-6">
                                                      <select class="form-control" name="Pendidikan" id="Pendidikan">
															<option value=""></option>
															<option value="Tidak Sekolah">Tidak Sekolah</option>
															<option value="SD">SD</option>
															<option value="SMP">SMP</option>
															<option value="SMA">SMA</option>
															<option value="Diploma">Diploma</option>
															<option value="S1">S1</option>
															<option value="S2">S2</option>
                                                      </select>
                                                    </div>
                                            </div>
                                            <br><br>
                                            <div class="form-group">
                                                <label for="Pekerjaan" class="col-sm-2 control-label">Pekerjaan</label>
                                                    <div class="col-sm-6">
                                                      <select class="form-control" name="Pekerjaan" id="Pekerjaan">
                                                        <option value=""></option>
                                                       
                                                      </select>
                                                    </div>
                                            </div>
                                            <br><br>
                                            <div class="form-group">
                                                <label for="NoKK" class="col-sm-2 control-label">No. KK</label>
                                                <div class="col-sm-6">
                                                    <input type="text" class="form-control" id="NoKK" placeholder="No. KK" name="NoKK">
                                                </div>
                                            </div>
                                            <br><br>
                                            <div class="form-group">
                                                <label for="NamaKK" class="col-sm-2 control-label">Nama Kepala Keluarga</label>
                                                <div class="col-sm-6">
                                                    <input type="text" class="form-control" id="NamaAyah" placeholder="NIK Ibu" name="NamaAyah">
                                                </div>
                                            </div>
                                            <br><br>
											<div class="form-group">
												<label for="Alamat" class="col-sm-2 control-label">Alamat</label>
													<div class="col-sm-4">
														<input type="text" class="form-control" id="Jalan"  name="Jalan">
													</div>
													<div class="col-sm-1">
														<input type="text" class="form-control" id="RT"  name="RT">
													</div>
													<div class="col-sm-1">
														<input type="text" class="form-control" id="RW"  name="RW">
													</div>
											</div>
											<br><br>
											<div class="form-group">
												<label for="WargaNegara" class="col-sm-2 control-label">Warga Negara</label>
													<div class="col-sm-6">
														<select class="form-control" name="Kewarganegaraan" id="Kewarganegaraan">
															<option value=""></option>
															<option value="WNI">WNI</option>
															<option value="WNA">WNA</option>
														</select>
													</div>
											</div>
											<br><br>
                                </div>
                            </div>
						</div>
                    </div><!-- /.tab-pane -->

                    <div class="tab-pane" id="tujuan">
                        <div class="post">
                            <div class="box">
                                <div class="box-header">
								
                                </div><!-- /.box-header -->
                                <div class="box-body">
										<div class="form-group">
                                            <label for="Desa" class="col-sm-2 control-label">Desa</label>
                                                <div class="col-sm-6">
                                                    <input type="text" class="form-control" id="AsalDesa"  name="AsalDesa">
                                                </div>
                                        </div>
                                        <br><br>
                                        <div class="form-group">
                                            <label for="Alamat" class="col-sm-2 control-label">Alamat</label>
                                                <div class="col-sm-4">
                                                    <input type="text" class="form-control" id="AsalJalan"  name="AsalJalan">
                                                </div>
                                                <div class="col-sm-1">
                                                    <input type="text" class="form-control" id="AsalRT"  name="AsalRT">
                                                </div>
                                                <div class="col-sm-1">
                                                    <input type="text" class="form-control" id="AsalRW"  name="AsalRW">
                                                </div>
                                        </div>
                                        <br><br>
                                        <div class="form-group">
                                            <label for="Kecamatan" class="col-sm-2 control-label">Kecamatan</label>
                                                <div class="col-sm-6">
                                                    <input type="text" class="form-control" id="AsalKecamatan"  name="AsalKecamatan">
                                                </div>
                                        </div>
                                        <br><br>
                                        <div class="form-group">
                                            <label for="Kabupaten" class="col-sm-2 control-label">Kabupaten/Kota</label>
                                                <div class="col-sm-6">
                                                    <input type="text" class="form-control" id="AsalKota"  name="AsalKota">
                                                </div>
                                        </div>
                                        <br><br>
                                        <div class="form-group">
                                            <label for="Provinsi" class="col-sm-2 control-label">Provinsi</label>
                                                <div class="col-sm-6">
                                                    <input type="text" class="form-control" id="AsalProvinsi"  name="AsalProvinsi">
                                                </div>
                                        </div>
                                        <br><br>
                                        <div class="form-group">
                                            <label for="KodePos" class="col-sm-2 control-label">Kode POS</label>
                                                <div class="col-sm-4">
                                                    <input type="text" class="form-control" id="AsalKodePos"  name="AsalKodePos">
                                                </div>
                                        </div>
										<br><br>
                                        <div class="form-group">
                                            <label for="TanggalPindah" class="col-sm-2 control-label">Tanggal Pindah</label>
                                                <div class="col-sm-6">
                                                    <input type="Date" class="form-control" id="TanggalPindah"  name="TanggalPindah">
                                                </div>
                                        </div>
                                        <br><br>
                                        <div class="form-group">
                                                <label for="AlasanPindah" class="col-sm-2 control-label">Alasan pindah</label>
                                                    <div class="col-sm-6">
                                                        <select class="form-control" name="AlasanPindah">
                                                        <option value=""></option>
                                                        
                                                        </select>
                                                    </div>
                                        </div>
                                        <br><br>
                                        <div class="form-group">
                                                <label for="StatusKK" class="col-sm-2 control-label">Status KK Bagi yang Tidak Pindah</label>
                                                    <div class="col-sm-6">
                                                        <select class="form-control" name="StatusKK">
															<option value=""></option>
															<option value="NumpangKK">Numpang KK</option>
															<option value="KKBaru">Membuat KK Baru</option>
															<option value="KKTetap">Nomor KK Tetap</option>
                                                        </select>
                                                    </div>
                                        </div>
                                        <br><br>
                                        <div class="form-group">
                                               <label for="StatusKK" class="col-sm-2 control-label">Status KK Bagi yang Pindah</label>
                                                    <div class="col-sm-6">
                                                        <select class="form-control" name="StatusKK">
															<option value=""></option>
															<option value="NumpangKK">Numpang KK</option>
															<option value="KKBaru">Membuat KK Baru</option>
															<option value="KKTetap">Nomor KK Tetap</option>
                                                        </select>
                                                    </div>
                                        </div>
                                        <br><br>
                                </div>
                            </div>
                        </div><!-- /.post -->
                    </div><!-- /.tab-pane --> 
					
					<div class="tab-pane" id="pengikut">
                        <div class="post">
                            <div class="box">
                                <div class="box-header">
									<span class="input-group-btn">
										<button class="btn btn-default" type="button" data-toggle="modal" data-target="#TambahPengikut">Tambah</button>
									</span>
                                </div><!-- /.box-header -->
                                <div class="box-body table-responsive" >
										<table id="table" class="table table-bordered table-striped">
											<thead>
												<tr>
													<th style="width:150px;">NIK</th>
													<th style="width:100px;">Nama</th>
													<th style="width:150px;">L/P</th>
													<th style="width:150px;">Status</th>
													<th style="width:150px;">Status Keluarga</th>
												</tr>
											</thead>
											<tbody>
											<?php
											$query = mysql_query("SELECT * FROM penduduk");
											while ($data = mysql_fetch_array($query)) {
											?>
												<tr>
													<td><?php echo $data['NoKTP']; ?></td>
													<td><?php echo $data['Nama']; ?></td>
													<td><?php echo $data['JenKel']; ?></td>
													<td><?php echo $data['StatusKK']; ?></td>
													<td><?php echo $data['SHDK']; ?></td>
												</tr>
												<?php } ?>
											</tbody>
										</table>
										<br><br>
										<div class="form-group">
											<div class="col-sm-offset-9 col-sm-10">
												<button type="submit" class="btn btn-danger"name="Simpan">SIMPAN</button>
											</div>
										</div>
                                </div>
                            </div>
                        </div><!-- /.post -->
                    </div><!-- /.tab-pane --> 
					</form>
					<?php
					include 'koneksi.php';
					if (isset($_POST['Simpan'])) 
					{
					include 'koneksi.php';
					error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));					
						$JenisPindah = $_POST['JenisPindah'];
						$NoKTP = $_POST['NoKTP'];
						$Nama= $_POST['Nama'];
						$JenKel= $_POST['JenKel']; 
						$TempatLahir= $_POST['TempatLahir']; 
						$TglLahir= $_POST['TglLahir'];
						$GolDar= $_POST['GolDar'];
						$Agama= $_POST['Agama']; 
						$S_Nikah= $_POST['S_Nikah'];
						$SHDK= $_POST['SHDK'];
						$Pendidikan= $_POST['Pendidikan'];
						$Pekerjaan = $_POST['Pekerjaan']; 
						$NoKK= $_POST['NoKK'];; 
						$NamaAyah= $_POST['NamaAyah'];
						$Jalan= $_POST['Jalan'];
						$RT = $_POST['RT'];
						$RW= $_POST['RW'];
						$Kewarganegaraan= $_POST['Kewarganegaraan'];
						
						$AsalDesa= $_POST['AsalDesa'];
						$AsalJalan= $_POST['AsalJalan'];
						$AsalRT = $_POST['AsalRT'];
						$AsalRW= $_POST['AsalRW'];  
						$AsalKecamatan= $_POST['AsalKecamatan'];
						$AsalKota = $_POST['AsalKota'];
						$AsalProvinsi= $_POST['AsalProvinsi'];  
						$AsalKodePos= $_POST['AsalKodePos'];
						$TanggalPindah= $_POST['TanggalPindah'];
						$StatusKK = $_POST['StatusKK'];
						
						 
						
					$query3=mysql_query("INSERT INTO penduduk (id,NoKTP,NoKK,Nama,TempatLahir,TglLahir,Jalan,RT,RW,JenKel,Agama,GolDar,Pendidikan,Pekerjaan,S_Nikah,Kewarganegaraan,SHDK,StatusKK,NamaAyah,JenisPindah,TanggalPindah,Keterangan,AsalDesa,AsalJalan,AsalRT,AsalRW,AsalKecamatan,AsalKota,AsalProvinsi,AsalKodePos) VALUES
														('','$NoKTP','$NoKK','$Nama','$TempatLahir','$TglLahir','$Jalan','$RT','$RW','$JenKel','$Agama','$GolDar','$Pendidikan','$Pekerjaan','$S_Nikah','$Kewarganegaraan','$SHDK','$StatusKK','$NamaAyah','$JenisPindah','$TanggalPindah','Mutasi Keluar', '$AsalDesa','$AsalJalan','$AsalRT','$AsalRW','$AsalKecamatan','$AsalKota','$AsalProvinsi','$AsalKodePos')")or die(mysql_error());  
					if($query3)
								{
									echo "<script>window.location='indexadmin.php?p=PendudukMutasi';</script>";
								}
							
					}
					?>
                    
                </div><!-- /.tab-content -->
            </div><!-- /.nav-tabs-custom -->
        </div><!-- /.col -->
    </div><!-- /.row -->
    </section><!-- /.content -->
</div><!-- /.content-wrapper -->


<!--Modal Tambah data-->
<div class="modal fade" id="TambahPengikut" tabindex="-1" role="dialog" aria-labelledby="TambahPengikutLabel" aria-hidden="true">
  	<div class="modal-dialog modal-lg">
    	<div class="modal-content">
            
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="TambahPengikutLabel">Form Tambah Data Pengikut</h4>
      		</div>
      		<div class="modal-body">            
                <form name="form" method="post" action="">
				<div class="form-group">
                    <label for="NIK" class="col-sm-2 control-label">NIK</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" id="NIK" placeholder="NIK" name="NIK">
                        </div>
                </div>
                <br><br>
                <div class="form-group">
                    <label for="Nama" class="col-sm-2 control-label">Nama</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" id="Nama" placeholder="Nama" name="Nama">
                        </div>
                </div>
				<br><br>
                <div class="form-group">
                    <label for="NoUrutKK" class="col-sm-2 control-label">No. Urut KK</label>
                        <div class="col-sm-6">
							<input type="text" class="form-control" id="NoUrutKK" placeholder="No. Urut KK" name="NoUrutKK">
                        </div>
                </div>
                <br><br>
                <div class="form-group">
                    <label for="JenKel" class="col-sm-2 control-label">Jenis Kelamin</label>
                        <div class="col-sm-6">
                            <select class="form-control" name="JenKel">
                                <option value=""></option>
                                <option value="Laki-laki">Laki-laki</option>
                                <option value="Perempuan">Perempuan</option>
                            </select>
                        </div>
                </div>
                <br><br>
                <div class="form-group">
                    <label for="TempatLahir" class="col-sm-2 control-label">Tempat Lahir</label>
						<div class="col-sm-6">
							<input type="text" class="form-control" id="TempatLahir" placeholder="Tempat Lahir" name="TempatLahir">
                        </div>
				</div>
                <br><br>
                <div class="form-group">
                    <label for="TglLahir" class="col-sm-2 control-label">Tanggal Lahir</label>
						<div class="col-sm-3">
							<input type="date" class="form-control" id="TglLahir" placeholder="" name="TglLahir">
					</div>
                </div>
                <br><br>
				<div class="form-group">
					<label for="Agama" class="col-sm-2 control-label">Agama</label>
						<div class="col-sm-6">
                            <select class="form-control" name="Agama">
                                <option value=""></option>
                                <option value="ISLAM">ISLAM</option>
                                <option value="KATOLIK">KATOLIK</option>
                                <option value="PROTESTAN">PROTESTAN</option>
                                <option value="HINDU">HINDU</option>
                                <option value="BUDHA">BUDHA</option>
                                <option value="LAINNYA">LAINNYA</option>
                            </select>
                        </div>
                </div>
                <br><br>
                <div class="form-group">
                    <label for="StatusNikah" class="col-sm-2 control-label">Status Nikah</label>
                        <div class="col-sm-6">
							<select class="form-control" name="StatusNikah">
								<option value=""></option>
                                <option value="Belum Nikah">Belum Nikah</option>
                                <option value="Nikah">Nikah</option>
                                <option value="Cerai Hidup">Cerai Hidup</option>
                                <option value="Cerai Mati">Cerai Mati</option>
                            </selecT>
					</div>
                </div>
                <br><br>
                <div class="form-group">
                    <label for="SHDK" class="col-sm-2 control-label">SHDK</label>
                        <div class="col-sm-6">
                            <select class="form-control" name="SHDK">
                                <option value="KEPALA KELUARGA">KEPALA KELUARGA</option>
                                <option value="SUAMI">SUAMI</option>
                                <option value="ISTRI">ISTRI</option>
                                <option value="ANAK">ANAK</option>
                                <option value="MENANTU">MENANTU</option>
                                <option value="CUCU">CUCU</option>
                                <option value="ORANG TUA">ORANG TUA</option>
                                <option value="MERTUA">MERTUA</option>
                                <option value="FAMILI LAIN">FAMILI LAIN</option>
                                <option value="PEMBANTU">PEMBANTU</option>
                                <option value="LAINNYA">LAINNYA</option>
                            </select>
                        </div>
                </div>
                <br><br>
                <div class="form-group">
                    <label for="Pendidikan" class="col-sm-2 control-label">Pendidikan</label>
                        <div class="col-sm-6">
                            <select class="form-control" name="Pendidikan">
                                <option value=""></option>
                                <option value="TIDAK/BELUM SEKOLAH">TIDAK/BELUM SEKOLAH</option>
                                <option value="BELUM TAMAT SD/SEDERAJAT">BELUM TAMAT SD/SEDERAJAT</option>
                                <option value="TAMAT SD/SEDERAJAT">TAMAT SD/SEDERAJAT</option>
                                <option value="SLTP/SEDERAJAT">SLTP/SEDERAJAT</option>
                                <option value="SLTA/SEDERAJAT">SLTA/SEDERAJAT</option>
                                <option value="DIPLOMA I/II">DIPLOMA I/II</option>
                                <option value="AKADEMI/DIPLOMA III/S.MUDA">AKADEMI/DIPLOMA III/S.MUDA</option>
                                <option value="DIPLOMA IV/STRATA I">DIPLOMA IV/STRATA I</option>
                                <option value="STRATA II">STRATA II</option>
                                <option value="STRATA III">STRATA III</option>
                            </select>
                        </div>
                </div>
                <br><br>
                <div class="form-group">
                    <label for="Pekerjaan" class="col-sm-2 control-label">Pekerjaan</label>
                        <div class="col-sm-6">
                            <select class="form-control" name="Pekerjaan">
                                <option value=""></option>
                                                       
                            </select>
                        </div>
                </div>
                <br><br>
                <div class="form-group">
                    <label for="NamaIbu" class="col-sm-2 control-label">Nama Ibu</label>
                        <div class="col-sm-6">
                             <input type="text" class="form-control" id="NamaIbu" placeholder="Nama Ibu" name="NamaIbu">
                        </div>
                </div>
                <br><br>
                <div class="form-group">
                    <label for="NIKIbu" class="col-sm-2 control-label">NIK Ibu</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" id="NIKIbu" placeholder="NIK Ibu" name="NIKIbu">
                         </div>
                </div>
                <br><br>
                <div class="form-group">
                    <label for="NamaAyah" class="col-sm-2 control-label">Nama Ayah</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" id="NamaAyah" placeholder="Nama Ayah" name="NamaAyah">
                        </div>
                </div>
                <br><br>
                <div class="form-group">
                    <label for="NIKAyah" class="col-sm-2 control-label">NIK Ayah</label>
                        <div class="col-sm-6">
                             <input type="text" class="form-control" id="NIKAyah" placeholder="NIK Ayah" name="NIKAyah">
                        </div>
                </div>
                <br><br>
                <div class="form-group">
                    <label for="WargaNegara" class="col-sm-2 control-label">Warga Negara</label>
                        <div class="col-sm-6">
                             <input type="text" class="form-control" id="WargaNegara" placeholder="Warga Negara" name="WargaNegara">
                        </div>
                </div>
                <br><br>  
            </div>
      		<div class="modal-footer">
                <button type="close" class="btn btn-default" data-dismiss="modal"><i class="fa fa-close"></i> Close</button>
        		<button type="submit" class="btn btn-primary" name="TambahData"><i class="fa fa-save"></i> Tambah</button>
                </form>
      		</div>
    	
        </div>
  	</div>
</div>
<!--End Modal Tambah data-->
<div class="modal fade" id="CariNama" tabindex="-1" role="dialog" aria-labelledby="carinama" aria-hidden="true">
  	<div class="modal-dialog modal-lg">
    	<div class="modal-content">
            
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="cariibu">Form Pencarian</h4>
      		</div>
      		<div class="modal-body">            
                <form name="form" method="post" action="">
                <div class="col-lg-6">
                    <div class="input-group">
                        <input type="text" class="form-control" placeholder="Cari">
                            <span class="input-group-btn">
                                <button class="btn btn-default" type="button">Cari</button>
                            </span>
                    </div>
                </div><br>
                <div>
                <table id="tablecari" class="table table-bordered table-striped">
                                    <thead>
                                        <tr>
                                            <th style="width:px;">Nama</th>
                                            <th style="width:px;">No KTP</th>
                                            <th style="width:px;">No KK</th>
                                            <th style="width:px;">Tempat Lahir</th>
                                            <th style="width:px;">Tanggal Lahir</th>
                                            <th style="width:px;">Jalan</th>
                                            <th style="">RT</th>
                                            <th style="width:px;">RW</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <?php
                                    $query = mysql_query("SELECT * FROM penduduk");
                                    while ($data = mysql_fetch_array($query)) {
                                    ?>
                                        <tr>
                                            <td><?php echo $data['Nama']; ?></td>         
                                            <td><a href="#"><?php echo $data['NoKTP']; ?></a></td>
                                            <td style="width:px; display:none;"><?php echo $data['JenKel']; ?></td>
                                            <td><?php echo $data['NoKK']; ?></td>
                                            <td><?php echo $data['TempatLahir']; ?></td>
                                            <td><?php echo $data['TglLahir']; ?></td>
											<td style="width:px; display:none;"><?php echo $data['GolDar']; ?></td>
											<td style="width:px; display:none;"><?php echo $data['Agama']; ?></td>
											<td style="width:px; display:none;"><?php echo $data['S_Nikah']; ?></td>
											<td style="width:px; display:none;"><?php echo $data['SHDK']; ?></td>
											<td style="width:px; display:none;"><?php echo $data['Pekerjaan']; ?></td>
											<td style="width:px; display:none;"><?php echo $data['NamaAyah']; ?></td>
                                            <td><?php echo $data['Jalan']; ?></td>
                                            <td><?php echo $data['RT']; ?></td>
                                            <td><?php echo $data['RW']; ?></td>
											<td style="width:px; display:none;"><?php echo $data['Pendidikan']; ?></td>
											<td style="width:px; display:none;"><?php echo $data['Kewarganegaraan']; ?></td>
                                        </tr>
                                      <?php
                                      }
                                      ?>
                                    </tbody>
                                </table>
                </div>
            </div>
      		<div class="modal-footer">
                <button type="close" class="btn btn-default" data-dismiss="modal"><i class="fa fa-close"></i> Close</button>
        		<button type="submit" class="btn btn-primary" name="TambahPemukiman"><i class="fa fa-save"></i> Ok</button>
                </form>
      		</div>
    	
        </div>
  	</div>
</div>
<script src="plugins/jQuery/jQuery-2.1.4.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript"> 
$(document).ready(function ()  {  
$("#tablecari td:nth-child(2)").click(function(event){  
  
//Prevent the hyperlink to perform default behavior  
event.preventDefault();  
//alert($(event.target).text())  
  
var $td= $(this).closest('tr').children('td');  
   
var Nama= $td.eq(0).text();  
var NoKTP= $td.eq(1).text();
var JenKel= $td.eq(2).text();
var NoKK= $td.eq(3).text();  
var TempatLahir= $td.eq(4).text();
var TglLahir= $td.eq(5).text();
var GolDar= $td.eq(6).text();
var Agama= $td.eq(7).text();
var S_Nikah= $td.eq(8).text();
var SHDK= $td.eq(9).text();
var Pekerjaan= $td.eq(10).text();
var NamaAyah= $td.eq(11).text();
var Jalan= $td.eq(12).text();  
var RT= $td.eq(13).text();
var RW= $td.eq(14).text();
var Pendidikan= $td.eq(15).text();
var Kewarganegaraan= $td.eq(16).text();

document.getElementById("Nama").value = Nama;
document.getElementById("NoKTP").value = NoKTP;
document.getElementById("JenKel").value = JenKel;
document.getElementById("NoKK").value = NoKK;
document.getElementById("TempatLahir").value = TempatLahir;
document.getElementById("TglLahir").value = TglLahir;
document.getElementById("GolDar").value = GolDar;
document.getElementById("Agama").value = Agama;
document.getElementById("S_Nikah").value = S_Nikah;
document.getElementById("SHDK").value = SHDK;
document.getElementById("Pekerjaan").value = Pekerjaan;
document.getElementById("NamaAyah").value = NamaAyah;
document.getElementById("Jalan").value = Jalan;
document.getElementById("RT").value = RT;
document.getElementById("RW").value = RW;
document.getElementById("Pendidikan").value = Pendidikan;
document.getElementById("Kewarganegaraan").value = Kewarganegaraan;
     $('#CariNama').modal('hide');}  
  
);  
  
});  
  
</script>  
