Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question3.html that is given : WAASAAS Frequent Flier Survey - Speak your Brains! function CheckForm(form){ // Code your answer here } WAASAAS Frequent Flier Survey

image text in transcribed

image text in transcribed

image text in transcribed

Question3.html that is given :

WAASAAS Frequent Flier Survey - Speak your Brains!

WAASAAS Frequent Flier Survey

About You

Your Contact Details

Your Flying Preferences

What do you like to do during flights?

What's your favorite thing about our airline?

Survey Submission

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; }
3. The WAASAAS airline (Western Australia and South Australia Air Service) is doing a web-based survey of its frequent fliers from Sydney. The survey form used for this is implemented in Question3.html, which is provided in the root folder of the zip file for this sample quiz. Add the following Java Script functionality to the form: The JavaScript function CheckForm() is to be called upon form submission, but the function is currently empty. Add JavaScript code to the function in order to carry out the following validations: Check that the phone number begins with (02) and then followed by 8 numeric digits Check that the favourite destination text box has been filled in Check that the preferred meal type has been chosen If the inputs are valid, the form should submit. When errors occur in user input the user must be alerted to these errors through appropriate inline messages (not alert boxes). Save Question3.html. 7 Marks 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 orderNumber, orderDate, shippingDate, customerID, firstName, lastName, postcode in ascending order of the orderDate 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. 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

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions