Hey,
If opening_hours and book_online are acf fields, then you can use
$book_online = get_field('book_online', $post->ID);
if(function_exists( 'iinclude_page' ) && $book_online)
{
//code here
}
You also need to make sure that the $post
and the function iinclude_page
is available.