Look for where make_http_request() is being called: on line 30. It's not defined above and the code below it expects that the request has been made, so the file_get_contents call is in the wrong place.

You need to replace this:
PHP Code:
$result make_http_request($ats_url); 
with this:
PHP Code:
$result file_get_contents($ats_url);