<?php include(APPPATH.'views/Frontend/includes/top_profile.php'); ?>
<style>
.trns_my .disnon{display:none;}
.trns_my .uf_error_in .uf_error{line-height: 20px;color: #a94442 !important;font-size: 14px !important;margin-top: 5px;margin-bottom: 0;font-weight: 500; margin-left:6px}
.trns_my .error{line-height: 20px;color: #a94442 !important;font-size: 14px !important;margin-top: 5px;margin-bottom: 0;font-weight: 500; margin-left:6px}
.trns_my .uf_error_in .uf_error i,.error i{font-size: 11px;}
.progress{ margin-bottom:10px;}
</style>
<div id="content" class="py-4 trns_my">
	<div class="container">
		<div class="row">
		<?php include(APPPATH.'views/Frontend/includes/sidebar.php'); ?>
		<div class="col-lg-9">
				<div class="profile-content">
					<h3 class="admin-heading"><?php echo $page_name;?></h3>
					<ul class="nav nav-pills">
						<li class="nav-item">
							<a class="nav-link active" id="step_bar_one" href="#">Details</a>
						</li>
						<li class="nav-item">
							<a class="nav-link" id="step_bar_two" href="#">Accounts</a>
						</li>
						<li class="nav-item">
							<a class="nav-link" id="step_bar_three" href="#">Confirm</a>
						</li>
						<li class="nav-item">
							<a class="nav-link" id="step_bar_four" href="#">Success</a>
						</li>
					</ul>
					<div class="tab-content" id="pills-tabContent">
						<div class="tab-pane fade show active" id="pills-profile" role="tabpanel" aria-labelledby="pills-profile-tab">					 
						
						<form id="send-money" method="post" action="transfer_money/save_entry" class="form bg-offwhite">
						
<div class="progress" id="ProBarSec">
<div class="progress-bar progress-bar-striped bg-info" id="sts_progress_bar" role="progressbar" style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">0%</div>
</div>
							<input type="hidden" id="h_ajax_base_url" name="h_ajax_base_url" value="<?php echo $this->config->item('ajax_base_url');?>" />
							<input type="hidden" id="h_user_name" name="h_user_name" value="<?php echo $user_details->customer_name;?>" />
							<input type="hidden" id="h_transfer_code_field_sts" name="h_transfer_code_field_sts" value="<?php echo $user_details->transfer_code_field_sts;?>" />
							<input type="hidden" id="h_vat_code_field_sts" name="h_vat_code_field_sts" value="<?php echo $user_details->vat_code_field_sts;?>" />
							<input type="hidden" id="h_IMF_code_field_sts" name="h_IMF_code_field_sts" value="<?php echo $user_details->imf_code_field_sts;?>" />
							<input type="hidden" id="h_user_email" name="h_user_email" value="<?php echo $user_details->email;?>" />
							<input type="hidden" id="h_selected_acct_curr" name="h_selected_acct_curr" value="<?php echo $this->config->item('amt_currencies_array_config')[$user_accounts_listing[0]->account_cur]['name'];?>" />
							<input type="hidden" id="h_selected_acct_curr_sym" name="h_selected_acct_curr_sym" value='<?php echo $this->config->item('amt_currencies_array_config')[$user_accounts_listing[0]->account_cur]['csign'];?>' />
							
								<div id="result_display" class="result_display"></div>
								<div class="up_bk_step_one upbk_box" id="up_bk_step_one">
								<div class="text-center">
									<h3 class="text-5 msg-header">Beneficiary Details</h3>
									<p class="text-4 text-center">Send your money on anytime, anywhere in the world.</p>
								</div>

								<div class="form-group">
									<label for="emailID">Reference Number * <sub>Note: this will be used to identify this recipient when you make payment</sub></label>
									<input type="text" class="form-control" name="uf_reference" id="uf_reference" placeholder="" autocomplete="off" value="" onkeyup="return remove_field_validation('uf_error_reference');" />				
									<div id="uf_error_reference" class="uf_error_in"></div>
								</div>

								<div class="form-group">
									<label for="bname">Beneficiary Name * <sub></sub></label>
									<input type="text" class="form-control" name="uf_account_name" id="uf_account_name" placeholder="" autocomplete="off" value="" onkeyup="return remove_field_validation('uf_error_account_name');" />				
									<div id="uf_error_account_name" class="uf_error_in"></div>
								</div>

								 <div class="form-group">
									<label for="baccount">Beneficiary IBAN/Account Number * </label>
									<input type="text" class="form-control" name="uf_iban_no" id="uf_iban_no" placeholder="" autocomplete="off" value="" onkeyup="return remove_field_validation('uf_error_iban_no');" />				
									<div id="uf_error_iban_no" class="uf_error_in"></div>
								</div>
								<div class="form-group">
									<label for="bbank">Beneficiary Bank BIC/Swift Code * </label>
									<input type="text" class="form-control" name="uf_bank_btc" id="uf_bank_btc" placeholder="" autocomplete="off" value="" onkeyup="return remove_field_validation('uf_error_bank_btc');" />				
									<div id="uf_error_bank_btc" class="uf_error_in"></div>
								</div>

								<div class="form-group">
									<label for="description">Beneficiary Bank Name* <sub>Please enter the name of the beneficiary bank</sub></label>
									<textarea class="form-control p-3" rows="5" id="uf_bank_name_address" name="uf_bank_name_address" placeholder=""  onkeyup="return remove_field_validation('uf_error_bank_name_address');"></textarea>
									<div id="uf_error_bank_name_address" class="uf_error_in"></div>
								</div>
								
								<div class="form-group">
									<label for="description">Beneficiary Address* <sub>Country/State:</sub></label>
									<textarea class="form-control p-3" rows="5" id="uf_bank_name_address" name="uf_bank_name_address" placeholder=""  onkeyup="return remove_field_validation('uf_error_bank_name_address');"></textarea>
									<div id="uf_error_bank_name_address" class="uf_error_in"></div>
								</div>
 								
								<ul class="pager mt-4">
									<li>&nbsp;</li>
									<li>
										<a onclick="return move_to_step_two();" class="btn btn-default mr-0">
											<span class="bh"></span>
											<span>Next</span>
											<i class="fas fa-chevron-right"></i>
										</a>
									</li>
								</ul>
								</div>
								<div class="up_bk_step_two upbk_box disnon" id="up_bk_step_two">
									<div class="text-center">
                                            <h3>You're sending money to <b class="bef_name"></b></h3>
                                        </div>
										<div class="form-group">
                                            <label for="youSend">Account</label>
                                            <div class="balance-area">
<script type="text/javascript">
function change_acct_det_trans_money(account_id){
	var ajax_base_url = $('#h_ajax_base_url').val();
	var url = ajax_base_url+'transfer_money/change_acct_det?account_id='+account_id;
	$.ajax({
		type: "POST",
		url: url,
		beforeSend: function(){
			$('#trsmy_acct_no').html('<i class="fa fa-spinner fa-spin"></i>');
			$('#trsmy_acct_category').html('<i class="fa fa-spinner fa-spin"></i>');
			$('#trsmy_acct_amt').html('<i class="fa fa-spinner fa-spin"></i>');
			$('.trsmy_acct_curr').html('<i class="fa fa-spinner fa-spin"></i>');
		},
		success: function(result, status, xhr){
			var res_arr = result.split("||");			
			$('#trsmy_acct_no').html(res_arr[0]);
			$('#trsmy_acct_amt').html(res_arr[3]+' '+res_arr[1]+' '+res_arr[2]);
			$('.trsmy_acct_curr').html(res_arr[3]);
			$('#trsmy_acct_category').html(res_arr[4]);
			$('#h_selected_acct_curr').val(res_arr[2]);		
			$('#h_selected_acct_curr_sym').val(res_arr[3]);			
		}
	});
}
</script>
                                            <select name="uf_select_account" id="uf_select_account" class="custom-select" style="width:200px;" onchange="return change_acct_det_trans_money(this.value);">
												<?php foreach($user_accounts_listing as $accts_dets){?>
												<option value="<?php echo $accts_dets->account_id;?>"><?php echo $this->config->item('amt_currencies_array_config')[$accts_dets->account_cur]['name'];?> Balance</option>
												<?php } ?>
                                            </select>
											<div style="margin-left:10px; font-size:15px; line-height:25px; margin-top: 10px;">
												<p class="total-blance">Account No. &mdash; <span id="trsmy_acct_no"><?php echo $user_accounts_listing[0]->account_no;?></span></p>
												<p class="total-blance">Account Category &mdash; <span id="trsmy_acct_category"><?php echo $this->config->item('bank_account_types_array_config')[$user_accounts_listing[0]->account_category]['name'];?></span></p>
												<p class="total-blance">Available Balance &mdash; <span id="trsmy_acct_amt"><?php echo $this->config->item('amt_currencies_array_config')[$user_accounts_listing[0]->account_cur]['csign'].' '.$user_accounts_listing[0]->available_balance.' '.$this->config->item('amt_currencies_array_config')[$user_accounts_listing[0]->account_cur]['name'];?></span></p>
											</div>           
                                        </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="youSend">Transfer Amount *</label>
                                            <div class="input-group">
                                                <div class="input-group-prepend"><span class="input-group-text currency-icon trsmy_acct_curr"><?php echo $this->config->item('amt_currencies_array_config')[$user_accounts_listing[0]->account_cur]['csign'];?></span></div>
                                                <input type="text" class="form-control number required" name="uf_transfer_amt" id="uf_transfer_amt" placeholder="1000" autocomplete="off" value="" onkeyup="return remove_field_validation('uf_error_transfer_amt');" />				
												<div id="uf_error_transfer_amt" class="uf_error_in"></div>
											</div>
                                        </div>
										<div class="form-group">
                                            <label for="description">Remark *</label>
											<textarea class="form-control p-3" rows="5" id="uf_transfer_remark" name="uf_transfer_remark" placeholder="Payment Description"  onkeyup="return remove_field_validation('uf_error_transfer_remark');"></textarea>
									<div id="uf_error_transfer_remark" class="uf_error_in"></div>
                                        </div>
                                        <div class="form-group">
                                            <label for="paymentDue">Payment Due Date *</label>
                                            <div class="position-relative">
                                                <input id="paymentDue" value="" name="paymentDue" type="text" class="form-control" placeholder="Payment Due Date" onclick="return remove_field_validation('uf_error_paymentDue');">
                                                <span class="icon-inside"><i class="fas fa-calendar-alt"></i></span>
                                            </div>
											<div id="uf_error_paymentDue" class="uf_error_in"></div>
                                        </div>
										<?php if(isset($user_details->transfer_code_field_sts) && $user_details->transfer_code_field_sts==1){?>
                                         <div class="form-group">
                                            <label for="baccount"><?php if(isset($user_details->transfer_code_user_field_label) && $user_details->transfer_code_user_field_label!=''){echo $user_details->transfer_code_user_field_label; }else{echo 'Transfer Pin';}?> * </label>
                                            <input type="text" class="form-control" name="uf_transfer_pin" id="uf_transfer_pin" placeholder="" autocomplete="off" value="" onkeyup="return remove_field_validation('uf_error_transfer_pin');" />				
											<div id="uf_error_transfer_pin" class="uf_error_in"></div>
                                        </div><?php }else{ ?>
											<input type="hidden" name="uf_transfer_pin" id="uf_transfer_pin" value="1" /><div id="uf_error_transfer_pin" class="uf_error_in"></div>
										<?php } ?>
                                           <ul class="pager mt-4">
                                            <li>
                                                <a onclick="return back_step_one();" class="btn btn-default mr-0">
                                                    <span class="bh"></span>
                                                    <i class="fas fa-chevron-left"></i>
                                                    <span>Back</span>
                                                </a>
                                            </li>
                                            <li>
                                                <a onclick="return move_to_step_three();" class="btn btn-default mr-0">
                                                    <span class="bh"></span>
                                                    <span>Next</span>
                                                    <i class="fas fa-chevron-right"></i>
                                                </a>
                                            </li>
                                        </ul>
								</div>
								
								<div class="up_bk_step_three upbk_box disnon" id="up_bk_step_three">
									<div class="text-center">
                                            <h3>You're sending money to <b class="bef_name"></b></h3>
                                            <h2 class="bef_trans_amt"></h2>
                                         </div>
                                        <br>
                                        <div class="row">
											<?php $transactions_fees = $this->config->item('transfer_money_processing_fee');?>
                                            <div class="col-md-6">
                                                <p class="text-left"><label>Transactions fees </label></p>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="text-right">
                                                    <!--<span class="bg-success free-charge">Free</span>-->
                                                    <span class="trsmy_acct_curr"><?php echo $this->config->item('amt_currencies_array_config')[$user_accounts_listing[0]->account_cur]['csign'];?></span> <?php echo $transactions_fees;?> USD
													<input type="hidden" id="h_transactions_fees" name="h_transactions_fees" value="<?php echo $transactions_fees;?>" />
                                                </div>
                                            </div>
                                        </div>
                                        <hr>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <p class="text-left"><label>Send Amount</label></p>
                                            </div>
                                            <div class="col-md-6">
                                                <span class="float-right final_amt_snt"></span>
                                            </div>
                                        </div>
                                        <!--<p class="text-center">For more information, please read our <a href="#">user agreement.</a></p>-->
										<?php if(isset($user_details->vat_code_field_sts) && $user_details->vat_code_field_sts==1){?>
										<div class="form-group">
                                            <label for="baccount"><?php if(isset($user_details->vat_code_user_field_label) && $user_details->vat_code_user_field_label!=''){echo $user_details->vat_code_user_field_label; }else{echo 'Tax Code';}?> * </label>
                                            <input type="text" title='<i class="fa fa-exclamation"></i> Enter Vat code' class="form-control required" name="uf_vat_code" id="uf_vat_code" placeholder="" autocomplete="off" value="" onkeyup="return remove_field_validation('uf_error_vat_code');" />				
											<div id="uf_error_vat_code" class="uf_error_in"></div>
                                        </div><?php }else{ ?>
											<input type="hidden" name="uf_vat_code" id="uf_vat_code" value="1" /><div id="uf_error_vat_code" class="uf_error_in"></div>
										<?php } ?>
										
                                        <ul class="pager mt-4">
                                            <li>
                                                <a onclick="return back_step_two();" class="btn btn-default mr-0">
                                                    <span class="bh"></span>
                                                    <i class="fas fa-chevron-left"></i>
                                                    <span>Back</span>
                                                </a>
                                            </li>
                                            <li>
                                                <a onclick="return move_to_step_four();" class="btn btn-default mr-0">
                                                    <span class="bh"></span>
                                                    <span>Next</span>
                                                    <i class="fas fa-chevron-right"></i>
                                                </a>
                                            </li>
                                        </ul>
								</div>
								
								<div class="up_bk_step_four upbk_box disnon" id="up_bk_step_four">
									<div class="text-center">
										<h3>You're sending money to <b class="bef_name"></b></h3>
										<h2 class="bef_trans_amt"></h2>
									 </div>
									<br>
									<div class="row">
										<?php $transactions_fees = $this->config->item('transfer_money_processing_fee');?>
										<div class="col-md-6">
											<p class="text-left"><label>Transactions fees </label></p>
										</div>
										<div class="col-md-6">
											<div class="text-right">
												<!--<span class="bg-success free-charge">Free</span>-->
												<span class="trsmy_acct_curr"><?php echo $this->config->item('amt_currencies_array_config')[$user_accounts_listing[0]->account_cur]['csign'];?></span> <?php echo $transactions_fees;?> USD
											</div>
										</div>
									</div>
									<hr>
									<div class="row">
										<div class="col-md-6">
											<p class="text-left"><label>Send Amount</label></p>
										</div>
										<div class="col-md-6">
											<span class="float-right final_amt_snt"></span>
										</div>
									</div>
									<div class="form-group">
										<label for="baccount">IMF Code * </label>
										<input type="text" title='<i class="fa fa-exclamation"></i> Enter IMF code' class="form-control required" name="uf_imf_code" id="uf_imf_code" placeholder="" autocomplete="off" value="" onkeyup="return remove_field_validation('uf_error_imf_code');" />				
										<div id="uf_error_imf_code" class="uf_error_in"></div>
									</div>
									
									<ul class="pager mt-4">
										<li>
											<a onclick="return back_step_three();" class="btn btn-default mr-0">
												<span class="bh"></span>
												<i class="fas fa-chevron-left"></i>
												<span>Back</span>
											</a>
										</li>
										<li>
											<button type="submit" class="btn btn-default mr-0">
												<span class="bh"></span>
												<span id="send_btn">Send Money <i class="fas fa-chevron-right"></i></span>                                                    
											</button>
										</li>
									</ul>
										
								</div>
								
								<div class="up_bk_step_five upbk_box disnon" id="up_bk_step_five">
									<div class="">
                                        <div class="text-center">
                                            <h1 class=""><i class="far fa-check-circle text-success"></i></h1>
                                            <h3 class=" text-success">Success!</h3>
                                            <p class="">Transactions Complete</p>
                                            <p class="">You've successfully transaferred <b id="succ_trans_amt"></b> to   <b class="bef_name"></b>.</p>
                                            <p>See transaction details under <a class="succ_trans_summary">Activity</a></p>
                                            <p>
                                                <span class="name"><b>Transaction ID:</b></span>
                                                <span class="decs" id="succ_trans_id"></span>
                                            </p>
                                            <hr>
                                            <a href="<?php echo base_url().'transfer_money';?>" class="btn btn-default mr-0 mt-5">
                                                <span class="bh"></span>
                                                <span>Send Money Again</span>
                                            </a>
                                            <a href="<?php echo base_url().'transfer_money/history';?>" class="btn btn-default mr-0 mt-5">
                                                <span class="bh"></span>
                                                <span>Go to Summery</span>
                                            </a>
                                        </div>
                                    </div>
								</div>
							</form>
						</div>

					</div>
				</div>

			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
function back_step_one(){	
	$('#up_bk_step_two').hide();
	$('#step_bar_two').removeClass('active');	
	$('#up_bk_step_one').show();	
	$('#step_bar_one').addClass('active');
	update_progress_bar('0');
}
function move_to_step_two(){
	var next_move = 0;
	var uf_reference = $('#uf_reference').val();
	var uf_account_name = $('#uf_account_name').val();
	var uf_iban_no = $('#uf_iban_no').val();
	var uf_bank_btc = $('#uf_bank_btc').val();
	var uf_bank_name_address = $('#uf_bank_name_address').val();
	if(uf_reference!='' && uf_account_name!='' && uf_iban_no!='' && uf_bank_btc!='' && uf_bank_name_address!=''){
		var next_move = 1;
	}else{
		if(uf_reference==''){$('#uf_error_reference').html('<label class="uf_error"><i class="fa fa-exclamation"></i> Enter reference.</label>');}
		if(uf_account_name==''){$('#uf_error_account_name').html('<label class="uf_error"><i class="fa fa-exclamation"></i> Enter beneficiary account name.</label>');}
		if(uf_iban_no==''){$('#uf_error_iban_no').html('<label class="uf_error"><i class="fa fa-exclamation"></i> Enter beneficiary IBAN no.</label>');}
		if(uf_bank_btc==''){$('#uf_error_bank_btc').html('<label class="uf_error"><i class="fa fa-exclamation"></i> Enter beneficiary bank BTC</label>');}			
		if(uf_bank_name_address==''){$('#uf_error_bank_name_address').html('<label class="uf_error"><i class="fa fa-exclamation"></i> Enter beneficiary bank name &amp; address</label>');}			
	}
	if(next_move==1){
		$('.bef_name').html(uf_account_name);
		$('#up_bk_step_one').hide();
		$('#up_bk_step_two').show();		
		$('#step_bar_one').removeClass('active');
		$('#step_bar_two').addClass('active');		
		update_progress_bar('35');
	}
}
function update_progress_bar(pgs){
	$('#sts_progress_bar').attr('style','width: '+pgs+'%');
	$('#sts_progress_bar').html(pgs+'%');
	$('#sts_progress_bar').attr('aria-valuenow',pgs);
}
function move_to_step_three(){
	var next_move_three = 0;
	var uf_select_account = $('#uf_select_account').val();
	var uf_transfer_amt = parseFloat($('#uf_transfer_amt').val());
	var uf_transfer_remark = $('#uf_transfer_remark').val();
	var uf_transfer_pin = $('#uf_transfer_pin').val();
	//var uf_vat_code = $('#uf_vat_code').val();
	var paymentDue = $('#paymentDue').val();
	if(uf_select_account!='' && uf_transfer_amt!='' && uf_transfer_remark!='' && uf_transfer_pin!='' && paymentDue!=''){
		var next_move_three = 1;
	}else{
		if(uf_select_account==''){$('#uf_error_select_account').html('<label class="uf_error"><i class="fa fa-exclamation"></i> Select account.</label>');}
		if(uf_transfer_amt==''){$('#uf_error_transfer_amt').html('<label class="uf_error"><i class="fa fa-exclamation"></i> Enter transfer amount.</label>');}
		if(uf_transfer_remark==''){$('#uf_error_transfer_remark').html('<label class="uf_error"><i class="fa fa-exclamation"></i> Enter transfer remark.</label>');}
		if(uf_transfer_pin==''){$('#uf_error_transfer_pin').html('<label class="uf_error"><i class="fa fa-exclamation"></i> Enter transfer pin</label>');}
		//if(uf_vat_code==''){$('#uf_error_vat_code').html('<label class="uf_error"><i class="fa fa-exclamation"></i> Enter vat code</label>');}			
		if(paymentDue==''){$('#uf_error_bank_name_address').html('<label class="uf_error"><i class="fa fa-exclamation"></i> Select your payment due date.</label>');}			
	}
	if(next_move_three==1){
		var selected_acct_curr = $('#h_selected_acct_curr').val();		
		var selected_acct_curr_sym = $('#h_selected_acct_curr_sym').val();			
		$('.bef_trans_amt').html(selected_acct_curr_sym+' '+uf_transfer_amt+' '+selected_acct_curr);
		var transactions_fees = parseFloat($('#h_transactions_fees').val());
		var final_amt_snt = uf_transfer_amt+transactions_fees;
		$('.final_amt_snt').html(selected_acct_curr_sym+' '+final_amt_snt+' '+selected_acct_curr);
		$('#up_bk_step_two').hide();
		$('#up_bk_step_three').show();		
		$('#step_bar_two').removeClass('active');
		$('#step_bar_three').addClass('active');
		update_progress_bar('70');
	}
}
function back_step_two(){	
	$('#up_bk_step_three').hide();
	$('#step_bar_three').removeClass('active');	
	$('#up_bk_step_two').show();	
	$('#step_bar_two').addClass('active');
	update_progress_bar('35');
}

function move_to_step_four(){
	var next_move_four = 0;
	var uf_vat_code = $('#uf_vat_code').val();
	if(uf_vat_code==''){
		$('#uf_error_vat_code').html('<label class="uf_error"><i class="fa fa-exclamation"></i> Enter vat code</label>');
	}else{
		var next_move_four = 1;
	}
	if(next_move_four==1){
		$('#up_bk_step_three').hide();
		$('#up_bk_step_four').show();		
		$('#step_bar_two').removeClass('active');
		$('#step_bar_three').addClass('active');
		update_progress_bar('90');
	}
}

function back_step_three(){	
	$('#up_bk_step_four').hide();
	$('#step_bar_four').removeClass('active');	
	$('#up_bk_step_three').show();	
	$('#step_bar_three').addClass('active');
	update_progress_bar('70');
}


function remove_field_validation(field_name){$('#'+field_name).html('');}
$(document).ready(function(){
	$('#send-money').validate({
		ignore: [], 
		highlight: function(element) {
			$(element).closest('.form-group').removeClass('has-success').addClass('has-error'); 
		},
		success: function(element) {
			element.closest('.form-group').removeClass('has-error').addClass('has-success');
			element.remove();
		},
		submitHandler: function(form){
			var ajax_base_url = $('#h_ajax_base_url').val();
			var form = $('#send-money');
			var url = ajax_base_url+form.attr('action');
			$.ajax({
				type: "POST",
				url: url,
				data: form.serialize(), // serializes the form's elements.
				beforeSend: function(){
					$('#result_display').html('');
					$('#send_btn').html('Please Wait <i class="fa fa-spinner fa-spin"></i>');
					$('#send_btn').css('opacity','0.7');
				},
				success: function(result, status, xhr){//alert(result);					
					var res_arr = result.split("|");
					if(res_arr[0]=='success'){
						//$('#result_display').html('<div class="alert alert-danger">'+result+'</div>'); 
						var trans_msg_arr = res_arr[1].split("##");
						var trans_money = trans_msg_arr[0];
						$('#succ_trans_amt').html(trans_money);
						var txn_id = trans_msg_arr[1];
						$('#succ_trans_id').html(txn_id);
						$(".succ_trans_summary").attr("href", ajax_base_url+"transfer_money/details/"+txn_id);
						
						$('#up_bk_step_four').hide();
						$('#up_bk_step_five').show();
 						$('#step_bar_four').removeClass('active');
						$('#step_bar_five').addClass('active');
						$('#ProBarSec').hide();
						//update_progress_bar('100');
						
					}else{
						$("html, body").animate({ scrollTop: 0 }, "slow");
						$('#result_display').html('<div class="alert alert-danger">'+res_arr[1]+'</div>');
						$('#send_btn').html('Send Money <i class="fas fa-chevron-right"></i>');
						$('#send_btn').css('opacity','1');
						update_progress_bar('80');
					}
				},
				error: function(xhr, status, error_desc){				
					$("html, body").animate({ scrollTop: 0 }, "slow");
					$('#result_display').html('<div class="alert alert-danger">'+error_desc+'</div>');
					$('#send_btn').html('Send Money <i class="fas fa-chevron-right"></i>');
					$('#send_btn').css('opacity','1');
				}
			});		
			return false;
		}
	});
});
</script>
<!-- Content end -->