<div class="box box-success b-t-non" id='panel-add'>
	<h4 class="labelGreen">
		<i class="fa fa-plus-square m-r-15"></i> Form Tambah
	</h4>
	<hr class="m-t-0">
	<form method='post' action="<?php echo e(route('addDtKesPas')); ?>" enctype='multipart/form-data'>
		<?php echo e(csrf_field()); ?>

		<div class="box-body">
			<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12 p-0'>
				<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0 p-b-5" id='gr_nik'>
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>NIK Calon Istri</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<input type="text" name="nik" id='nikIstri' onkeyup="cekNIK()" required="required" autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
						<div class='iconStatus' id='icon_nik'></div>
					</div>
					<span class='col-lg-9 col-md-9 col-sm-12 col-xs-12 col-lg-offset-3 col-md-offset-3' id="cek_no_induk"></span>
				</div>
				<div class="clearfix"></div>
				<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0 p-b-5" id='gr_noReg'>
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>No Registrasi</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<select name="id_identitas_pasangan" id='noRegis' required="required" class="form-control input-sm customInput col-md-7 col-xs-12">
							<option value='' disabled selected> .:: Pilih No Registrasi ::. </option>
							<option value='0'> Pindahan / Lanjutan </option>
						</select>
					</div>
					<span class='col-lg-9 col-md-9 col-sm-12 col-xs-12 col-lg-offset-3 col-md-offset-3' id="cek_registrasi"></span>
				</div>
				<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0 p-b-5">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Tanggal Registrasi</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12 input-group p-t-0 p-b-0 p-l-15 p-r-15">
						<div class="input-group-addon">
							<i class="fa fa-calendar"></i>
						</div>
						<input type="text" name='tgl_registrasi' autocomplete='off' placeholder='dd-mm-yyyy' class="form-control pull-right"  id='form_datetime_today_reg' data-date-format="dd-mm-yyyy" required='required' disabled>
					</div>
				</div>
				<div class="clearfix"></div>
				<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0 p-b-5">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Nama Calon Suami</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<input type="text" name="nama_suami" id='namaSuami' required="required" autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12" readonly>
					</div>
				</div>
				<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0 p-b-5">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Nama Calon Istri</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<input type="text" name="nama_istri" id="namaIstri" required="required" autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12" readonly>
					</div>
				</div>
				<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0 p-b-5">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Tanggal Pemeriksaan</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12 input-group p-t-0 p-b-0 p-l-15 p-r-15">
						<div class="input-group-addon">
							<i class="fa fa-calendar"></i>
						</div>
						<input type="text" name='tgl_periksa' autocomplete='off' placeholder='dd-mm-yyyy' class="form-control pull-right"  id='form_datetime_today_periksa' data-date-format="dd-mm-yyyy" required='required'>
					</div>
				</div>
			</div>
			<div class="clearfix"></div>
			<h4 class="labelGreen m-0 m-b-5"><i class="fa fa-puzzle-piece m-r-15"></i> 1. POLI UMUM</h4>
			<label class="control-label col-lg-12 col-md-12 col-sm-12 col-xs-12" style="font-size: 18px">Anamnese dan Riwayat Penyakit</label>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>TBC</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<input type="radio" class="customCheck" id="tbc1" value='1' name="tbc" required="required"><label class="labelRadio" for="tbc1">Ya</label>
					<input type="radio" class="customCheck" id="tbc2" value='2' name="tbc" required="required"><label class="labelRadio" for="tbc2">Tidak</label>
				</div>
			</div>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Diabetes Militus</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<input type="radio" class="customCheck" id="diabetes1" value='1' name="diabetes" required="required"><label class="labelRadio" for="diabetes1">Ya</label>
					<input type="radio" class="customCheck" id="diabetes2" value='2' name="diabetes" required="required"><label class="labelRadio" for="diabetes2">Tidak</label>
				</div>
			</div>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Jantung</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<input type="radio" class="customCheck" id="jantung1" value='1' name="jantung" required="required"><label class="labelRadio" for="jantung1">Ya</label>
					<input type="radio" class="customCheck" id="jantung2" value='2' name="jantung" required="required"><label class="labelRadio" for="jantung2">Tidak</label>
				</div>
			</div>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Hipertensi</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<input type="radio" class="customCheck" id="hipertensi1" value='1' name="hipertensi" required="required"><label class="labelRadio" for="hipertensi1">Ya</label>
					<input type="radio" class="customCheck" id="hipertensi2" value='2' name="hipertensi" required="required"><label class="labelRadio" for="hipertensi2">Tidak</label>
				</div>
			</div>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Infeksi Kandungan</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<input type="radio" class="customCheck" id="infekKand1" value='1' name="infeksi_kandungan" required="required"><label class="labelRadio" for="infekKand1">Ya</label>
					<input type="radio" class="customCheck" id="infekKand2" value='2' name="infeksi_kandungan" required="required"><label class="labelRadio" for="infekKand2">Tidak</label>
				</div>
			</div>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Penyakit Lain</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<input type="radio" class="customCheck" id="penyakitLain1" value='1' name="penyakit_lain" required="required"><label class="labelRadio" for="penyakitLain1">Ya</label>
					<input type="radio" class="customCheck" id="penyakitLain2" value='2' name="penyakit_lain" required="required"><label class="labelRadio" for="penyakitLain2">Tidak</label>
				</div>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12 col-lg-offset-3 col-md-offset-3 m-b-5" id='namaPenyakitLain' style='display:none'>
					<input type="text" name="nama_penyakit" id='nmPenyakit' autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
				</div>
			</div>
			<label class="control-label col-lg-12 col-md-12 col-sm-12 col-xs-12" style="font-size: 18px">Pemeriksaan</label>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Tekanan Darah (mmHg)</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<!-- <input type="text" name="tekanan_darah" required='required' autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12"> -->
					<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 p-0">
						<label class="control-label col-lg-4 col-md-4 col-sm-6 col-xs-6 p-0" id='label-input'>Sistole</label>
						<div class="col-lg-7 col-md-7 col-sm-5 col-xs-5 p-0">
							<input type="number" name="sistole" step='any' autocomplete='off' required="required" class="form-control input-sm customInput">
						</div>
					</div>
					<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 p-0">
						<label class="control-label col-lg-4 col-md-4 col-sm-6 col-xs-6 p-0" id='label-input'>Diastole</label>
						<div class="col-lg-7 col-md-7 col-sm-5 col-xs-5 p-0">
							<input type="number" name="diastole" step='any' autocomplete='off' required="required" class="form-control input-sm customInput col-md-7 col-xs-12">
						</div>
					</div>
				</div>
			</div>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Kesehatan Umum</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<input type="radio" class="customCheck" id="kesehatanUmum1" value='1' name="kesehatan_umum" required="required"><label class="labelRadio" for="kesehatanUmum1">Baik</label>
					<input type="radio" class="customCheck" id="kesehatanUmum2" value='2' name="kesehatan_umum" required="required"><label class="labelRadio" for="kesehatanUmum2">Kurang</label>
				</div>
			</div>
			<div class="clearfix"></div>
			<h4 class="labelGreen m-0 m-b-5"><i class="fa fa-puzzle-piece m-r-15"></i> 2. POLI KIA</h4>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Imunisasi TT</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<input type="radio" class="customCheck" id="imunTT1" value='1' name="imunisasi_tt" required="required"><label class="labelRadio" for="imunTT1">Ya</label>
					<input type="radio" class="customCheck" id="imunTT2" value='2' name="imunisasi_tt" required="required"><label class="labelRadio" for="imunTT2">Tidak</label>
				</div>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12 col-lg-offset-3 col-md-offset-3 m-b-5" id='inKetImunTT' style='display:none'>
					<input type="text" name="ket_imun_tt" id='ketImunTT' autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
				</div>
			</div>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Menggunakan Kontrasepsi</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<input type="radio" class="customCheck" id="kontrasepsi1" value='1' name="kontrasepsi" required="required"><label class="labelRadio" for="kontrasepsi1">Ya</label>
					<input type="radio" class="customCheck" id="kontrasepsi2" value='2' name="kontrasepsi" required="required"><label class="labelRadio" for="kontrasepsi2">Tidak</label>
				</div>
				<div class='col-lg-12 p-0 m-0' id='inkontrasepsi' style='display:none'>
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Jenis</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12 m-b-5">
						<input type="text" name="jenis_kontrasepsi" id='jnsKontrasepsi' autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
					</div>
				</div>
			</div>
			<div class='clearfix'></div>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Ingin punya anak dalam waktu 1 tahun</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<input type="radio" class="customCheck" id="inginAnak1" value='1' name="ingin_anak_batuta" required="required"><label class="labelRadio" for="inginAnak1">Ya</label>
					<input type="radio" class="customCheck" id="inginAnak2" value='2' name="ingin_anak_batuta" required="required"><label class="labelRadio" for="inginAnak2">Tidak</label>
				</div>
			</div>
			<div class="clearfix"></div>
			<h4 class="labelGreen m-0 m-b-15"><i class="fa fa-puzzle-piece m-r-15"></i> 3. LABORATORIUM</h4>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Hemoglobin (Hb)</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<input type="text" name="hb" required='required' autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
				</div>
			</div>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Tes kehamilan</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<input type="radio" class="customCheck" id="testKehamilan1" value='1' name="test_kehamilan" required="required"><label class="labelRadio" for="testKehamilan1">Positif</label>
					<input type="radio" class="customCheck" id="testKehamilan2" value='2' name="test_kehamilan" required="required"><label class="labelRadio" for="testKehamilan2">Negatif</label>
				</div>
			</div>
			<div class='clearfix m-b-5'></div>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-5">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Tes lain</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<input type="text" name="test_lain" required='required' autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
				</div>
			</div>
			<div class="clearfix"></div>
			<h4 class="labelGreen m-0 m-b-15"><i class="fa fa-puzzle-piece m-r-15"></i> 4. POJOK GIZI</h4>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-5">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Berat badan (Kg)</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<input type="number" name="berat_badan" step='any' required='required' autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
				</div>
			</div>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-5">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Tinggi badan (Cm)</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<input type="number" name="tinggi_badan" step='any' required='required' autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
				</div>
			</div>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-5">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Lingkar lengan atas (Cm)</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<input type="number" name="lingkar_lengan_atas" step='any' required='required' autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
				</div>
			</div>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-5">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Lingkar pinggang (Cm)</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<input type="number" name="lingkar_pinggang" step='any' required='required' autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
				</div>
			</div>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-5">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Lingkar panggul (Cm)</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<input type="number" name="lingkar_panggul" step='any' required='required' autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
				</div>
			</div>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Menerima vitamin pengantin</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<input type="radio" class="customCheck" id="vitPengantin1" value='1' name="vitamin_pengantin" required="required"><label class="labelRadio" for="vitPengantin1">Ya</label>
					<input type="radio" class="customCheck" id="vitPengantin2" value='2' name="vitamin_pengantin" required="required"><label class="labelRadio" for="vitPengantin2">Tidak</label>
				</div>
			</div>
			<div class="clearfix m-b-5"></div>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0">
				<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Menerima buku saku</label>
				<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
					<input type="radio" class="customCheck" id="bukuSaku1" value='1' name="buku_saku" required="required"><label class="labelRadio" for="bukuSaku1">Ya</label>
					<input type="radio" class="customCheck" id="bukuSaku2" value='2' name="buku_saku" required="required"><label class="labelRadio" for="bukuSaku2">Tidak</label>
				</div>
			</div>
			<div class='clearfix p-b-5'></div>
		</div>
		<div class="box-footer">
			<span id='tombol'>
				<button type="submit" class="btn btn-primary pull-right m-l-15" disabled>Simpan <span class="fa fa-save"></span></button>
			</span>
			<button type="button" class="btn btn-warning btn-cancel pull-right"><span class="fa fa-chevron-left"></span> Kembali</button>
		</div>
	</form>
</div>
<script type="text/javascript">
	var onLoad = (function() {
		$('#panel-add').animateCss('bounceInUp');
	})();

	$('.btn-cancel').click(function(e){
    	e.preventDefault();
    	$('#panel-add').animateCss('bounceOutDown');
    	$('.other-page').fadeOut(function(){
    		$('.other-page').empty();
            $('.main-layer').fadeIn();
        });
    });

    $('#noRegis').chosen();

    function cekNIK() {
		var nik = $('#nikIstri').val();
		$.post("<?php echo route('cekPernikahanIstri'); ?>", {nik:nik }).done(function(data){
			var listDes = '<option value="" disabled selected> .:: Pilih No Registrasi ::. </option><option value="0"> Pindahan / Lanjutan </option>';
    		if(data.pernikahan.length > 0){
    			$.each(data.pernikahan, function(k,v){
    				listDes += '<option value="'+v.id_identitas_pasangan+'">'+v.no_registrasi+'</option>';
    			});
    		}
    		$('#noRegis').html(listDes);
    		$('#noRegis').trigger('chosen:updated');

    		if(data.bumil != null){
				$('#gr_nik').attr('class','col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0 p-b-5');
				var icon = "<i class='fa fa-check-circle'></i>";
				$('#icon_nik').attr('style','color:green');
				var status = "";
				var button = '<button type="submit" class="btn btn-primary pull-right m-l-15" disabled>Simpan <span class="fa fa-save"></span></button>';
			}else{
				$('#gr_nik').attr('class','col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0 p-b-5 has-error');
				var icon = "<i class='fa fa-warning'></i>";
				$('#icon_nik').attr('style','color:red');
				var status = "<p class='messageError'><i>NIK Calon Istri Tidak Ditemukan</i></p>";
				var button = '<button type="submit" class="btn btn-primary pull-right m-l-15" disabled>Simpan <span class="fa fa-save"></span></button>';
			}
			if (nik != '') {
				$('#cek_no_induk').html(status);
				$('#icon_nik').html(icon);
				$('#tombol').html(button);
			}else{
				$('#cek_no_induk').html("");
				$('#icon_nik').html("");
				$('#tombol').html('<button type="submit" class="btn btn-primary pull-right m-l-15" disabled>Simpan <span class="fa fa-save"></span></button>');
			};
			$('#gr_noReg').attr('class','col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0 p-b-5');
			$('#cek_registrasi').html("");
		});
	}

	$('#noRegis').change(function(){
    	var nikIstri= $('#nikIstri').val();
    	var id= $('#noRegis').val();
    	if (id != 0) {
	    	$.post("<?php echo route('getDetPernikahan'); ?>", {id :id }).done(function(data){
	    		var tglAwal = data.idenPas.tgl_registrasi.split("-");
				var tglEnd = tglAwal[2]+"-"+tglAwal[1]+"-"+tglAwal[0];
				$('#form_datetime_today_reg').val(tglEnd);
				$('#namaSuami').val(data.idenPas.nama_suami);
				$('#namaIstri').val(data.idenPas.bumil.nama_bumil);

				if (data.kesehatan == null) {
					var button = '<button type="submit" class="btn btn-primary pull-right m-l-15">Simpan <span class="fa fa-save"></span></button>';
					var status = "";
					$('#gr_noReg').attr('class','col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0 p-b-5');
				}else{
					var button = '<button type="submit" class="btn btn-primary pull-right m-l-15" disabled>Simpan <span class="fa fa-save"></span></button>';
					var status = "<p class='messageError'><i>No Registrasi Sudah digunakan</i></p>";
					$('#gr_noReg').attr('class','col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0 p-b-5 has-error');
				}
				$('#cek_registrasi').html(status);
				$('#tombol').html(button);
	    	});
    	}else{
    		$.post("<?php echo route('cekNik_Istri'); ?>", {nik :nikIstri }).done(function(data){
    			if(data.length == 0){
    				window.alert(id);
    				var button = '<button type="submit" class="btn btn-primary pull-right m-l-15" disabled>Simpan <span class="fa fa-save"></span></button>';
					var status = "<p class='messageError'><i>NIK Istri Harus Diisi / NIK Istri Tidak Ditemukan</i></p>";
					$('#gr_noReg').attr('class','col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0 p-b-5 has-error');
    			}else{
					$('#form_datetime_today_reg').val('-');
    				$.each(data, function(k,v){
    					// listDes += '<option value="'+v.id_desa+'">'+v.nama_desa+'</option>';
						$('#namaSuami').val(v.nama_suami);
						$('#namaIstri').val(v.nama_bumil);
    				});

					var button = '<button type="submit" class="btn btn-primary pull-right m-l-15">Simpan <span class="fa fa-save"></span></button>';
					var status = "";
					$('#gr_noReg').attr('class','col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0 p-b-5');
    			}
				$('#cek_registrasi').html(status);
				$('#tombol').html(button);
	    	});
    	}
    });

    $('#form_datetime_today_periksa').datetimepicker({
        weekStart: 2,
        todayBtn:  1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        minView: 2,
        forceParse: 0,
    });

	// function cekReg() {
	// 	var noReg = $('#noRegistrasi').val();
	// 	$.post("<?php echo route('cekNoRegistrasi'); ?>", {noReg:noReg }).done(function(data){
	// 		if(data.length != 0){
	// 			$('#gr_reg').attr('class','col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0 p-b-5');
	// 			var icon = "<i class='fa fa-check-circle'></i>";
	// 			$('#icon_reg').attr('style','color:green');
	// 			var status = "";
	// 			var button = '<button type="submit" class="btn btn-primary pull-right m-l-15">Simpan <span class="fa fa-save"></span></button>';
	// 			$.each(data, function(k,v){
	// 				var tglAwal = v.tgl_registrasi.split("-");
	// 				var tglEnd = tglAwal[2]+"-"+tglAwal[1]+"-"+tglAwal[0];
	// 				$('#form_datetime_today_reg').val(tglEnd);
	// 				$('#namaSuami').val(v.nama_suami);
	// 				$('#namaIstri').val(v.bumil.nama_bumil);
	// 			});
	// 		}else{
	// 			$('#gr_reg').attr('class','col-lg-6 col-md-6 col-sm-12 col-xs-12 form-group m-b-0 p-b-5 has-error');
	// 			var icon = "<i class='fa fa-warning'></i>";
	// 			$('#icon_reg').attr('style','color:red');
	// 			var status = "<p class='messageError' style='position: absolute;top: -30px;right: 45px;'><i>No Registrasi Tidak Ditemukan</i></p>";
	// 			$('#form_datetime_today_reg').val("");
	// 			$('#namaSuami').val("");
	// 			$('#namaIstri').val("");
	// 			var button = '<button type="submit" class="btn btn-primary pull-right m-l-15" disabled>Simpan <span class="fa fa-save"></span></button>';
	// 		}
	// 		if (noReg != '') {
	// 			$('#cek_no_req').html(status);
	// 			$('#icon_reg').html(icon);
	// 			$('#tombol').html(button);
	// 		}else{
	// 			$('#cek_no_req').html("");
	// 			$('#icon_reg').html("");
	// 			$('#tombol').html('<button type="submit" class="btn btn-primary pull-right m-l-15" disabled>Simpan <span class="fa fa-save"></span></button>');
	// 		};
	// 	});
	// }

	$('#penyakitLain1').click(function(){
		$('#namaPenyakitLain').show();
		$('#nmPenyakit').attr('required',true);
	});
	$('#penyakitLain2').click(function(){
		$('#namaPenyakitLain').hide();
		$('#nmPenyakit').attr('required',false);
	});	

	$('#imunTT1').click(function(){
		$('#inKetImunTT').show();
		$('#ketImunTT').attr('required',true);
	});
	$('#imunTT2').click(function(){
		$('#inKetImunTT').hide();
		$('#ketImunTT').attr('required',false);
	});

	$('#kontrasepsi1').click(function(){
		$('#inkontrasepsi').show();
		$('#jnsKontrasepsi').attr('required',true);
	});
	$('#kontrasepsi2').click(function(){
		$('#inkontrasepsi').hide();
		$('#jnsKontrasepsi').attr('required',false);
	});	
</script>