dongrenzheng1619 2013-12-10 14:33
浏览 40

PHP + CalDav + ICS Room Timeslot算法?

I am currently working on a booking site. I am using PHP Baikal CalDav Server (modified it). The ical file generated by Baikal stores the VCALENDAR (each event) file in a single column as medium blob in mysql, when generating it via Mozilla Thunderbird or iCal. Furthermore my bookings on my site are stored as VCALENDAR file, too.

If I want to check if a room is available, I have to fetch every single VCALENDAR file matching to the room_id and extract information out of VCALENDAR. I don´t know if this operation is too costly. I try to "clean" the database from VCALENDARS are already used and not recurrent.

I have to open the room_id opening hours VCALENDAR -> extract data with Sabre process

For Loop through Exception VCALENDAR -> extract data with Sabre process

For Loop through Baikal VCALENDAR -> extract data with Sabre process

For Loop through Bookings VCALENDAR -> extract data with Sabre process

-> Process All -> Return Result, if room is free in the given time.

Are their any smart algorithms, that check for the room availability in a given timeslot, when having the ics files (opening hours, exceptions, bookings, baikal reservations) ?

Thanks!

  • 写回答

1条回答 默认 最新

  • douchilian1009 2013-12-10 20:58
    关注

    Query SabreDAV directly. It's highly optimized for time-based queries. If you do a calendar-query REPORT HTTP request, and filter for a start and end-time, it will return only events that overlap with that time-range.

    You can even ask it to grab all events in that timerange, and turn it into a VFREEBUSY report, which is basically a simplified VCALENDAR that lists exactly which timeslots are open and not open.

    You can find more information about these reports in the CalDAV specification

    评论

报告相同问题?

悬赏问题

  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器