Question: Question 4 [ 3 0 marks ] You are required to combine loops, classes, HTML forms, and MySQL with PDO to develop a simple to
Question marks
You are required to combine loops, classes, HTML forms, and MySQL with PDO to
develop a simple todo list application to manage your daily tasks. Imagine you're a
busy student juggling classes, assignments, and extracurricular activities. This
application will help you stay organised and on top of your workload.
Application user story:
Users can add new tasks, view existing ones, and mark them as completed. The
application will store everything persistently in a MySQL database using prepared
statements for security. This ensures your todo list remains accessible even if you
clear your browser history or use the application from a different device.
Requirements:
Create a Task class with properties like id description, and completed boolean
HSYD JulDecFARMV
Implement methods to getset these properties.
Develop a PHP script indexphp that performs the following:
a Connects to the MySQL database using PDO and prepared statements.
b Displays an HTML form to capture a new task description. Use appropriate
form elements
c Processes the submitted form data:
i Create a new Task object with the entered description.
ii Insert the new task into the database using a prepared statement.
d Fetches existing tasks from the database and displays them in a userfriendly format eg table using a loop.
e Allows users to mark a task as completed by providing a checkbox next to
each item.
f When a checkbox is clicked, update the corresponding
task's completed status in the database using a prepared statement.
Create an HTML file indexhtml that includes the index.php script and provides
the user interface for the todo list application. The HTML should:
a Embed the form for adding new tasks.
b Display the list of existing tasks retrieved from the database.
c Include checkboxes for marking tasks as completed.
Rubric
Criteria Possible Mark
Task Class
methods to getset Task Class properties
HSYD JulDecFARMV
Index.php
Connects to the MySQL database using PDO and
prepared statements. marks
Processes the submitted form data:
a Create a new Task object with the entered
description. marks
b Insert the new task into the database using a
prepared statement. marks
Fetches existing tasks from the database and displays
them in a userfriendly format eg table using a loop.
marks
Allows users to mark a task as completed by providing
a checkbox next to each item. marks
When a checkbox is clicked, update the corresponding
task's completed status in the database using a
prepared statement. marks
Index.html form
Mark task s completed status in the database using a prepared statement.
Create an HTML file indexhtml that includes the index.php script and provides
the user interface for the todo list application. The HTML should:
a Embed the form for adding new tasks.
b Display the list of existing tasks retrieved from the database.
c Include checkboxes for marking tasks as completed.
Rubrictask's completed status in the database using a prepared statement.
Create an HTML file indexhtml that includes the index.php script and provides
the user interface for the todo list application. The HTML should:
a Embed the form for adding new tasks.
b Display the list of existing tasks retrieved from the database.
c Include checkboxes for marking tasks as completed.
Rubric
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
