diff_months: 15

Build a B&B Booking System for a property portfolio

Download Solution Now
Added on: 2023-02-11 11:34:16
Order Code: CLT128065
Question Task Id: 0

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

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.  

Continues next page

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

Hint: Write your HTML, CSS first before you do any Javascript or PHP programming. Using this approach makes it easy to focus on design and allows you to add the programming logic later – it is considerably  easier this way. Plus, if you fail to implement the Javascript or PHP you can still get marks for the HTML and  CSS used to construct the page. 

Navigation 

The site must have a main navigation bar. Where you place this within your page is up to you. Every page  should have this navigation bar. Pages which fail to have a navigation bar will lose marks. The navigation  bar should display the following links: 

  • Home – links to index.php 
  • Properties – links to properties.php 
  • Bookings – links to bookings.php 
    • This should only be present if the user is logged in 
  • My Profile – links to profile.php 
    • This should only be present if the user is logged in 
  • Register – links to register.php 
    • If the user is logged in this link should not be present 
  • Login – links to login.php 
    • If the user is logged in this link should change to ‘Logout’ (logout.php

Style and Design – styles.css 

The styles.css file is your master CSS stylesheet for your site. Although you are allowed embedded and  inline styles, a focus on external styles should be maintained. For maximum marks, your style and design should be responsive. This means it can be viewed both on a mobile screen and a desktop. Use the device  preview available in Google Chrome under Developer Tools.

Javascript – actions.js 

This file is to hold all your javascript required for your pages; all your form validations or actions in  javascript.  

Home page – index.php 

This file is the home page to your site. This page only requires: 

  • A navigation bar 
  • A welcome message 

List Properties – properties.php 

a) This page lists the properties found within the database table property. The listing of the properties can  either be in rows or a grid. Regardless of how the properties are displayed they need to show: The property name 

  • The number of beds 
  • Address 
  • Price per night 
  • Image – images for each properties are found within the image directory of your assignment zip.

b) The page needs to allow the user to search for availability of properties between a date range (start  and end date). If a property is not available for the entered date range the property is either removed  or is marked as unavailable with its next availability shown. If a property is available a user can book  the property by clicking a ‘Book’ button. This book button should take the user to the book.php page. To achieve the availability functionality a post-back must be used. This is where the page posts data  back to itself and uses this data to refine the listing of properties. The data needing to be posted back is  the start and end date. By using these two dates you can compare the start and end dates of properties  to determine their availability.  

c) When the page first loads the initial date range should be the present date and 3 days into the future.  

Book Properties – book.php 

A user must be logged in to see this page, if not they are redirected to login.php 

a) After a user has clicked ‘Book’ on an available property they are taken to this page with the property  ID, start and end date in the URL (GET request) 

b) The details of the property of the chosen property, similar details to what is shown on the properties  page, and the date range selected by the user are to be shown.  

c) A total price calculation of the reservation needs to be made from the booking date range and the  property per night cost. Remember it is nights, not days. For instance, if a user has entered in a date  range of 5 days it would be 4 nights. A calculation of GST also needs to be added to the calculated price  to show a total cost of the booking.  

d) There is to be a confirm booking button which will take the user to php. It would be best to  save the details of the booking in a session to be saved to the database after the checkout is  completed.  

Checkout – checkout.php 

A user must be logged in to see this page, if not they are redirected to login.php 

a) This page will present a form for payment details (part b of this page). Once the payment details have  been validated the booking will be processed. Processing of the booking means the currently logged in  user will have a new booking listed with all details of that booking (property booked) within the  database.  

b) For the payment details the following are required: 

  • Credit Card Name
    • Must be alphabetical characters and single inverted commas only 
  • Credit Card Number 
    • Must be 16 digits long 
  • Expiry Date 
    • Must be greater than current date 
  • CSV Number 
    • Must be 3 digits long 

These details are not to be stored, it is a mock payment form. However, the mock form must be validated  before the order can be processed. 

c) Once processed a thank you message is shown needs to be presented (booking-confirmed.php).  

Booking Confirmation – booking-confirmed.php 

A user must be logged in to see this page, if not they are redirected to login.php 

a) This page should display a thank you message, along with the bookings details to show the user.  

Booking History – Bookings.php 

A user must be logged in to see this page, if not they are redirected to login.php 

This page lists all the bookings placed by the currently logged in user. The page only needs the show  following details for each booking: 

  • The Property 
  • The date the booking was made 
  • The start and end date of booking reservation 
  • The total cost of the booking 

User Profile – profile.php 

A user must be logged in to see this page, if not they are redirected to login.php 

a) This page presents the currently logged in users’ details within a form (except their user id, user type  and password).  

b) If the details have changed the user can update details and click submit/update to perform a postback and save the modified details to the database. This page requires the following validations before the  postback can occur: 

  • Basic form validation so all fields are required 
  • The email address is a valid email address form 
  • Post code must be 4 digits 
  • State must be 3 characters or less (Hint: use a drop down) 

User Registration – register.php 

a) This is the user registration page. When users are registered through this page they become a ‘general’ user type. For this reason, your registration form must not have the user_type field displayed to the  user and insert the value ‘general’ for user type. Also, the user_id field is not to be entered in by the  user. The database automatically populates this field.  

b) To process this form, you are to use a postback to submit the data back to php. Once the form  is valid, a new user is saved to the database, and a new user session is created where you must redirect  the user to the home page (index.php).  

c) When processing the password field, it must be hashed (encrypted). The encryption algorithm to be  used is sha256. The following code outlines how to use the hash function to perform this encryption  algorithm: 

Continues next page

$password "234jkldd"; 

$hashedPassword hash('sha256', $password); // $hashedPassword now contains: 

Technologies for Web Applications COMP2020 

// a5d95f8ebc8d8d592cfe772d33d8833909f526233d9ae12c32ada2bbea6a0bba 

d) This form needs to be validated before submitting. The required validations are: All fields are required  

  • First name and last name must start with a capital letter 
  • The email address must be a valid email address 
  • Post code must be 4 digits only 
  • State must be 3 alphabet characters or less 
  • Password must be 8 characters long and must include at least 1 number [0-9] 

User Login – login.php 

a) This page will hold a login form containing a username (the user’s email) and a password field.  Although there are different types of users, both users can login through the same form. Remember, when checking if a user’s password is valid you will have to encrypt it before you can check if the password is correct. This encryption is the same process found in register.php.

b) A postback must be used to login the user. If all credentials are valid, a user session is created and then  the user is redirected to the home page (index.php). If the credential are invalid, the user is presented  with an error informing them the username and password entered is incorrect.  

There are four users already present in the database: 

  • User 1: 
    • Username: john.smith@example.com 
    • Password: password1 
  • User 2: 
    • Username: sarah.smith@example.com 
    • Password: password2 
  • User 3: 
    • Username: margret@example.com 
    • Password: password3 
  • User 4: 
    • Username: admin@example.com 
    • Password: password4 

Logoff – logoff.php 

This page is not a presentation page. When a user navigates to this page their user session is destroyed.  Everything within should be destroyed. Once destroyed, the user is then redirected to the home page  (index.php)

Get your  COMP2020 Technologies for Web Applications assignment solved by our Web Designing Experts from Exam Question Bank . Our Assignment Writing Experts are efficient to provide a fresh solution to all question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing Style. Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered.

You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turn tin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

  • Uploaded By : Katthy Wills
  • Posted on : February 11th, 2023
  • Downloads : 0
  • Views : 482

Download Solution Now

Can't find what you're looking for?

Whatsapp Tap to ChatGet instant assistance

Choose a Plan

Premium

80 USD
  • All in Gold, plus:
  • 30-minute live one-to-one session with an expert
    • Understanding Marking Rubric
    • Understanding task requirements
    • Structuring & Formatting
    • Referencing & Citing
Most
Popular

Gold

30 50 USD
  • Get the Full Used Solution
    (Solution is already submitted and 100% plagiarised.
    Can only be used for reference purposes)
Save 33%

Silver

20 USD
  • Journals
  • Peer-Reviewed Articles
  • Books
  • Various other Data Sources – ProQuest, Informit, Scopus, Academic Search Complete, EBSCO, Exerpta Medica Database, and more