PHP日历循环逻辑 [英] PHP Calendar Recurrence Logic
问题描述
在答案开始之前(我知道他们会),我知道有一百万个项目,已经做到了这一点。说过我想要做的是创建一个在线日历 - 使用PHP& MySQL这里是我计划的...
((calendar_item)
id,title,start_date,start time,end time,recurrence_type_id,
recurrence_qty,interval,end_date)
id,name,value(我想存储逻辑,所以它可以编辑
)
((calendar_item_exception)
id,calendar_item_id,title ,start_date,开始时间,结束时间,
recurrence_type_id,recurrence_qty,interval,end_date)
((join_calendar_day)
calendar_id,day_id)
,name)
基本流程,从数据库中取出所有记录INNER JOIN calendar_item and calendar_item_exception ON id / calendar_item_id
通过查看今天的异常日期开始,并打印任何内容...如果没有移动到calendar_item
/ li>这一切在我的头上都是完全正确的,直到这一点
有一个我喜欢的术语,它是模糊逻辑,我几乎居住在这里---
如果任何人都可以帮助我,知道从哪里去添加recurrence_id的实际逻辑,以及如何实现it ...
ie item is on __date recurs(recurrence_id)daily(qty)5x(interval)每3天(join_calendar_day)周一,周三,周五
我已经看到了ical格式,并看着梨,但老实说,不能抓住我的头中的下一步,以使异常(我真的想看到发生没有使用另一个框架...最好只是PHP& ; MySQL)
并且为了进一步澄清我的问题,我正在寻找真实世界的例子,而不是抽象原则我是一个视觉设计师和音乐家第一不是程序员,看一些工作,所以我可以禁止它来理解它
没有梨,没有红宝石,没有部落,没有其他框架...只是PHP& Mysql尽可能简单请
如果你能帮助...谢谢你!
这是以下问题的重复:
这些问题之间的良好链接是这篇文章由Martin Fowler介绍。
Before the answers start coming (which I know they will) I know that there are a million projects out there that have done this already. Having said that what I am trying to do is create an online calendar - using PHP & MySQL here is what I am planning ...
tables in database
((calendar_item) id, title, start_date, start time, end time, recurrence_type_id, recurrence_qty, interval, end_date) ((recurrence_type) id, name, value (where I want to store the logic so it can be edited on the fly)) ((calendar_item_exception) id, calendar_item_id, title, start_date, start time, end time, recurrence_type_id, recurrence_qty, interval, end_date) ((join_calendar_day) calendar_id, day_id) ((day) id, name)
Basic flow, pull all records from the database INNER JOIN calendar_item and calendar_item_exception ON id/calendar_item_id
begin by looking at today's date for an exception and print anything that's there... if nothing move on to the calendar_item
This all makes perfect sense in my head up until this point There is a term I like and it is "Fuzzy Logic", pretty much where I live so---
IF Anyone can help me, know where to go from here to add the actual logic for the recurrence_id and how to implement it... ie item is on __date recurs (recurrence_id) daily (qty) 5x (interval) every 3 days (join_calendar_day) on Monday, Wednesday, Friday
I have seen the ical format, and have looked at pear, but honestly can't grasp the next step in my head to make the exceptions (which I really want to see happen without using another framework... preferrably just PHP & MySQL)
and to clarify my question further, I am looking for real world examples, not abstract principles I am a visual designer and musician first not programmer, so I have to see something working so I can disect it to understand it
NO Pear, NO Ruby, NO Horde, NO Other frameworks... just PHP & Mysql as simple as possible please
If You can help ... THANK YOU!!!
This is a duplicate of these questions:
- Design question: How would you design a recurring event system?
- What’s the best way to model recurring events in a calendar application?
A good link from one of those questions is this article about it by Martin Fowler.
这篇关于PHP日历循环逻辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!