Edit Calendar Event Now Works, now you can create calendars and select a color, added bootstrap select to add additnal html content to select boxes and make them look prettier

This commit is contained in:
root
2019-06-06 13:22:25 -04:00
parent 9c313030ee
commit 81438fef93
133 changed files with 5656 additions and 36 deletions

View File

@@ -11,6 +11,25 @@ if(isset($_GET['calendar_id'])){
<div id='calendar'></div>
<?php include("add_calendar_event_modal.php"); ?>
<?php include("add_calendar_modal.php"); ?>
<?php
//loop through IDs and create a modal for each
$sql = mysqli_query($mysqli,"SELECT * FROM events, calendars WHERE events.calendar_id = calendars.calendar_id");
while($row = mysqli_fetch_array($sql)){
$event_id = $row['event_id'];
$event_title = $row['event_title'];
$event_start = $row['event_start'];
$event_end = $row['event_end'];
$calendar_id = $row['calendar_id'];
$calendar_name = $row['calendar_name'];
$calendar_color = $row['calendar_color'];
include("edit_calendar_event_modal.php");
}
?>
<?php include("footer.php"); ?>
@@ -20,24 +39,31 @@ if(isset($_GET['calendar_id'])){
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
plugins: [ 'interaction', 'dayGrid', 'timeGrid', 'list' ],
plugins: [ 'bootstrap', 'dayGrid', 'timeGrid', 'list' ],
themeSystem: 'bootstrap',
defaultView: 'dayGridMonth',
customButtons: {
myCustomButton: {
text: 'New',
addEvent: {
bootstrapFontAwesome: 'fa fa-plus',
click: function() {
$("#addCalendarEventModal").modal("show");
$("#addCalendarEventModal").modal();
}
},
addCalendar: {
bootstrapFontAwesome: 'fa fa-calendar-plus',
click: function() {
$("#addCalendarModal").modal();
}
}
},
header: {
left: 'prev,next today',
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth myCustomButton'
right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth addEvent addCalendar '
},
events: [
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM events");
$sql = mysqli_query($mysqli,"SELECT * FROM events, calendars WHERE events.calendar_id = calendars.calendar_id");
while($row = mysqli_fetch_array($sql)){
$event_id = $row['event_id'];
$event_title = $row['event_title'];
@@ -45,12 +71,14 @@ if(isset($_GET['calendar_id'])){
$event_end = $row['event_end'];
$calendar_id = $row['calendar_id'];
$calendar_name = $row['calendar_name'];
echo "{ id: '$event_id', title: '$event_title', start: '$event_start'},";
$calendar_color = $row['calendar_color'];
echo "{ id: '$event_id', title: '$event_title', start: '$event_start', end: '$event_end', color: '$calendar_color'},";
}
?>
],
eventClick: function(calEvent, jsEvent, view, resourceObj) {
$("#addCalendarEventModal").modal("show");
eventClick: function(editEvent) {
$('#editEventModal'+editEvent.event.id).modal();
}
});