} if ($slots[$i] & 2) { $inoffice = false; } if (!$inoffice) { $slots[$i] |= 4; $prov[$i] = $i; } } } $ckavail = true; // If the requested date is a holiday/closed date we need to alert the user about it and let him choose if he wants to proceed ////// $is_holiday = false; $holidays_controller = new Holidays_Controller(); $holidays = $holidays_controller->get_holidays_by_date_range($sdate, $edate); if (in_array($sdate, $holidays)) { $is_holiday = true; $ckavail = true; } ////// // The cktime parameter is a number of minutes into the starting day of a // tentative appointment that is to be checked. If it is present then we are // being asked to check if this indicated slot is available, and to submit // the opener and go away quietly if it is. If it's not then we have more // work to do. if (isset($_REQUEST['cktime'])) { $cktime = 0 + $_REQUEST['cktime']; $ckindex = (int) ($cktime * 60 / $slotsecs); for ($j = $ckindex; $j < $ckindex + $evslots; ++$j) { if ($slots[$j] >= 4) {