




<br />
<b>Deprecated</b>:  Creation of dynamic property Google\Site_Kit\Core\Authentication\Setup::$proxy_support_link_url is deprecated in <b>/sys-data/WebData/projects/epsilon/wp-content/plugins/google-site-kit/includes/Core/Authentication/Setup.php</b> on line <b>94</b><br />
<br />
<b>Warning</b>:  Undefined variable $projectid in <b>/sys-data/WebData/projects/epsilon/wp-content/plugins/bi-toolkit-calendar/bi-toolkit-calendar.php</b> on line <b>35</b><br />
<br />
<b>Warning</b>:  Undefined variable $projectid in <b>/sys-data/WebData/projects/epsilon/wp-content/plugins/bi-toolkit-calendar/bi-toolkit-calendar.php</b> on line <b>42</b><br />
<br />
<b>Warning</b>:  Undefined variable $projectid in <b>/sys-data/WebData/projects/epsilon/wp-content/plugins/bi-toolkit-calendar/bi-toolkit-calendar.php</b> on line <b>61</b><br />
	
	<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
    #eventModal{
/*        position: absolute;*/
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
    }
    .modal-header{
        background-color: #E5E9F5;
        border-radius:10px;
    }
    #calendar {
        max-width: 900px;
        margin: 0 auto;
    }
</style>
<title>Calendar</title>

<body>

<div id='calendar'></div>

<!-- Modal -->
<div class="modal fade" id="eventModal" tabindex="-1" role="dialog" aria-labelledby="eventModalLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
        <h3 class="modal-title" id="eventModalLabel">Event Details</h3>
      
      </div>
      <div class="modal-body">
        <div id="eventInfo"></div>
      </div>
       <div class="modal-footer">
            <button type="button" class="btn btn-danger" id="deleteEventBtn">Delete Event(s)</button>
        </div>
    </div>
  </div>
</div>
    
</div>
</body>
<script src="https://cdn.jsdelivr.net/npm/fullcalendar@6.1.11/index.global.min.js"></script>


<!-- Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

<script>
    window.onload = function() {
        var calendarEl = document.getElementById('calendar');
        var eventsJson = [];
        console.log(eventsJson);

        var calendar = new FullCalendar.Calendar(calendarEl, {
            initialView: 'dayGridMonth', // Default view: monthly
            contentHeight:"auto",
            events: eventsJson,
            eventClick: function(info) {
                var event=info.event;
                console.log(event);
                $('#eventInfo').html(
                    '<p><strong>Title:</strong> ' + event.title + '</p>' +
                    '<p><strong>Start:</strong> ' + event.start + '</p>' +
                    '<p><strong>End:</strong> ' + event.end + '</p>' +
                    '<p style=\"white-space: pre-line\"><strong>Info:</strong> ' + (event.extendedProps.infoEvent ? event.extendedProps.infoEvent : 'N/A') + '</p>' +
                    '<p><strong>Link:</strong> ' + (event.extendedProps.linkToEvent ? '<a href="' + event.extendedProps.linkToEvent + '" target="_blank">' + event.extendedProps.linkToEvent + '</a>' : 'N/A') + '</p>'
                );
                $('#eventModal').modal('show');

                $('#deleteEventBtn').on('click', function() {
                var eventId = event.id; // Assuming your event object has an ID

                    // Send an AJAX request to a PHP script that handles event deletion
                    $.ajax({
                        url: 'https://epsilon.cs.ucy.ac.cy/wp-content/plugins/bi-toolkit-calendar/delete-event.php',
                        type: 'POST',
                        data: { eventId: eventId },
                        success: function(response) {
                            // Handle the response here if needed
                            // For example, you might want to close the modal
                            $('#eventModal').modal('hide');
                            // Reload the page
                            location.reload();
                        },
                        error: function(xhr, status, error) {
                            // Handle errors here
                            console.error(xhr.responseText);
                        }
                    });
                });

            }

        });

        


        calendar.render();
    };
</script>
</head>
</body>
</html>

	{"id":492,"date":"2024-03-29T09:43:16","date_gmt":"2024-03-29T09:43:16","guid":{"rendered":"https:\/\/epsilon.cs.ucy.ac.cy\/?page_id=492"},"modified":"2024-03-29T14:03:33","modified_gmt":"2024-03-29T14:03:33","slug":"bi-toolkit-calendar","status":"publish","type":"page","link":"https:\/\/epsilon.cs.ucy.ac.cy\/index.php\/bi-toolkit-calendar\/","title":{"rendered":"BI Toolkit-Calendar"},"content":{"rendered":"\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ub_ctt_via":""},"featured_image_src":null,"_links":{"self":[{"href":"https:\/\/epsilon.cs.ucy.ac.cy\/index.php\/wp-json\/wp\/v2\/pages\/492"}],"collection":[{"href":"https:\/\/epsilon.cs.ucy.ac.cy\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/epsilon.cs.ucy.ac.cy\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/epsilon.cs.ucy.ac.cy\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/epsilon.cs.ucy.ac.cy\/index.php\/wp-json\/wp\/v2\/comments?post=492"}],"version-history":[{"count":4,"href":"https:\/\/epsilon.cs.ucy.ac.cy\/index.php\/wp-json\/wp\/v2\/pages\/492\/revisions"}],"predecessor-version":[{"id":509,"href":"https:\/\/epsilon.cs.ucy.ac.cy\/index.php\/wp-json\/wp\/v2\/pages\/492\/revisions\/509"}],"wp:attachment":[{"href":"https:\/\/epsilon.cs.ucy.ac.cy\/index.php\/wp-json\/wp\/v2\/media?parent=492"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}