partially implemented todo tracker

This commit is contained in:
2025-04-20 17:05:41 -06:00
parent 9e47110758
commit ab30859446
29 changed files with 546 additions and 157 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
require_once 'functions/init.php';
require_once 'functions/functions.php';
require_once 'functions/todo_functions.php';
// UI Components
foreach (glob('components/todo/*.php') as $file)
require_once $file;
include_once 'components/head.php';
if (!isset($_SESSION['role_id'])) {
$redirect = 'todo.php?view=display';
header('Location: user.php?view=login&redirect=' . urlencode($redirect));
}
if (isset($_GET['view']))
$view = $_GET['view'];
else
$view = 'display';
switch ($view) {
case 'display':
$todos = exec_stmt('SELECT * FROM todos WHERE user_id = ? ORDER BY updated_at DESC', 'i', $_SESSION['user_id']);
echo todo_display($todos);
break;
}
include_once 'components/foot.php';