Starting from:

$25

CSIS3280– Lab 10 JPar Solved

Visual Studio Code

1. Download the lab template from Blackboard

2. Extract it

3. Fill in the relevant code to create the solution and meet the requirements

Solution

Based on the Demo Code and the bookorama database. Create a Web application that allows you to add and delete Customers using a web service.

You may use the demo code from Week 12 as reference to this part of the Lab, create the application so the following list of customers is presented and the Delete link works for each Customer. The add form should always be present unless you are editing, in which case the edit form should always be present, and the message should come up as to which customer was added.

Requirements
1.    You must use a database called "Lab10", your username should be 'root' and your password should be '' just like the lab computers.

2.   

 
 


You must populate the 'Lab10' database with the included sql files (sql/bookorama.sql and sql/books-insert.sql)

3.    You must use the PDO class we created based on the template provided.

4.    You must use classes you should not alter the PDO class we have created.

5.    You must list all the customers in the database and provide the provisions to add and delete Customers

6.    By default the Add form should be displayed, if the user clicks on the "Edit" action or link you must allow them to edit the entry they clicked on.

7.    You may only use one controller file.

8.    Your controller file may only call your RestClient. You may not talk directly to the database from your page controller or from your RestClient.

9.    You must configure your lab so the included location of the REST API

(http://localhost/3280/Lab%2010/RestAPI.php) is valid. You may not modify API_URL in config.inc.php.

10.  You must employ a static "Mapper" class to support your CRUD operations. Your Mapper class must use the Customer Class. You may not use any array elements that are not objects.

11.  As you are using a previous template you must pull out any code that is not used such as the BookMapper and the Book class.

Structure
According to the structure this means that your folder should be called "Lab 10".

FileName                                         Description

FileName                                         Description

inc/config.inc.php
Database configuration information
inc/Utilities/PDOAgent.class.php
PDO Wrapper Class
inc/Utilities/Page.class.php
Page Class
inc/Utilities/CustomerMapper.class.php
Static Customer Mapper responsible for CRUD operations
inc/Utilities/RestClient.class.php
Static class that calls the web service
inc/Entities/Customer.class.php
Customer Entity with getters and setters.
Lab10_SWh-56789.php
The controller class for your application, should be used to support All the CRUD operations
The Rest API that receive and respond to HTTP calls and talk to

RestAPI.php the database

Hints:

Use the hidden input type to post hidden data such as the id.

Use the hidden input type to specify which action you are doing.

There are alot of moving parts in this assignment USE XDEBUG it will save you time!

If you do the lab properly you should really only need to modify the Controller file for the page and the class for the Customer, the rest should work without any modification.

Appendix:

Included below are the screenshots from Lab08 because the Lab should be functionally the same Please change the title

1. List



2. Add Form



3. Edit Form

More products