I am attempting to build a booking system for a air training centre using perl/mysql/cgi.
I have set up three tables in MySQL - Booking,User and Plane. Currently a user to make a booking however when the administrator goes to the booking results page of the site it lists all of the bookings in text format.
The problem is this...I would like to be able to present the administrator with a grid like page which highlights bookings as coloured blocks.
The plan in theory is as follows:
1. Build a HTML table for an average day (use as template).
2. Build a query page to choose a specific date.
3. Drop the date chosen in as the title in the HTML page.
4. Use this date in the SQL Query.
My SQL statement on paper for 1 BLOCK of the grid would be as follows:
SELECT * FROM Booking
WHERE planereg = "Cessna 150"
AND starttime >= "2003-06-03 10:00:00"
and endtime <= "2003-06-03 11:00:00";
However as the date is a variable I don't know how to:
A) Put something like AND startime >= "$DATESELECTED 11:00:00".
Also perhaps a stupid question... how do I go about putting the above statement into a HTML page for example a HTML table?
I was thinking of perhaps an IF statement like IF the record does not exist then do nothing however IF the record does exist change the bgcolor to blue or something?!?
Lots of questions, sorry for being a bit stupid but I am totally new to all of this! Any help is really appreciated!
Si22
I have set up three tables in MySQL - Booking,User and Plane. Currently a user to make a booking however when the administrator goes to the booking results page of the site it lists all of the bookings in text format.
The problem is this...I would like to be able to present the administrator with a grid like page which highlights bookings as coloured blocks.
The plan in theory is as follows:
1. Build a HTML table for an average day (use as template).
2. Build a query page to choose a specific date.
3. Drop the date chosen in as the title in the HTML page.
4. Use this date in the SQL Query.
My SQL statement on paper for 1 BLOCK of the grid would be as follows:
SELECT * FROM Booking
WHERE planereg = "Cessna 150"
AND starttime >= "2003-06-03 10:00:00"
and endtime <= "2003-06-03 11:00:00";
However as the date is a variable I don't know how to:
A) Put something like AND startime >= "$DATESELECTED 11:00:00".
Also perhaps a stupid question... how do I go about putting the above statement into a HTML page for example a HTML table?
I was thinking of perhaps an IF statement like IF the record does not exist then do nothing however IF the record does exist change the bgcolor to blue or something?!?
Lots of questions, sorry for being a bit stupid but I am totally new to all of this! Any help is really appreciated!
Si22