Web Analytics Made Easy -
StatCounter Calendar scheduling script w/ php and mySQL - CodingForum

Announcement

Collapse
No announcement yet.

Calendar scheduling script w/ php and mySQL

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Calendar scheduling script w/ php and mySQL

    I would like to create an online scheduling page for people to schedule meetings. Ideally this would display a calendar with the dates and times available, (which would be populated from a DB).

    I don't have a problem with the scheduling after the calendar is created, the problem I cna't figure out is how to create a DB.

    Right now I have a DB with a tables like such:

    table months(yearID, monthID, monthName, firstDayOfMonth, totalDaysInMonth)

    where firstDayOfMonth is the day of the week that the first day falls on.

    for example, the query "SELECT * FROM months WHERE yearID=2002 and monthID=7" would yield:

    2002, 7, July, 1, 31

    Since 0=Sunday, 1=Monday and so on this tells me that July 2002 starts on a Monday and has 31 days, so from that I can construct a calendar.

    Now, I know there is an easier way to construct a calendar, and I've looked for a perpetual calendar, but can't find any info on how to get the first day of the month based on any algorithm.

    Does anybody have some ideas on an easier way ot accomplish this? Thanks
    Create accessible online surveys -::- Koobten.com - compare netbook prices and reviews -::- Affordable, reliable hosting for less than $20 per year
    Zend Certified Engineer


  • #2
    You should read some tutorials on data modelling then. You should first come up with an ER diagram to develop the schema for your project.
    Spookster
    CodingForum Supreme Overlord
    All Hail Spookster

    Comment


    • #3
      Right, the ER modeling isn't what I'm concerned about at this time. I guess I gave too much info.

      What I'm really looking for is an algorithm to determing the info that I was going to store in the table outlined above.

      I know there is an algorithm for determining the first day of the month in for any month in a given year, I just don't know what it is. Anybody know?


      That way, rather then quering the DB to set up my calendar, I can just plug in the variable into an equation, and spit out the calender where the individual days will query the DB asking for available times.

      Thanks for your help tho.
      Create accessible online surveys -::- Koobten.com - compare netbook prices and reviews -::- Affordable, reliable hosting for less than $20 per year
      Zend Certified Engineer

      Comment


      • #4
        have PHP?

        PHP Code:
        <?
        print ("my birfday is on a " date ("l"mktime(0,0,0,15,08,2002)));
        ?>
        php can also calculate dates in systems other than gregorian, but I am pretty sure that MySQL can do exactly the same for you - maybe take a peek in the manual.
        resistance is...

        MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

        Comment

        Working...
        X