PracSet2 Autumn 2021 Technologies for Web Applications 300582 Page 1 of 2 Practical Set 2 Due: 7.00pm Friday 14th May XXXXXXXXXXWeight: 20% Note: • This assessment is not a group assessment;...

1 answer below »
i have attached the files below


PracSet2 Autumn 2021 Technologies for Web Applications 300582 Page 1 of 2 Practical Set 2 Due: 7.00pm Friday 14th May 2021 Weight: 20% Note: • This assessment is not a group assessment; collusion, plagiarism, cheating of any kind is not acceptable. Submitting your work to your TWA site signifies that the work uploaded is yours. If you cannot honestly certify that the work is your own then do not upload it to your TWA site. Breaches of the Misconduct Rule will be dealt with according to the university policy (see the learning guide for more information). • Include code comments for your student ID, Name, and Practical Class Time at the top of each source file created (all html, css, php files) • All files must be uploaded to your TWA web site in the correct location before submission due date. • The submission process: o All files must be uploaded to your TWA web site in the correct location before submission due date. o The submission script must then be used to submit your work after all work is on your TWA website. Failure to use this script will result in a non-submission. o Ensure that you allow sufficient time to complete the entire submission process before the due time. The 7pm cut-off time will be adhered to when determining late penalties. o See Submission Instructions at the bottom of this page for full details. This assessment is an accumulation of weekly practical exercises from week 8 and week 10. Practical Set 2 comprises the following exercises: Exercise Questions Marking Criteria A. Week 8 practical Exercise 2 [2 marks] Exercise 3 [4 marks] Code Functionality/ Correctness 100% B. Week 10 practical Exercise 1 [1.5 marks] Exercise 2 [0 mark] Exercise 3 [1.5 marks] Exercise 4 [4 marks] Exercise 5 [7 marks] All files relating to the above exercises must be uploaded to your TWA web site in the correct folders – see the weekly practical exercise documents for details. Submission Instructions To submit your Practical Set 2 you must do the following by the due date and time specified on page 1 of this document. 1. Upload all your practical files in the correct folders in your TWA web site on the TWA server as instructed in each question 2. Run the submission script located at Autumn 2021 Technologies for Web Applications 300582 Page 2 of 2 http://twaaut.cdms.westernsydney.edu.au/submit/submit.asp

 As part of the submission, you will be prompted for your TWA website username and password. You will then be asked to read the WSU policy on plagiarism and certify that work submitted by you is your own work. This action will be logged in a database for future reference and is deemed to be evidence that you claim that your work is original. Next, you will need to select from a drop down list the Practical Set you are submitting, eg, Prac Set 2, and click the Submit Assessment button. The web page will then display a listing of the files you have submitted along with a receipt number. You should print this page for proof of submission. Referencing Referencing must follow the guidelines given in Section 2.5.2 of the unit Learning Guide. Examples are shown in the FAQ in the TWA vUWS site. Marking Criteria and Standards (Rubric) The marking criteria and standards for Practical Set 2 are found in section 2.5.2 in the Learning Guide (reproduced below) and will be used to assess each question in this Practical Set according to the specific weightings identified above for each question. * As a special case, if a program does not render or execute it is still possible to receive partial marks in this criterion at the markers discretion. This is dependent if there are clear attempts at the logic or what is required of the question or task. CRITERIA Unacceptable Poor Satisfactory Good Excellent Code Functionality and Correctness* (See weighting for each question in table on page 1) Functional item(s) do not execute because of errors; output is correct for less than 25% of marking test cases; no error checking code included as required by question; output is simply dumped to the screen without any semblance of logic or thought – the user would be confused by this output Functional item(s) executes but with some errors or handles some special cases correctly; the functional item(s) contains very minimal error checking code as required by the question; functional items(s) output is correct for at least 25% of marking test cases; output is simple written to the screen without any clear organisation or thought - the user would find it hard to understand Functional item(s) executes without errors and handles some special cases correctly; the functional item(s) contains most error checking code as required by the question; output is correct for at least 50% of marking test cases; output is well organised for some function points and is generally easy for the user to understand Functional item(s) executes without errors and handles most special cases correctly; the functional item(s) contains most error checking code as required by the question; output is correct for at least 75% of marking test cases; output is well organised and is mostly easy for the user to understand Functional item(s) executes without errors and handles all special cases correctly; the functional item(s) contains thorough error checking code as required by the question; output is correct for all marking test cases; output is very well organised and is easy for the user to understand Practical-Week8Exercises Autumn 2021 Technologies for Web Applications 300582 Page 1 of 2 Week 8 Practical Exercises Note: • Exercise 2 and 3 will be assessed as part of the Practical Set 2 submission. • Include HTML comments for your student ID, Name, and Practical Class Time at the top of each source file created. • All files must be uploaded to your TWA web site before submission of Practical Set 2. Objectives: • write php scripts that correctly retrieve form inputs via post and get methods. • write php scripts that correctly retrieve form inputs using the basic ideas of postback. • implement a simple map using the Google Maps API and utilise features such as markers, labels and Info Windows in the map. Suggested Resources: • PHP Manual https://www.php.net/manual/en/index.php • PHP tutorials https://www.w3schools.com/php/ Before you start: 1. Upload the html and php files provided to you (see the zip file) into your TWA web site in the practicals/week8 folder 2. Upload the css file provided to you (see the zip file) into your TWA web site in the practicals/css folder Exercise 1: • This question uses the exercise1.html file to capture some data from the user. When the form submits it will send the data to exercise1.php (see the action attribute in the form) for processing on the server. You will create the exercise1.php file below: o Create a file named exercise1.php in practicals/week8 on your TWA web site. A. Add the following code to exercise1.php: Week 8 Exercise 1

The following information was received from the form:



name =



 B. Test the php script by submitting data from exercise1.html to the php script. You will notice that not all of the input devices from the form are shown in the output of the php page. Fix this by making appropriate modifications to the php file so that all input devices are shown as part of the output. What you should notice by completing this exercise is that it does not matter what type of input device is used on the form (text box, radio button, checkbox, selection list, etc) the method of obtaining the values is the same. Autumn 2021 Technologies for Web Applications 300582 Page 2 of 2 Exercise 2 • This question uses the exercise2.html file to capture some data from the user. When the form submits it will send the data to exercise2.php (see the action attribute in the form) for processing on the server. You will create the exercise2.php file below. • The forms in exercise 1 and 2 are very similar but with some important differences. These include: o the selection list size has been changed to "4" o multiple selections are now enabled in the selection list o the action of the form has been changed to exercise2.php o the form method has been changed • create a file named exercise2.php in practicals/week8 on your TWA web site • copy your solution code from exercise1.php into exercise2.php A. modify exercise2.php to correctly process the form from exercise2.html. Hint: Because of the changes made to the form (in particular, the change to the form method is critical) you will need to modify several aspects of the php script. B. Ensure that your exercise2 script is capable of displaying all of the selections made from the selection list - it won’t without appropriate modifications to both the
Answered 4 days AfterMay 13, 2021

Answer To: PracSet2 Autumn 2021 Technologies for Web Applications 300582 Page 1 of 2 Practical Set 2 Due:...

Sanghamitra answered on May 17 2021
131 Votes
84043/Week10/alltables.php
/**
* Allows one to view all tables and their data in a database
*/
require_once("conn.php");
$sql = "SHOW TABLES";
$tables = $dbConn->query($sql);
$tablesAndTheirData = array();
while($tableName = $tables->fetch_array()) {
    $sql = "SELECT * FROM $ta
bleName[0] limit 100";
    $data = $dbConn->query($sql);
array_push($tablesAndTheirData, array(
'name' => $tableName[0],
'fields' => $data->fetch_fields(),
'data' => $data
));
}
?>



    
    Database Tables





Table


    num_rows):?>
        
            
                
                
                    
                
                
            
            
        fetch_assoc()): ?>
            
                 $value):?>
                    
                
            
        
            
        
name;?>

                    

    
        

Table does not have any data


    
$dbConn->close();
?>


84043/Week10/conn.php
$dbConn = new mysqli("localhost", "TWA_student", "TWA_2021_Autumn", "electrical");
if($dbConn->connect_error) {
die("Failed to connect to database " . $dbConn->connect_error);
}
?>
84043/Week10/Exercise1.php
query($sql)
or die ('Problem with query: ' . $dbConn->error);
?>
Product table
        Product Code        Name         Quantity In Stock        Price
fetch_assoc()) { ?>
                                
close(); ?>

84043/Week10/Exercise3.php
10 ORDER BY quantityInStock asc";
$results = $dbConn->query($sql)
or die ('Problem with query: ' . $dbConn->error);
?>
Products with stock > 10
        Name         Quantity In Stock        Price
fetch_assoc()) { ?>
                        
close(); ?>

84043/Week10/exercise4.html

Quantity in Stock
Please enter the quantity to check against stock levels

Quantity:

84043/Week10/Exercise4.php
".$qty." ORDER BY quantityInStock asc";
$results = $dbConn->query($sql);

if(mysqli_num_rows($results) > 0){
$error='';
}else{
$error ="There are no products that have more than ".$qty." in stock";
}

}else{
$error ="The value entered for the quantity was not a number";

}
?>

Products with stock >
        Name         Quantity In Stock        Price
fetch_assoc()) { ?>
                        
close();

}
?>
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here