<?php 	include_once('../../config.php');   	
		include_once(ABS_PATH.'/admin/login_check.php');    
		
		
		
		     
		    if(isset($_POST['update']))
            {  	 
                       
                    
                    $stmt=$conn->prepare("insert into  UI__PowerTopUp (custId,Tdate,Tpamt) values(:custId,:Tdate,:Tpamt)    "); 
                    $stmt->bindValue(':custId', $_REQUEST['custId'], PDO::PARAM_STR); 
                    $stmt->bindValue(':Tdate', date("d-M-Y H:i"), PDO::PARAM_STR); 
                    $stmt->bindValue(':Tpamt', $_POST['AMMT'], PDO::PARAM_STR);   
                    $stmt->execute();  
					header("Location: PowerTopup.php");
					die;
            }       
?>  
<?php  include ABS_PATH.'/admin/header.php';	?>  

<script>
function hideFun()
{
    $("#update").hide();
}
function del_record(val)
{

	var r = confirm("Do you really want to delete record !");
	if (r == true) {    
	$.ajax({
	type: 'POST',
	url: "../ajax/default.php",
	//async: false,			 
	data: {del_city_names:1,val:val},	  
	success: function(ajaxresult){	     
		location.reload();	 	
	},
	error: function(XMLHttpRequest, textStatus, errorThrown) { 
	alert('Error');
	}
	});
	
	}	
	
}


 
        $(document).ready(function()
        {        
            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>");
                        }
                    });   
            });  
    });   

</script>
		 
		<div class="col-md-10">  
  			<div class="content-box-large">
  				<div class="panel-heading">
					<div class="panel-title"><h3>User Topup</h3></div>
					
					<div align="right">
					     
					</div>
					
				</div>
				
  				<div class="panel-body">
  					  
					    <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" id="product_frm" autocomplete="off"> 
								 
								 
							 
							     <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">UserId</label>
								    <div class="col-sm-3">
								      <input type="text" name="cuurentId"  id="cuurentId"  value="<?php echo $_REQUEST['custId'];?>" readonly class="form-control"  required/>
								      <span id="AvailbleId"></span>
								    </div>
								 </div>   
								 <hr>
								 
							 	 <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Amount</label>
								    <div class="col-sm-3">
								      <input type="number" name="AMMT"   class="form-control" required />
								    </div>
								 </div>
								 <hr>  
								  
								  
								  <div class="form-group">
										<label for="inputEmail3" class="col-sm-2 control-label">Update</label>
										<div class="col-sm-10">
										  <input type="submit"    class="btn btn-primary"  name="update" id="update" value="Topup"  onclick="hideFun()">
										</div>
								  </div>   
								</form>
					 	
								
								
  				</div>
  			</div>



		  </div>
		</div>
    </div>

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