<?php
class Task_model extends CI_Model {

	// Get tasks for a specific user
	public function get_tasks($user_id) {
		$this->db->where('user_id', $user_id);
		$query = $this->db->get('tasks');
		return $query->result();
	}

	// Add a new task
	public function add_task($data) {
		return $this->db->insert('tasks', $data);
	}

	// Update a task
	public function update_task($task_id, $data) {
		$this->db->where('id', $task_id);
		return $this->db->update('tasks', $data);
	}

	// Delete a task
	public function delete_task($task_id) {
		$this->db->where('id', $task_id);
		return $this->db->delete('tasks');
	}
}
?>
