?
Current Path : /home1/savoy/public_html/savoyglobal.net/koaladraft/application/views/calendar/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/public_html/savoyglobal.net/koaladraft/application/views/calendar/view_calendar.php |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?> <script type='text/javascript'> (function() { Date.prototype.toYMD = Date_toYMD; function Date_toYMD() { var year, month, day; year = String(this.getFullYear()); month = String(this.getMonth() + 1); if (month.length == 1) { month = "0" + month; } day = String(this.getDate()); if (day.length == 1) { day = "0" + day; } return year + "-" + month + "-" + day; } })(); $(document).ready(function() { var date = new Date(); var d = date.getDate(); var m = date.getMonth(); var y = date.getFullYear(); var calendar = $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, selectable: true, selectHelper: true, select: function(start, end, allDay) { var title = prompt('Event Title:'); if (title) { calendar.fullCalendar('renderEvent', { title: title, start: start, end: end, allDay: allDay }, true // make the event "stick" ); var dt = new Date(start); var start_date = dt.toYMD(); var dt2 = new Date(end); var end_date = dt2.toYMD(); var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } url = "<?= site_url('calendar/insertevent/') ?>/" +title+'/'+start_date+'/'+end_date; ajaxRequest.open("GET",url, true); ajaxRequest.send(null); // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ } } } calendar.fullCalendar('unselect'); }, editable: true, events: [ <?php if ($viewinfo->num_rows() > 0) { foreach ($viewinfo->result() as $row) { ?> { title: '<?= $row->calendar_title; ?>', start: '<?= $row->calendar_start_date; ?>', end: '<?= $row->calendar_end_date; ?>' }, <?php } } ?> ] }); }); </script> <span class="section_content_top"></span> <div class="section_content_inner"> <div id='calendar'></div> </div> <span class="section_content_bottom"></span>