<?php 
	include_once("../view/header-footer/InnerHeader.php");   
	include_once("leftMenu.php");   
?>    
<script> 
$(document).ready(function()
{   
 
        
        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"><style>
 button.close {
    float: right;
}   
#proceed {
  display: none;
} 

      
</style>
<div class="user_content">
<div class="container">
<div class="row pt-2 pb-2">
<div class="col-sm-12">
<ol class="breadcrumb ml-3 mr-3">
<li class="breadcrumb-item"><a href="https://atlanticworld.info/user/dashboard">Home /</a></li>
<li class="breadcrumb-item active" aria-current="page">Update Password &nbsp;</li> 
<li style="color:green;font-style:bold"> <?php if(isset($_SESSION['Regis']))  echo $_SESSION['Regis'];?></li>
</ol>
</div>
</div>
<div class="user_main_card mb-3 ">
<div class="user_card_body user_content_page ">
<h5 class="user_card_title filter_title"><i class="fa fa-user-circle" aria-hidden="true"></i>Password</h5>
</div>
<div class="user_card_body user_content_page ">
<form id="_frm" method="post">
<div class="user_form_row user_form_content">
<div class="row">
    
     
<div class="col-lg-12 mb-3">
<label class="label_user_title">Password</label>
<div class="input-group ">
<input   type="text"   class="form-control"  name="Password"    value="<?php echo $FResult->pwd;?>"   placeholder="Enter Password"  required  >
</div>
</div>

 
  
</div>
</div>
<div class="user_form_row_data user_form_content ">
<div class="user_submit_button mb-2 mt-2"> 
        <input type="submit" name="submit" value="Update Password" id="" class="user_btn_button"> 
</div>
</div>
</form>
<div class="col-lg-12 mb-3">
<div class="data_save">
  
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<script>

var timeleft = 30;
    var downloadTimer = setInterval(function(){
    timeleft--;
    document.getElementById("countdowntimer").textContent = timeleft;
    if(timeleft <= 0)
        clearInterval(downloadTimer);
        
    },1000);
    
     $(document).ready(function() {
  setTimeout(function() {
    $("#proceed").show();
  }, 30000);
});  
</script>
</div> 
<?php 
    unset($_SESSION['Regis']);
	include_once("../view/header-footer/footer.php");    
?> 