SOEN287 Web Programming Programming Assignment 4 - 41750

Solution Posted by
jordanblink

jordanblink

Rating : (19)A+
Solution Detail
Price: $70.00
Request Description

SOEN287 Web Programming

Programming Assignment 4

 

 

Content: XML, Ajax tying in with PHP

Objectives: To obtain a solid understanding of more advanced web programming concepts that are increasingly more important in today’s professional world.

Coverage: Using Ajax and XML to create more dynamic web pages.

Note that your files must be validated correctly in order to receive full credit. XHTML 1.0 Strict is expected (unless otherwise specified by the exercises). Only use PHP as the server-side language.

Exercise 1 – XML Pages

For each of the following, create a new XML file and design a suitable XML structure. Populate each XML file with at least five records. The XML that you design here will be used to build a functional application in the exercises that follow. No need of DTD or XML schema.

i)        Design an XML that emulates a typical university library. The XML must be suitable for storing information related to books only. Each book should have the following properties: ISBN, author, title, book edition.

 

ii)      Students must have registered accounts with the library before being allowed to take out books. Design an XML that stores information on Students. Information for each should at least include: student ID, full name, phone number, password, and email. Furthermore, the XML should include circulation information for each registered account: How many books have been taken out, ISBN of each book, when were they taken out and when are they due to be returned.

 

Exercise 2 – Validation with Ajax

Answer any ONE of the following (Part 1 OR Part 2):

Part 1
Create an XHTML page that includes a form used to create a Student Library account. The form should include the following fields:

Student ID à must be exactly 7 characters in length and numeric and must not be left blank.

Full Name à Must not be blank.

Phone Number àMust be in the format of 555.555.5555. May not be left blank.

Email àMust have a correct email format such as skywalker@gmail.com. May not be left blank.

At the server side, you use the XML file created in Exercise (ii) to record the student information. After the student ID is entered (as soon as the text field loses focus, and the validation is successful), use Ajax to check if the student ID exists in the server side records. If it exists, the rest of the text fields are filled with the information in the XML file. The user can continue to edit the text fields. If the student ID does not exist, insert “New record” after the student ID text field. The user can continue to edit the text fields.

After the “submission” button is clicked, use JavaScript to validate all inputs. If validation is successful, a new record is created in the server side XML file (if the student ID does not exist), or the old record is updated (if the student ID exists). If it is a new record, generate a 4 digit password and store it in the new record. Display the full student account information in the next page, including all the student info, password, and the books borrowed.

Part 2
Create a XHTML page that includes a form used to create an entry for a new book. The form must use Ajax to validate and should include at least the following fields:

ISBNà must be exactly 12 characters in length and numeric and must not be left blank.

Book Title à Must not be blank.

Author à Must not be left blank.

Book Edition à Must be numeric and non-blank.

At the server side, you use the XML file created in Exercise (i) to record the book information. After ISBN is entered (as soon as the text field loses focus, and the validation is successful), use Ajax to check if ISBN exists in the server side records. If it exists, the rest of the text fields are filled with the information in the XML file. The user can continue to edit the text fields. If ISBN does not exist, insert “New record” after the ISBN text field. The user can continue to edit the text fields.

After the “submission” button is clicked, use JavaScript to validate all inputs. If validation is successful, a new record is created in the server side XML file (if ISBN does not exist), or the old record is updated (if ISBN exists). Display the entire book record in the next page.

Exercise 3 – Project

The last exercise of each assignment will be continuous from assignment to assignment and will

have the goal of building an e-store website by the end of the course.

 

Remove from Cart

On the cart page (cart.php), it should be possible for a logged in user to remove items from the cart. When an item is removed from the cart, the overall price listed should update accordingly.

 

Change Quantity in Cart

Your page must also be modified so that a logged in user can change the quantity of an item using a text-field associated with each item already in the shopping cart. When any of these text-fields losses focus, a JavaScript function should be called to verify that a whole number (positive integer) was entered. If invalid data was entered, the user should be notified in a form of an alert box. If the quantity value is correct, the overall price should be updated accordingly to reflect the quantity change.

 

Checkout

When the “checkout” button is clicked, a printer friendly receipt / invoice should be created on a new page (receipt.php). This page should include minimal CSS, and list all of what the user purchased along with an overall price.


Submission Criteria

 

Your submission must include a README.txt file that includes the following information:

·         Students Full Name

·         Students ID

·         Difficulties (outlining difficulties will help the TA’s focus on repairing weaknesses)

·         Additional comments (anything deemed important for marking purposes)

 

All files relating to each Exercise must be placed in its own folder named EX-# where # is the number corresponding to the exercise. All the exercise folders must then be placed into a single assignment folder named: studentID-assignment4

 

The assignment folder must be compressed into a zip file and submitted through the course website on Moodle (accessible through your www.myconcordia.ca portal).

 

Please note that the markers reserve the right to deduct marks if the submission format is not followed as specified.

 

Late submissions are subject to a penalty of 20% / day. Assignments submitted after the solutions are posted will receive a mark of 0.

 

 

 

Solution Description

SOEN287

Attachments
9699155-assignment3.zip
9699155-assignm...