Technologies for Web Applications COMP2020
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
Technologies for Web Applications COMP2020
Web Application Assignment
Due: Sunday 11:59pm 12th of February 2023 – Assessment Weight: 30%
Note:
• Include comments for your student ID, Name, and Practical Class Time at the top of each source file created.
• All instructions given in this document must be followed in order to be eligible for full marks for the Web Application Assignment
• This assignment is not a group assignment; collusion, plagiarism, cheating of any kind will not be tolerated. Submitting your work to your TWA site signifies that the work uploaded is yours. If you cannot honestly certify that the work is your own then do not upload it to your TWA site. Breaches of the Misconduct Rule will be dealt with according to the university policy (see the learning guide for more information)
• All files must be uploaded to your TWA web site before submission due date
• Ensure all HTML written is valid. Use http://validator.w3.org to confirm before submission
Assignment Overview:
For this assignment, you are going to be build a B&B Booking System for a property portfolio. To do this, you are given a list of files that you will need to create. These will be a mix of HTML, CSS, Javascript and PHP files. Within some of your PHP files, you will be required to connect to and execute SQL statements on a database. This database will be given to you and will only be associated with your TWA site.
The concepts or skills within this assignment has been presented in lecture or has been part of a practical class exercises. You will be combining all these concepts and skills to build your basic B&B Booking System.
Design and Styling
For this major web assignment, you must design and style your own site. You can adopt what has been given in your Practical Class exercises or you can start from scratch. Either way, you must design and style your B&B Booking System so it is professional looking. Your chosen design and styling will be assessed.
Javascript and PHP Validation
All forms or where a user can provide input needs to be validated with both Javascript and PHP. HTML validation will not be accepted as a valid form of validation.
Web Application Assignment Database
You have been provided with your own copy of the database called bnb_booking on your TWA site. To access this database, you must use a username and password.
The following is a generic representation of the connection information to be used when connecting to your bnb_booking database (you do this with PHP code):
Database Name: bnb_booking###
Username: twa###
Password: twa###XX
Server: localhost
Where ### is your twa site number, and XX refers to the first two characters of your TWA site password.
For example, if your TWA site is twa999, and your password is abcd7890, then the following would be your connection information:
Database Name: bnb_booking999
Username: twa999
Password: twa999ab
Server: localhost
Using this information, you will use similar code to that below to connect to your database:
$connection = new mysqli('localhost', 'twa999', 'twa999ab', 'bnb_booking999');
if($connection->connect_error) {
// Echo out if it failed to connect to the database
echo $connection->connect_error;
}
Once connected to your database, you will have access to the bnb_booking database and all its data. Figure 1 presents the Entity Relationship Diagram and the schema of your database.
You will can only access your database through your TWA site.
Figure 1
The bnb_booking Database Data Dictionary:
User Table |
|||
Column |
Description |
Type |
Required |
user_id |
This is an auto incrementing number to uniquely identify a table row. You do not insert this number into the database it is determined automatically |
INT |
Yes |
user_email |
This is the email address of the user. It will be used as their login |
VARCHAR(255) |
Yes |
user_password |
This is an encrypted password. The encryption used is sha256. |
VARCHAR(255) |
Yes |
user_fname |
This is the first name of the user |
VARCHAR(45) |
Yes |
user_lname |
This is the last name of the user |
VARCHAR(45) |
Yes |
user_street |
This is the home street of the user, e.g. 4 Silly Street |
VARCHAR(45) |
Yes |
user_suburb |
This is the home suburb of the user, e.g. Parramatta |
VARCHAR(45) |
Yes |
user_state |
This is the home state of the user, e.g. NSW |
VARCHAR(3) |
Yes |
user_postcode |
This is the home post code of the user, e.g. 2000 |
INT |
Yes |
user_type |
This is the type of user they are. There is ‘general’ for general user and ‘admin’ for admin user. ‘general’ is default. |
ENUM(‘general’, ’admin’) |
Yes |
Booking Table |
|||
Column |
Description |
Type |
Required |
booking_id |
This is an auto incrementing number to uniquely identify a table row. You do not insert this number into the database it is determined automatically |
INT |
Yes |
booking_user_id |
This is a foreign key for the user who place the booking. |
INT |
Yes |
booking_property_id |
This is a foreign key for the properter booked. |
INT |
Yes |
booking_start |
This is the start date of the booking reservation. |
DATE |
Yes |
booking_end |
This is the end date of the booking reservation |
DATE |
Yes |
booking_price |
This is the final price of the book. It should include GST, and any other calculations |
DOUBLE |
Yes |
booking_date |
This is the data the booking reservation was made. |
DATE |
Yes |
Property Detail |
2023-02-16