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
https://forums.phpfreaks.com/topic/211635-reservation-calendar-flow/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.