<?php 
require('includes/header.php'); 
?>	

<style>
.select2-container--default .select2-results__option[aria-disabled=true] {
    display: none;
}
</style>
<!--begin::Content-->
<div class="content d-flex flex-column flex-column-fluid" id="kt_content">
	<!--begin::Subheader-->
	<div class="subheader py-2 py-lg-4 subheader-solid" id="kt_subheader">
		<div class="container-fluid d-flex align-items-center justify-content-between flex-wrap flex-sm-nowrap">
			<!--begin::Info-->
			<div class="d-flex align-items-center flex-wrap mr-2">
				<!--begin::Page Title-->
				<h5 class="text-dark font-weight-bold mt-2 mb-2 mr-5">Semakan Penerimaan/ Pengesahan Permohonan/ Pengesahan EFT Program Utama</h5>
				<!--end::Page Title-->
				<!--begin::Actions-->
				<div class="subheader-separator subheader-separator-ver mt-2 mb-2 mr-4 bg-gray-200"></div>
			</div>
			<!--end::Info-->
		</div>
	</div>
	<!--end::Subheader-->
	<!--begin::Entry-->
	<div class="d-flex flex-column-fluid">
		<!--begin::Container-->
		<div class="container">
			<div class="accordion accordion-solid accordion-panel accordion-svg-toggle" id="accordionExample8">
				<div class="card">
					<div class="card-header" id="headingThree8">
						<div class="card-title" data-toggle="collapse" data-target="#collapseThree8">
							<div class="card-label">													
								<span class="svg-icon svg-icon-primary menu-icon">
									<?=$Tapisanhome_svg?>
								</span>Penerimaan/ Pengesahan Permohonan/ Pengesahan EFT Program Utama</div>
							<span class="svg-icon">
								<?=$Tapisan_svg?>
							</span>
						</div>
					</div>
					<div id="collapseThree8" class="" data-parent="#accordionExample8">
						<div class="card-body" style="padding-top:10px">
							<form id="semakanForm" name="semakanForm">
								<?php
									createTextBox('No KP Pemohon', 'kpbaru_pemohon', 'No KP Pemohon', '', 3, 0, 7, 12, '', 'numonly', 'Sila masukkan No KP pemohon','maxlength="12"');
								?>
								<div style="text-align:center;padding-top:20px">
									<button type="button" class="btn btn-primary" id="semakanSubmitBtn">Carian</button>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>	
			<div class="card" id="semakanResultOuterDiv" style="display:none">			
				<div id="semakanResultDiv"></div>
			</div>
			<?php
				createModal();
			?>
		</div>
		<!--end::Container-->
	</div>
	<!--end::Entry-->
</div>
<!--end::Content-->
					
<?php 
require('includes/footer.php');
?>

<script>
var digit = 12;
$('#kpbaru_pemohon').keyup(function(){
	if(this.value.length == digit){
		$('#semakanSubmitBtn').click();
	}
});

$(document).ready(function(){  
	
	$('#semakanSubmitBtn').click(function() {
		var indicator_list = [[]];
		indicator_list.push(['kpbaru_pemohon', 'No Kad Pengenalan', 'kp']);
		
		if (checkInput(indicator_list))
		{			
			$('#semakanSubmitBtn').prop("disabled",true);
			var param = $('#semakanForm').serialize();
			$.ajax({
				type: "POST", 
				url: "general-carian_semak.php", 
				data: param,

				success: function(res){
					$('#semakanResultDiv').html(res);
					$('#semakanResultOuterDiv').show();
					$('#semakanSubmitBtn').prop("disabled",false);
				} 
			});  //end ajax
		}
		else
		{
			$('#semakanResultDiv').html('');
			$('#semakanResultOuterDiv').hide();
		}
	});	
});	
</script>