Top Search bar now searches clients, added events and trips to client details, started adding trims to trim whitespace on beginning and end of some inputs

This commit is contained in:
johnny@pittpc.com
2019-11-21 21:23:34 -05:00
parent dfb963da32
commit a66e2c7e33
13 changed files with 628 additions and 23 deletions

View File

@@ -1,5 +1,3 @@
<?php include("header.php"); ?>
<?php
if(isset($_GET['calendar_id'])){
@@ -8,12 +6,30 @@ if(isset($_GET['calendar_id'])){
?>
<div id='calendar'></div>
<div class="card"><?php echo $client_id; ?>
<div id='calendar'></div>
</div>
<?php include("add_calendar_event_modal.php"); ?>
<?php include("edit_calendar_event_modal.php"); ?>
<?php include("client_add_calendar_event_modal.php"); ?>
<?php include("add_calendar_modal.php"); ?>
<?php include("footer.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 AND events.client_id = $client_id AND calendars.company_id = $session_company_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("client_edit_calendar_event_modal.php");
}
?>
<script>
@@ -21,25 +37,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 AND calendars.company_id = $session_company_id AND events.client_id = $client_id");
while($row = mysqli_fetch_array($sql)){
$event_id = $row['event_id'];
$event_title = $row['event_title'];
@@ -47,16 +69,15 @@ 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(event, jsEvent, view) {
$('#modalTitle').html(event.title);
$('#modalBody').html(event.description);
$('#eventUrl').attr('href',event.url);
$('#editEventModal').modal();
},
eventClick: function(editEvent) {
$('#editEventModal'+editEvent.event.id).modal();
}
});
calendar.render();