diff --git a/add_calendar_event_modal.php b/add_calendar_event_modal.php
new file mode 100644
index 00000000..10301749
--- /dev/null
+++ b/add_calendar_event_modal.php
@@ -0,0 +1,67 @@
+
\ No newline at end of file
diff --git a/calendar_events.php b/calendar_events.php
new file mode 100644
index 00000000..97a75ad3
--- /dev/null
+++ b/calendar_events.php
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ | Date |
+ Times |
+ Title |
+ Calendar |
+ Actions |
+
+
+
+
+
+ |
+ - |
+ |
+ |
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+" tabindex="-1">
+
+
\ No newline at end of file
diff --git a/post.php b/post.php
index 13fd3cb2..b852dc46 100644
--- a/post.php
+++ b/post.php
@@ -272,6 +272,48 @@ if(isset($_GET['delete_client'])){
}
+if(isset($_POST['add_calendar_event'])){
+
+ $calendar_id = intval($_POST['calendar']);
+ $title = strip_tags(mysqli_real_escape_string($mysqli,$_POST['title']));
+ $start = strip_tags(mysqli_real_escape_string($mysqli,$_POST['start']));
+ $end = strip_tags(mysqli_real_escape_string($mysqli,$_POST['end']));
+
+ mysqli_query($mysqli,"INSERT INTO calendar_events SET calendar_event_title = '$title', calendar_event_start = '$start', calendar_event_end = '$end', calendar_id = $calendar_id");
+
+ $_SESSION['alert_message'] = "Event added to the calendar";
+
+ header("Location: " . $_SERVER["HTTP_REFERER"]);
+
+}
+
+if(isset($_POST['edit_calendar_event'])){
+
+ $calendar_event_id = intval($_POST['calendar_event_id']);
+ $calendar_id = intval($_POST['calendar']);
+ $title = strip_tags(mysqli_real_escape_string($mysqli,$_POST['title']));
+ $start = strip_tags(mysqli_real_escape_string($mysqli,$_POST['start']));
+ $end = strip_tags(mysqli_real_escape_string($mysqli,$_POST['end']));
+
+ mysqli_query($mysqli,"UPDATE calendar_events SET calendar_event_title = '$title', calendar_event_start = '$start', calendar_event_end = '$end', calendar_id = $calendar_id WHERE calendar_event_id = $calendar_event_id");
+
+ $_SESSION['alert_message'] = "Event modified on the calendar";
+
+ header("Location: " . $_SERVER["HTTP_REFERER"]);
+
+}
+
+if(isset($_GET['delete_calendar_event'])){
+ $calendar_event_id = intval($_GET['delete_calendar_event']);
+
+ mysqli_query($mysqli,"DELETE FROM calendar_events WHERE calendar_event_id = $calendar_event_id");
+
+ $_SESSION['alert_message'] = "Event deleted on the calendar";
+
+ header("Location: " . $_SERVER["HTTP_REFERER"]);
+
+}
+
if(isset($_POST['add_vendor'])){
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
diff --git a/side_nav.php b/side_nav.php
index 81b9426b..844111e2 100644
--- a/side_nav.php
+++ b/side_nav.php
@@ -11,6 +11,11 @@
Clients
+
+
+
+ Calendar
+