Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

URGENT PLS Task 3: Logbook (3-logbook, 10 pts) It is worth making small or large diary-like notes about our tours. In this task, we will

URGENT PLS

Task 3: Logbook (3-logbook, 10 pts)

It is worth making small or large diary-like notes about our tours. In this task, we will create a PHP application in which we can make notes about the stages of the National Blue Trail, when, with whom, what experiences we gathered, and how we rate the tour!

The data must be stored in a file, the storage format is up to you. You may use the Storage class shown in the lectures but it's not mandatory. The track sections are contained in the tracks.json file. We can store our logs in another JSON file. Note: the form does not need to be validated on server side in this task, we assume that it is filled in correctly!

  • a. (1 pt) As a first step, let us prepare to save new logs. There is a link on the index.php page that leads to new.php. Here fill in the drop-down field with the tour section data in the tracks.json file (in the format "Number. From - To")!
  • b. (2 pts) In order to save a log on the new.php page, choose a trail section, enter the date range, write down your experiences, and finally specify the list of people we went with in the multi-line text field separated by commas (don't bother with the checkboxes for now!) and rate the tour! Save the data to a file by clicking the send button! One thing to note is that it is worth storing the hiking fellows separated by commas as an array! The explode function in PHP can be used for this! (Caution! It creates an array with one element for empty text!) After successful saving, direct the page to index.php!
  • c. (1 pt) On the new.php page, generate checkboxes for the hiking fellows who were with us on our previous hikes. Make sure that each name only appears once!
  • d. (1 pt) When saving on the new.php page, take into account that the hiking fellows can come from both the checkboxes or from the text input field!
  • e. (1 pt) We list our tour descriptions on the index.php page, in such a way that the individual descriptions are listed section by section (see the sample given in index.php)!
  • f. (1 pt) On the index.php page, do not list the sections that do not include a tour!
  • g. (1 pt) On the index.php page, the tour descriptions should be links that can be clicked to get to the page displaying the details of the tour. Here, display the data according to the sample given on the log.php page. To display the description, it is worth using the htmlspecialchars and nl2br functions to get rid of sensitive HTML characters and display the multi-line text correctly!
  • h. (1 pt) There should be a link on the log.php page that leads to a page (e.g. edit.php) where we can edit the tour description data! It is worth starting by creating a copy of the new.php page! On this page, as a first step, display the data of the given tour description!
  • i. (1 pt) When saving on the editing page, change the data of the given tour description and go back to the log.php page!

INDEX.PHP
!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Task 3title>
<link rel="stylesheet" href="index.css">
head>
<body>
<h1>Task 3: Logbookh1>
<a href="new.php">Add new log...a>
<h2>1. From1 - To1h2>
<ul>
<li>2023-01-11 - 2023-01-13li>
ul>
<h2>2. From2 - To2h2>
<ul>
<li>2022-04-14 - 2022-04-14li>
<li>2022-04-21 - 2022-04-22li>
ul>
body>
html>

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

Climate And Environmental Database Systems

Authors: Michael Lautenschlager ,Manfred Reinke

1st Edition

1461368332, 978-1461368335

More Books

Students also viewed these Databases questions