Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question4.html that is given : Quiz Question 4 Form Orders by Postcode Enter a postcode and then select whether you want to view orders that

image text in transcribed

image text in transcribed

Question4.html that is given :

Quiz Question 4 Form

Orders by Postcode

Enter a postcode and then select whether you want to view orders that have been shipped or not shipped:

orders for this postcode

For testing purposes here are the current postcodes:

  • 2322
  • 3001
  • 1345
  • 2222
  • 2732
  • 2771
  • 2560
  • 6234
  • 1023
  • 5345
  • 4035

styles.css that is given :

body { margin:0; padding:0; font-family: Arial; font-size:1em; background-color:#ffffff; color:#000000; } form { margin:20px; } input[type="text"], select { width:250px; padding:3px; font-size:1em; } input[type="submit"] { padding:3px; font-size:1em; } label { display:inline-block; width:150px; }
4. Question4.html which contains the form to be used for this question can be found in the root folder of the zip file for this sample quiz. This form allows the user to select which orders are to be listed from a MySQL database. - do not modify this html file in anyway. Create Question4.php page (which is the action for the form) so that it does the following: Connects to the MySQL database called warehouse (the connection details are given on the following page). Retrieves from the warehouse database, and displays in a table, the order Number, orderDate, shippingDate, customerID, firstName, lastName, postcode in ascending order of the order Date for all orders that meet the criteria as entered by the user on the form. Eg, if the user selects Shipped in the selection list then all orders that have been shipped for the postcode indicated by the value in the text box must be shown. If the user selects Not-shipped in the selection list then all orders that have not been shipped for the postcode indicated by the value in the text box must be shown. Page 2 of 3 Sample Quiz 300582 To simplify your coding, validations are not required on user inputs. However, you should sanitize user input by calling the escape_string() function if an SQL injection attack is possible through that user input. Only display the output table if there are orders which meet the criteria indicated in the form by the user, otherwise display the message: No orders were found that match your criteria. Save Question4.php. The following database description applies to question 4. The two database tables relevant for this question are the customer and orders tables. The relevant fields, including data types, are shown below. Relevant database connection information is also shown below. Database Connection Information Type of database Name of database Location of database MySQL warehouse localhost warehouse Database (only tables relevant to this question are shown) Username to connect TWA_student Password to connect TWA_2018_Autumn Table name: customer (This table provides details about customers that have placed orders) Field Type (size) Description customerID int Unique customer identifier firstName varchar(30) Customer's first name. lastName varchar(30) Customer's last name. address varchar(150) Customer's residential address. suburb varchar(25) Customer's suburb of residence. state varchar(3) Customer's state of residence. postcode int Customer's postcode of residence. Table name: orders (This table gives details of all orders placed by each customer) Field Type (size) Description orderNumber varchar(7) Unique identifier for an order customerID int Customer id of customer that placed this order orderDate datetime The date the order was placed by the customer shipped char(1) An indicator for whether the order has been shipped to the customer. Possible values are Y or N shippingDate datetime The date the order was shipped to the customer (if it has been shipped). If the order has not been shipped then this field is empty. staffID int The staff id for the staff member that shipped the order to the customer

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL Crash Course A Hands On Introduction To Database Development

Authors: Rick Silva

1st Edition

1718503008, 978-1718503007

More Books

Students also viewed these Databases questions