Please note: The yoga course is Sunday to Friday but your holiday is Saturday to Saturday.

45)?$NextYear:$Year; $April23rd=mktime(0,0,1,4,1,$AprilYear2Use);//in fact set to april 1st $April23rd=mktime(0,0,1,3,1,$AprilYear2Use);//in fact set to march 1st if (!$_GET['StartingFromDate']) $StartingFromDate=(time()>$April23rd)?time():$April23rd; if (!$_GET['LookAheadTS']) { $LookAheadTS=strtotime("+ $LookAhead weeks",$StartingFromDate); } else { print '

All prices shown are in ' . CURRENCY_CODE . '.

'; } ?> 0) $DiscountAvailable=true; $DatesnPrices=array(); $SQL="SELECT * FROM Villas WHERE `Show_On_Site` = 'Yes' ORDER BY Ordered"; $vqr=mysql_query($SQL); while( $var=mysql_fetch_array($vqr) ) { print ''; $Villa=$var[id]; //DATES $RSQL=" SELECT SUM(Spaces), Villas.Booking_Date_Description_Above FROM Rooms, Villas WHERE Rooms.Villa='$Villa' AND Villas.id=Rooms.Villa AND Rooms.Staff_Only=0 GROUP BY Rooms.Villa "; $Rqr=mysql_query($RSQL); $Aar=mysql_fetch_array($Rqr); $NoPlaces=$Aar[0];//number of places available in a date range for Selected Villa $SQL=" SELECT Levels.Level AS LLevel, Teachers.Name, Availability.* FROM Availability,Levels,Teachers WHERE Availability.Villa=$Villa AND Levels.id=Availability.Level AND Teachers.id=Availability.Teacher AND Availability.Start_Date>$StartingFromDate AND Availability.Start_Date<$LookAheadTS AND Availability.`Availability` != 'Hidden' ORDER BY Start_Date";//get all dates and details $dqr=mysql_query($SQL); $CoursesAvailable=mysql_num_rows($dqr); if ($CoursesAvailable) { while ($ar=mysql_fetch_array($dqr)) {//cycle dates $useableStart = convertTS( $ar['Start_Date'] ); $useableEnd = convertTS( $ar['End_Date'] ); $Season = season( $useableStart ); $PlacesAvailable=$MaleTotal=$FemaleTotal=$SuppCount=0; $DiscountText=''; list( $TotalBookings, $PlacesAvailable, $FemaleTotal, $MaleTotal, $SuppCount ) = numberGuests( $Villa, $NoPlaces, $ar['Start_Date'], $ar['End_Date'] ); $ThisMonth=date("F Y",$useableStart); $ThisMonthNumber=date("n",$useableStart); if ($ThisMonth!=$LastMonth) { $LastMonth=$ThisMonth; $Dates.="$ThisMonth
"; } else { $LastMonth=$LastMonth; } if ($ar[Start_Date]>$ThisYearDiscountEnd && $DiscountAvailable && $Season=='Summer') $DiscountText='!!'.$DiscountPercentage.'% OFF!!';//display discount $PlacesAvailable=$NoPlaces-$TotalBookings; $Continue=0; print ''; if ($PlacesAvailable>0) { if ($ar['Availability']=='Available') { print ' '; $Continue=1; } } else { print ' '; } print ''; $Date=$ar['Start_Date']; if ($Date && $Date<$ThisYearDiscountEnd) $DiscountAvailable=false; $SQL="SELECT End_Date FROM Availability WHERE Start_Date>=$Date AND Villa=$Villa ORDER BY Start_Date ASC LIMIT 1"; $qr=mysql_query($SQL); while ( $par=mysql_fetch_array($qr) ) { $EndDate=$par['End_Date'];//get end date of last record - ie last week } //ROOMS $SQL=" SELECT * FROM Rooms WHERE Villa='$Villa' AND Rooms.Staff_Only=0 AND 1=$Continue ORDER BY Ordered";//get all rooms for selected villa $rqr=mysql_query($SQL); list( $BookingMonth, $supplementMonth ) = explode( '|', date( 'n|F', $Date ) ); while ($rar=mysql_fetch_array($rqr)) {//cycle rooms $Room=$rar[id]; $FemaleTotal=$MaleTotal=0; $PlacesAvailable=0; $Warning=$URL=''; $Sex=$People=''; $SupplementPercentage = $rar['Supplement_' . $supplementMonth]; $NoRoomPlaces = $rar[Spaces];//places for this room list( $TotalBookings, $PlacesAvailable, $FemaleTotal, $MaleTotal, $SuppCount ) = numberGuests( $Villa, $NoRoomPlaces, $ar['Start_Date'], $ar['End_Date'], $Room ); //calc any extra fees to add on $ExtraAmount=0; $ExtraAmount = accumulatedExtrasNew( $rar['id'], $Date, $Date, CURRENCY_CODE ); $PriceField = ($Season=='Winter')?'Winter_Price_' . CURRENCY_CODE:'Summer_Price_' . CURRENCY_CODE;// > october || < may $RoomPrice = $rar[$PriceField]+$ExtraAmount; $Book=true; if ( $PlacesAvailable > 0 ) {//if places available $Sharing=$PeopleLink=''; if ($PlacesAvailable==1) {//1 place available $People=1; if ($FemaleTotal) {//female booked $Sharing='. FEMALE ONLY '; $Sex='Female'; } if ($MaleTotal) {//male booked $Sharing='. MALE ONLY '; $Sex='Male'; } } $Warning=$PlacesAvailable.' Place(s) Available'.$Sharing; } else {//no places available $Warning = 'FULLY BOOKED'; $Book = false; } print ''; }//while rooms // if ($Continue) print '
'; }//while dates } else {//no courses print '';//no dates available } } ?>
'.$var['Villa_Title'].'
 '.showTS($useableStart - 86400).' - '.showTS($useableEnd + 86400).' ['.$ar[Name].':'.$ar[LLevel].'] '.$DiscountText.'
 '.showTS($useableStart - 86400).' - '.showTS($useableEnd + 86400).' ['.$ar[Name].':'.$ar[LLevel].'] '.$DiscountText.'
  '.$var['Villa_Title'].' [FULLY BOOKED]  
  '.$rar[Room_Title].''; if ($Warning!='') print ' ['.$Warning.']'; if ($DiscountAvailable && $Season=='Summer' && $DiscountPercentage > 0) {//10% off $DiscountPrice=($RoomPrice*($DiscountPercentage/100)); $DiscountPrice=$RoomPrice-$DiscountPrice; print ' ('.prix($RoomPrice ).' '.prix($DiscountPrice).' '; print CURRENCY_CODE . ' per person per '.(($Villa==6)?'day':'week').' '; if ($Villa==3 || $Villa==13) print ' - minimum of two people '; print '!!'.$DiscountPercentage.'% OFF!!)'; } else {//normal price print ' ('.prix($RoomPrice).' ' . CURRENCY_CODE . ' per person per '.(($Villa==6)?'day':'week').''; if ($Villa==3 || $Villa==13) print ' - minimum of two people'; print ')'; } print ''; if ( $ar['Availability']=='Available' && $Book ) { print ' » Book'; } else { print ' '; } print '
'.ucwords($var['Villa_Title']).' FULLY BOOKED!