?
Current Path : /home1/savoy/public_html/savoyglobal.net/cocorico/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/cocorico/application/views/calendar/view_calendar.php |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?> <link media="screen" rel="stylesheet" type="text/css" href="<?=base_url()?>assets/css/fullcalendar.css" /> <div class="row-fluid"> <div class="span12"> <!-- BEGIN EXAMPLE TABLE PORTLET--> <div class="portlet box blue"> <div class="portlet-title"> <div class="caption"><i class="icon-cogs"></i>Event Details</div> <div class="actions"> <a href="#" onclick="addformdisplay('add_event','calendar')" class="btn green"><i class="icon-plus"></i> Add</a> </div> </div> <div class="portlet-body" style="min-height: 400px;"> <div id='calendar'></div> </div> </div> </div> </div> <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); dt2.setDate(dt2.getDate()-1); 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; } } } title = encodeURIComponent(title); alert(end_date); 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>