You are required to build a mysql database driven xhtml and


Assignment Overview

In this first assignment, you will build skills in both client and server side web development, particularly in the essential areas of form processing, form validation and database interaction.

You are required to build a MySQL database driven XHTML and PHP website to manage online booking for free concerts. People who wish to attend a concert (known as "attendees") can register on the website and make bookings, and the administrators of the website can log into the website to manage the details of the concerts.

This assignment forms the basis for assignment two, in which you will add new features to the system and apply more in-depth business rules.

Public Section of the Website

People who visit the website without being logged in can only access the following:

• A registration page, where people can register an attendee account

• An attendee login form, containing a text field for a mobile number, a password field for a password and a submit button

• A list of upcoming concertsoOnly concerts that have not yet happened should appear in the list oOrder the list by the concert dates

• An admin login form, containing a text field for a username, a password field for a password and a submit button

These things do NOT all need to be on the same page. You are welcome to design all sections of the website however you like, as long as the functionality is implemented.

Attendee Registration

Before a user can log in as an attendee, they must fill out the registration form to register an account. The registration form must include the following fields:
• First name and surname
• Gender
• Date of Birth (in YYYY-MM-DD format)
• Mobile phone number
• Password (and a password confirmation field)

All fields are required, and the form should be validated using BOTH JavaScript and PHP - make the validation as strong as possible, checking for things such as blank fields, a numeric mobile phone number and a correctly formatted date of birth.

Be sure to adhere to the date of birth format specified and use the "DATE" data type to store it in the database. If the date of birth is appearing as "0000-00-00" in the database when an attendee registers, then the insert query is not providing the date in an appropriate format.

When the form is validated successfully, the details should be inserted as a row in an "attendees" table in the database. Attendees can then log in to the website via the attendee login form using their mobile phone number and password. For this reason, your PHP validation will need to check that the mobile phone number supplied in the registration form has not already been used by another attendee.

Attendee Section of the Website

The page that attendees are taken to after logging in must contain the following:

• Their name, e.g. "Welcome, Joe Bloggs" or "You are logged in as Joe Bloggs"

• A link to log out

• A list of upcoming concertsoOnly concerts that have not yet happened should appear in the list oOrder the list by the concert dates oBeside each concert there should be a link for the attendee to make a booking

• A list of the upcoming concerts that they have bookings foroOnly concerts that have not yet happened should appear in the list oOrder the list by the concert dates oBeside each booking there should be a link for the attendee to cancel their booking oIf the attendee has no bookings, display a "You have no bookings." message

Each attendee can only have one booking for each concert. An error message should be shown if they try to book for a concert they already have a booking for. You can also ensure that the "Book" link does not appear next to concerts that they already have a booking for.

The details of concerts that the attendee has made bookings for should appear in their list of bookings. Clicking the "Cancel" link next to a booking deletes the appropriate row in the "bookings" table in the database.

Use sessions to ensure that the attendee functionality works properly:

1. When an attendee logs in, store their mobile phone number as a session variable

2. Check that the attendee mobile number session variable exists and is not empty in order to allow access to pages and functionality that require an attendee to be logged in

3. Use the session variable when adding and cancelling bookings 4.Destroy the session when the logout link is clicked

Admin Section of Website

The details of the website administrators are also stored in the database, in an "admins" table. You do not need to create a registration form for admins - simply add a few of them directly into the database. The only details that need to be stored about admins are their username and password.

Admins log in to the website with their username and password using the admin login form. Once logged in, they are taken to an admin-only section of the website that must contain the following:

• A link to log out

• The ability to manage bands. This involves:
o Viewing a list of the bands that are currently in the database oAdding new bands to the database oEditing the details of bands in the database oDeleting existing bands from the database

• The ability to manage venues. This involves:
o Viewing a list of the venues that are currently in the database oAdding new venues to the database oEditing the details of venues in the database oDeleting existing venues from the database

• The ability to add concertsoTo add a concert, a band and a venue must be selected from dynamically-generated drop down lists, and a date and time must be specified

o In this assignment, admins do NOT need to be able to edit or delete concerts oAdmins should also be able to view all concerts that have been added, even those which have already occurred

Before any concerts can be added, bands and venues must be added to the database. These are stored in two very simple database tables:

• A "bands" table, consisting of a "band_id" column and a "band_name" column

• A "venues" table, consisting of a "venue_id" column and a "venue_name" column

Admins must be able to view lists of existing bands and venues, add new ones, edit the names of existing ones, and delete them.

When a concert is added, a new row is inserted into a "concerts" table in the database, containing the id number of the band, the id number of the venue, the date and the time.

Use sessions to ensure that access to the admin pages and functionality is controlled:
1. When an admin logs in, store their username as a session variable
2. Check that the admin username session variable exists and is not empty in order to allow access to pages and functionality that require an admin to be logged in 3.Destroy the session when the logout link is clicked

Business Rules
Within the website, there are a number of business rules that must be adhered to. These are all common sense rules that ensure that the website runs smoothly and effectively.
• Band and venue names must be unique (e.g. cannot have two bands with the same name)
• Admins cannot delete bands that are linked to any concerts (upcoming or in the past)
• Admins cannot delete venues that are linked to any concerts (upcoming or in the past)
• Admins must confirm their action when they try to delete a band or venue

Website Structure & Functionality Summary

As detailed, the website contains a public section, an attendee section and an admin section. The attendee-only and admin-only pages and functionality must be restricted to only allow access to the appropriately logged in users. Ensure that your website provides convenient, consistent and logical options to navigate from page to page.

Database Structure

The MySQL database storing the data must be a well-structured and efficient. A suggested structure is presented below. If you wish to deviate from this structure, please discuss it with your tutor.

It is recommended that you use auto-incrementing integersas primary keys for the "bookings", "concerts", "bands" and "venues" tables. Mobile phone numbers are an appropriate primary key for attendees, and usernames are an appropriate primary key for admins.

Consider the following sample content if you are having difficulty understanding how data is stored in a database. Primary key columns have been given a grey background.

You are free to invent bands and venues, or use the names of ones you like. Make sure that you include at least 3 bands and 3 venues. Make sure that you include at least 5 concerts, and that at least one of them has a date which is in the past (i.e. the concert has already occurred). Once your assignment is complete, re-read the assignment brief to make sure you have implemented everything that is asked for. Then, zip/rar both the web folder containing your code files and the folder containing your database together into a single file that includes your name and student id in the file name. Also include a text file named "readme.txt", containing the login details for at least one attendee and one admin. Upload the zipped assignment to the Blackboard assignment submission area on or before the assignment due date and time.

Request for Solution File

Ask an Expert for Answer!!
PHP Web Programming: You are required to build a mysql database driven xhtml and
Reference No:- TGS01229414

Expected delivery within 24 Hours