<script type="text/javascript">

	function cekkip() 

	{

		var punyakip = document.getElementById("opsikip").value;

		if (punyakip == "Ya") 

		{

			document.getElementById('kip').style.display = 'block';

			document.getElementById('input_kip').setAttribute("required","required");

		}

		else

		{

			document.getElementById('kip').style.display = 'none';

			$("#input_kip").removeAttr("required");

			document.getElementById('input_kip').value = '';

		}

	}

	function cekkks() 

	{

		var punyakks = document.getElementById("opsikks").value;

		if (punyakks == "Ya") 

		{

			document.getElementById('kks').style.display = 'block';

			document.getElementById('input_kks').setAttribute("required","required");

		}

		else

		{

			document.getElementById('kks').style.display = 'none';

			$("#input_kks").removeAttr("required");

			document.getElementById('input_kks').value = '';

		}

	}

	function cekpkh() 

	{

		var punyapkh = document.getElementById("opsipkh").value;

		if (punyapkh == "Ya") 

		{

			document.getElementById('pkh').style.display = 'block';

			document.getElementById('input_pkh').setAttribute("required","required");

		}

		else

		{

			document.getElementById('pkh').style.display = 'none';

			$("#input_pkh").removeAttr("required");

			document.getElementById('input_pkh').value = '';

		}

	}

</script>

<div class="az-content az-content-dashboard">

  <div class="container">

	<div class="az-content-body">

	  <div class="az-content-label mg-b-5">Data Diri</div>

		<form action="<?php echo base_url();?>Pendaftaran/step1Exec" method="POST" enctype="multipart/form-data">

		  <div class="row row-sm mg-b-20">

			<div class="col-lg-2">

			  <p class="mg-b-10">Nama</p>

			</div>

			<div class="col-lg-10">

			  <strong>

				<p>

					: <?php echo $calonsiswa->nama;?>

				</p>

			  </strong>

			</div><!-- col-4 -->

		  </div><!-- row -->

		  <div class="row row-sm mg-b-20">

			<div class="col-lg-2">

			  <p class="mg-b-10">NIK</p>

			</div>

			<div class="col-lg-10">

			  <strong>

				<p>

					: <?php echo $calonsiswa->nik;?>

				</p>

			  </strong>

			</div><!-- col-4 -->

		  </div><!-- row -->

		  <div class="row row-sm mg-b-20">

			<div class="col-lg-2">

			  <p class="mg-b-10">Tempat Lahir</p>

			</div>

			<div class="col-lg-4">

			  <input class="form-control" value="<?php echo $calonsiswa->tempat_lahir;?>" type="text" name="tempat_lahir" placeholder="Masukkan Tempat dan Tanggal Lahir sesuai KK" oninput="this.value = this.value.toUpperCase()" required>

			</div><!-- col-4 -->

			<p style="color:#ff0000;font-style : italic;font-size:12px;margin:20px 0 0px 0;">*)</p>

		  </div><!-- row -->

		  <div class="row row-sm mg-b-20">

			<div class="col-lg-2">

			  <p class="mg-b-10">Tanggal Lahir</p>

			</div>

			<?php

				if($calonsiswa->tanggal_lahir != NULL)

				{

					$pecah = explode("-",$calonsiswa->tanggal_lahir);

					?>

					<div class="col-lg-2">

					  <select class="form-control select2-no-search" name="tanggal" required>

						<option value="">- pilih tanggal -</option>

						<?php

							for($x=1;$x<=31;$x++)

							{	

								$tanggal = ($x <10 ? "0".$x : $x);

								?>

								<option value="<?php echo $tanggal;?>" <?php echo ($tanggal == $pecah[2] ? "selected" : "");?>><?php echo $tanggal;?></option>

								<?php

							}

						?>

					  </select>

					</div><!-- col-4 -->

					<div class="col-lg-2">

					  <select class="form-control select2-no-search" name="bulan" required>

						<option value="">- pilih bulan -</option>

						<?php

							$bulan = array("","Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember");

							for($y=1;$y<=12;$y++)

							{	

								$month	= ($y <10 ? "0".$y : $y);

								?>

								<option value="<?php echo $month;?>" <?php echo ($month == $pecah[1] ? "selected" : "");?>><?php echo $bulan[$y];?></option>

								<?php

							}

						?>

					  </select>

					</div><!-- col-4 -->

					<div class="col-lg-2">

					  <select class="form-control select2-no-search" name="tahun" required>

						<option value="">- pilih tahun -</option>

						<?php

							for($z=2000;$z<=2020;$z++)

							{	

								?>

								<option value="<?php echo $z;?>" <?php echo ($z == $pecah[0] ? "selected" : "");?>><?php echo $z;?></option>

								<?php

							}

						?>

					  </select>

					</div><!-- col-4 -->

					<p style="color:#ff0000;font-style : italic;font-size:12px;margin:0px 0 20px 0;">*)</p>

					<?php

				}

				else

				{

					?>

					<div class="col-lg-2">

					  <select class="form-control select2-no-search" name="tanggal" required>

						<option value="">- pilih tanggal -</option>

						<?php

							for($x=1;$x<=31;$x++)

							{	

								$tanggal = ($x <10 ? "0".$x : $x);

								?>

								<option value="<?php echo $tanggal;?>"><?php echo $tanggal;?></option>

								<?php

							}

						?>

					  </select>

					</div><!-- col-4 -->

					<div class="col-lg-2">

					  <select class="form-control select2-no-search" name="bulan" required>

						<option value="">- pilih bulan -</option>

						<?php

							$bulan = array("","Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember");

							for($y=1;$y<=12;$y++)

							{	

								$month	= ($y <10 ? "0".$y : $y);

								?>

								<option value="<?php echo $month;?>"><?php echo $bulan[$y];?></option>

								<?php

							}

						?>

					  </select>

					</div><!-- col-4 -->

					<div class="col-lg-2">

					  <select class="form-control select2-no-search" name="tahun" required>

						<option value="">- pilih tahun -</option>

						<?php

							for($z=2000;$z<=2020;$z++)

							{	

								?>

								<option value="<?php echo $z;?>"><?php echo $z;?></option>

								<?php

							}

						?>

					  </select>

					</div><!-- col-4 -->

					<?php

				}

			?>

			</div><!-- row -->

		  <div class="row row-sm mg-b-20">

			<div class="col-lg-2">

			  <p class="mg-b-10">Jenis Kelamin</p>

			</div>

			<div class="col-lg-2" style="padding-top:10px;">

              <label class="rdiobox">

                <input type="radio" name="jen_kel" value="L" <?php echo ($calonsiswa->jen_kel == "L" ? "checked" : "");?> required>

                <span>Laki-Laki</span>

              </label>

			</div><!-- col-4 -->

			<div class="col-lg-2"  style="padding-top:10px;">

              <label class="rdiobox">

                <input type="radio" name="jen_kel" value="P" <?php echo ($calonsiswa->jen_kel == "P" ? "checked" : "");?> required>

                <span>Perempuan</span>

              </label>

			</div><!-- col-4 -->

			<p style="color:#ff0000;font-style : italic;font-size:12px;margin:10px 0 0px 0;">*)</p>

		  </div><!-- row -->

		  <div class="row row-sm mg-b-20">

			<div class="col-lg-2">

			  <p class="mg-b-10">Agama</p>

			</div>

			<div class="col-lg-4">

              <select class="form-control select2-no-search" name="agama" required>

                <option value="">- pilih agama -</option>

                <option value="Islam" <?php echo ($calonsiswa->agama == "Islam" ? "selected" : "");?>>Islam</option>

                <option value="Kristen Protestan" <?php echo ($calonsiswa->agama == "Kristen Protestan" ? "selected" : "");?>>Kristen Protestan</option>

                <option value="Katholik" <?php echo ($calonsiswa->agama == "Katholik" ? "selected" : "");?>>Katholik</option>

                <option value="Hindu" <?php echo ($calonsiswa->agama == "Hindu" ? "selected" : "");?>>Hindu</option>

                <option value="Budha" <?php echo ($calonsiswa->agama == "Budha" ? "selected" : "");?>>Budha</option>

                <option value="Kong Hu Cu" <?php echo ($calonsiswa->agama == "Kong Hu Cu" ? "selected" : "");?>>Kong Hu Cu</option>

              </select>

			</div><!-- col-4 -->

			<p style="color:#ff0000;font-style : italic;font-size:12px;margin:20px 0 0px 0;">*)</p>

		  </div><!-- row -->

		  <div class="row row-sm mg-b-20">

			<div class="col-lg-2">

			  <p class="mg-b-10">No HP (Whatsapp) Siswa</p>

			</div>

			<div class="col-lg-3">

              <input type="text" class="form-control" name="no_hp" value="<?php echo $calonsiswa->no_hp;?>" required onkeypress="return (event.charCode !=8 && event.charCode ==0 || (event.charCode >= 48 && event.charCode <= 57))">

			</div><!-- col-4 -->

			<p style="color:#ff0000;font-style : italic;font-size:12px;margin:20px 0 0px 0;">*)</p>

		  </div><!-- row -->

		  <div class="row row-sm mg-b-20">

			<div class="col-lg-2">

			  <p class="mg-b-10">Email</p>

			</div>

			<div class="col-lg-3">

              <input type="email" class="form-control" name="email" value="<?php echo $calonsiswa->email;?>">

			</div><!-- col-4 -->

		  </div><!-- row -->

		  <div class="row row-sm mg-b-20">

			<div class="col-lg-2">

			  <p class="mg-b-10">Alamat</p>

			  <!--<p style="color:#ff0000;font-style : italic;font-size:12px;margin:-10px 10em 0px 0;">*)</p>
			-->
			</div>

			<div class="col-lg-10">

              <textarea class="form-control" name="alamat" rows="3" id="alamat_siswa" placeholder="Masukkan Alamat sesuai KK" required><?php echo $calonsiswa->alamat;?></textarea>
			  <p style="color:#ff0000;font-style : italic;font-size:12px;margin:0px 10em 0px 0;">*) Isikan alamat sesuai KK dengan format penulisan :</p>
			  <p style="color:#ff0000; font-style : italic;font-size:12px;margin:0px 20em 10px 0;">Nama Lingkungan/Dusun/Komplek/Jalan/Gang +-> RT/RW +-> Ds/Kel +-> Kec. +-> Kota/Kab +-> Provinsi</p>


			</div><!-- col-4 -->

		  </div><!-- row --><br>

		  <div class="row row-sm mg-b-20">

<!--			<div class="col-lg-2">

			  <p class="mg-b-10">Transportasi ke Madrasah</p>

			</div>

			<div class="col-lg-4">

              <input type="text" class="form-control" name="transportasi" value="<?php echo $calonsiswa->transportasi;?>" placeholder="misal: Sepeda, Bus, Mobil, Sepeda Motor" required>

			</div><!-- col-4 -->

		  </div><!-- row --> 

		  <div class="row row-sm mg-b-20">

			<div class="col-lg-2">

			  <p class="mg-b-10">Transportasi ke Madrasah</p>

			</div>

			<div class="col-lg-4">

              <select class="form-control select2-no-search" name="transportasi" required>

                <option value="">- pilih transportasi -</option>

                <option value="Jalan Kaki" <?php echo ($calonsiswa->transportasi == "Jalan Kaki" ? "selected" : "");?>>Jalan Kaki</option>

                <option value="Sepeda" <?php echo ($calonsiswa->transportasi == "Sepeda" ? "selected" : "");?>>Sepeda</option>

                <option value="Sepeda Motor" <?php echo ($calonsiswa->transportasi == "Sepeda Motor" ? "selected" : "");?>>Sepeda Motor</option>

                <option value="Mobil Pribadi" <?php echo ($calonsiswa->transportasi == "Mobil Pribadi" ? "selected" : "");?>>Mobil Pribadi</option>

                <option value="Angkutan Umum" <?php echo ($calonsiswa->transportasi == "Angkutan Umum" ? "selected" : "");?>>Angkutan Umum</option>

                <option value="Lainnya" <?php echo ($calonsiswa->transportasi == "Lainnya" ? "selected" : "");?>>Lainnya</option>

              </select>

			</div><!-- col-4 -->

			<p style="color:#ff0000;font-style : italic;font-size:12px;margin:20px 0 0px 0;">*)</p>

		  </div><!-- row -->

		  <div class="row row-sm mg-b-20">

			<div class="col-lg-2">

			  <p class="mg-b-10">Jarak Tempat Tinggal ke Madrasah</p>

			</div>

			<div class="col-lg-4">

              <select class="form-control select2-no-search" name="jarak" required>

                <option value="">- pilih jarak -</option>

                <option value="Kurang dari 5 Km" <?php echo ($calonsiswa->jarak == "Kurang dari 5 Km" ? "selected" : "");?>>Kurang dari 5 Km</option>

                <option value="Antara 5 - 10 Km" <?php echo ($calonsiswa->jarak == "Antara 5 - 10 Km" ? "selected" : "");?>>Antara 5 - 10 Km</option>

                <option value="Antara 11 - 20 Km" <?php echo ($calonsiswa->jarak == "Antara 11 - 20 Km" ? "selected" : "");?>>Antara 11 - 20 Km</option>

                <option value="Antara 21 - 30 Km" <?php echo ($calonsiswa->jarak == "Antara 21 - 30 Km" ? "selected" : "");?>>Antara 21 - 30 Km</option>

                <option value="Lebih dari 30 Km" <?php echo ($calonsiswa->jarak == "Lebih dari 30 Km" ? "selected" : "");?>>Lebih dari 30 Km</option>

              </select>

			</div><!-- col-4 -->

			<p style="color:#ff0000;font-style : italic;font-size:12px;margin:20px 0 00px 0;">*)</p>

		  </div><!-- row -->

		  <div class="row row-sm mg-b-20">

			<div class="col-lg-2">

			  <p class="mg-b-10">Waktu Tempuh (menit)</p>

			</div>

			<div class="col-lg-2">

              <input type="number" class="form-control" name="waktu_tempuh" min="0" value="<?php echo $calonsiswa->waktu_tempuh;?>" required>

			</div><!-- col-4 -->

			<p style="color:#ff0000;font-style : italic;font-size:12px;margin:20px 0 00px 0;">*)</p>

		  </div><!-- row -->

		  <div class="row row-sm mg-b-20">

			<div class="col-lg-2">

			  <p class="mg-b-10">Cita-Cita</p>

			</div>

			<div class="col-lg-4">

              <input type="text" class="form-control" name="cita_cita" value="<?php echo $calonsiswa->cita_cita;?>" required>

			</div><!-- col-4 -->

			<p style="color:#ff0000;font-style : italic;font-size:12px;margin:20px 0 00px 0;">*)</p>

		  </div><!-- row -->

		  <div class="row row-sm mg-b-20">

			<div class="col-lg-2">

			  <p class="mg-b-10">Hobi</p>

			</div>

			<div class="col-lg-4">

              <input type="text" class="form-control" name="hoby" value="<?php echo $calonsiswa->hoby;?>" required>

			</div><!-- col-4 -->

			<p style="color:#ff0000;font-style : italic;font-size:12px;margin:20px 0 00px 0;">*)</p>

		  </div><!-- row -->

		  <div class="row row-sm mg-b-20">

			<div class="col-lg-2">

			  <p class="mg-b-10">Pas Foto</p>

			  <p style="color:#ff0000;font-style : italic;font-size:12px;margin: -10px 0 00px 0;">*)</p>

			</div>

			<div class="col-lg-6">

			  <?php

				if($calonsiswa->foto != NULL)

				{

					?>

					<img src="<?php echo base_url();?>files/calon_siswa/foto/<?php echo $calonsiswa->foto;?>" height="200px">

					<?php

				}

			  ?>

              <input type="file" class="form-control" name="foto" accept=".jpeg,.jpg" <?php echo ($calonsiswa->foto == NULL ?"required" : "");?>>

			  <label style="color:#ff0000;"><i>*Foto resmi dimensi 4x6 menggunakan seragam OSIS dengan background merah dan file berformat picture (.JPEG)</i></label>

			</div>

		  </div><!-- row --><br>

		  <div class="row row-sm mg-b-20">

			<div class="col-lg-2">

			  <p class="mg-b-10">Mempunyai KIP?</p>

			</div>

			<div class="col-lg-2">

              <select class="form-control select2-no-search" name="opsikip" id="opsikip" onchange="cekkip();" required>

                <option value="Tidak">Tidak</option>

                <option value="Ya" <?php echo ($calonsiswa->kip != NULL ? "selected" :"");?>>Ya</option>

              </select>

			</div><!-- col-4 -->

		    <div class="col-lg-4" <?php echo ($calonsiswa->kip == NULL ? "style='display:none;'" : "style='display:block;'");?> id="kip">

              <input type="text" class="form-control" name="kip" id="input_kip" value="<?php echo $calonsiswa->kip;?>" placeholder="Masukkan nomor Kartu Indonesia Pintar">

			</div><!-- col-4 -->

		  </div><!-- row -->

		  <div class="row row-sm mg-b-20">

			<div class="col-lg-2">

			  <p class="mg-b-10">Mempunyai KKS?</p>

			</div>

			<div class="col-lg-2">

              <select class="form-control select2-no-search" name="opsikks" id="opsikks" onchange="cekkks();" required>

                <option value="Tidak">Tidak</option>

                <option value="Ya" <?php echo ($calonsiswa->kks != NULL ? "selected" :"");?>>Ya</option>

              </select>

			</div><!-- col-4 -->

		    <div class="col-lg-4" <?php echo ($calonsiswa->kks == NULL ? "style='display:none;'" : "style='display:block;'");?> id="kks">

              <input type="text" class="form-control" name="kks" id="input_kks" value="<?php echo $calonsiswa->kks;?>" placeholder="Masukkan nomor Kartu Keluarga Sejahtera">

			</div><!-- col-4 -->

		  </div><!-- row -->

		  <div class="row row-sm mg-b-20">

			<div class="col-lg-2">

			  <p class="mg-b-10">Mempunyai PKH?</p>

			</div>

			<div class="col-lg-2">

              <select class="form-control select2-no-search" name="opsipkh" id="opsipkh" onchange="cekpkh();" required>

                <option value="Tidak">Tidak</option>

                <option value="Ya" <?php echo ($calonsiswa->pkh != NULL ? "selected" :"");?>>Ya</option>

              </select>

			</div><!-- col-4 -->

		    <div class="col-lg-4" <?php echo ($calonsiswa->pkh == NULL ? "style='display:none;'" : "style='display:block;'");?> id="pkh">

              <input type="text" class="form-control" name="pkh" id="input_pkh" value="<?php echo $calonsiswa->pkh;?>" placeholder="Masukkan nomor Program Keluarga Harapan">

			</div><!-- col-4 -->

		  </div><!-- row -->

		  <br>

		  <br>

		  <div class="row row-sm mg-b-20">

			<div class="col-lg-12">

			  <button type="submit" class="btn btn-az-primary float-sm-right" onclick="return confirm('Apakah data Anda sudah benar?\nJika sudah benar, silakan klik OK.\nJika belum, silakan tekan Cancel/Batal, dan perbaiki terlebih dahulu.');">

				Lanjut <i class="fa fa-arrow-right"></i> 

			  </button>

			</div><!-- col-4 -->

		  </div><!-- row -->

		  <p style="color:#ff0000;font-style : italic;font-size:12px;margin:20px 0 00px 0;">Catatan : *) wajib diisi</p>
		  <p style="font-style : italic;font-size:12px;margin:0px 0 00px 0;">Catatan : Jika data belum lengkap, silahkan logout lalu lanjutkan dengan login kembali setelah data lengkap</p>


		</form>

	</div>

  </div>

</div><!-- az-content -->