<?php 
add_shortcode( 'PENDING-REVIEW-KYB-LIST', 'cip_pending_review_kyb_list_callback' );
function cip_pending_review_kyb_list_callback(){
	$html = "";
	wp_enqueue_style( 'cip-css' );
	wp_enqueue_style( 'bs-table' );
	wp_enqueue_style( 'bs-sticky-header' );
	wp_enqueue_style( 'magnify' );
	wp_enqueue_script('bs-table');
	wp_enqueue_script('bs-sticky-header');
	wp_enqueue_script('bs-table-filter-control');
	wp_enqueue_script('magnify');

	wp_enqueue_style( 'daterangepicker-style' );
	wp_enqueue_script('dr-moment');
	wp_enqueue_script('daterangepicker-script');
	ob_start();
	global $wpdb;
	$tableKyc = $wpdb->prefix.'kyc_data';
	if( isset( $_GET['view'] ) && !empty( $_GET['view'] ) ){
		$decrypted_id_raw = base64_decode( $_GET['view'] );
		$id = preg_replace(sprintf('/%s/', md5('CIP_kyc_CIP') ), '', $decrypted_id_raw);
		$getKycData = $wpdb->get_row("SELECT * FROM $tableKyc WHERE 1 AND `id` = $id AND ( `status` <> '' AND `status` IS NOT NULL ) AND `account_type` = 'business'");
		$reject_steps = array();
		$approve_steps = array();
		if( $getKycData ){
			$userData = get_user_by('email', $getKycData->email);
			$user_id = 0;
			if( $userData ){
				$user_id = $userData->ID;
			}
			$reject_steps = explode( ',', $getKycData->reject_steps );
			$approve_steps = explode( ',', $getKycData->approve_steps );
			$totalProceedStep = 0;
			if( in_array( 1, $reject_steps ) || in_array( 1, $approve_steps ) ){
				$totalProceedStep++;
			}
			if( in_array( 2, $reject_steps ) || in_array( 2, $approve_steps ) ){
				$totalProceedStep++;
			}
			if( in_array( 3, $reject_steps ) || in_array( 3, $approve_steps ) ){
				$totalProceedStep++;
			}
			if( in_array( 4, $reject_steps ) || in_array( 4, $approve_steps ) ){
				$totalProceedStep++;
			}
			if( in_array( 5, $reject_steps ) || in_array( 5, $approve_steps ) ){
				$totalProceedStep++;
			}
		?>
		<div class="container-fluid">
			<div class="row justify-content-left">
				<div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 p-0 mt-2 mb-2">
					<div class="card shadow p-3 mb-5 bg-white rounded memberKycFrm kycReviewSection">
						<div class="row">
							<div class="col-3 kyc-update-left-panel">
								<div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical">
									<a class="nav-link active" id="v-pills-business-details-tab" data-toggle="pill" href="#v-pills-business-details" role="tab" aria-controls="v-pills-business-details" aria-selected="true"><?php echo getKybStepsName( 1 ); ?>
										<?php if( in_array( 1, $reject_steps ) ){ ?> <span class="fas fa-times-circle float-right mt-1"></span> <?php } ?>
										<?php if( in_array( 1, $approve_steps ) ){ ?> <span class="fas fa-check-circle float-right mt-1"></span> <?php } ?>
									</a>
									<a class="nav-link" id="v-pills-contact-details-tab" data-toggle="pill" href="#v-pills-contact-details" role="tab" aria-controls="v-pills-contact-details" aria-selected="false"><?php echo getKybStepsName( 2 ); ?>
										<?php if( in_array( 2, $reject_steps ) ){ ?> <span class="fas fa-times-circle float-right mt-1"></span> <?php } ?>
										<?php if( in_array( 2, $approve_steps ) ){ ?> <span class="fas fa-check-circle float-right mt-1"></span> <?php } ?>
									</a>
									<a class="nav-link" id="v-pills-director-or-equivalent-person-tab" data-toggle="pill" href="#v-pills-director-or-equivalent-person" role="tab" aria-controls="v-pills-director-or-equivalent-person" aria-selected="false"><?php echo getKybStepsName( 3 ); ?>
										<?php if( in_array( 3, $reject_steps ) ){ ?> <span class="fas fa-times-circle float-right mt-1"></span> <?php } ?>
										<?php if( in_array( 3, $approve_steps ) ){ ?> <span class="fas fa-check-circle float-right mt-1"></span> <?php } ?>
									</a>
									<a class="nav-link" id="v-pills-upload-documents-tab" data-toggle="pill" href="#v-pills-upload-documents" role="tab" aria-controls="v-pills-upload-documents" aria-selected="false"><?php echo getKybStepsName( 4 ); ?>
										<?php if( in_array( 4, $reject_steps ) ){ ?> <span class="fas fa-times-circle float-right mt-1"></span> <?php } ?>
										<?php if( in_array( 4, $approve_steps ) ){ ?> <span class="fas fa-check-circle float-right mt-1"></span> <?php } ?>		
									</a>
									<a class="nav-link" id="v-pills-confirmation-tab" data-toggle="pill" href="#v-pills-confirmation" role="tab" aria-controls="v-pills-confirmation" aria-selected="false"><?php echo getKybStepsName( 5 ); ?>
										<?php if( in_array( 5, $reject_steps ) ){ ?> <span class="fas fa-times-circle float-right mt-1"></span> <?php } ?>
										<?php if( in_array( 5, $approve_steps ) ){ ?> <span class="fas fa-check-circle float-right mt-1"></span> <?php } ?>		
									</a>
								</div>
								<hr/>
								<br/>
								<?php if( ( in_array( 1, $approve_steps ) && in_array( 2, $approve_steps ) && in_array( 3, $approve_steps ) && in_array( 4, $approve_steps ) && in_array( 5, $approve_steps ) ) && $getKycData->status != 'approved' ){ ?>
									<button type="button" id="approvedKycPopup" class="btn w-100 text-left mb-3" data-toggle="modal" data-target="#approvedKycModal"><?php _e('Approve KYB', CIP_TXTDOMAIN); ?></button>
								<?php } ?>
								<?php if( $totalProceedStep == 5 ){ ?>
									<button type="button" id="rejectWholeKycPopup" class="btn w-100 text-left mb-3" data-toggle="modal" data-target="#rejectWholeKycModal"><?php _e('Reject KYB', CIP_TXTDOMAIN); ?></button>
								<?php } ?>
								<?php if( $getKycData->status == 'approved' ){ ?>
									<button type="button" id="dropKycPopup" class="btn w-100 text-left mb-3" data-toggle="modal" data-target="#dropKycModal"><?php _e('Drop KYC', CIP_TXTDOMAIN); ?></button>
								<?php }else{
									$dropTooltip = "";
									if( $getKycData->status == 'reject' ){
										$dropTooltip = sprintf( __('You cannot drop a rejected KYB') );
									}else if( $getKycData->status == 'pending' ){
										$dropTooltip = sprintf( __('You cannot drop a pending KYB') );
									}
									?>
									<button type="button" class="btn w-100 text-left mb-3" data-toggle="tooltip" data-placement="top" title="<?php echo $dropTooltip; ?>" <?php if( $getKycData->status == 'dropped' ){ echo 'disabled'; } ?>><?php _e('Drop KYB', CIP_TXTDOMAIN); ?></button>
								<?php } ?>
								<?php /*<button type="button" id="rejectWholeKycPopup" class="btn w-100 text-left mb-3" data-toggle="modal" data-target="#rejectWholeKycModal"><?php _e('Reject KYC', CIP_TXTDOMAIN); ?></button>*/ ?>
								<?php //if( $getKycData->status == 'pending' ){ ?>
								<?php /*<button type="button" id="approvedKycPopup" class="btn w-100 text-left mb-3" data-toggle="modal" data-target="#approvedKycModal"><?php _e('Approve KYC', CIP_TXTDOMAIN); ?></button>*/ ?>
								<?php //} ?>
								<button type="button" class="btn w-100 text-left mb-3" onclick="window.location.href='<?php echo get_the_permalink( get_page_by_path('content/operations/support_agent/kyb-verification') ); ?>'"><?php _e('Back to KYB List', CIP_TXTDOMAIN); ?></button>
							</div>
							<div class="col-9">
								<div class="tab-content" id="v-pills-tabContent">
									<div class="tab-pane fade show active" id="v-pills-business-details" role="tabpanel" aria-labelledby="v-pills-business-details-tab">
										<?php if( /* ($getKycData->status == 'pending' || $getKycData->status == 'reject' || $getKycData->status == 'dropped') && */ !in_array( 1, $reject_steps ) ){ ?>
											<button type="button" class="rejectKycPopup btn text-left mb-3" data-step="1"><?php _e('Reject', CIP_TXTDOMAIN); ?></button>
										<?php } ?>
										<?php if( ($getKycData->status == 'pending' || $getKycData->status == 'reject' || $getKycData->status == 'dropped') && !in_array( 1, $approve_steps ) ){ ?>
											<button type="button" class="approveKycStepPopup btn text-left mb-3" data-step="1" data-stepName="<?php echo getKybStepsName( 1 ); ?>" ><?php _e('Approve', CIP_TXTDOMAIN); ?></button>
										<?php } ?>
										<!-- step 1 -->
										<div class="form-group row">
											<div class="col-sm-4">
												<label for="business_name">Business Name *</label>
												<p class="form-control mb-2"><?php echo $getKycData->business_name; ?></p>
											</div>
											<div class="col-sm-4">
												<label for="business_registration_country">Registration Country *</label>
												<p class="form-control mb-2" ><?php echo $getKycData->business_registration_country; ?></p>
											</div>
											<div class="col-sm-4">
												<label for="business_registration_number">Registration number*</label>
												<p class="form-control mb-2"><?php echo $getKycData->business_registration_number; ?></p>
											</div>
											<div class="col-sm-12">
												<label for="business_type_of_business">Type of Business*</label>
												<p class="form-control mb-2"><?php echo $getKycData->business_type_of_business; ?></p>
											</div>
											
											<div class="col-sm-12">
												<label for="business_nature_of_your_business">The nature of business*</label>
												<p class="form-control mb-2"><?php echo $getKycData->business_nature_of_your_business; ?></p>
											</div>
										</div>
										
									</div>
									<div class="tab-pane fade" id="v-pills-contact-details" role="tabpanel" aria-labelledby="v-pills-contact-details-tab">
										<?php if( /* ($getKycData->status == 'pending' || $getKycData->status == 'reject' || $getKycData->status == 'dropped') && */ !in_array( 2, $reject_steps ) ){ ?>
											<button type="button" class="rejectKycPopup btn text-left mb-3" data-step="2"><?php _e('Reject', CIP_TXTDOMAIN); ?></button>
										<?php } ?>
										<?php if( ($getKycData->status == 'pending' || $getKycData->status == 'reject' || $getKycData->status == 'dropped') && !in_array( 2, $approve_steps ) ){ ?>
											<button type="button" class="approveKycStepPopup btn text-left mb-3" data-step="2" data-stepName="<?php echo getKybStepsName( 2 ); ?>" ><?php _e('Approve', CIP_TXTDOMAIN); ?></button>
										<?php } ?>
										<!-- step 2 -->	
										<div class="form-group row">

											<div class="col-12"><h4>Registered address</h4></div>
											<div class="col-sm-6 mb-2">
												<label for="business_registered_address">Registered address *</label>
												<p class="form-control mb-2"><?php echo $getKycData->business_registered_address; ?></p>
												
												<label for="business_registered_address_line_2">Registered address line 2 *</label>
												<p class="form-control mb-2"><?php echo $getKycData->business_registered_address_line_2; ?></p>
												<label for="business_registered_city">Registered city *</label>
												<p class="form-control mb-2"><?php echo $getKycData->business_registered_city; ?></p>
												
												<label for="business_registered_state">Registered state *</label>
												<p class="form-control mb-2" ><?php echo $getKycData->business_registered_state; ?></p>
											</div>
											<div class="col-sm-6 mb-2">
												<label for="business_registered_postal_code">Registered postal code *</label>
												<p class="form-control mb-2" ><?php echo $getKycData->business_registered_postal_code; ?></p>
												<label for="business_registered_country">Registered country*</label>
												<p class="form-control mb-2"><?php echo $getKycData->business_registered_country; ?></p>
											</div>
											
										</div>
										<div class="form-group row">
											<div class="col-12"><h4>Operatin business address</h4></div>
											<div class="col-sm-12 mb-2">
												<div class="form-check">
													<input type="checkbox" class="form-check-input" id="business_same_as_registered_address" name="business_same_as_registered_address" value="1" <?php checked( $getKycData->business_same_as_registered_address, '1', true ); ?> readonly>
													<label class="form-check-label pt-0" for="business_same_as_registered_address">Business same as registered address.</label>
												</div>
											</div>
											<?php if( $getKycData->business_same_as_registered_address != 1 ){ ?>
											<div class="col-sm-6 mb-2">
												<label for="business_operating_address">Operating address *</label>
												<p class="form-control mb-2"><?php echo $getKycData->business_operating_address; ?></p>
												
												<label for="business_operating_address_line_2">Operating address line 2 *</label>
												<p class="form-control mb-2"><?php echo $getKycData->business_operating_address_line_2; ?></p>
												<label for="business_operating_city">Operating city *</label>
												<p class="form-control mb-2"><?php echo $getKycData->business_operating_city; ?></p>
												
												<label for="business_operating_state">Operating state *</label>
												<p class="form-control mb-2" ><?php echo $getKycData->business_operating_state; ?></p>
											</div>
											<div class="col-sm-6 mb-2">
												<label for="business_operating_postal_code">Operating postal code *</label>
												<p class="form-control mb-2" ><?php echo $getKycData->business_operating_postal_code; ?></p>
												<label for="business_operating_country">Operating country*</label>
												<p class="form-control mb-2"><?php echo $getKycData->business_operating_country; ?></p>
											</div>
											<?php } ?>
										</div>
										<div class="form-group row">
											<div class="col-12"><h4>Additional Information</h4></div>
											<div class="col-sm-12 mb-2">
												<label for="business_contact_number">Contact number *</label>
												<p class="form-control mb-2"><?php if( !empty( $getKycData->business_contact_dial_code ) ){ echo '+'.$getKycData->business_contact_dial_code; } ?> <?php echo $getKycData->business_contact_number; ?></p>
												
												<label for="business_company_website">Company website *</label>
												<p class="form-control mb-2"><?php echo $getKycData->business_company_website; ?></p>
											</div>
										</div>
										<div class="form-group row">
											<div class="col-12"><h4>Declarations</h4></div>
											<div class="col-sm-12 mb-2">
												<p class="mb-1">Are you a aware of any sanctions or embargoes that apply to your business or customers?</p>
												<div class="form-check form-check-inline">
													<p class="form-check-input"><?php echo $getKycData->business_aware_of_any_sanctions; ?></p>
												</div>
											</div>
										</div>
										<div class="form-group row">
											<div class="col-sm-12 mb-2">
												<p class="mb-1">Have you undergone any external audits or assessments related to AML/CTF compilance?</p>
												<div class="form-check form-check-inline">
													<p class="form-check-input"><?php echo $getKycData->business_undergone_any_external_audits; ?></p>
												</div>
											</div>
										</div>
										<div class="form-group row">
											<div class="col-sm-12 mb-2">
												<p class="mb-1">Is your business involved in any money laundering or financing of terrorism activities?</p>
												<div class="form-check form-check-inline">
													<p class="form-check-input"><?php echo $getKycData->business_business_involved_in_any_money_laundering; ?></p>
												</div>
											</div>
										</div>
										<div class="form-group row">
											<div class="col-sm-12 mb-2">
												<p class="mb-1">Have you received any penalties or sanctions related to AML/CTF violations?</p>
												<div class="form-check form-check-inline">
													<p class="form-check-input"><?php echo $getKycData->business_received_any_penalties; ?></p>
												</div>
											</div>
										</div>
																			
									</div>
									<div class="tab-pane fade" id="v-pills-director-or-equivalent-person" role="tabpanel" aria-labelledby="v-pills-director-or-equivalent-person-tab">
										<?php if( /* ($getKycData->status == 'pending' || $getKycData->status == 'reject' || $getKycData->status == 'dropped') && */ !in_array( 3, $reject_steps ) ){ ?>
											<button type="button" class="rejectKycPopup btn text-left mb-3" data-step="3"><?php _e('Reject', CIP_TXTDOMAIN); ?></button>
										<?php } ?>
										<?php if( ($getKycData->status == 'pending' || $getKycData->status == 'reject' || $getKycData->status == 'dropped') && !in_array( 3, $approve_steps ) ){ ?>
											<button type="button" class="approveKycStepPopup btn text-left mb-3" data-step="3" data-stepName="<?php echo getKybStepsName( 3 ); ?>" ><?php _e('Approve', CIP_TXTDOMAIN); ?></button>
										<?php } ?>
										<!-- step 4 -->	
										<div class="form-group row">
											<div class="col-sm-12"><h4 class="mb-0"><?php _e('Business Owner', CIP_TXTDOMAIN); ?></h4></div>
											<div class="col-sm-6 mb-2">
												<label for="business_owner_first_name">Owner first name *</label>
												<p class="form-control mb-0"><?php echo $getKycData->business_owner_first_name; ?></p>
											</div>
											<div class="col-sm-6 mb-2">
												<label for="business_owner_last_name">Owner last name *</label>
												<p class="form-control mb-0"><?php echo $getKycData->business_owner_last_name; ?></p>
											</div>
											<div class="col-sm-6 mb-2">
												<label for="business_owner_dob">Owner date of birth *</label>
												<p class="form-control mb-0"><?php echo $getKycData->business_owner_dob; ?></p>
											</div>
											<div class="col-sm-6 mb-2">
												<label for="business_owner_address">Owner address *</label>
												<p class="form-control mb-0"><?php echo $getKycData->business_owner_address; ?></p>
											</div>
											<div class="col-sm-12 mb-2">
												<label for="business_owner_address_line_2">Owner address line 2 *</label>
												<p class="form-control mb-0"><?php echo $getKycData->business_owner_address_line_2; ?></p>
											</div>
											<div class="col-sm-12 mb-2">
												<label for="business_owner_city">Owner city *</label>
												<p class="form-control mb-0"><?php echo $getKycData->business_owner_city; ?></p>
											</div>
											<div class="col-sm-6 mb-2">
												<label for="business_owner_state">Owner state *</label>
												<p class="form-control mb-0"><?php echo $getKycData->business_owner_state; ?></p>
											</div>
											<div class="col-sm-6 mb-2">
												<label for="business_owner_postal_code">Owner postal code *</label>
												<p class="form-control mb-0"><?php echo $getKycData->business_owner_postal_code; ?></p>
											</div>
											<div class="col-sm-6 mb-2">
												<label for="business_owner_country">Owner country *</label>
												<p class="form-control mb-0"><?php echo $getKycData->business_owner_country; ?></p>
											</div>
											<div class="col-sm-12 mb-2">
												<p class="mb-1">Is this person politically exposed?</p>
												<div class="form-check form-check-inline">
													<p class="form-check-input"><?php echo $getKycData->business_owner_person_politically_exposed; ?></p>
												</div>
											</div>
										</div>
										<div class="form-group row">
											<div class="col-sm-12"><h4 class="mb-0"><?php _e('Director', CIP_TXTDOMAIN); ?></h4></div>
											<div class="col-sm-12 mb-2">
												<div class="form-check">
													<input type="checkbox" class="form-check-input" id="business_director_details_same_as_owner" name="business_director_details_same_as_owner" value="1" <?php checked( $getKycData->business_director_details_same_as_owner, '1', true ); ?> readonly>
													<label class="form-check-label pt-0" for="business_director_details_same_as_owner">Business director details same as owner.</label>
												</div>
											</div>

											<?php if( $getKycData->business_director_details_same_as_owner != 1 ){ ?>
												<div class="col-sm-6 mb-2">
													<label for="business_director_first_name">Director first name *</label>
													<p class="form-control mb-0"><?php echo $getKycData->business_director_first_name; ?></p>
												</div>
												<div class="col-sm-6 mb-2">
													<label for="business_director_last_name">Director last name *</label>
													<p class="form-control mb-0"><?php echo $getKycData->business_director_last_name; ?></p>
												</div>
												<div class="col-sm-6 mb-2">
													<label for="business_director_dob">Director date of birth *</label>
													<p class="form-control mb-0"><?php echo $getKycData->business_director_dob; ?></p>
												</div>
												<div class="col-sm-6 mb-2">
													<label for="business_director_address">Director address *</label>
													<p class="form-control mb-0"><?php echo $getKycData->business_director_address; ?></p>
												</div>
												<div class="col-sm-12 mb-2">
													<label for="business_director_address_line_2">Director address line 2 *</label>
													<p class="form-control mb-0"><?php echo $getKycData->business_director_address_line_2; ?></p>
												</div>
												<div class="col-sm-12 mb-2">
													<label for="business_director_city">Director city *</label>
													<p class="form-control mb-0"><?php echo $getKycData->business_director_city; ?></p>
												</div>
												<div class="col-sm-6 mb-2">
													<label for="business_director_state">Director state *</label>
													<p class="form-control mb-0"><?php echo $getKycData->business_director_state; ?></p>
												</div>
												<div class="col-sm-6 mb-2">
													<label for="business_director_postal_code">Director postal code *</label>
													<p class="form-control mb-0"><?php echo $getKycData->business_director_postal_code; ?></p>
												</div>
												<div class="col-sm-6 mb-2">
													<label for="business_director_country">Director country *</label>
													<p class="form-control mb-0"><?php echo $getKycData->business_director_country; ?></p>
												</div>
												<div class="col-sm-12 mb-2">
													<p class="mb-1">Is this person politically exposed?</p>
													<div class="form-check form-check-inline">
														<p class="form-check-input"><?php echo $getKycData->business_director_person_politically_exposed; ?></p>
													</div>
												</div>
											<?php } ?>
										</div>
									</div>
									<div class="tab-pane fade" id="v-pills-upload-documents" role="tabpanel" aria-labelledby="v-pills-upload-documents-tab">
										<?php if( !in_array( 4, $reject_steps ) ){ ?>
											<button type="button" class="rejectKycPopup btn text-left mb-3" data-step="4"><?php _e('Reject', CIP_TXTDOMAIN); ?></button>
										<?php } ?>
										<?php if( ($getKycData->status == 'pending' || $getKycData->status == 'reject' || $getKycData->status == 'dropped') && !in_array( 4, $approve_steps ) ){ ?>
											<button type="button" class="approveKycStepPopup btn text-left mb-3" data-step="4" data-stepName="<?php echo getKybStepsName( 4 ); ?>" ><?php _e('Approve', CIP_TXTDOMAIN); ?></button>
										<?php } ?>
										<!-- step 5 -->
										<div class="form-group row">
											<div class="col-12"><h4>Business</h4></div>
												<div class="col-sm-12">
													<label for="identification_document">Certificate of Incorporation/Registration of your company *</label>
												</div>
												<div class="col-sm-12">
													<div class="d-flex align-items-center doc-grid_section">
													<?php
														$uploadDir = CIP_PLUGIN_BASE . 'uploaded_doc/'.$user_id;
														$ViewDir = CIP_PLUGIN_FOLDER . 'uploaded_doc/'.$user_id;
														if( !empty( $getKycData->business_certificate_of_incorporation_1 ) && file_exists( $uploadDir.'/'.$getKycData->business_certificate_of_incorporation_1 ) ){
															$fileType = strtolower( pathinfo($getKycData->business_certificate_of_incorporation_1, PATHINFO_EXTENSION) );
															if( $fileType == 'pdf' ){
																$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
															}else{
																$imgSrc = $ViewDir.'/'.$getKycData->business_certificate_of_incorporation_1;
															}

															$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
															$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

															echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_certificate_of_incorporation_1.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
														}
														if( !empty( $getKycData->business_certificate_of_incorporation_2 ) && file_exists( $uploadDir.'/'.$getKycData->business_certificate_of_incorporation_2 ) ){
															$fileType = strtolower( pathinfo($getKycData->business_certificate_of_incorporation_2, PATHINFO_EXTENSION) );
															if( $fileType == 'pdf' ){
																$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
															}else{
																$imgSrc = $ViewDir.'/'.$getKycData->business_certificate_of_incorporation_2;
															}

															$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
															$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

															echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_certificate_of_incorporation_2.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
														}
														if( !empty( $getKycData->business_certificate_of_incorporation_3 ) && file_exists( $uploadDir.'/'.$getKycData->business_certificate_of_incorporation_3 ) ){
															$fileType = strtolower( pathinfo($getKycData->business_certificate_of_incorporation_3, PATHINFO_EXTENSION) );
															if( $fileType == 'pdf' ){
																$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
															}else{
																$imgSrc = $ViewDir.'/'.$getKycData->business_certificate_of_incorporation_3;
															}

															$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
															$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

															echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_certificate_of_incorporation_3.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
														}
													?>
													</div>
												</div>
												<div class="col-sm-12">
													<label for="identification_document">Shareholder Certificate or Proof of Ownership *</label>
												</div>
												<div class="col-sm-12">
													<div class="d-flex align-items-center doc-grid_section">
													<?php
														if( !empty( $getKycData->business_shareholder_certificate_1 ) && file_exists( $uploadDir.'/'.$getKycData->business_shareholder_certificate_1 ) ){
															$fileType = strtolower( pathinfo($getKycData->business_shareholder_certificate_1, PATHINFO_EXTENSION) );
															if( $fileType == 'pdf' ){
																$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
															}else{
																$imgSrc = $ViewDir.'/'.$getKycData->business_shareholder_certificate_1;
															}

															$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
															$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

															echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_shareholder_certificate_1.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
														}
														if( !empty( $getKycData->business_shareholder_certificate_2 ) && file_exists( $uploadDir.'/'.$getKycData->business_shareholder_certificate_2 ) ){
															$fileType = strtolower( pathinfo($getKycData->business_shareholder_certificate_2, PATHINFO_EXTENSION) );
															if( $fileType == 'pdf' ){
																$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
															}else{
																$imgSrc = $ViewDir.'/'.$getKycData->business_shareholder_certificate_2;
															}

															$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
															$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

															echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_shareholder_certificate_2.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
														}
														if( !empty( $getKycData->business_shareholder_certificate_3 ) && file_exists( $uploadDir.'/'.$getKycData->business_shareholder_certificate_3 ) ){
															$fileType = strtolower( pathinfo($getKycData->business_shareholder_certificate_3, PATHINFO_EXTENSION) );
															if( $fileType == 'pdf' ){
																$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
															}else{
																$imgSrc = $ViewDir.'/'.$getKycData->business_shareholder_certificate_3;
															}

															$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
															$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

															echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_shareholder_certificate_3.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
														}
													?>
													</div>
												</div>
												<div class="col-sm-12">
													<label for="identification_document">Proof of address of the Business *</label>
												</div>
												<div class="col-sm-12">
													<div class="d-flex align-items-center doc-grid_section">
													<?php
														if( !empty( $getKycData->business_proof_address_1 ) && file_exists( $uploadDir.'/'.$getKycData->business_proof_address_1 ) ){
															$fileType = strtolower( pathinfo($getKycData->business_proof_address_1, PATHINFO_EXTENSION) );
															if( $fileType == 'pdf' ){
																$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
															}else{
																$imgSrc = $ViewDir.'/'.$getKycData->business_proof_address_1;
															}

															$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
															$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

															echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_proof_address_1.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
														}
														if( !empty( $getKycData->business_proof_address_2 ) && file_exists( $uploadDir.'/'.$getKycData->business_proof_address_2 ) ){
															$fileType = strtolower( pathinfo($getKycData->business_proof_address_2, PATHINFO_EXTENSION) );
															if( $fileType == 'pdf' ){
																$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
															}else{
																$imgSrc = $ViewDir.'/'.$getKycData->business_proof_address_2;
															}

															$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
															$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

															echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_proof_address_2.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
														}
														if( !empty( $getKycData->business_proof_address_3 ) && file_exists( $uploadDir.'/'.$getKycData->business_proof_address_3 ) ){
															$fileType = strtolower( pathinfo($getKycData->business_proof_address_3, PATHINFO_EXTENSION) );
															if( $fileType == 'pdf' ){
																$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
															}else{
																$imgSrc = $ViewDir.'/'.$getKycData->business_proof_address_3;
															}
															
															$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
															$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

															echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_proof_address_3.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
														}
													?>
													</div>
													
												</div>
												
												<div class="col-12"><hr class="mt-4 mb-3"><h4>Business Owner</h4></div>
												<div class="col-sm-12">
													<label for="identification_document">Passport or National ID *</label>
												</div>
												<div class="col-sm-12">
													<div class="d-flex align-items-center doc-grid_section">
													<?php
													if( !empty( $getKycData->business_owner_passport_national_id_1 ) && file_exists( $uploadDir.'/'.$getKycData->business_owner_passport_national_id_1 ) ){
														$fileType = strtolower( pathinfo($getKycData->business_owner_passport_national_id_1, PATHINFO_EXTENSION) );
														if( $fileType == 'pdf' ){
															$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
														}else{
															$imgSrc = $ViewDir.'/'.$getKycData->business_owner_passport_national_id_1;
														}

														$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
														$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

														echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_owner_passport_national_id_1.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
													}
													if( !empty( $getKycData->business_owner_passport_national_id_2 ) && file_exists( $uploadDir.'/'.$getKycData->business_owner_passport_national_id_2 ) ){
														$fileType = strtolower( pathinfo($getKycData->business_owner_passport_national_id_2, PATHINFO_EXTENSION) );
														if( $fileType == 'pdf' ){
															$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
														}else{
															$imgSrc = $ViewDir.'/'.$getKycData->business_owner_passport_national_id_2;
														}

														$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
														$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

														echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_owner_passport_national_id_2.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
													}
													if( !empty( $getKycData->business_owner_passport_national_id_3 ) && file_exists( $uploadDir.'/'.$getKycData->business_owner_passport_national_id_3 ) ){
														$fileType = strtolower( pathinfo($getKycData->business_owner_passport_national_id_3, PATHINFO_EXTENSION) );
														if( $fileType == 'pdf' ){
															$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
														}else{
															$imgSrc = $ViewDir.'/'.$getKycData->business_owner_passport_national_id_3;
														}

														$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
														$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

														echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_owner_passport_national_id_3.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
													}
													?>
												</div>
											</div>
											<div class="col-sm-12">
													<label for="identification_document">Proof of address (Personal Residential Address) *</label>
											</div>
											<div class="col-sm-12">
												<div class="d-flex align-items-center doc-grid_section">
												<?php
													$uploadDir = CIP_PLUGIN_BASE . 'uploaded_doc/'.$user_id;
													$ViewDir = CIP_PLUGIN_FOLDER . 'uploaded_doc/'.$user_id;
													if( !empty( $getKycData->business_owner_proof_address_1 ) && file_exists( $uploadDir.'/'.$getKycData->business_owner_proof_address_1 ) ){
														$fileType = strtolower( pathinfo($getKycData->business_owner_proof_address_1, PATHINFO_EXTENSION) );
														if( $fileType == 'pdf' ){
															$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
														}else{
															$imgSrc = $ViewDir.'/'.$getKycData->business_owner_proof_address_1;
														}

														$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
														$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

														echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_owner_proof_address_1.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
													}
													if( !empty( $getKycData->business_owner_proof_address_2 ) && file_exists( $uploadDir.'/'.$getKycData->business_owner_proof_address_2 ) ){
														$fileType = strtolower( pathinfo($getKycData->business_owner_proof_address_2, PATHINFO_EXTENSION) );
														if( $fileType == 'pdf' ){
															$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
														}else{
															$imgSrc = $ViewDir.'/'.$getKycData->business_owner_proof_address_2;
														}

														$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
														$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

														echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_owner_proof_address_2.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
													}
													if( !empty( $getKycData->business_owner_proof_address_3 ) && file_exists( $uploadDir.'/'.$getKycData->business_owner_proof_address_3 ) ){
														$fileType = strtolower( pathinfo($getKycData->business_owner_proof_address_3, PATHINFO_EXTENSION) );
														if( $fileType == 'pdf' ){
															$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
														}else{
															$imgSrc = $ViewDir.'/'.$getKycData->business_owner_proof_address_3;
														}

														$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
														$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

														echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_owner_proof_address_3.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
													}
													?>
												</div>
											</div>

											<div class="col-12" style="<?php echo ( $getKycData->business_director_details_same_as_owner == 1 ) ? 'display:none;' : ''; ?>">
											<div class="row">

												<div class="col-12"><hr class="mt-4 mb-3"><h4>Director or Equivalent Person</h4></div>
												<div class="col-sm-12">
													<label for="identification_document">Passport or National ID *</label>
												</div>
												<div class="col-sm-12">		
													<div class="d-flex align-items-center doc-grid_section">
													<?php
													$uploadDir = CIP_PLUGIN_BASE . 'uploaded_doc/'.$user_id;
													$ViewDir = CIP_PLUGIN_FOLDER . 'uploaded_doc/'.$user_id;
													if( !empty( $getKycData->business_director_passport_national_id_1 ) && file_exists( $uploadDir.'/'.$getKycData->business_director_passport_national_id_1 ) ){
														$fileType = strtolower( pathinfo($getKycData->business_director_passport_national_id_1, PATHINFO_EXTENSION) );
														if( $fileType == 'pdf' ){
															$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
														}else{
															$imgSrc = $ViewDir.'/'.$getKycData->business_director_passport_national_id_1;
														}

														$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
														$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

														echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_director_passport_national_id_1.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
													}
													if( !empty( $getKycData->business_director_passport_national_id_2 ) && file_exists( $uploadDir.'/'.$getKycData->business_director_passport_national_id_2 ) ){
														$fileType = strtolower( pathinfo($getKycData->business_director_passport_national_id_2, PATHINFO_EXTENSION) );
														if( $fileType == 'pdf' ){
															$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
														}else{
															$imgSrc = $ViewDir.'/'.$getKycData->business_director_passport_national_id_2;
														}

														$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
														$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

														echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_director_passport_national_id_2.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
													}
													if( !empty( $getKycData->business_director_passport_national_id_3 ) && file_exists( $uploadDir.'/'.$getKycData->business_director_passport_national_id_3 ) ){
														$fileType = strtolower( pathinfo($getKycData->business_director_passport_national_id_3, PATHINFO_EXTENSION) );
														if( $fileType == 'pdf' ){
															$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
														}else{
															$imgSrc = $ViewDir.'/'.$getKycData->business_director_passport_national_id_3;
														}

														$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
														$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

														echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_director_passport_national_id_3.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
													}
													?>
													</div>
												</div>
												<div class="col-sm-12">
													<label for="identification_document">Proof of address (Personal Residential Address) *</label>
												</div>
												<div class="col-sm-12">
													<div class="d-flex align-items-center doc-grid_section">
													<?php
													if( !empty( $getKycData->business_director_proof_address_1 ) && file_exists( $uploadDir.'/'.$getKycData->business_director_proof_address_1 ) ){
														$fileType = strtolower( pathinfo($getKycData->business_director_proof_address_1, PATHINFO_EXTENSION) );
														if( $fileType == 'pdf' ){
															$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
														}else{
															$imgSrc = $ViewDir.'/'.$getKycData->business_director_proof_address_1;
														}

														$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
														$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

														echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_director_proof_address_1.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
													}
													if( !empty( $getKycData->business_director_proof_address_2 ) && file_exists( $uploadDir.'/'.$getKycData->business_director_proof_address_2 ) ){
														$fileType = strtolower( pathinfo($getKycData->business_director_proof_address_2, PATHINFO_EXTENSION) );
														if( $fileType == 'pdf' ){
															$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
														}else{
															$imgSrc = $ViewDir.'/'.$getKycData->business_director_proof_address_2;
														}

														$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
														$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

														echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_director_proof_address_2.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
													}
													if( !empty( $getKycData->business_director_proof_address_3 ) && file_exists( $uploadDir.'/'.$getKycData->business_director_proof_address_3 ) ){
														$fileType = strtolower( pathinfo($getKycData->business_director_proof_address_3, PATHINFO_EXTENSION) );
														if( $fileType == 'pdf' ){
															$imgSrc = CIP_PLUGIN_FOLDER .'/images/pdf.png';
														}else{
															$imgSrc = $ViewDir.'/'.$getKycData->business_director_proof_address_3;
														}

														$magnify = ( $fileType != 'pdf' ) ? 'data-magnify="gallery" data-magnify-initmaximized="true"' : '';
														$magnifySrc = ( $fileType != 'pdf' ) ? 'data-src="'.$imgSrc.'"' : '';

														echo '<div><a href="'.$ViewDir.'/'.$getKycData->business_director_proof_address_3.'" data-elementor-open-lightbox="no" target="_blank"> <img class="doc-img-thumbnail" src="'.$imgSrc.'" '.$magnify.' '.$magnifySrc.' /> </a></div>';
													}
													?>
													</div>
												</div>

											</div>
											</div>
										</div>
									</div>
									<div class="tab-pane fade" id="v-pills-confirmation" role="tabpanel" aria-labelledby="v-pills-confirmation-tab">
										<?php if( !in_array( 5, $reject_steps ) ){ ?>
											<button type="button" class="rejectKycPopup btn text-left mb-3" data-step="5"><?php _e('Reject', CIP_TXTDOMAIN); ?></button>
										<?php } ?>
										<?php if( ($getKycData->status == 'pending' || $getKycData->status == 'reject' || $getKycData->status == 'dropped') && !in_array( 5, $approve_steps ) ){ ?>
											<button type="button" class="approveKycStepPopup btn text-left mb-3" data-step="5" data-stepName="<?php echo getKybStepsName( 5 ); ?>" ><?php _e('Approve', CIP_TXTDOMAIN); ?></button>
										<?php } ?>
										<!-- step 5 -->
										<div class="form-group row">
											<div class="col-sm-12">
												<p class="mb-1">I consent to my data being shared with all companies in the Cosair Group</p>
												<div class="form-check form-check-inline">
													<p class="form-check-input"><?php echo $getKycData->consent_my_data_share; ?></p>
												</div>
											</div>
											<div class="col-sm-12">
												<p class="mb-1">I confim the information submitted in this form is complete and correct</p>
												<div class="form-check form-check-inline">
													<p class="form-check-input"><?php echo $getKycData->confirm_correct_info; ?></p>
												</div>
											</div>
											
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="modal fade" id="dropKycModal" tabindex="-1" role="dialog">
			<div class="modal-dialog modal-dialog-centered" role="document">
				<div class="modal-content">
					<div class="modal-body">
						<form class="dropKycModalFrm" id="dropKycModalFrm" name="dropKycModalFrm">
							<div class="row">
								<div class="col-sm-12">
									<div class="form-group">
										<label for="drop_message">Message</label>
										<textarea class="form-control" id="drop_message" name="drop_message" required></textarea>
									</div>
									<div class="form-check-inline">
										<label class="form-check-label pt-0"><input type="checkbox" name="dropSteps[]" class="form-check-input" value="1"><?php echo getKybStepsName(1); ?></label>
									</div>
									<div class="form-check-inline">
										<label class="form-check-label pt-0"><input type="checkbox" name="dropSteps[]" class="form-check-input" value="2"><?php echo getKybStepsName(2); ?></label>
									</div>
									<div class="form-check-inline">
										<label class="form-check-label pt-0"><input type="checkbox" name="dropSteps[]" class="form-check-input" value="3"><?php echo getKybStepsName(3); ?></label>
									</div>
									<div class="form-check-inline">
										<label class="form-check-label pt-0"><input type="checkbox" name="dropSteps[]" class="form-check-input" value="4"><?php echo getKybStepsName(4); ?></label>
									</div>
									<div class="form-check-inline">
										<label class="form-check-label pt-0"><input type="checkbox" name="dropSteps[]" class="form-check-input" value="5"><?php echo getKybStepsName(5); ?></label>
									</div>
								</div>
							</div>
							<br/>
							<button type="submit" class="btn btn-secondary"><?php _e('Submit', CIP_TXTDOMAIN); ?></button>
							<button type="button" class="btn btn-secondary" data-dismiss="modal"><?php _e('Cancel', CIP_TXTDOMAIN) ?></button>
							<input type="hidden" name="action" value="drop_kyc_verification_act" />
							<input type="hidden" name="pageid" value="<?php echo get_the_id(); ?>" />
							<input type="hidden" name="_microid" value="<?php echo $_GET['view']; ?>" />
							<input type="hidden" name="_micro" value="<?php echo wp_create_nonce('_YxCIPDropKycCIPXy_'); ?>" />
							<p><span class="form_response"></span></p>
						</form>
					</div>
				</div>
			</div>
		</div>
		
		<?php if( $totalProceedStep == 5 ){ ?>
		<div class="modal fade" id="rejectWholeKycModal" tabindex="-1" role="dialog">
			<div class="modal-dialog modal-dialog-centered" role="document">
				<div class="modal-content">
					<div class="modal-body">
						<form class="rejectWholeKycModalFrm" id="rejectWholeKycModalFrm" name="rejectWholeKycModalFrm">
							<div class="row">
								<div class="col-sm-12">
									<h5><?php _e('You are Rejecting the KYB', CIP_TXTDOMAIN); ?></h5>
								</div>
								<div class="col-sm-12">
									<div class="form-group">
										<label for="rejection_message">Message</label>
										<textarea class="form-control" id="rejection_message" name="rejection_message" required></textarea>
									</div>
									<div class="form-check-inline">
										<label class="form-check-label pt-0"><input type="checkbox" name="dropSteps[]" class="form-check-input" value="1"><?php echo getKybStepsName(1); ?></label>
									</div>
									<div class="form-check-inline">
										<label class="form-check-label pt-0"><input type="checkbox" name="dropSteps[]" class="form-check-input" value="2"><?php echo getKybStepsName(2); ?></label>
									</div>
									<div class="form-check-inline">
										<label class="form-check-label pt-0"><input type="checkbox" name="dropSteps[]" class="form-check-input" value="3"><?php echo getKybStepsName(3); ?></label>
									</div>
									<div class="form-check-inline">
										<label class="form-check-label pt-0"><input type="checkbox" name="dropSteps[]" class="form-check-input" value="4"><?php echo getKybStepsName(4); ?></label>
									</div>
									<div class="form-check-inline">
										<label class="form-check-label pt-0"><input type="checkbox" name="dropSteps[]" class="form-check-input" value="5"><?php echo getKybStepsName(5); ?></label>
									</div>
								</div>
							</div>
							<br/>
							<button type="submit" class="btn btn-secondary"><?php _e('Reject', CIP_TXTDOMAIN); ?></button>
							<button type="button" class="btn btn-secondary" data-dismiss="modal"><?php _e('Cancel', CIP_TXTDOMAIN) ?></button>
							<input type="hidden" name="action" value="reject_whole_kyc_verification_act" />
							<input type="hidden" name="pageid" value="<?php echo get_the_id(); ?>" />
							<input type="hidden" name="_microid" value="<?php echo $_GET['view']; ?>" />
							<input type="hidden" name="_micro" value="<?php echo wp_create_nonce('_YxCIPRejectWholeKycCIPXy_'); ?>" />
							<p><span class="form_response"></span></p>
						</form>
					</div>
				</div>
			</div>
		</div>
		<?php } ?>
		<?php if( $getKycData->status == 'pending' || $getKycData->status == 'reject' || $getKycData->status == 'dropped' || $getKycData->status == 'approved' ){ ?>
		<div class="modal fade" id="rejectKycModal" tabindex="-1" role="dialog">
			<div class="modal-dialog modal-dialog-centered" role="document">
				<div class="modal-content">
					<div class="modal-body">
						<form class="rejectKycModalFrm" id="rejectKycModalFrm" name="rejectKycModalFrm">
							<div class="row">
								<div class="col-sm-12">
									<div class="form-group">
										<label for="drop_message"><?php _e('Rejection Reason', CIP_TXTDOMAIN ); ?></label>
										<textarea class="form-control" id="rejection_reason" name="rejection_reason" required></textarea>
									</div>
								</div>
							</div>
							<button type="submit" class="btn btn-secondary"><?php _e('Submit', CIP_TXTDOMAIN); ?></button>
							<button type="button" class="btn btn-secondary" data-dismiss="modal"><?php _e('Cancel', CIP_TXTDOMAIN) ?></button>
							<input type="hidden" name="action" value="reject_kyc_verification_act" />
							<input type="hidden" name="pageid" value="<?php echo get_the_id(); ?>" />
							<input type="hidden" name="_microid" value="<?php echo $_GET['view']; ?>" />
							<input type="hidden" name="_micro" value="<?php echo wp_create_nonce('_YxCIPRejectionKycCIPXy_'); ?>" />
							<p><span class="form_response"></span></p>
						</form>
					</div>
				</div>
			</div>
		</div>
		<?php } ?>
		<?php if( $getKycData->status == 'pending' || $getKycData->status == 'reject' || $getKycData->status == 'dropped' ){ ?>
		<div class="modal fade" id="approveKycStepModal" tabindex="-1" role="dialog">
			<div class="modal-dialog modal-dialog-centered" role="document">
				<div class="modal-content">
					<div class="modal-body">
						<form class="approveKycStepModalFrm text-center" id="approveKycStepModalFrm" name="approveKycStepModalFrm">
							<div class="row">
								<div class="col-sm-12">
									<h5>Are you sure want to approve this <span class="stepNameModal">X</span> KYC details.?</h5>
								</div>
							</div>
							<br/>
							<button type="submit" class="btn btn-secondary"><?php _e('Approved', CIP_TXTDOMAIN); ?></button>
							<button type="button" class="btn btn-secondary" data-dismiss="modal"><?php _e('Cancel', CIP_TXTDOMAIN) ?></button>
							<input type="hidden" name="action" value="approvedStepKycact" />
							<input type="hidden" name="pageid" value="<?php echo get_the_id(); ?>" />
							<input type="hidden" name="_microid" value="<?php echo $_GET['view']; ?>" />
							<input type="hidden" name="_micro" value="<?php echo wp_create_nonce('_YxCIPApproveStepKycCIPXy_'); ?>" />
							<p><span class="form_response"></span></p>
						</form>
					</div>
				</div>
			</div>
		</div>
		<?php } ?>
		<?php if( in_array( 1, $approve_steps ) && in_array( 2, $approve_steps ) && in_array( 3, $approve_steps ) && in_array( 4, $approve_steps ) && in_array( 5, $approve_steps ) ){ ?>
		<div class="modal fade" id="approvedKycModal" tabindex="-1" role="dialog">
			<div class="modal-dialog modal-dialog-centered" role="document">
				<div class="modal-content">
					<div class="modal-body">
						<form class="approvedKycModalFrm text-center" id="approvedKycModalFrm" name="approvedKycModalFrm">
							<div class="row">
								<div class="col-sm-12">
									<h5><?php _e('You are approving the KYB', CIP_TXTDOMAIN); ?></h5>
								</div>
							</div>
							<br/>
							<button type="submit" class="btn btn-secondary"><?php _e('Approve', CIP_TXTDOMAIN); ?></button>
							<button type="button" class="btn btn-secondary" data-dismiss="modal"><?php _e('Cancel', CIP_TXTDOMAIN) ?></button>
							<input type="hidden" name="action" value="approved_kyc_verification_act" />
							<input type="hidden" name="pageid" value="<?php echo get_the_id(); ?>" />
							<input type="hidden" name="_microid" value="<?php echo $_GET['view']; ?>" />
							<input type="hidden" name="_micro" value="<?php echo wp_create_nonce('_YxCIPApprovedKycCIPXy_'); ?>" />
							<p><span class="form_response"></span></p>
						</form>
					</div>
				</div>
			</div>
		</div>
		<?php } ?>
		<form name="tabMoveFrm" id="tabMoveFrm" method="post">
			<input type="hidden" name="tabMoveIndex" id="tabMoveIndex" value="" />
		</form>
		<?php if( isset( $_POST['tabMoveIndex'] ) && ( $_POST['tabMoveIndex'] > 0 && $_POST['tabMoveIndex'] < 6 ) ){ ?>
		<script>
			jQuery(document).ready(function($){
				var tabMoveIndex = "<?php echo $_POST['tabMoveIndex']; ?>";
				if( tabMoveIndex == 2 ){
					$('.nav-pills a[href="#v-pills-contact-details"]').tab('show');
				}else if( tabMoveIndex == 3 ){
					$('.nav-pills a[href="#v-pills-director-or-equivalent-person"]').tab('show');
				}else if( tabMoveIndex == 4 ){
					$('.nav-pills a[href="#v-pills-upload-documents"]').tab('show');
				}else if( tabMoveIndex == 5 ){
					$('.nav-pills a[href="#v-pills-confirmation"]').tab('show');
				}
			});
		</script>
		<?php } ?>
		<?php
		}else{
			
		}
	}else{
	?>
	<table id="csr_kyb_pending_review" data-filter-control="true" data-show-search-clear-button="false" data-pagination="true" data-toggle="table" data-show-columns="false" data-show-toggle="false" data-click-to-select="false" data-show-columns-toggle-all="false" data-show-export="false" data-click-to-select="false" class="table table-bordered" data-side-pagination="server" data-pagination="true" data-page-list="[10, 20, 50, 100]">
	<thead>
		<tr>
			<th data-field="id" class="id" data-switchable="false"><?php _e('Id',CIP_TXTDOMAIN); ?></th>
			<th data-field="email" data-sortable="true" data-filter-control="input" class="email" data-switchable="false"><?php _e('Email',CIP_TXTDOMAIN); ?></th>
			<th data-field="business_name" data-sortable="true" data-filter-control="input" class="business_name" data-switchable="false"><?php _e('Business name',CIP_TXTDOMAIN); ?></th>
			<th data-field="business_director_first_name" data-sortable="true" data-filter-control="input" class="business_director_first_name" data-switchable="false"><?php _e('Director First name',CIP_TXTDOMAIN); ?></th>
			
			<th data-field="business_director_last_name" data-sortable="true" data-filter-control="input" class="business_director_last_name" data-switchable="false"><?php _e('Director Last name',CIP_TXTDOMAIN); ?></th>
			<th data-field="_date" class="_date" data-sortable="true" data-filter-control="input" data-switchable="false"><?php _e('Submission Date',CIP_TXTDOMAIN); ?></th>
			<th data-field="lastupdate" class="lastupdate" data-sortable="true"  data-filter-control="input" data-switchable="false"><?php _e('Last Update Date',CIP_TXTDOMAIN); ?></th>
			<th data-field="status" data-filter-control="select" class="status" data-filter-custom-search="BsTableFilterStatus" data-filter-data="var:filterKycKybStatus" class="status" data-switchable="false"><?php _e('Status',CIP_TXTDOMAIN); ?></th>
			<th data-field="action" class="action"><?php _e('Action',CIP_TXTDOMAIN); ?></th>
		</tr>
	</thead>
	<tbody>
	</tbody>
	</table>
	<?php
	}
	$html .= ob_get_clean();
	return $html;
}