<?php   
	include_once("../view/header-footer/header.php");  
?>  
 
 <script>
        $(document).ready(function()
        {        
            
                document.getElementById('amount').onkeyup = function () 
                {
                    document.getElementById('AmountDisplay').innerHTML = inWords(document.getElementById('amount').value);
                };
            
              $(".PaySound").click(function()
                {
                    
                    $('.loader').css('display','block');
                }); 
                
            var URL = "<?php echo ROOTPATH;?>";    
            $( "#cuurentId" ).change(function() 
            {       
                       
              $.ajax({	
                    type: "POST",
                    url: URL+"/ajax/validation.php",
                    data: {userDatacheck:1,Data:$("#cuurentId").val()},
                    beforeSend: function(){ 
                    },
                    success: function(data)
                        {       
                            $("#AvailbleId").html("<span style='color:green;'>"+data+" &#x2713</span>");
                        }
                    });   
            });  
            
            
            
            URL = "<?php echo ROOTPATH;?>";  
            
            $("#BrowsePlan").click(function()
            {
                 
                window.location.href = URL+"/dashboard/browsePlan.php?mob="+$("#mobile_no").val()+"&Opt="+$("#operatorPrepaid").val()+"&optval="+$("#operatorPrepaidval").val(); 
                ("#BrowsePlan").html("Loading...");   
            }); 
            
            
            $("#mobile_no").keyup(function()
            {
               var phoneno = /^\d{10}$/;        
               if( ($("#mobile_no").val()!="") && ($("#mobile_no").val().match(phoneno))  )
               {
                  // $("#mobileno_msg").html(""); 
                  // $("#RechargeItmes").hide(); 
        		      
        		    $.ajax({	
                    		type: "POST",
                    		url: URL+"/welcome/getProvider.php",
                    		data: {GetProviderId:1,mobile_no:$("#mobile_no").val()},
                    		beforeSend: function(){ 
                    		    //$('#submit_login').addClass('disableloginbtn');
                    		},
                    		success: function(val)
                    		{ 
                    		     
        						var SplitD = val.split(","); 
        						operatorPrepaid = SplitD[0];  
        						$("#operatorPrepaid").val(operatorPrepaid);
        						
        						if(SplitD[0]==1)
        						{
        							$("#Operator").val("Airtel"+","+SplitD[1]);
        							$("#operatorPrepaidval").val("Airtel"+","+SplitD[1]);
        							//$("#mival").html('<img id="theImg" src="https://www.paykindia.com/view/images/Prepaid_airtel.png" />'); 
        						}else if(SplitD[0]==2)
        						{
        							$("#Operator").val("VI"+","+SplitD[1]);
        							//$("#mival").html('<img id="theImg" src="https://www.paykindia.com/view/images/Prepaid_vi.png" />'); 
        							$("#operatorPrepaidval").val("Airtel"+","+SplitD[1]);
        						}else  if(SplitD[0]==3)
        						{
        							$("#Operator").val("Idea"+","+SplitD[1]);
        							//$("#mival").html('<img id="theImg" src="https://www.paykindia.com/view/images/Prepaid_vi.png" />'); 
        							$("#operatorPrepaidval").val("Airtel"+","+SplitD[1]);
        						}else  if(SplitD[0]==8)
        						{
        							$("#Operator").val("BSNL"+","+SplitD[1]);
        							//$("#mival").html('<img id="theImg" src="https://www.paykindia.com/view/images/Prepaid_bsnl.png" />'); 
        							$("#operatorPrepaidval").val("Airtel"+","+SplitD[1]);
        						}else  if(SplitD[0]==88)
        						{
        							$("#Operator").val("JIO"+","+SplitD[1]);
        							//$("#mival").html('<img id="theImg" src="https://www.paykindia.com/view/images/Prepaid_jio.png" />'); 
        							$("#operatorPrepaidval").val("Airtel"+","+SplitD[1]);
        						}      
        						
        						
        						
                    		} 
            		   }); 
        			   
        		   
               }
               else
               {
                   $("#mobileno_msg").html("Enter valid mobile no");
               }
               
            });
    
        });    
    
     
    </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>MOBILE RECHARGE </h4> 
          <span style="color:red;">
           <?php  
                if(isset($_SESSION['Regis']))  
                    echo $_SESSION['Regis'];     
            ?>
          </span>
     </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_no"  id="mobile_no" value="<?php echo $_REQUEST['mob'];?>"  required/> 
            <a href="javascript:void(0);" id="BrowsePlan"> Browse plans</a>
            
            <input type="hidden"   id="operatorPrepaid" name="operatorPrepaid" value="<?php echo $_REQUEST['opt'];?>"/>
            <input type="hidden"   id="operatorPrepaidval" name="operatorPrepaidval"/>
          </div>  
	 
		  
		  
		   <div class="form-outline">
            <label class="form-label" for="form12">Operator</label>
            <input type="text"  class="form-control" placeholder=" " [(ngModel)] = 'line1'  name="Operator"  id="Operator" value="<?php echo $_REQUEST['optval'];?>"  required   />
			 
          </div> 
          
           
           
             
          
            <input    type="hidden"     name="amount"  id="amount"  />      
		  
          
		  <input type="submit" class="btn btn-primary bigBtn PaySound mb-2 PaySound"     name="Recharge" value="Continue"  /> 
	 
          </form>

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