<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="{{ route('addIdenPas') }}" enctype='multipart/form-data'>
		{{ csrf_field() }}
		<div class="box-body">
			<div class='col-lg-6 col-md-6 col-sm-12 col-xs-12 p-0'>
				<div class="form-group" id='gr_reg'>
					<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">
						<input type="text" name="no_registrasi" id='noRegistrasi' onkeyup="cekReg()" required="required" autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
						<div class='iconStatus' id='icon_reg'></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_req"></span>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group m-b-0">
					<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'>
					</div>
				</div>
			</div>
			<div class="clearfix"></div>
			<hr class="lineTopGreen">
			<div class='col-lg-6 col-md-6 col-sm-12 col-xs-12 p-0'>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>NIK Calon Suami</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<input type="text" name="nik_suami" required="required" autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<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" required="required" autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Tempat Lahir</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<input type="text" name="tmp_lahir_suami" required="required" autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group m-b-0">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Tanggal Lahir</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_lahir_suami' autocomplete='off' placeholder='dd-mm-yyyy' class="form-control pull-right"  id='form_datetime_today_husban' data-date-format="dd-mm-yyyy" required='required'>
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Agama</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<select name="agama_suami" id='agamaSuami' required="required" class="form-control input-sm customInput col-md-7 col-xs-12">
							<option value='' disabled selected> .:: Pilih Agama ::. </option>
							<option value='Aliran Kepercayaan'>Aliran Kepercayaan</option>
							<option value='Buddha'>Buddha</option>
							<option value='Hindu'>Hindu</option>
							<option value='Islam'>Islam</option>
							<option value='Konghucu'>Konghucu</option>
							<option value='Kristen Protestan'>Kristen Protestan</option>
							<option value='Katholik'>Katholik</option>
						</select>
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Suku</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<input type="text" name="suku_suami" required="required" autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Pendidikan</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<input type="text" name="pendidikan_suami" required="required" autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Pekerjaan</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<input type="text" name="pekerjaan_suami" required="required" autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Alamat</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<input type="text" name="alamat_suami" required="required" autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Pilih Provinsi</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<select name="provinsi_suami_id" id='provinsiSuami' required="required" class="form-control input-sm customInput col-md-7 col-xs-12">
							<option value='' disabled selected> .:: Pilih Provinsi ::. </option>
							@foreach ($provinsis as $provinsi)
								<option value='{!! $provinsi->id_provinsi !!}'>{!! $provinsi->nama_provinsi !!}</option>
							@endforeach
						</select>
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Pilih Kabupaten</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<select name="kabupaten_suami_id" id='kabupatenSuami' required="required" class="form-control input-sm customInput col-md-7 col-xs-12">
							<option value='' disabled selected> .:: Pilih Kabupaten ::. </option>
						</select>
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Pilih Kecamatan</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<select name="kecamatan_suami_id" id='kecamatanSuami' required="required" class="form-control input-sm customInput col-md-7 col-xs-12">
							<option value='' disabled selected> .:: Pilih Kecamatan ::. </option>
						</select>
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Pilih Desa</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<select name="desa_suami_id" id='desaSuami' required="required" class="form-control input-sm customInput col-md-7 col-xs-12">
							<option value='' disabled selected> .:: Pilih Desa ::. </option>
						</select>
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Pernah Menikah Sebelumnya</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<input type="radio" class="customCheck" id="nikahSuami1" value='1' name="pernah_menikah_suami">
						<label class="labelRadio" for="nikahSuami1">Ya</label>
						<input type="radio" class="customCheck" id="nikahSuami2" value='2' name="pernah_menikah_suami">
						<label class="labelRadio" for="nikahSuami2">Tidak</label>
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
			</div>
			<div class='col-lg-6 col-md-6 col-sm-12 col-xs-12 p-0'>
				<div class="form-group">
					<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 p-b-5'></div>
				<div class="form-group">
					<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_bumil" id="namaBumil" required="required" autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Tempat Lahir</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<input type="text" name="tmp_lahir" id="tmpLahir" required="required" autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group m-b-0">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Tanggal Lahir</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_lahir' autocomplete='off' placeholder='dd-mm-yyyy' class="form-control pull-right"  id='form_datetime_todayWife' data-date-format="dd-mm-yyyy" required='required'>
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Agama</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<select name="agama" id='agamaIstri' required="required" class="form-control input-sm customInput col-md-7 col-xs-12">
							<option value='' disabled selected> .:: Pilih Agama ::. </option>
							<option value='Aliran Kepercayaan'>Aliran Kepercayaan</option>
							<option value='Buddha'>Buddha</option>
							<option value='Hindu'>Hindu</option>
							<option value='Islam'>Islam</option>
							<option value='Konghucu'>Konghucu</option>
							<option value='Kristen Protestan'>Kristen Protestan</option>
							<option value='Katholik'>Katholik</option>
						</select>
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Suku</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<input type="text" name="suku_istri" required="required" autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Pendidikan</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<input type="text" name="pendidikan" id="pendidikanIstri" required="required" autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Pekerjaan</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<input type="text" name="pekerjaan" id="pekerjaanIstri" required="required" autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Alamat</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<input type="text" name="alamat_ktp" id="alamatIstri" required="required" autocomplete='off' class="form-control input-sm customInput col-md-7 col-xs-12">
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Pilih Provinsi</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<select name="provinsi_ktp_id" id='provinsiIstri' required="required" class="form-control input-sm customInput col-md-7 col-xs-12">
							<option value='' disabled selected> .:: Pilih Provinsi ::. </option>
							@foreach ($provinsis as $provinsi)
								<option value='{!! $provinsi->id_provinsi !!}'>{!! $provinsi->nama_provinsi !!}</option>
							@endforeach
						</select>
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Pilih Kabupaten</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<select name="kabupaten_ktp_id" id='kabupatenIstri' required="required" class="form-control input-sm customInput col-md-7 col-xs-12">
							<option value='' disabled selected> .:: Pilih Kabupaten ::. </option>
						</select>
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Pilih Kecamatan</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<select name="kecamatan_ktp_id" id='kecamatanIstri' required="required" class="form-control input-sm customInput col-md-7 col-xs-12">
							<option value='' disabled selected> .:: Pilih Kecamatan ::. </option>
						</select>
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Pilih Desa</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<select name="desa_ktp_id" id='desaIstri' required="required" class="form-control input-sm customInput col-md-7 col-xs-12">
							<option value='' disabled selected> .:: Pilih Desa ::. </option>
						</select>
					</div>
				</div>
				<div class='clearfix p-b-5'></div>
				<div class="form-group">
					<label class="control-label col-lg-3 col-md-3 col-sm-12 col-xs-12" id='label-input'>Pernah Menikah Sebelumnya</label>
					<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
						<input type="radio" class="customCheck" id="nikahIstri1" value='1' name="pernah_menikah_istri">
						<label class="labelRadio" for="nikahIstri1">Ya</label>
						<input type="radio" class="customCheck" id="nikahIstri2" value='2' name="pernah_menikah_istri">
						<label class="labelRadio" for="nikahIstri2">Tidak</label>
					</div>
				</div>
				<div class='clearfix p-b-5'></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();
        });
    });

    function loadFilePhoto(event) {
        var image = URL.createObjectURL(event.target.files[0]);
        $('#preview-photo').fadeOut(function(){
        	$(this).attr('src', image).fadeIn().css({
        		'-webkit-animation' : 'showSlowlyElement 700ms',
        		'animation'         : 'showSlowlyElement 700ms'
        	});
        });
    };

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

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

    $('#agamaSuami').chosen();
    $('#provinsiSuami').chosen();
    $('#kabupatenSuami').chosen();
    $('#kecamatanSuami').chosen();
    $('#desaSuami').chosen();

    $('#provinsiSuami').change(function(){
    	var id= $('#provinsiSuami').val();
    	$.post("{!! route('getKabupaten') !!}", {id :id }).done(function(data){
    		var listKab = '<option value="" disabled selected> .:: Pilih Kabupaten ::. </option>';
    		if(data.length > 0){
    			$.each(data, function(k,v){
    				listKab += '<option value="'+v.id_kabupaten+'">'+v.nama_kabupaten+'</option>';
    			});
    		}
    		$('#kabupatenSuami').html(listKab);
    		$('#kabupatenSuami').trigger('chosen:updated');
    	});
    });
    $('#kabupatenSuami').change(function(){
    	var id= $('#kabupatenSuami').val();
    	$.post("{!! route('getKecamatan') !!}", {id :id }).done(function(data){
    		var listKec = '<option value="" disabled selected> .:: Pilih Kecamatan ::. </option>';
    		if(data.length > 0){
    			$.each(data, function(k,v){
    				listKec += '<option value="'+v.id_kecamatan+'">'+v.nama_kecamatan+'</option>';
    			});
    		}
    		$('#kecamatanSuami').html(listKec);
    		$('#kecamatanSuami').trigger('chosen:updated');
    	});
    });
    $('#kecamatanSuami').change(function(){
    	var id= $('#kecamatanSuami').val();
    	$.post("{!! route('getDesa') !!}", {id :id }).done(function(data){
    		var listDes = '<option value="" disabled selected> .:: Pilih Desa ::. </option>';
    		if(data.length > 0){
    			$.each(data, function(k,v){
    				listDes += '<option value="'+v.id_desa+'">'+v.nama_desa+'</option>';
    			});
    		}
    		$('#desaSuami').html(listDes);
    		$('#desaSuami').trigger('chosen:updated');
    	});
    });

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

    $('#agamaIstri').chosen();
    $('#provinsiIstri').chosen();
    $('#kabupatenIstri').chosen();
    $('#kecamatanIstri').chosen();
    $('#desaIstri').chosen();

    $('#provinsiIstri').change(function(){
    	var id= $('#provinsiIstri').val();
    	$.post("{!! route('getKabupaten') !!}", {id :id }).done(function(data){
    		var listKab = '<option value="" disabled selected> .:: Pilih Kabupaten ::. </option>';
    		if(data.length > 0){
    			$.each(data, function(k,v){
    				listKab += '<option value="'+v.id_kabupaten+'">'+v.nama_kabupaten+'</option>';
    			});
    		}
    		$('#kabupatenIstri').html(listKab);
    		$('#kabupatenIstri').trigger('chosen:updated');
    	});
    });
    $('#kabupatenIstri').change(function(){
    	var id= $('#kabupatenIstri').val();
    	$.post("{!! route('getKecamatan') !!}", {id :id }).done(function(data){
    		var listKec = '<option value="" disabled selected> .:: Pilih Kecamatan ::. </option>';
    		if(data.length > 0){
    			$.each(data, function(k,v){
    				listKec += '<option value="'+v.id_kecamatan+'">'+v.nama_kecamatan+'</option>';
    			});
    		}
    		$('#kecamatanIstri').html(listKec);
    		$('#kecamatanIstri').trigger('chosen:updated');
    	});
    });
    $('#kecamatanIstri').change(function(){
    	var id= $('#kecamatanIstri').val();
    	$.post("{!! route('getDesa') !!}", {id :id }).done(function(data){
    		var listDes = '<option value="" disabled selected> .:: Pilih Desa ::. </option>';
    		if(data.length > 0){
    			$.each(data, function(k,v){
    				listDes += '<option value="'+v.id_desa+'">'+v.nama_desa+'</option>';
    			});
    		}
    		$('#desaIstri').html(listDes);
    		$('#desaIstri').trigger('chosen:updated');
    	});
    });

    function cekNIK() {
		var nik = $('#nikIstri').val();
		$.post("{!! route('cekNikIstri') !!}", {nik:nik }).done(function(data){
			if(data.bumil.length == 0){
				$('#namaBumil').val("");$('#namaBumil').attr('readonly',false);
				$('#tmpLahir').val("");$('#tmpLahir').attr('readonly',false);
				$('#form_datetime_todayWife').val("");$('#form_datetime_todayWife').attr('disabled',false);
				$('#agamaIstri').html("<option value='' disabled selected> .:: Pilih Agama ::. </option><option value='Aliran Kepercayaan'>Aliran Kepercayaan</option><option value='Buddha'>Buddha</option><option value='Hindu'>Hindu</option><option value='Islam'>Islam</option><option value='Konghucu'>Konghucu</option><option value='Kristen Protestan'>Kristen Protestan</option><option value='Katholik'>Katholik</option>");
				$('#agamaIstri').attr('disabled',false);
				$('#agamaIstri').trigger('chosen:updated');
				$('#pendidikanIstri').val("");$('#pendidikanIstri').attr('readonly',false);
				$('#pekerjaanIstri').val("");$('#pekerjaanIstri').attr('readonly',false);
				$('#alamatIstri').val("");$('#alamatIstri').attr('readonly',false);
				var prov = "<option value='' disabled selected> .:: Pilih Provinsi ::. </option>";
				$.each(data.provinsis, function(k,p){
					prov += '<option value="'+p.id_provinsi+'">'+p.nama_provinsi+'</option>';
				});
				$('#provinsiIstri').html(prov);$('#provinsiIstri').attr('disabled',false);
				$('#provinsiIstri').trigger('chosen:updated');
				$('#kabupatenIstri').html("<option value='' disabled selected> .:: Pilih Kabupaten ::. </option>");$('#kabupatenIstri').attr('disabled',false);
				$('#kabupatenIstri').trigger('chosen:updated');
				$('#kecamatanIstri').html("<option value='' disabled selected> .:: Pilih Kecamatan ::. </option>");$('#kecamatanIstri').attr('disabled',false);
				$('#kecamatanIstri').trigger('chosen:updated');
				$('#desaIstri').html("<option value='' disabled selected> .:: Pilih Desa ::. </option>");$('#desaIstri').attr('disabled',false);
				$('#desaIstri').trigger('chosen:updated');
			}else{
				$.each(data.bumil, function(k,v){
					$('#namaBumil').val(v.nama_bumil);$('#namaBumil').attr('readonly',true);
					$('#tmpLahir').val(v.tmp_lahir);$('#tmpLahir').attr('readonly',true);
					var tglAwal = v.tgl_lahir.split("-");
					var tglEnd = tglAwal[2]+"-"+tglAwal[1]+"-"+tglAwal[0];
					$('#form_datetime_todayWife').val(tglEnd);$('#form_datetime_todayWife').attr('disabled',true);
					var choseAgama = "<option value='"+v.agama+"'>"+v.agama+"</option>";
					$('#agamaIstri').html("<option value='"+v.agama+"'>"+v.agama+"</option>");$('#agamaIstri').attr('disabled',true);
					$('#agamaIstri').trigger('chosen:updated');
					$('#pendidikanIstri').val(v.pendidikan);$('#pendidikanIstri').attr('readonly',true);
					$('#pekerjaanIstri').val(v.pekerjaan);$('#pekerjaanIstri').attr('readonly',true);
					$('#alamatIstri').val(v.alamat_ktp);$('#alamatIstri').attr('readonly',true);
					$('#provinsiIstri').html("<option value='"+v.provinsi.id_provinsi+"'>"+v.provinsi.nama_provinsi+"</option>");
					$('#provinsiIstri').attr('readonly',true);
					$('#provinsiIstri').trigger('chosen:updated');
					$('#kabupatenIstri').html("<option value='"+v.kabupaten.id_kabupaten+"'>"+v.kabupaten.nama_kabupaten+"</option>");
					$('#kabupatenIstri').attr('readonly',true);
					$('#kabupatenIstri').trigger('chosen:updated');
					$('#kecamatanIstri').html("<option value='"+v.kecamatan.id_kecamatan+"'>"+v.kecamatan.nama_kecamatan+"</option>");
					$('#kecamatanIstri').attr('readonly',true);
					$('#kecamatanIstri').trigger('chosen:updated');
					$('#desaIstri').html("<option value='"+v.desa.id_desa+"'>"+v.desa.nama_desa+"</option>");
					$('#desaIstri').attr('readonly',true);
					$('#desaIstri').trigger('chosen:updated');
    			});
			}
		});
	}

	function cekReg() {
		var noReg = $('#noRegistrasi').val();
		$.post("{!! route('cekNoRegistrasi') !!}", {noReg:noReg }).done(function(data){
			if(data.length == 0){
				$('#gr_reg').attr('class','form-group');
				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>';
			}else{
				$('#gr_reg').attr('class','form-group has-error');
				var icon = "<i class='fa fa-warning'></i>";
				$('#icon_reg').attr('style','color:red');
				var status = "<p class='messageError'><i>No Registrasi Sudah Digunakan</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 (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>');
			};
		});
	}
</script>