Hi,
I have been tasked to create a php reservations system for a game rental system. The system needs to be as simple as it can be in order to understand it.
The problem is that I have no idea where to even start. The requirements of my system are as follows:
[ul][li]The reservations web page should have a form where pupils can fill in the following details:
• their name
• game ID (possible drop down field, populated from my database table??)
• start date of the reservation
• number of days the game will be reserved (this must be a number between 1 and 5).[/li][/ul]
MY THOUGHTS: I’m guessing what I need to do here is have some simple form validation on my fields to ensure that the number of days is between 1 and 5.
[ul][li]The system should check that the game ID entered into the form is valid and then display
the name of the game on the page. The game ID is valid if it matches one of the game IDs
listed in the database table called games.[/li][/ul]
MY THOUGHTS: So the code from 1(above) should be edited so that when a user selects a gameID that would possibly be a drop down field which is populated from the database table and then display the game that has been selected on screen.
[ul][li][b]
The system should check that the game is available for the requested dates of reservation.
If the reservation is for more than one day then all relevant dates need to be checked for
availability. For example, if the start date of the reservation is 21st January 2016 and the
number of days the game will be reserved is 3 then the dates 21st January 2016, 22nd
January 2016 and 23rd January 2016 should be checked for availability.
If the game is not available for one or more of the days requested then an appropriate error
message should be displayed.
[/b][/li][/ul]
MY THOUGHTS: This is where i’m lost… would I have to put some conditions in the system that would show that an individual game cannot be selected on dates that it has been reserved??? Would this form part of my games table in my database???
[ul][li]
The system should calculate and display how much the pupil must pay to rent the game.
To work this out the number of days of the reservation is multiplied by the game’s rental
cost per day.
[/li][/ul]
MY THOUGHTS: I’m guessing that depending on the value entered into the number of days field, I would be mutiplying that by the price of the game rental and then display back a total??
[ul][li]
The reservation details should be saved, providing they are all valid.
[/li][/ul]
MY THOUGHTS: Hmmm this would just be a simply insert statement that would alter the database. Am I write in saying that I would need 3 tables in my database?? customer, games and reservations???
Anyones help would be much appreciated?? thanks for reading.
[/list]