@extends('layouts.app')

@section('content')





{{--*/ usort($tableGrid, "SiteHelpers::_sort") /*--}}
<!--<section class="page-header row">
	<h2> {{ $pageTitle }} <small> {{ $pageNote }} </small></h2>
	<ol class="breadcrumb">
		<li><a href="{{ url('') }}"> Dashboard </a></li>
		<li class="active"> {{ $pageTitle }} </li>		
	</ol>
</section>-->

<div class="page-header" style="background-color: #6382a6;;">
  <div class="modulo"><img class="imagenmodulo1" src="dashboardimage/calendar2.png">
  <img class="imagenmodulo2" src="dashboardimage/linea.png">&nbsp   CALENDARIO</div>
</div>

<div class="toolbar-nav" >   
	<div class="row">
		<div class="col-md-8 col-sm-8"> 	
			@if($access['is_add'] ==1)
			<!--<a href="{{ url('pagosmantenimientos/create?return='.$return) }}" class="btn  btn-sm"  
				title="{{ __('core.btn_create') }}"><i class=" fa fa-plus "></i> Create New </a>-->
			@endif

			<div class="btn-group">
				<button type="button" class="btn btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="border-color:#f29f41;"><i class="fa fa-bars"></i> Acciones</button>
		        <ul class="dropdown-menu">
		        <!--@if($access['is_remove'] ==1)
					 <li class="nav-item"><a href="javascript://ajax"  onclick="SximoDelete();" class="nav-link tips" title="{{ __('core.btn_remove') }}">
					Remove Selected </a></li>
				@endif 
				@if($access['is_add'] ==1)
					<li class="nav-item"><a href="javascript://ajax" class=" copy nav-link " title="Copy" > Copy selected</a></li>
					<div class="dropdown-divider"></div>
					<li class="nav-item"><a href="{{ url($pageModule .'/import?return='.$return) }}" onclick="SximoModal(this.href, 'Import CSV'); return false;" class="nav-link "> Import CSV</a></li>

					
				@endif
				<div class="dropdown-divider"></div>
		        @if($access['is_excel'] ==1)
					<li class="nav-item"><a href="{{ url( $pageModule .'/export?do=excel&return='.$return) }}" class="nav-link "> Export Excel </a></li>	
				@endif
				@if($access['is_csv'] ==1)
					<li class="nav-item"><a href="{{ url( $pageModule .'/export?do=csv&return='.$return) }}" class="nav-link "> Export CSV </a></li>	
				@endif-->
				@if($access['is_pdf'] ==1)
					<li class="nav-item"><a href="{{ url('reservacionesadmin') }}" class="nav-link "> Control de Reservaciones </a></li>	
				@endif
				<!--@if($access['is_print'] ==1)
					<li class="nav-item"><a href="{{ url( $pageModule .'/export?do=print&return='.$return) }}" class="nav-link "> Print Document </a></li>	
				@endif
					<div class="dropdown-divider"></div>-->
				<li class="nav-item"><a href="{{ url('dashboard') }}"  class="nav-link "> Salir </a></li>
		          	
		        
		          
		        </ul>
		    </div> 
		    <!--<button type="button" class="btn btn-default btn-sm " 
			        onclick="SximoModal('{{ url($pageModule."/search") }}','Busqueda'); " style="border-color:#7fb3e3;" ><i class="fa fa-filter"></i> Filtro </button>-->
			        

		</div>
		<div class="col-md-2 col-sm-2 text-left">
			<!--<div class="input-group ">
			      <div class="input-group-prepend">
			        <button type="button" class="btn btn-default btn-sm " 
			        onclick="SximoModal('{{ url($pageModule."/search") }}','Busqueda'); " ><i class="fa fa-filter"></i> Filtro </button>
			      </div><!-- /btn-group
			      <input type="text" class="form-control form-control-sm onsearch" data-target="{{ url($pageModule) }}" aria-label="..." placeholder=" Type And Hit Enter ">
			    </div>-->
		</div>    
	</div>	

</div>	
<div class="page-content row" >
	<div class="page-content-wrapper no-margin">

		<div class="sbox">
			<div class="sbox-title">
			<!--	<h4> My Calendar </h4>
				<div class="sbox-tools">
					<a href="{{ url('calendar/create') }}" onclick="SximoModal(this.href ,'New Event '); return false;" class="btn btn-sm " ><i class="fa fa-plus"></i> New Event </a>
				</div>-->
			</div>
			<div class="sbox-content">
				<div class="row">
					<div class="col-md-12" >
						<div class="white-box"style= "background-color: white;">
							<div id="calendar" ></div>
						</div>	
					</div>	
				</div>	
			</div>		 
		</div>
	</div>
</div>		

<!-- This is a Custom CSS -->

<link href="{{ asset('sximo5/js/plugins/calendar/dist/fullcalendar.css')}}" rel="stylesheet">
<script type="text/javascript" src="{{ asset('sximo5/js/plugins/moment/moment.js') }}"></script>
<script type="text/javascript" src="{{ asset('sximo5/js/plugins/calendar/fullcalendar.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('sximo5/js/plugins/calendar/dist/lang/es.js') }}"></script>



<script>



	$(document).ready(function() {
	    
	   // $('#calendar').fullCalendar("refetchEvents");
		
		//getLoad( '<?php echo url("calendarform/create");?>' , ' Create New Event ');
		

		$('#calendar').fullCalendar({
		 buttonText: {
    today: 'Hoy',
    month: 'Mes',
    week : 'Semana'
  },height: 450,
  header: {
				left: 'prev,next today',
				center: 'title',
				right: 'month,agendaWeek'
			},
			defaultDate: '{{ date("Y-m-d")}}',
			selectable: false,
			selectHelper: true,
			select: function(start, end) {
				SximoModal('{!! url("calendarform/create?s='+start+'") !!}',' New Date');
				
			},
		   	eventClick: function(calEvent, jsEvent, view) {
		   		//alert(calEvent.id);
		   		var id = calEvent.id;
				SximoModal('{!! url("calendarform/'+ id +'/edit") !!}','Reservación: '+calEvent.title );				
		
			},			
			editable: false,
			events: {
				url: '{!! url("calendarform/load?") !!}',
				lazyFetching: false,
				error: function() {
					$('#script-warning').show();
				}
			},
		/*	eventDrop: function(event, revertFunc) {
				if (confirm("Are you sure about this change?")) {
					
					$.post( '{!! url("calendarform") !!}', 
					{ id:event.id,start : event.start.format(),end : event.end.format()},function(callback){
						notyMessage( callback.message);
					});					
				} else {
					revertFunc();
				}
		
			}*/	
		});
		
	});


</script>	
<style>
#calendar {
  
  padding:15px; 
}

.fc-toolbar {
	text-align: center;
	margin-bottom: -20px;
	margin-top:-30px;
}  


.fc-center {
    padding:7px;
}


.btn:focus,.btn:active {
   outline: none !important;
   box-shadow: none;
}     


</style>
@stop