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
+1 -1
View File
@@ -243,7 +243,7 @@ function delete_account($user_id, $password = null, $verify_password = null)
exec_stmt('DELETE FROM user WHERE user_id = ?', 'i', $user_id);
logout();
} else if ($_SESSION['role_id'] <= 2) {
} else if ($_SESSION['role_id'] <= admin) {
$user = exec_stmt('SELECT user_id, profile_picture FROM user WHERE user_id = ?', 'i', $user_id)->fetch_assoc();
if ($user['user_id'] == 2025) {
+3
View File
@@ -16,6 +16,7 @@ function notify_users($emails, $auther_username, $article_id, $article_title, $e
<p>' . $excerpt . '</p>
';
$client = new PostmarkClient($_ENV['POSTMARK_API_TOKEN']);
$client->sendEmail(
@@ -171,7 +172,9 @@ function check_csv_upload($target)
function pretty_dump($arr)
{
ob_start();
echo '<pre>';
print_r($arr);
echo '</pre>';
return ob_get_clean();
}
+5
View File
@@ -20,6 +20,11 @@ if (!isset($_SESSION['initialized'])) {
unset($_POST['theme']);
}
define('owner', 1);
define('admin', 2);
define('contributor', 3);
define('reader', 4);
// Update the database and cookies to keep the user logged in.
if (isset($_SESSION['user_id'])) {
$conn = get_connection();
+55
View File
@@ -0,0 +1,55 @@
<?php
// class Todo
// {
// private $todo_id;
// private $user_id;
// private $task;
// private $description;
// private $priority;
// private $due_date;
// private $category;
// private $status;
// private $created_at;
// private $update_at;
// private $completed_at;
// private $is_recurring;
// private $recurrence_rule;
// private $reminder_at;
//
// function __construct(
// $todo_id,
// $user_id,
// $task,
// $description,
// $priority,
// $due_date,
// $category,
// $status,
// $created_at,
// $update_at,
// $completed_at,
// $is_recurring,
// $recurrence_rule,
// $reminder_at,
// ) {
// $this->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);
}
+1
View File
@@ -0,0 +1 @@
../vendor