Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

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

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions