<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="csrf-token" content="<?= csrf_token() ?>">
    <link rel="shortcut icon" href="{{ asset('favicon.ico') }}">

    <!-- Bootstrap CSS-->
    {{ HTML::style('vendor/bootstrap/css/bootstrap.min.css') }}


    <!-- X-Editable -->
    {{ HTML::style('vendor/xeditable/bootstrap-editable.css') }}


    <!-- CSS -->
    {{ HTML::style('css/custom.css') }}
    {{ HTML::style('css/sticky-footer.css') }}

    @yield('css')

    <script src="{{ asset('vendor/modernizr-custom.min.js') }}"></script>

    <!-- jQuery -->
    <script src="{{ asset('vendor/jquery.min.js') }}"></script>

    <!-- Bootstrap js -->
    <script src="{{ asset('vendor/bootstrap/js/bootstrap.min.js') }}"></script>

    <title>Online Learning Assessment System</title>
</head>
<body>
    <!-- Modal to change term -->
    <div class="modal fade" id="changeTermModal" tabindex="-1" role="dialog" aria-labelledby="changeTermModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-sm">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title" id="changeTermModalLabel">Change Semesters</h4>
                </div>
                <div class="modal-body">
                    <p>Select one or more semesters to view their data. These settings will be applied site-wide.</p>
                    {{ Form::open(array('action' => array('SemestersController@filterSemesters'))) }}
                        @foreach (Semester::where('is_visible', 1)->get() as $semester)
                        <div class="checkbox">
                            <label>
                                <input name="semesters_ids[]" value="{{ $semester->id }}" type="checkbox">{{ $semester->name }} ({{ $semester->code }})
                            </label>
                        </div>
                        @endforeach
                </div>
                <div class="modal-footer">
                        <div class="btn-group" role="group">
                            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                            <button type="submit" class="btn btn-default btn-primary">Submit</button>
                        </div>
                    {{ Form::close() }}
                </div>
            </div>
        </div>
    </div>
    <header class="header hidden-print">
        <div style="background-color: #e70033; background-image:url({{ URL::asset('images/header-olas-back.png')}}); background-repeat:no-repeat; min-height:100px; position: relative; width:100%; min-width:1560px">
        <div class="gotoright">
            <h1>Online Learning Assessment System - 
                @if(Auth::user()->role == '1')
                    <strong>Administrator</strong>
                @elseif (Auth::user()->role == '2')
                    <strong>School Coordinator</strong>
                @elseif (Auth::user()->role == '3')
                    <strong>Program Coordinator</strong>
                @elseif (Auth::user()->role == '4')
                    <strong>Professor</h3></strong>
                @endif
            </h1>
    	</div>
    	</div>
        @yield('navigation')
        <div class="semesterbar">
            <p><strong>Viewing:</strong>  @foreach (Session::get('semesters_info') as $semester_info) 
                <strong>&#183;</strong> {{ $semester_info }} 
            @endforeach
            
	
<a href="#" data-toggle="modal" data-target="#changeTermModal"> <strong>Change</strong></a></p>
   
        </div>
    </header>
    <main class="main">
        <div class="container">
            <div class="row">
                <div class="col-md-12"><h2> {{ $title }} </h2></div>
            </div>

            @if(Session::get('status'))
            <div class="row">
            <div class="col-md-12">
              <div class="alert alert-{{ Session::get('status') }}" role="alert">
                {{ Session::get('message') }}
              </div>
            </div>
            </div>
            @endif

            <div id="js-error-row" class="row">
                <div class="col-md-12">
                    <div class="alert alert-danger" role="alert">
                        <span id="error-message">
                        </span></span>
                    </div>
                </div>
            </div>


            @yield('main')
        </div>
    </main>

    @include('layouts/footer')

    <!-- File specific scripts -->
    @yield('included-js')

    <!-- General Scripts -->
    <script type="text/javascript">
    $(document).ready(function() {
        $('#js-error-row').hide();

        // Always scroll to the top
        $(this).scrollTop(0);
        $('html').animate({scrollTop:0}, 1);
        $('body').animate({scrollTop:0}, 1);

        // Yield to js
        @yield('javascript')

        // Turn on tooltips
        $('[data-toggle="tooltip"]').tooltip();

    });
        
    </script>

    <!-- AJAX setup for CSRF protection -->
    <script src="{{ asset('js/ajaxSetup.js') }}"></script>

    <script type="text/javascript">
    $('.panel-heading').css('cursor', 'pointer');
    </script>


    <!-- HighCharts -->
    <!--script src="http://code.highcharts.com/modules/exporting.js"></script -->

</body>
</html>
