diff --git a/panel_manager/panel_manager.php b/panel_manager/panel_manager.php index e1e8b6a..f826823 100644 --- a/panel_manager/panel_manager.php +++ b/panel_manager/panel_manager.php @@ -89,7 +89,7 @@ return $panel; } static function calendar(){ - + $formSession = new FormSession("new_session", $_SESSION["cinema"] ); $hall = $_POST['hall'] ?? $_GET['hall'] ?? "1"; $halls = Hall::getListHalls($_SESSION["cinema"]); @@ -115,8 +115,15 @@
+
-
'; + '; }else{ $panel ='

No hay ninguna sala en este cine

diff --git a/panel_manager/sessioncalendar.js b/panel_manager/sessioncalendar.js index f44ea5c..6ae59c9 100644 --- a/panel_manager/sessioncalendar.js +++ b/panel_manager/sessioncalendar.js @@ -2,7 +2,14 @@ $(document).ready(function(){ var selectedFeed = $('#hall_selector').find(':selected').data('feed'); - + var modal = document.getElementById("myModal"); + + // Get the button that opens the modal + var btn = document.getElementById("myBtn"); + + // Get the element that closes the modal + var span = document.getElementsByClassName("close")[0]; + var calendar = $('#calendar').fullCalendar({ editable:true, header:{ @@ -16,7 +23,8 @@ $(document).ready(function(){ timeFormat: 'H:mm', select: function(start, end, allDay) { - + modal.style.display = "block"; + /* var e = { "date" : $.fullCalendar.formatDate(allDay,"Y-MM-DD"), "start" : $.fullCalendar.formatDate(start, "HH:mm"), @@ -33,7 +41,7 @@ $(document).ready(function(){ calendar.fullCalendar('refetchEvents'); alert("Added Successfully"); } - }) + })*/ }, editable:true, eventResize:function(event) @@ -114,5 +122,17 @@ $(document).ready(function(){ $('#calendar').fullCalendar('addEventSource', feed); selectedFeed = feed; }; + + // When the user clicks on (x), close the modal + span.onclick = function() { + modal.style.display = "none"; + } + + // When the user clicks anywhere outside of the modal, close it + window.onclick = function(event) { + if (event.target == modal) { + modal.style.display = "none"; + } + } });