<?php   
	include_once("../view/header-footer/header.php");  
?>  
<script>

        function verify()
        {    
                        
            if( ($("#accountNo").val()!='') && ($("#ifsc").val()!='') && ($("#mobile").val()!='')  ) 
            {     
                 
                     $.ajax({	
                        type: "POST",
                        url: URL+"/ajax/validation.php",
                        data: {BankVerify:1,accno:$("#accountNo").val(),ifsc:$("#ifsc").val(),mobile:$("#mobile").val()},
                        beforeSend: function(){ 
                        },
                        success: function(data)
                            {         
                                 if(data!='')
                                 $("#AvailbleId").html("<span style='color:green;'>"+data+" &#x2713</span>");
                            }
                        });   
                }else
                {
                    alert("Please fill the details");
                }
          }
        
        
        $(document).ready(function()
        {        
            
                $(".PaySound").click(function()
                {
                    
                    $('.loader').css('display','block');
                });  
                

            var URL = "<?php echo ROOTPATH;?>";    
            $( "#cuurentId" ).change(function() 
            {       
                  
                       
              $.ajax({	
                    type: "POST",
                    url: URL+"/ajax/validation.php",
                    data: {userDatacheckTop:1,Data:$("#cuurentId").val()},
                    beforeSend: function(){ 
                    },
                    success: function(data)
                        {       
                            $("#AvailbleId").html("<span style='color:green;'>"+data+" &#x2713</span>");
                        }
                    });   
            });  
            
            
             
            
        });  
        
        
        function PaySubmit()
        {
            if( ($("#amount").val()!='')  && ($("#pinno").val()!='') )
            {
                
                $("#Mysubmit").hide();
            } 
        }
        
        function SelecAcc(val)
        {
                    $.ajax({	
                   type: "POST",
                    url: URL+"/ajax/validation.php",
                    data: {SelectACcount:1,AccId:val},
                    beforeSend: function(){ 
                    },
                    success: function(data)
                        {       
                            var Mydata = jQuery.parseJSON(data); 
                            $("#rname_").val(Mydata.accName);   
                            $("#accountNo").val(Mydata.accno);   
                            $("#ifsc").val(Mydata.ifsc);   
                        }
                    });  
        }
        
        function amtshow()
        {
             
            
            {
                var payble = "<?php echo $UI__Deduction->charges;?>"; 
                if($("#amount").val()>1000)
                    var chr = ($("#amount").val()*1.5)/100;  
                else
                    var chr = payble;//($("#amount").val()*payble)/100;  
            }
            
            $("#deduction").val((chr));
            $("#payble").val(($("#amount").val()-chr));
        }
    
     
    </script> 
<script type="text/javascript" src="<?php echo ROOTPATH;?>/view/js/tab/profile.js"> </script>
<script>
        //Function To Display Popup
    function div_show() {
    
    document.getElementById('abc').style.display = "block";
    }
    //Function to Hide Popup
    function div_hide(){
    document.getElementById('abc').style.display = "none";
    }
        
</script>
  
   
 <!-- Features -->
<div class="innerDeader">
    
<div class="loader">
    <div class="loaderInn">
        <img src="<?php echo ROOTPATH;?>/images/loader.gif" alt="loading" />
    </div>
</div>

      <div class="container">
       <a href="javascript:void(0);" id="go-back" class="goBack PaySound">
           <img src="<?php echo ROOTPATH;?>/images/Arrow 1.svg" alt="back">
       </a>   
          <h4> TRANSFER MONEY </h4>  
          <?php 
            if(isset($_SESSION['topSuc'])) 
            {
          ?>
          <span style="font-size:13px;color:green;font-weight:bold;">
           <?php  
                if(isset($_SESSION['Regis']))  
                    echo $_SESSION['Regis'];
            ?>  
            </span>  
            <?php 
                } else { 
            ?> 
            <span style="font-size:13px;color:red;font-weight:bold;">
           <?php  
                if(isset($_SESSION['Regis']))  
                    echo $_SESSION['Regis'];
            ?>  
            </span>    
            <?php  } ?>  
     </div>  
    
       
   </div>
   <div class="innerBody">
       <div class="container">
        <div class="formBox">
            <form method="post" autocomplete="off">
                
          <div class="form-outline">
            <label class="form-label" for="form12">Mobile No</label>
            <input type="number"  class="form-control" name="mobile"  id="mobile"  required  value="<?php echo trim($Result->phm);?>" maxlength="10" />
			 
          </div> 
          
          
          
          
           <div class="form-outline">
            <label class="form-label" for="form12">Add Beneficiary</label>
            <input type="text"  class="form-control"  name="beneFiciary"  id="beneFiciary" /> 
          </div> 
          
          
          <div class="form-outline">
            <label class="form-label" for="form12">Select Account</label> 
            <select class="form-control"  name="AccountList" id="AccountList" onchange="SelecAcc(this.value)" required>
                <option value="">Select Account</option>
                <?php 
                        
                        $stmt=$conn->prepare("select * from UI__AddAccount  where  custId=:cuurentId  ");   
                        $stmt->bindValue(':cuurentId',  $_SESSION['userId'] , PDO::PARAM_STR);  
                        $stmt->execute();
                        $UI__AddAccount = $stmt->fetchAll(PDO::FETCH_OBJ);  
                        foreach($UI__AddAccount as $data) 
                        {  
                ?>
                    <option value="<?php echo $data->id;?>"><?php echo $data->accName;?></option>
                <?php } ?>
            </select>
          </div> 
          
          
         
           
          
          <div class="form-outline">
            <label class="form-label" for="form12">Select Mode Of Payment</label> 
            <select class="form-control"  name="mode" id="mode"   required>
                <option value="">Select Mode</option>
                
                <?php 
                    if($Result->impsStats==0) {
                ?>
                <option value="2">IMPS</option>
                <?php } ?>
                <option value="1">NEFT</option>  
            </select>
          </div> 
          
          <div class="form-outline">
            <label class="form-label" for="form12">Receiver Name</label>
            <input type="text"  class="form-control"  name="rname_"  id="rname_"  required  readonly/> 
          </div> 
          
          <div class="form-outline">
            <label class="form-label" for="form12">Receiver Acc No</label>
            <input type="number"  class="form-control"     name="accountNo"  id="accountNo"  required  readonly/>
          </div> 
		  
		  
		  
		  <div class="form-outline">
            <label class="form-label" for="form12">Receiver IFSC</label>
            <input type="text"  class="form-control"    name="ifsc"  id="ifsc"  required  readonly /> 
          </div> 
          
           
         <div class="form-outline">
            <label class="form-label" for="form12">Amount</label> 
            <input type="number"   class="form-control"     name="amount"  id="amount"    onchange="amtshow();"  required/>  
             
          </div>  
          
           <div class="form-outline">
            <label class="form-label" for="form12">Deduction</label> 
            <input type="number"   class="form-control"    readonly    id="deduction"    />  
             
          </div>  
		  
		  
		  
           <div class="form-outline">
            <label class="form-label" for="form12">Total Payble</label> 
            <input type="number"   class="form-control"    readonly  id="payble"     />  
             
          </div>  
          
		  
		 <div class="form-outline mt-5">
            <label class="form-label" for="form12">Enter Transaction Password</label>
            <input type="text"  class="form-control"    type="password"  [(ngModel)] = 'line1'    name="pinno"  id="pinno"      required  />
          </div> 
          
	     <div class="form-outline">
            <label class="form-label" for="form12">Available Balance</label>
            <input type="text"   class="form-control"   value="₹<?php echo $PAYWAllet;?>" readonly  /> 
          </div>
		  
          
		  <input type="submit" class="btn btn-primary bigBtn PaySound mb-3 PaySound"   onclick="PaySubmit();"  name="submit" id="Mysubmit"  value="TRANSFER NOW"/>  
		  <a href="AddMAccountmcopy.php"class="PaySound " style="background-color: #055e06;
                    border: none;
                    color: #fff;
                    padding: 5px 10px;
                    text-align: center;
                    text-decoration: none;
                    display: inline-block;
                    width:100%; 
                    border-radius:5px;
                    font-size: 15px;
                    margin: 4px 2px;
                    cursor: pointer;" >ADD BANK ACCOUNT
            </a> 
                     
		   <a href="javascript:void(0);" id="go-backDown" class="PaySound " style="background-color: #747474;
                    border: none;
                    color: #fff;
                    padding: 5px 10px;
                    text-align: center;
                    text-decoration: none;
                    display: inline-block;
                    width:100%; 
                    border-radius:5px;
                    font-size: 15px;
                    margin: 4px 2px;
                    cursor: pointer;" >Go Back</a>
          </form>

        </div>  
       </div>
   </div>  
   
     
</div>
 
<?php 
  include_once("../view/header-footer/footer.php");  
unset($_SESSION['Regis']);  
unset($_SESSION['topSuc']); 
unset($_SESSION['QRSET']); 