SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Sep 2008
    Posts
    977
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Creating appointments system

    Hello,

    I am creating two appointments systems and I can't seem to get a hang of one aspect for each.

    if there are set times for appointments of 30 mins each, eg 0900, 0930 1230 1400, 1630, need I have a table that contains all possible appointment slots? Just seems a bit excessive when many of them won't actually be booked.

    The second booking system has no set appointment times. You can 'book' for any time between 0930 and 1630 (except 1200 - 1300), and the only restriction is that no more than 50 people are 'in' at the same time.

    If anyone can give me a nudge on either question, it would help me greatly.

    bazz

  2. #2
    SitePoint Guru
    Join Date
    Jan 2007
    Posts
    971
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    if there are set times for appointments of 30 mins each, eg 0900, 0930 1230 1400, 1630, need I have a table that contains all possible appointment slots? Just seems a bit excessive when many of them won't actually be booked.
    On this question. I think it makes more sense to assign a time on the appointment and control the logic of availability with PHP or other language.
    In other words:
    appointment- john doe, 2010-12-50-05 08:00:00, 2010-12-50-05 08:30:00
    Use another query to look for availabilty-
    "SELECT * WHERE start_time>=$start_time AND end_time<=$end_time"
    The selection of an appointment would be controlled through a form which could be dynamically created as needed.

    The second booking system has no set appointment times. You can 'book' for any time between 0930 and 1630 (except 1200 - 1300), and the only restriction is that no more than 50 people are 'in' at the same time.
    Again use a query to validate sign ups:
    "SELECT count(*) WHERE start_time>=$start_time AND end_time<=$end_time"

  3. #3
    SitePoint Guru
    Join Date
    Sep 2008
    Posts
    977
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks.

    I already understood that but, you have jigged my brain and the penny seems finally, to have dropped. I need to store the other constraints in their own table.

    bazz


Bookmarks

Posting Permissions

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