Jump to content

reservation calendar flow


snk

Recommended Posts

hello everybody,

 

i would like to make a calendar that accepts only 5 reservations per day, thus i need to show how many empty slots are left for each day. When somebody picks a day then some info is filled up (and is written to database) and slot is decreased.

 

I am not sure how to start for it.. I was thinking to put just a table in DB including the date.

 

In printing dates function, when i print a date I make a query to the table on date field with sql count function in order to return how many reservations i have.

 

What considers me is if I am doing it properly. because if i have about 200 reservations then 200 x 30 days x 12 months = 7200 queries.

 

Of course if there is any similar script with what I am going to do i would be very pleased to hear about coz Im not going to reinvent the wheel. I have seen some open source scripts with colors and I was thinking to modify them in order to print slots left rather colors.

 

Thank you in advance for any advice and recommendation.

 

 

Link to comment
Share on other sites

Let's say you're viewing an entire month.  You can pull everything you need from the database in 1 query:

 

 <?php
//Assuming September of 2010
SELECT * FROM table WHERE date='2010-09-%'

 

That will give you everything for the month.  Then just use php to sort through it and display it.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.