Calenar php

:-\ Hi all, its been a long tim since i posted on here. but yet again i need help! my problem is i need to make a laptop booking system where all teachers can see the bookings, but not edit them. the user also must be able to make a booking but there are only 20 laptops so i want to prevent double bookings etc. i have looked at a few but they all involve day bookings and the calendar isnt great. the calendar needs to be broken preferably into hour slots.

any help greatfully recieved.

There are thousands of free calendar code segments on the net for this application.
Most are orientated for day scheduling. One simple way around this is to use a basic calendar
that uses tables. Inside each "day’ cell in the table place a list of hours. Make the list of hours
buttons and post the button when it is clicked. Since you should be using a login system for your
project, you already know who is logged in and you can have the code for the button save the
month, day and hour from the button. The calendar should be saved inside of your database so
that others can pull it out to review who is booked.

Another way is to just list the “booked” hours in the day cell. This would be done with a simple
query to your calendar database. In this way, you would add an area at the bottom of the calendar
for booking. It would be a simple form with drop-downs for the month, day and hour. Once someone
selects the month, only days that have openings would show in the next drop-down, etc…

I think it is much easier to use buttons inside the day cell’s. But, since you have 20 laptops, that could
lead to a lot of buttons. Since I suspect that you are using a first-come/first-serve system, it does not
matter how many laptops you have. You just have to keep track of the laptop number and the hours that
are involved.

Now, this can get a bit tricky, but, if you design your database, it is easier. From what you have said, you
will need the following for the records.
Date for the booking which would be year/month/day/hour
Laptop number (1 to 20)
Well, that’s it, correct? Not too complicated. You can simply create a table in your database called, well,
let’s say “bookings”… In that you have just one row of data for each and every booking. In each row,
you would need the follow data held.
DateTime field for date, user-id for who is booked, laptop number
When booking, you can use buttons for the user to press to select which hour they want to use. The code
would need to save this one record with the above data. In your database, you would have 20 entries for
each hour in the calendar. But, since database’s are accessed quickly this is not an issue.
One problem you would have is how to show the teachers the schedule. Since you have 20 laptops times
24 hours times 30 days, well, that is a lot of data to show a teacher. Perhaps for them to review who is
scheduled, you may want to have buttons for them to drill down to more details as needed. Such as one
button for each hour in the day and if the teacher presses it, it shows who is scheduled for that hour on a
separate display.

Most of how this would work would be dependent on how you want the data to be displayed and how
you were planning on using the data. If the teachers only need to see how many laptops are scheduled
at any one hour, just display the total used. When it reaches 20, the button can be disabled for that one
hour and no user’s can press it. (No over-booking!)

Well, there are several suggestions to get you started. Here is a small code segment I found that shows
how to set up a calendar, but, it is set up for just days. But, it might give you ideas on how to get started
with the general layouts. Let us know once you have something to show us and we can help further.
Good luck… http://www.phpjabbers.com/how-to-make-a-php-calendar-php26.html

Sponsor our Newsletter | Privacy Policy | Terms of Service