You using sqlsrv_fetch_array
incorrectly second time.
sqlsrv_fetch_array($conn, $aanvragenATV);
sqlsrv_fetch_array take first parameter as sql statement & second fetch type. So change it to,
sqlsrv_fetch_array($aanvragenATV,SQLSRV_FETCH_NUMERIC);
Note: It seems from your code you have used $rowATV[0]
you need to fetch it by type NUMERIC
or else change it as per your need.