Question: This assumes you have created the practice database, with two tables, customers and orders, and also added customer functionality. Add additional customer order functionality to
This assumes you have created the practice database, with two tables, customers and orders, and also added customer functionality.
Add additional customer order functionality to your project.
After reading instructions, complete required steps.
Create a file called controllerslistorders.php This file should:
Define a function called listorders that retrieves all orders from the orders table and returns them as an array.
Load the viewslistorders.php file and pass the array of orders to it
Create a file called controllersaddorder.php This file should:
Define a function called addorder that retrieves the order data from the POST request and inserts it into the orders table.
Redirect the user to the listorders.php
Create a file called viewslistorders.php This file should:
Loop through the array of orders passed to it and display their information in a table.
Create a file called viewsaddorder.php This file should:
Display a form that allows the user to enter the order information and submit it to the addorder function in the controllersaddorder.php file.
Modify the index.php file to include the new controllers and views for the orders table, similar to the customers table.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
