Пример #1
0
function srvc_book_is_blocked($vdate)
{
    $err = impl_book_date_is_locked($vdate);
    return $err;
}
Пример #2
0
function impl_book_query_lock($prev_n, $next_n, &$result_arr)
{
    $begin_day = time() - $prev_n * SEC_PER_DAY;
    for ($k = 0; $k < $prev_n + $next_n; $k++) {
        $blocked_slots = [];
        $blocked_slots_len = 0;
        $cur = $begin_day + $k * SEC_PER_DAY;
        $vdate = date("Ymd", $cur);
        if (impl_book_date_is_locked($vdate)) {
            $blocked_slots[] = "all";
            $blocked_slots_len++;
        }
        for ($cur_hour = OPEN_HOUR_BEGIN; $cur_hour <= OPEN_HOUR_END; $cur_hour += OPEN_HOUR_SLOT) {
            if (impl_book_timeslot_is_locked($vdate, $cur_hour)) {
                $blocked_slots[] = $cur_hour;
                $blocked_slots_len++;
            }
        }
        if ($blocked_slots_len > 0) {
            $result_arr[$vdate] = $blocked_slots;
        }
    }
    return BOOK_CODE_OK;
}