$callback= $_GET['callback'];
echo $callback;
$url = $_SERVER['PHP_SELF'];
$path = parse_url($url, PHP_URL_PATH);
$pos = strpos ( $path , '/' ,1 );
$len = strlen ( $path );
$parameter = substr ( $path , $pos+1, $len-$pos);
$datetoday = date('Y-m-d', time());
$url = "http://localhost:8080/rest/tempo-teams/2/teammember/".$parameter."/memberships?from=".$datetoday."&to=".$datetoday;
$username = 'username';$password = 'password';
$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, $username.":".$password);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
$output = curl_exec($ch);
$jsonData = (json_decode($output, true));
$teams = count($jsonData); |