Design an xml document for storing information

Assignment Help PHP Web Programming
Reference no: EM131940449

Assignment Tasks

The assignment is to develop a web-based selling and buying system called ShopOnline. ShopOnline allows sellers to list items for selling and buyers to bid for the items based on the English Auction strategy, which is a popular strategy used in many systems such as eBay, real-estate auction. Five components (registration, login, listing, bidding, and maintenance) of ShopOnline that must be completed for this assignment are specified in the sub-sections below. You may explore further functions such as detailed payment processing, notification service and password changing for fun later. For this assignment, you must use XMLHttpRequest for client/server communications.

Login/Registration

These two components are used to allow an existing customer to login to the system and to allow a new customer to register, respectively. The system maintains an XML document to record customer information. The specific functions include

1) Design and create an XML document (customer.xml) for storing information of all customers. For each customer (regardless a seller or a bidder), you need to keep the system generated customer id, first name, surname, unique email address, and password (generated by the system for this assignment).

2) For an existing customer, the email address and password are expected and checked against the XML document (see Figure 1). If a customer is matched against the information stored in the XML document, the customer information will be remembered by the system for the following sessions (for either bidding or listing) before log-out and current auction items will be shown up (i.e., switch to the bidding page); otherwise, login failure message will be displayed for invalid email address or password.

(Hint: you may use session variable to keep the information about the customer.)

3) For a new customer, the system will check (a) all inputs including first name, surname, email address, password, re-typed password (for double checking) are given (shown in Figure 2), and (b) the email address is unique (i.e., it has not been used by other customers in the customer document). If there is problem with the above checking, the corresponding error message will be displayed; otherwise, the system will generate a customer id before sending the message.

Recipient: the provided <email address> Subject: "Welcome to ShopOnline!"
Message: "Dear <first name>, welcome to use ShopOnline! Your customer id is
<customerID> and the password is <password>." Header: "From [email protected]"
When sending email from php using the mail() function, you should specify an envelope sender who will receive the bounce messages as shown below:
mail($to, $subject, $message, $headers);
The system will also store all the required information for the customer into the XML document. If the XML document does not exist (i.e. when the first customer is registered in the system), create a new one. Finally, the system will show the successful registration information. Similar to login, the customer information will also be remembered by the system for the following sessions (for either bidding or listing) before log-out.

Listing

This component allows a customer (as a seller) who logged in the system to add an item into ShopOnline for selling. The inputs include item name, category, description, reserve price, buy-it-now price, start price (default 0), duration. Once you get these inputs, you need to validate the inputs, generate an item number, and add the item listing information together with the customer id of the seller and other system generated information in another XML document. The specific functions of this component include

1) Design an XML document (auction.xml) for storing information about all listed items. For each listed item, apart from the inputs from the seller, you also need to keep the customer id of the seller, system generated item number, the current system date and time that the item is put up for auction (startDate and startTime), the status (which takes in_progress, sold, and failed as value, and in_progress as the initial value), and the information about the latest bid which include customer id of the bidder and the current bid price (with the start price as initial value).

2) As shown in Figure 3, design the user interface to take a seller's inputs for an item. For category, you are encouraged to use a drop-down list with its item values retrieved from existing categories in auction.xml plus an "other" item allowing the seller to list an item belonging to new categories. However, you may choose to hardcode the drop- down list with a pre-defined list of category values. When the Listing button is pressed, the system will validate the inputs. In particular, the start price must no more than the reserve price and the reserve price must be less than the buy-it-now price.

3) If there is no problem with the inputs, the system will generate an item number, startDate and startTime, and add them together with the customer id of the seller and the seller's inputs to the XML document. If the XML document does not exist (i.e. when the first item is entered in the system), create a new one. We assume that the auction process starts immediately after the item is listed so the status is set to in- progress. The current bid price is also set to the value of the start price. Finally, you need to return the generated item number, start date and start time to the client and display under the inputted data "Thank you! Your item has been listed in ShopOnline. The item number is <itemNumber>, and the bidding starts now: <startTime> on
<startDate>.

Bidding

This component allows a customer (as a bidder) to view all the listed items and to put in a bid. The specific functions of this component include

1) As shown in Figure 4, design the user interface to periodically (say, every 5 seconds) retrieve all items in the XML documents and neatly display them. Instead of displaying duration, startDate and startTime, show the time left. For each item, display the item number, name, category, description (first 30 characters), buy-it-now price, current bid price, and time left. Don't display the reserve price. For each displayed item, if the item has not been sold and the time left is greater than zero, add two buttons: Place Bid and Buy It Now button; otherwise, show either the item has been sold or the time expired.

(Note: if you implement these two buttons under all the displayed items, then the item number is required as part of the inputs. If you choose to implement it like this, a penalty of 2 out of 72 marks will apply)

2) Once the Place Bid button is clicked, a pop-up window will show up to take the new bid price as input, and the bid request with the new bid price, item number and bidder's customer id will be sent for processing. You need to check if the new bid for the item is acceptable (i.e. the new bid price is higher than the current bid price of the item and the item is not sold), and if so, update the item in the XML document with the new bid price and the new bidder's customer id, and send back an acknowledgement "Thank you! Your bid is recorded in ShopOnline." to the customer; otherwise send back a message "Sorry, your bid is not valid." to the customer.

3) Once the Buy It Now button is clicked, the buy-it-now request will be sent for processing with the item number and customer id. You need to update the item in the XML document by changing the current bid price by the buy-it-now price, the bid by the customer id, and setting the status immediately to "sold". Then you send back an acknowledgement "Thank you for purchasing this item." to the customer.

Maintenance

This component allows the broker to process items that are sold or expired before the current date and time, and to report the "sold" and "failed" items. It should only allow system administrators rather than normal customers to use these functions. In this assignment, we do not place this restriction.

1) Design the user interface that has two functions: "Process Auction Items" and "Generate Report".

2) If the "Process Auction Items" button is pressed, the system will check each item with "in_progress" status in the XML document to see if it is expired by calculating the time left (using current date/time, start date/time, and duration). If the time left is zero (or negative), then check the current bid price and reserve price to determine the status of the item ("sold" or "failed") and change the status of the item in the XML document accordingly. Once the processing is finished, display a message to show the process is complete.

3) If the "Generate Report" button is pressed, the system will retrieve all sold or failed items and compute the revenue (assume that you charge 3% of the sold price from each sold item and charge 1% of the reserved price from each failed item) from these items. We also choose to remove these items from the XML file. The list of the sold or failed items (all information about the item except the description) formatted as a table will be displayed. The total number of sold and failed items and the revenue will also be displayed under the table (You will find it easy to implement this function using XSLT).

Note: All Figure are attached in file 

Submission Requirements
You must ensure that all your program files used for the assignment sit in a directory called "Assignment2" (use this name exactly, it is case sensitive and no space between Assignment and 2) under www/htdocs directory within your mercury account. This directory should contain no other files and no other sub-directories. However, your XML documents customer.xml and auction.xml must be placed under www/data directory.

All files required by the assignment description must be submitted as one single ZIP file by using the electronic submission system (ESP). The files should include:
- XHTML files login.htm, register.htm, listing.htm, bidding.htm, and maintenance.htm;
- the XML data file auction.xml with at least 5 test items;
- the JavaScript, PHP, and XSLT files that you use;
- other files that you used;
- readme.doc that includes
o a list of all the files in the system;
o brief instructions on how to use the system.
For each submitted file, we require the minimum comments including student information and the main function for the file. After submission, you are not allowed to change any of the submitted files in the Assignment2 directory and auction.xml on your mercury account; time stamps will be checked.

Attachment:- Assignment.rar

Reference no: EM131940449

Questions Cloud

Describe the business leader development : Describe the business leader's development to become a leader. Describe the business leader's views on leadership. Describe what they've done to grain a strong.
Write analytical essay on Chinese business etiquette : You are to prepare a formal analytical essay of strictly no more than 1500 words on Chinese business etiquette. Develop good research and interpretation skills
The lack of development in many countries : Who or what bears the most responsibility for the lack of development in many countries: the country itself (poor leadership, corruption, etc.).
Determine the unlevered free cash flows of new project : Prepare a financial statement to determine the unlevered free cash flows of new project. What is your analysis and make recommendation regarding new business?
Design an xml document for storing information : Assignment - Web Application Development - Design an XML document for storing information about all listed items. For each listed item
Create a compensation and benefits package : Now that you have considered how to recruit and retain the employees you want in your organization, create a compensation and benefits package using.
Most likely to result in decrease in nominal interest rates : Which of the following would be most likely to result in a decrease in nominal interest rates?
Why is a helping contract important : What does it mean for the client to initiate a request for services? How can the helping professional facilitate this phase of the initial encounter?
What is the market value of the joint venture : Both the cable and mobile phone sectors are inherently oligopolistic in nature, and both Channel Company, What is the market value of the joint venture?

Reviews

len1940449

4/13/2018 3:49:57 AM

2.3.1 UI, auto refresh and display, add two buttons 7 2.3.2 take input, input validation, get item number from UI and bidder id from session, update xml, return information 8 2.3.3 get item number from UI and buyer id from session, update xml 4 2.4.1 UI 2 2.4.2 update xml based on left time and current bid price/reserve price 5 2.4.3 retrieve required items, display in table, calculate/show total number of sold/failed items, calculate revenue, remove items from xml 8 Total 72

len1940449

4/13/2018 3:49:50 AM

Assessment item Marks Minimum comment; readme.doc and quality of code 3 2.1.1 design customer.xml 2 2.1.2 check email/password, keep login information in session, switch to bidding page or show failure information 6 2.1.3 simple input validation, check unique email address, send email, generate customer id, create xml, update xml, keep login information in session 9 2.2.1 design auction xml 3 2.2.2 UI including the drop-down list, input validation 6 2.2.3 generate item number etc., get customer id, initial value setting, create xml, update xml, return information 9

len1940449

4/13/2018 3:49:42 AM

If you use your PC/laptop for the assignment, you must make sure your completed assignment is loaded under your mercury account and works fine. We strongly recommend that you give sufficient time to do so! 4 Marking Scheme Work will be assessed based on quality and presentation. The assignment will be marked out of 72 and will contribute 18% towards assessment of the unit.

len1940449

4/13/2018 3:49:35 AM

All files required by the assignment description must be submitted as one single ZIP file by using the electronic submission system (ESP). The files should include: • XHTML files login.htm, register.htm, listing.htm, bidding.htm, and maintenance.htm; • the XML data file auction.xml with at least 5 test items; • the JavaScript, PHP, and XSLT files that you use; • other files that you used; • readme.doc that includes o a list of all the files in the system; o brief instructions on how to use the system. For each submitted file, we require the minimum comments including student information and the main function for the file. After submission, you are not allowed to change any of the submitted files in the Assignment2 directory and auction.xml on your mercury account; time stamps will be checked. Assignments that fail to follow "submission requirements" will NOT be assessed.

len1940449

4/13/2018 3:49:28 AM

You must ensure that all your program files used for the assignment sit in a directory called “Assignment2” (use this name exactly, it is case sensitive and no space between Assignment and 2) under www/htdocs directory within your mercury account. This directory should contain no other files and no other sub-directories. However, your XML documents customer.xml and auction.xml must be placed under www/data directory.

Write a Review

PHP Web Programming Questions & Answers

  Random integral numbers based on normal distribution

Prepare a system to generate random integral numbers based on normal distribution. Study Data Generator's structure and extend number generation type to activate normal distribution.

  Shopping cart program for web applications class

Shopping Cart program for web applications class. Allows user to browse while keeping track of the items in which they will purchase at the end on the order page link and this will give a final price for all items.

  Create a web site for an apple farm

Create a web site for an apple farm. Create an HTML5 form allowing visitors to create an account with the site. Account details are to be stored in your MySQL database. Information should be stored in a secure way.

  Develop a dynamic website open university

Develop a dynamic website Open University

  Sample website project

This website consists of three sections: a narrative, a storyboard, and a business Website.

  Online banking application

Designing and developing a web applications The company you are working has secured a contract with a local banking group to develop an ONLINE BANKING APPLICATION using PHP and MySQL.

  Design a dynamic database

Design a dynamic database using Mangodb, html , and php.

  Show the accessibility and usability of website

The webpage must have several menus about country Azerbaijan such as "About Azerbaijan" "History" "Geography" "Landscape" and "Accessibility" menu.

  Implement a web application

Implement a web application called CS320Starter, which is similar to the crowd funding platform Kickstarter where people raise funds for their projects.

  Prepare an ajax enabled web form

Prepare an AJAX enabled web form utilising a ListView control that will allow logged-in staff to list, edit, delete, insert magazine details for magazines from a selected magazine category.

  Create a very simple order system as a web application

Create a very simple Order System as a web application.

  Which of the following jsp expressions is valid

A JSP expression can contain any Java expression that evaluates to a String object, Java object, primitive type, primitive type or Java object

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd