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 4[30 marks]
You are required to combine loops, classes, HTML forms, and MySQL with PDO to
develop a simple to-do 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 to-do list remains accessible even if you
clear your browser history or use the application from a different device.
Requirements:
1. Create a Task class with properties like id, description, and completed (boolean).
9 HSYD300-1- Jul-Dec2024-FA1-RM-V4-27082024
2. Implement methods to get/set these properties.
3. Develop a PHP script (index.php) 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 (e.g., 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.
4. Create an HTML file (index.html) that includes the index.php script and provides
the user interface for the to-do 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 3
methods to get/set Task Class properties 10
10 HSYD300-1- Jul-Dec2024-FA1-RM-V4-27082024
Index.php
5. Connects to the MySQL database using PDO and
prepared statements. (2 marks)
6. Processes the submitted form data:
a. Create a new Task object with the entered
description. (2 marks)
b. Insert the new task into the database using a
prepared statement. (2 marks)
7. Fetches existing tasks from the database and displays
them in a user-friendly format (e.g., table) using a loop.
(2 marks)
8. Allows users to mark a task as completed by providing
a checkbox next to each item. (2 marks)
9. When a checkbox is clicked, update the corresponding
task's completed status in the database using a
prepared statement. (2 marks)
12
Index.html form 5
Mark 3task s completed status in the database using a prepared statement.
Create an HTML file (index.html) that includes the index.php script and provides
the user interface for the to-do 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 (index.html) that includes the index.php script and provides
the user interface for the to-do 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
Question 4 [ 3 0 marks ] You are required to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!