$clientid = "1Cu1zYv8a1";
$url="https://data.sportlink.com/aanmeldenaspirantlid-form?client_id=" . $clientid;
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$result=curl_exec($ch);
curl_close($ch);
$array = json_decode($result, true);
$fields = array("voornaam","tussenvoegsel","achternaam","initialen","geslacht","geboortedatum","straatnaam","huisnummer","nummertoevoeging","postcode","plaats","land","telefoonnummer","mobielnummer","email","iban","bic","captcha","bondssporten");
$required = array("voornaam","achternaam","geslacht","geboortedatum","huisnummer","postcode","mobielnummer","email","captcha","bondssporten");
echo "
\n\n";
echo "
\n";foreach($array as $key => $value)
{
foreach($value as $key2 => $value2)
{
if(in_array($key2,$fields))
{
echo “\n”;echo “”;
echo “\n”;
echo “\n\n”;
}
}
echo ”
\n “;
echo ucfirst(str_replace(“captcha”,”typ de code over”,$key2));
if($key2==”geboortedatum”)
{
echo ” (jjjj-mm-dd)”;
}
if(in_array($key2,$required))
{
echo ” *”;
}
echo “\n “;
if(is_array($value2) and count($value2)==2)
{
foreach($value2 as $key3 => $value3)
{
echo “\n $value4)
{
if($key4==”name”)
{
echo “name=\”$key2\” “;
$fieldname = $value4;
}
if($key4==”value”)
{
echo “value=\”$value4\” “;
}
if($key4==”selected” and $value4==”true”)
{
echo “checked=\”checked\” “;
}
}
if(in_array($key2,$required))
{
echo ” required=\”required\””;
}
echo “>”;
echo $fieldname;
}
}
elseif(is_array($value2) and count($value2)>2)
{
echo “\n
“;
}
elseif($key2==”captcha”)
{
echo “\n \n “;
}
elseif($key2==”email”)
{
echo “\n “;
}
elseif($key2==”huisnummer”)
{
echo “\n “;
}
elseif($key2==”geboortedatum”)
{
echo “\n “;
}
else
{
echo “\n “;
}
echo “\n
\n”;
foreach($value as $key2 => $value2)
{
if(!in_array($key2,$fields))
{
echo “\n “;
}
}
}
echo “\n\n
\n”;
echo ” “;
echo ” “;
echo ” “;
echo “\n
\n\n”;
echo ”
\n”;
?>