Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 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

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    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
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    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.

  • #4
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,108
    Thanks
    11
    Thanked 101 Times in 99 Posts
    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)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •