todo_id = $todo_id; // $this->user_id = $user_id; // $this->task = $task; // $this->description = $description; // $this->priority = $priority; // $this->due_date = $due_date; // $this->category = $category; // $this->status = $status; // $this->created_at = $created_at; // $this->update_at = $update_at; // $this->completed_at = $completed_at; // $this->is_recurring = $is_recurring; // $this->recurrence_rule = $recurrence_rule; // $this->reminder_at = $reminder_at; // } // } function change_status($todo_id, $status) { exec_stmt('UPDATE todos SET status = ? WHERE todo_id = ?', 'si', $status, $todo_id); } function create_todo($todo) { exec_stmt('INSERT INTO todos (title, description, priority, due_date, category, status) VALUES (?,?,?,?,?,?)', 'ssssss', $todo['title'], $todo['description'], $todo['priority'], $todo['due_date'], $todo['category'], 'open'); } function update_todo($todo_id, $todo) { exec_stmt('UPDATE todos SET title = ? WHERE todo_id = ?', 'si', $todo['title'], $todo_id); exec_stmt('UPDATE todos SET description = ? WHERE todo_id = ?', 'si', $todo['description'], $todo_id); exec_stmt('UPDATE todos SET priority = ? WHERE todo_id = ?', 'si', $todo['priority'], $todo_id); exec_stmt('UPDATE todos SET due_date = ? WHERE todo_id = ?', 'si', $todo['due_date'], $todo_id); exec_stmt('UPDATE todos SET category = ? WHERE todo_id = ?', 'si', $todo['category'], $todo_id); exec_stmt('UPDATE todos SET status = ? WHERE todo_id = ?', 'si', $todo['status'], $todo_id); }