<?php 
	include_once("../view/header-footer/InnerHeader.php");   
	include_once("leftMenu.php");   
?>    
<script> 
$(document).ready(function()
{   
 
	$("#FundTransferAddress").hide();
	
				
				
			$("#address").change(function()
			{ 
				 
				$("#payment_type").change(function()
				{
					$("#FundTransferAddress").show(200);
				});	 
			});
        
        jQuery.validator.addMethod("lettersonly", function(value, element) 
        {
            return this.optional(element) || /^[a-z0-9\_\s]+$/i.test(value); 
        }, "Use alphanumaric & _ only"); 
        
        $( "#cuurentId" ).change(function() 
        {
               
              $.ajax({	
                    type: "POST",
                    url: URL+"/ajax/validation.php",
                    data: {TopUpDatacheck:1,Data:$(this).val()},
                    beforeSend: function(){ 
                    },
                    success: function(data)
                        {   
                            if(data==1)
                                 $("#AvailbleId").html("<span style='color:green;'>Valid Id  &#x2713</span>");
                            else  if(data==3) {
                                $("#cuurentId").val('');
                                 $("#AvailbleId").html("<span style='color:red;'>Invalid</span>"); 
                            }
                            else  if(data==2) {
                                $("#cuurentId").val('');
                                 $("#AvailbleId").html("<span style='color:red;'>Not Available X</span>");      
                            }
                        }
                    });
               
             
        });
        
        
         $( "#TopPin" ).change(function() 
        {
               
              $.ajax({	
                    type: "POST",
                    url: URL+"/ajax/validation.php",
                    data: {CheckDataPin:1,Data:$(this).val()},
                    beforeSend: function(){ 
                    },
                    success: function(data)
                        {    
                            var Data = JSON.parse(data);  
                            if(Data['Status']==1) 
                            {
                                 $("#MPINDetails").html("<span style='color:green;'>Valid PIN  Of Rs "+Data['Data']+" Rs &#x2713 </span>");
                                 
                                 var newStr = Data['Data'].replace(',','')
                                 $("#TpMt").val(parseInt(newStr));  
                            }
                            else    {
                                 $("#MPINDetails").html("<span style='color:red;'>Invalid PIN</span>");      
                                 $("#TopPin").val('');
                            }
                        }
                    });
               
             
        });
        
      
        
 

	$("#_frm").validate({
		
		errorElement:'div',
		rules:{ 
		 
			TopPin:{
				required:true   	
			} ,
			cuurentId:{
				required:true,
				lettersonly:true
			} 
		},
		messages:{ 
		    
			TopPin:{
				required:"Enter PIN" 
			},
			cuurentId:{
				required:"Ener Top Up User ID " 
			} 
			 
		}
	}); 
});  
</script>        
 
 
 
 
<div class="page-wrapper">
<div class="page-content"><div class="container pages">
<div class="row pt-2 pb-2">
<div class="col-sm-12">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<?php echo ROOTPATH;?>">Home</a></li>|
 
<li class="breadcrumb-item active" aria-current="page">Fund Request <?php if(isset($_SESSION['Regis'])) echo $_SESSION['Regis'];  ?></li>
</ol>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<div class="card card-body  card-bg">
<form  method="post" enctype="multipart/form-data">
<div class="form-group">
<label for="">Method</label>
<select class="form-control select_address" name="address" id="address" data-response="payment_type" required>

<option value="">Select Method</option>
<option value="crypto">INR</option>
</select>
</div>
<div class="form-group">
<label for="">Payment Type</label>
<select class="form-control payment_type" name="payment_type" id="payment_type" data-response="address_res" required>
<option value="">Select </option>

<option value="Rtgs">Rtgs</option> 
<option value="Neft">Neft</option> 
<option value="Imps">Imps</option> 
<option value="UPI">UPI</option>
</select> 
 

<span class=" text-warning"></span>
</div>
<div class="form-group">
<label for="">INR</label>
<input type="text" name="amount" value="" class="form-control" placeholder="" aria-describedby="helpId" required>
<span class=" text-warning"></span>
</div>
 
<div class="form-group">
<label for="">Payment Slip</label>
<input type="file" name="payment_slip" id="payment_slip" value="" class="form-control" placeholder="" aria-describedby="helpId" required>
<small id="helpId" class=" text-warning  "></small>
</div>
<br>
<input type="submit" class="user_btn_button" name="request_btn" value="Save">
</form>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<div class="card">
<div class="card-header">
 
</div>
<!--div class=" card-body">
        <span id="FundTransferAddress">
			<img id="address_res" style="width:75%;" src="<?php echo ROOTPATH;?>/dashboard/USDT(BEP20).jpeg">
		</span> 
<div class="input-group card-bg-2" id="address_div" style="">
<input type="text" id="referral_address" class="form-control" value="">
<div class="input-group-append">
<div class="input-group-btn ml-2">
<button type="submit" class="btn btn-default" onclick="copyLink11(&#39;left&#39;)">
<i class="fa fa-copy" style="color: #D3B916; font-size: 18px;"></i>
</button>
</div>
</div>
</div>
</div-->

</div>
</div>
</div>
</div>
<script>
function copyLink11(iid) {
        
      / Get the text field /
      var copyText = document.getElementById("referral_address");
    
      / Select the text field /
      copyText.select();
      copyText.setSelectionRange(0, 99999); /*For mobile devices*/
    
      / Copy the text inside the text field /
      document.execCommand("copy");
    
      / Alert the copied text /
      alert("Copied the text: " + copyText.value);
    }
    
    
   
</script>
</div>
</div>

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