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.
1) Create a file called controllers/list_orders.php. This file should:
Define a function called list_orders() that retrieves all orders from the orders table and returns them as an array.
Load the views/list_orders.php file and pass the array of orders to it.
2) Create a file called controllers/add_order.php. This file should:
Define a function called add_order() that retrieves the order data from the POST request and inserts it into the orders table.
Redirect the user to the list_orders.php
3) Create a file called views/list_orders.php. This file should:
Loop through the array of orders passed to it and display their information in a table.
4) Create a file called views/add_order.php. This file should:
Display a form that allows the user to enter the order information and submit it to the add_order() function in the controllers/add_order.php file.
5) Modify the index.php file to include the new controllers and views for the orders table, similar to the customers table.
 This assumes you have created the practice database, with two tables,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!