$29
There are two projects in this assignment. Follow the instructions for each project to complete them. You have been provided with the necessary files to complete these projects.
Project 1: Share Your Travel Photos (PHP Arrays and Superglobals)
Overview
You have been provided with two files: a page that will eventually contain thumbnails for a variety of travel images (list.php) and a page that will eventually display the details of a single travel image (detail.php). Clicking a thumbnail in the first file will take you to the second page where you will be able to see details for that image, as shown in Figure 1.
Instructions
Both pages (list.php and detail.php ) will make use of arrays that are contained within the “include file” travel-data.inc.php. Include this file in both pages (include 'filename';).
Both pages display a list of countries. Replace the hard-coded lists by looping through the $countries array (in travel-data.inc.php) to display a list (in detail.php, the list is contained within the include file left.inc.php). Be sure to first use a PHP sort function. Each country in the list should be a link to list.php with the country name as a query string parameter. Also replace the hard-coded list of continents with a loop as well.
In list.php, replace the existing image list markup with a loop that displays the thumbnail image and link for each of the elements in the $images array (which is provided within travel-data.inc.php). Notice that the links are to detail.php and that they pass the id element as a query string parameter.
After testing list.php to verify it works as expected, add logic to handle the country links. Each link in the country list should be to list.php but with the country name as a query string (e.g., list.php?country=Canada). You will need to filter the images list so that the page displays only those images from the specified country.
In detail.php, retrieve the id passed in the query string, and use it as an index into the $images array. With that index, you can output the relevant title, image (in the images/travel/medium folder), user name, country, city, description, and tags.
Test
Test the pages in the browser. (Remember that you cannot simply open a local PHP page in the browser using its open command. Instead you must have the browser request the page from a server.)
Figure 1 Completed Project 1
Project 2: CRM Admin (PHP and MySQL)
Overview
Demonstrate your ability to retrieve information from a database and display it using PHP and SQL. The results when finished will look similar to that shown in Figure 2.
Instructions
You have been provided with a PHP page (chapter14-project1.php) along with various include files.
You will need to retrieve information from two tables: Employees and EmployeeToDo. You will need to display the first and last name from every record in the Employee table within an unordered list. The data should be sorted by the LastName field.
Each employee name in the list should be a link back to the same page (chapter14-project1.php), but with the EmployeeID field appended via a query string parameter.
When a request is received with a query string, then the page will display additional information within the Employee Details <div. In the Address tab group, display the rest of the employee record information. In the TO DO tab group, display the related records from the EmployeeToDo table for that EmployeeID. Sort the EmployeeToDo data by the DateBy field.
Test
Test the page. Verify that the links work as expected and that the data is correctly sorted.
Submitting your assignment
Put your assignment files and all resources they require in a folder named assign3_yourname (e.g., assign3_johnsmith) and compress them into a zip file. Upload the assign3_yourname.zip file to the Assignment 3 submission folder in the dropbox in elearning.
Your assignment 3 is worth 5% of your total grade.
Figure 2 Completed Project 2