Added: favicon, Dashboard, Habits list, some styles, dashboard redirect

This commit is contained in:
2024-12-27 02:06:32 +01:00
parent d33d233f0f
commit 2847231376
17 changed files with 266 additions and 45 deletions

View File

@ -29,4 +29,18 @@ class Habit {
return false;
}
}
public function getHabitsByUser($userId) {
$stmt = $this->db->prepare("SELECT id, title, frequency, custom_frequency, reward_points, created_at FROM habits WHERE user_id = ?");
$stmt->bind_param("i", $userId);
$stmt->execute();
$result = $stmt->get_result();
$habits = [];
while ($row = $result->fetch_assoc()) {
$habits[] = $row;
}
return $habits;
}
}