<?php
    
    include'../LLPRECHARGE/connection.php';
    include'../LLPRECHARGE/functions.php';
    
    $userid = $_GET['userid'];
	$token  = $_GET['token'];
	
	$QuGetUser = "SELECT Userid FROM api_user WHERE Userid='$userid' AND Token='$token'";
	$ReGetUser = mysqli_query($con,$QuGetUser);
	$GetUser   = mysqli_num_rows($ReGetUser);
	
	if($GetUser!==1)
	{    
		$myresponse = array("bal"=>"Invalid Userid Or API Token !");
		echo $myresult = json_encode($myresponse);
	}
	else
	{
	    $newbal = getBal($userid);
		$myresponse = array("bal"=>"$newbal");
		echo $myresult = json_encode($myresponse);
	}

?>