<?php
session_start();

//$usuario = $_SESSION['usuario'];
//$id_registro = $_SESSION['id_registro'];

 

if(isset($_SESSION['ingreso']) && $_SESSION['ingreso']=='YES')
	
{ ?>

	<DOCTYPE html>
	<html>
	<head>
	<meta charset='utf-8' />
	<link rel='stylesheet' href='../lib/cupertino/jquery-ui.min.css' />
	<link href='../fullcalendar.min.css' rel='stylesheet' />
	<link href='../fullcalendar.print.min.css' rel='stylesheet' media='print' />
	<?php



	?>

	<script src='../lib/moment.min.js'></script>
	<script src='../lib/jquery.min.js'></script>
	<script src='../fullcalendar.min.js'></script>
	<script src='../locale/es.js'></script>
	<script>


		$(document).ready(function() {
		
			//$('#calendar').fullCalendar('option', 'height', 700);

			$('#calendar').fullCalendar({
				theme: true,
				header: {
					left: 'prev,next today',
					center: 'title',
					//right: 'month,agendaWeek,agendaDay'
				},
				defaultDate: new Date(),
				//navLinks: true, // can click day/week names to navigate views
				selectable: true,
				//selectHelper: true,
				businessHours: true,
				//hiddenDays: [0,6 ],
				handleWindowResize: true,
				electOverlap:true,
				Integer : 1000,
				//weekends: false, // will hide Saturdays and Sundays
				//height: 500,
				//contentHeight: 400,
				//aspectRatio: 2,
				//AllDay:true,
				//editable: true,
				//eventLimit: true,

				    
				select: function() {
					$('#calendar').fullCalendar({
	    dayClick: function() {
	        alert('¡Se ha hecho clic en un día!');
	    }
	});
				//select: function(start, end) {
					//var title = prompt('Confirmar yiny:');
					var eventData;
					/*if (title) {
						eventData = {
							title: title,
							start: start,
							end: end
						};

						$('#calendar').fullCalendar('renderEvent', eventData, false); // stick? = true
					}
					$('#calendar').fullCalendar('unselect');*/

				},

				
				//editable: true,
				eventLimit: true, // allow "more" link when too many events
				events: [
					{
						title: 'No hay cupo',
						start: '2017-06-08',
						color: '#257e4a',
						rendering: 'background',
						color: '#ff0011',

						
					},
					{
						title: 'No hay cupo',
						start: '2017-06-12',					
						rendering: 'background',
						color: '#ff0011',
						
					},
					{
						title: 'No hay cupo',
						start: '2017-06-22',	
						rendering: 'background',
						color: '#ff0011',
						
					},
					{
						title: 'No hay cupo',
						start: '2017-06-20',	
						rendering: 'background',
						color: '#ff0011',
						
					},
					
				]
			});
			
		});

	</script>
	<style>

		body {
			margin:10px 10px;
			padding: 0;
			font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
			font-size: 15px;
		}

		#calendar {
			max-width: 800px;
			margin: 0 auto;
		}

	</style>
	</head>
	<body>

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


	</body>
	</html>
	<?php
}
else
{
    ?>
        <!DOCTYPE html>
        <html>
            <head>
                <meta http-equiv="refresh" content="0;url=/metrologia/views/index.php">
                <title>SM V2.0</title>
                <script language="javascript">
                    window.location.href = "/metrologia/views/index.php"
                </script>
            </head>
            <body>
                Go to <a href="/metrologia/views/index.php">/metrologia/views/index.php</a>
            </body>
        </html>
<?php
}
?>