prohibit booking on weekends and holydays

Hakan,

Spent the last weeks many hours to solve my problem:
Clients/patients should, in the weekend or on a holyday, not be able to book for the first working day after that weekend or that holyday.
So:
- On Friday (until 17:00) they can book for the next Monday.
- On Sat/Sun they cannot book for the first Monday. There first booking possibility is Tuesday.
But…
- if that Monday is a holyday, they cannot book for Tuesday either. Then there first booking possibility is Wednesday.

I did not succeed in programming that. Can you help me out?
My colleague produced a code that did not work:

<?php
/* Start BEPERK boeken in appointments+ */
/* Op zaterdag kan niet op de volgende maandag worden geboekt */
/* Op Zondag kan niet op de volgende maandag worden geboekt */

function set_next_days_as_holiday( $is_holiday, $ccs, $cce, $service, $worker ) {
/* check dat lokale dag een holiday is */
$myresult = $this->get_exception( $this->location, $worker, 'closed' );
if ( $myresult != null && strpos( $myresult->days, date( 'Y-m-d' ) ) == false )
return $is_holiday;
if ( Date('N') == 6 && date( 'Y-m-d', $ccs ) == date( 'Y-m-d', current_time('timestamp') + 2* 24 * 3600 ) )
return true;
if ( date( 'Y-m-d', $ccs ) == date( 'Y-m-d', current_time('timestamp') + 24 * 3600 ) )
return true;
return $is_holiday;
}
add_filter( 'app_is_holiday', 'set_next_days_as_holiday', 10, 5 );
?>

Thanks, Albert Mullaart