<?php 	include_once('../../config.php'); 
		include_once(ABS_PATH.'/admin/login_check.php');
		   
		if(isset($_POST['submit']))
		{ 
		    
	 	 }  
include ABS_PATH.'/admin/header.php';	
?>  


 <script>

	
	 function sub_locations(val)
	{  
		$.ajax({	
			type: "POST",
			url: "ajax-file.php",
			data:{sub_locations:1,id:val},	
			beforeSend: function(){
				//$("#search-box").css("background","#FFF url(LoaderIcon.gif) no-repeat 165px");
			},
			success: function(val){  
				 $("#sub-location").html(val); 
				  
			}
		});	
	}	
		
		
	function CheckWalet()
	{ 
         
        $.ajax({	
			type: "POST",
			url: "ajax-file.php",
			data:{checkWavlAcmt:1,mobileno:$("#mobileno").val()},	
			beforeSend: function(){
				//$("#search-box").css("background","#FFF url(LoaderIcon.gif) no-repeat 165px");
			},
			success: function(val)
			{ 	  
				   var Obj = jQuery.parseJSON(val);   
				   $("#valAmt ").html(Obj.name+", Rs "+Obj.amount+"/-"); 
			}
		});	 
        
	}
		
 </script>
 <script>
	 
    var URL = "<?php echo ROOTPATH;?>";
	$(document).ready(function()
	{   
    	$("#walletfrm").validate({ 
    			
    			errorElement:'div',
    			rules:{ 
    			   mobileno:{
    				required:true,   
    			  }
    			}, 
    	   messages:{				 
        			
        		  mobileno:{
    				required:"Please enter Id",
    			 
    			  } 		  
    			}
      }); 
      
       var user_type=0;
      
        $(".user_type").change(function()
        {
            user_type=this.value;
        });
    	
    	$("#walletfrm").submit(function( event )  // on click on this id...we will do folowwings
    	{ 		   
    	    $("#wallet_successMsg").html("");
    	    $("#wallet_msg").html("");
    	    
    		if($('#walletfrm').valid())  
    		{
    		    //if(($("#amount").val()) > 0)
    		    {
        		   var r = confirm("Do you really want to update amount");
        		   if (r == true) 
        		   { 
            		   $.ajax({	
                		type: "POST",
                		url: "ajax-file.php",
                		data:{UpdateWvallAmtCt:1,mobileno:$("#mobileno").val()},	
                		beforeSend: function(){ 
                		    //$('#update_wallet').addClass('disableloginbtn');
                		},
                		success: function(val)
                		{ 
                		    alert("Comepleted!!");   
                		    window.location.href= URL+"/admin/wallet/ConirmWallet.php";
                		} 
    		          });  
        		   } 
    		    } 
    		}
    		event.preventDefault();  // this is help to prevent from submit
	    });


});
 


</script>
		 
		 <div class="col-md-10">

	  			<div class="row">
	  				<div class="col-md-12">
	  					<div class="content-box-large">
							<div class="panel-heading"> 

							
							
							<div class="panel-title"> <h1>Re Wallet  Update </h1></div>     
								<!--div class="panel-options">  
								<input type="button"  class="btn btn-warning" name="btnback" id="btnback" value=" Back " onClick="javascript:location.href='admin_users.php'" /> 
								</div-->  
							</div>   
							
						
			  				<div class="panel-body">  								 
			  					<form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" id="walletfrm" autocomplete="off">       
								 <div class="form-group">    
								 
							    <div class="form-group">  
								    <label for="inputEmail3" class="col-sm-2 control-label">User ID </label>
								    <div class="col-sm-3">  
								      <h5>
								            <input type="text" name="mobileno" id="mobileno"   value=""  class="form-control"  />  
								            <span id="valAmt"></span>
								      
								      </h5> 
								       
								    </div> 
								 </div>	
								<hr>
								
							 
						 

								<div class="form-group">  
								    <label for="inputEmail3" class="col-sm-2 control-label">Check Updates</label>
								    <div class="col-sm-10">  
								      <h5> 
								            <a href="javascript:void(0);"  class="btn btn-primary" onclick="CheckWalet();" > Check Wallet </a>
								            <input type="submit" name="submit" value="Update Wallet" class="btn btn-primary"/>  
								      </h5>  
								       
								    </div> 
								 </div>		
 
								 
								</form>   
							 
			  				</div>
			  			</div>
	  				</div>
	  				 
	  			</div>

	  			 


	  		<!--  Page content -->
		  </div>
		</div>
    </div>

 
<?php  include ABS_PATH.'/admin/footer.php';	?>  