Question: i got below code here together with the Tasks.php code and its working as expected improve the estatics of below images 1 . change colour

i got below code here together with the Tasks.php code and its working as expected
improve the estatics of below images
1. change colour of add task button to be blue
2. Visualise the added task in a table similar to the one in mysql table, e.g change heading Task to Description
3. add backgroud colur to the webpage to be light blue and modern
Create a PHP file named inde tox.php and add the following code:
setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e){
die("Could not connect to the database: ". $e->getMessage());
}
// Handling form submission to add a new task
if ($_SERVER['REQUEST_METHOD']== 'POST' && isset($_POST['task_description'])){
$description = $_POST['task_description'];
$task = new Task($description);
$stmt = $pdo->prepare("INSERT INTO tasks (description) VALUES (:description)");
$stmt->execute(['description'=> $task->getDescription()]);
header("Location: index.php");
exit();
}
// Handling task completion
if (isset($_POST['task_id']) && isset($_POST['completed'])){
$taskId = $_POST['task_id'];
$completed = $_POST['completed']=='1'? true : false;
$stmt = $pdo->prepare("UPDATE tasks SET completed = :completed WHERE id = :id");
$stmt->execute(['completed'=> $completed, 'id'=> $taskId]);
header("Location: index.php");
exit();
}
// Fetching existing tasks
$stmt = $pdo->query("SELECT * FROM tasks");
$tasks = $stmt->fetchAll(PDO::FETCH_ASSOC);
?>
To-Do List
i got below code here together with the Tasks.php

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!