' . update_profile_picture_form() . '
- if ((isset($_SESSION['user_id']) && $_SESSION['user_id'] == $user_id) || (isset($_SESSION['role_id']) && $_SESSION['role_id'] <= 2)) {
+ if ((isset($_SESSION['user_id']) && $_SESSION['user_id'] == $user_id) || (isset($_SESSION['role_id']) && $_SESSION['role_id'] <= admin)) {
$view .= '
diff --git a/css/base.css b/css/base.css
index 2624d23..5a7ed45 100644
--- a/css/base.css
+++ b/css/base.css
@@ -19,6 +19,7 @@ h2,
h3,
h4,
h5,
+h6,
p,
small,
label,
@@ -61,6 +62,11 @@ h5 a {
font-size: 1.5vw;
}
+h6,
+h6 a {
+ font-size: 1.25vw;
+}
+
p,
a,
label,
@@ -167,32 +173,17 @@ code {
margin-bottom: 5px;
}
-.row_no_margin {
- display: flex;
- justify-content: space-between;
- width: 100%;
- margin: 0;
-}
-
-.row {
- display: flex;
- justify-content: space-between;
- align-items: center;
- width: 100%;
- margin: 15px 0px 15px 0px;
-}
-
.center-h {
margin: 0 auto;
}
-.article_filters form .row_no_margin {
+.article_filters form .row_space_between {
display: flex;
align-items: center;
margin-top: 25px;
}
-.article_filters form .row_no_margin p {
+.article_filters form .row_space_between p {
margin-bottom: 0;
padding-bottom: 0;
}
@@ -755,8 +746,62 @@ hr {
margin-bottom: 5px;
}
-.margin_right {
- margin-right: 15px;
+.todo_display {
+ margin: 0 auto;
+ margin-top: 25px;
+ width: 80%;
+ height: 80vh;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.todo_actions {
+ padding: 15px;
+ border: 2px solid white;
+ border-radius: 8px;
+ width: 100%;
+ box-sizing: border-box;
+ margin-bottom: 25px;
+}
+
+.todo_actions form {
+ width: 100%;
+ display: flex;
+ flex-direction: row;
+ justify-content: space-evenly;
+}
+
+.todo_category_window {
+ display: flex;
+ flex-direction: row;
+ width: 100%;
+ height: 100%;
+ overflow-x: scroll;
+ overflow-y: none;
+}
+
+.todo_category {
+ display: block;
+ min-width: 400px;
+ margin-right: 50px;
+ overflow-y: scroll;
+ overflow-x: none;
+}
+
+.todo_category h4 {
+ text-align: center;
+ position: relative;
+}
+
+.todo_list {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.todo_item {
+ width: 100%;
}
@media screen and (max-width: 992px) {
@@ -788,6 +833,11 @@ hr {
font-size: 3vw;
}
+ h6,
+ h6 a {
+ font-size: 2.5vw;
+ }
+
p,
a,
label,
@@ -827,7 +877,7 @@ hr {
flex-direction: row-reverse;
}
- nav .row_no_margin {
+ nav .row_space_between .no_margin {
flex-direction: row-reverse;
}
diff --git a/css/rewrite.css b/css/rewrite.css
new file mode 100644
index 0000000..16fff8f
--- /dev/null
+++ b/css/rewrite.css
@@ -0,0 +1,95 @@
+/********** Borders & Outlines **********/
+.std_border,
+.med_border,
+.sm_border {
+ border-radius: 9px;
+}
+
+.std_border {
+ border: 3px solid white;
+}
+
+.med_border {
+ border: 2px solid white;
+}
+
+.sm_border {
+ border: 1px solid white;
+}
+
+.debug {
+ border: 1px solid red;
+}
+
+/********** Rows & Columns **********/
+.row {
+ display: flex;
+ flex-direction: row;
+}
+
+.row_space_between {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ width: 100%;
+ margin: 15px 0px 15px 0px;
+}
+
+.column {
+ display: flex;
+ flex-direction: column;
+}
+
+.center {
+ align-items: center;
+ justify-content: center;
+}
+
+/********** Margins & Padding **********/
+.margin {
+ margin: 15px;
+}
+
+.no_margin {
+ margin: 0;
+}
+
+.top_margin {
+ margin-top: 15px;
+}
+
+.right_margin {
+ margin-right: 15px;
+}
+
+.bottom_margin {
+ margin-bottom: 15px;
+}
+
+.left_margin {
+ margin-left: 15px;
+}
+
+.padding {
+ padding: 15px;
+}
+
+.no_padding {
+ padding: 0;
+}
+
+.top_padding {
+ padding-top: 15px;
+}
+
+.right_padding {
+ padding-right: 15px;
+}
+
+.bottom_padding {
+ padding-bottom: 15px;
+}
+
+.left_padding {
+ padding-left: 15px;
+}
diff --git a/director.php b/director.php
new file mode 100644
index 0000000..f7a0168
--- /dev/null
+++ b/director.php
@@ -0,0 +1,29 @@
+fetch_assoc();
if ($user['user_id'] == 2025) {
diff --git a/functions/functions.php b/functions/functions.php
index 3f6ce2b..70424c4 100644
--- a/functions/functions.php
+++ b/functions/functions.php
@@ -16,6 +16,7 @@ function notify_users($emails, $auther_username, $article_id, $article_title, $e
' . $excerpt . '
';
+
$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 '
';
print_r($arr);
echo '';
+ return ob_get_clean();
}
diff --git a/functions/init.php b/functions/init.php
index 3f61510..c710c85 100644
--- a/functions/init.php
+++ b/functions/init.php
@@ -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();
diff --git a/functions/todo_functions.php b/functions/todo_functions.php
new file mode 100644
index 0000000..ab97d8f
--- /dev/null
+++ b/functions/todo_functions.php
@@ -0,0 +1,55 @@
+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);
+}
diff --git a/functions/vendor b/functions/vendor
new file mode 120000
index 0000000..9c39cc9
--- /dev/null
+++ b/functions/vendor
@@ -0,0 +1 @@
+../vendor
\ No newline at end of file
diff --git a/js/todo.js b/js/todo.js
new file mode 100644
index 0000000..97de8c6
--- /dev/null
+++ b/js/todo.js
@@ -0,0 +1,48 @@
+/*
+
+ .then(response => {
+ if (!response.ok) {
+ throw new Error(`HTTP error! status: ${response.status}`);
+ }
+ return response.json(); // Or handle other response formats
+ })
+ .then(responseData => {
+ console.log('Response received:', responseData);
+ // Handle the server's response
+ });
+
+*/
+
+document.addEventListener('DOMContentLoaded', function() {
+ var todos = document.getElementsByClassName('todo_item');
+ //var todos = document.querySelectorAll('todo_item');
+
+ for (let i = 0; i < todos.length; i++) {
+ var item = todos[i];
+ var checkbox = item.querySelector('input[type="checkbox"]');
+ checkbox.todo_id = item.querySelector('input[name="todo_id"]').value;
+ checkbox.is_checked = checkbox.checked;
+
+ checkbox.addEventListener('click', function() {
+ if (!this.is_checked) {
+ this.is_checked = true;
+ fetch('director.php', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ },
+ body: 'ajax_id=todo&action_id=status&todo_id=' + this.todo_id + '&status=completed',
+ });
+ } else {
+ this.is_checked = false;
+ fetch('director.php', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ },
+ body: 'ajax_id=todo&action_id=status&todo_id=' + this.todo_id + '&status=open',
+ });
+ }
+ });
+ }
+});
diff --git a/todo.php b/todo.php
new file mode 100644
index 0000000..f3a6698
--- /dev/null
+++ b/todo.php
@@ -0,0 +1,29 @@
+