CSCI 466 Assignment 9 (Spring 2022) 1 of 1
CSCI 466 Assignment 9 (Spring 2022)
PHP w/ Forms – Parts/Suppliers (100 pts)
Introduction
For this assignment, you will be developing PHP/PDO code for a page or set of pages that fulfill(s) the requirements found below.
Using your personal database on the MariaDB server (the one that has your zid as its name), create the tables from the SQL SELECT slides (S, SP, P) and make sure they contain the data in the rows shown in the slides (before adding the extra rows later). None of the columns should be allowed to be NULL. Data types are not specified in the tables from the slides, so feel free to choose any that would work to store the data shown.
Requirements
1 There must be a way to show all of the suppliers and their details. Show them neatly in a table. (10 pts)
2 There must be a way to show all of the parts and their details. (10 pts)
3 There must be a form that allows a user to select a part and see everyone who supplies that part, along with how many of that part they have available. The other information on the part chosen should be shown as well. (20 pts)
4 There must be a form that allows a user to select a supplier and display a list of all of the parts they supply and how many of each they have. Information on the supplier chosen should also be displayed. (15 pts)
5 There must be a way to select a part and a supplier and “buy” some number of parts from them, reducing the quantity they have left to supply by the amount “bought”. (Don’t worry about tracking the purchases, just adjust the quantity appropriately.) (15 pts)
6 There must be a form that allows a user to add a new part to the database. (15 pts)
7 There must be a form that allows a user to choose a supplier and a part, specifying an appropriate quantity, and put the information into the database that indicates that the chosen supplier supplies that many of the chosen part. (15 pts)
Important Notes
▶ You will have a fair amount of leeway on the design of the page. The functionality is the most important part, but it should be obvious how your pages work while the TAs are grading. The portions that fulfill the requirements should stand out.
▶ You are required to use prepared statements for any queries that will contain data that comes from the user.
▶ Note: Do not forget that PHP code only runs ON THE SERVER when the page is requested. Additionally, the files con-taining your code must have an extension of .php or the code will not be run.
▶ Another Note: You will need to display the form to the user before you can do anything with the form’s results, which, for obvious reasons, come from submitting the form.
What to turn in?
Submit, through Blackboard, the following:
▶ The PHP file(s) that implement your pages. If you have more than one, name them in a way that makes the purpose of each file clear. (Their names should match the ones that make it work on the server, whose names must follow this requirement).
▶ An SQL script file, suitable for running with \. in the MariaDB client, that creates the required tables and populates them with data.
▶ A link to that same PHP file, hosted on the NIU webserver. Place it in the appropriate place in your public_html directory and provide the URL to it in the comments of the Blackboard submission page.
IMPORTANT: DO NOT DELETE THE PHP FILES FROM THE SERVER UNTIL AFTER YOUR ASSIGNMENT HAS BEEN GRADED. IF ANY OF THEM ARE MISSING WHEN THE TA CHECKS FOR THEM, YOU WILL RECEIVE A ZERO.