<?php
	include( 'includes/bootstrap.inc.php' );
	
	if( empty( Data::getSession( 'uid' ) ) ){
		header('Location: login.php?op=e');
		die();
	}
	
	$op 	= Data::getGet( 'op' );
	$output = '';
	
	$layout_calendar = new Template( _DEFAULT_THEME_PATH . _DEFAULT_THEME . "/generic_content.tpl" );

	
	// create a new user object
	$bs = new Bootstrap();
	
	switch ($op){
		// handle json / ajax call
		case 'f':
			break;
		
		case 's':
			break;
		
		case 'd':
			break;
		
		default:
			$output .= "<h3>THIS SECTION IS UNDER DEVELOPMENT</h3>";
			
			// $layout_visit->set ( "visit-logic-init", $JS_translated_messages . $JS_init_vars );
			$output .= '<link rel="stylesheet" href="assets/js/fullcalendar/fullcalendar.css" />';
			$output .= '<script type="text/javascript" src="assets/js/moment-with-locales.js"></script>';
			$output .= '<script type="text/javascript" src="assets/js/fullcalendar/fullcalendar.js"></script>';
			$output .= '<script type="text/javascript" src="assets/js/calendar.logic.js"></script>';
			/*
			$output .= '<script>
						$(document).ready(function() {

							// page is now ready, initialize the calendar...

							$("#calendar").fullCalendar({
								// put your options and callbacks here
								editable: true,
								header: {
								 left: "prev,next today",
								 center: "title",
								 right: "month,agendaWeek,agendaDay"

							}



							})

						});
						</script>';
			*/
			$output .= '<div id="calendar"></div>';

			
			
			break;
	}
	
	/**
	 * Outputs the page with the user's profile.
	 */
	$layout->set ( 'section-name', _( "Calendar" ) );
	
	// create the search input using Typeahead suggestion library
	$search_logic = '<script type="text/javascript" src="assets/js/search.logic.js"></script>';

	$bso = new BootstrapInput( 'input-search', '' );
	$bso->placeholder = _('Search...');
	$search_input = $bso->output();

	$layout->set ( "search", $search_logic . $search_input );
	
	$layout_calendar->set( 'generic-content', $output );
	$layout->set ( "content", $layout_calendar->output() );
	
	echo template_common_header();
	echo $layout->output();
	echo template_common_footer();
?>
