Added Calendar and Event Functionality

This commit is contained in:
root
2019-04-26 21:02:07 -04:00
parent 2416f80dba
commit 095def07a1
5 changed files with 276 additions and 0 deletions

View File

@@ -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']));