Question
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
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 tonew.php
. Here fill in the drop-down field with the tour section data in thetracks.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! Theexplode
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 toindex.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 inindex.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 thelog.php
page. To display the description, it is worth using thehtmlspecialchars
andnl2br
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 thenew.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!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started