<section class="content">
	<div class="row">
		<div class="col-md-12">
			<div class="box">
				
				<form class="form-horizontal" id="debitFrm" method="post" action="transactions/vectra_debit_entry">
					<input type="hidden" id="h_base_url" name="h_base_url" value="<?php echo base_url().$this->config->item('admin_directory_name').'/';?>" />
					<div class="box-body">
 						
						<div class="col-md-10" style="margin-top:10px;">
							<div id="result_display"></div>
							
							<div id="stepOne">
								<div class="form-group" >
									<label class="col-sm-4 control-label" for="user_id">User Account *</label>
									<div class="col-sm-8">
										<select class="form-control required" id="user_id" name="user_id">
											<option value="">Select....</option>
											<?php foreach($user_accounts_data as $user){?>
												<option value="<?php echo $user->user_id;?>"><?php echo $user->customer_name;?></option>
											<?php } ?>
										</select>
									</div>
								</div>
								<div class="form-group" >
									<button type="button" onclick="return move_step_two();" id="continueBtn" class="btn btn-primary">Continue</button>
								</div>
							</div>
							
							<div class="userSelectSts" id="stepTwo" style="display:none"></div>
							 							 
						</div>
					</div>
				</form>
			
			</div>
		</div>
	</div>
</section>
<script type="text/javascript">
function move_step_two(){
	var user_id = $('#user_id').val();
	if(user_id!=''){
		var site_base_url = $('#h_base_url').val();
		var url = site_base_url+'transactions/ajax_vectra_user_bef_acct?user_id='+user_id;
		$.ajax({
			type: "POST",
			url: url,
			beforeSend: function(){
				$('#continueBtn').html('Please Wait <i class="fa fa-spinner fa-spin" aria-hidden="true"></i>');
			},
			success: function(result, status, xhr){
				$('#stepTwo').html(result);
				$('#stepTwo').show();
				$('#stepOne').hide();
				$('#continueBtn').html('Continue');
			}
		});		
		return false;
	}
}
function chkOther(val){
	if(val!=''){
 		if(val=='other'){
			$('#bef_details').show();
			$('.benCls').addClass('required');
		}else{
			$('#bef_details').hide();
			$('.benCls').removeClass('required');
			//var val_arr = val.split("|");
			//$('#uf_account_name').val(val_arr[1]);
		}
	}
}
</script>