diff --git a/calendar_edit_modal.php b/calendar_edit_modal.php
new file mode 100644
index 00000000..c0ead624
--- /dev/null
+++ b/calendar_edit_modal.php
@@ -0,0 +1,42 @@
+
diff --git a/calendar_events.php b/calendar_events.php
index 7aeeaa18..4193b2ce 100644
--- a/calendar_events.php
+++ b/calendar_events.php
@@ -39,9 +39,12 @@ if (isset($_GET['calendar_id'])) {
?>
-
+
-
+
diff --git a/post/event.php b/post/event.php
index 831a2839..786960b6 100644
--- a/post/event.php
+++ b/post/event.php
@@ -22,6 +22,23 @@ if (isset($_POST['add_calendar'])) {
}
+if (isset($_POST['edit_calendar'])) {
+
+ $calendar_id = intval($_POST['calendar_id']);
+ $name = sanitizeInput($_POST['name']);
+ $color = sanitizeInput($_POST['color']);
+
+ mysqli_query($mysqli,"UPDATE calendars SET calendar_name = '$name', calendar_color = '$color' WHERE calendar_id = $calendar_id");
+
+ //Logging
+ mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Calendar', log_action = 'Edit', log_description = '$session_name Edited calendar $name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id, log_entity_id = $calendar_id");
+
+ $_SESSION['alert_message'] = "Calendar $name edited";
+
+ header("Location: " . $_SERVER["HTTP_REFERER"]);
+
+}
+
if (isset($_POST['add_event'])) {
require_once 'post/event_model.php';