@extends('layouts.master') @section('css') {{ HTML::style('vendor/datetimepicker-master/jquery.datetimepicker.css') }} @stop @section('navigation') @include('local.managers.admins._new_navigation') @stop @section('main')

Use this page to change the available semesters' start dates, end dates, and visibility. Start dates and end dates determine the range of time within which users enter data for each semester. Visibility determines whether a user can select that semester for viewing and/or entering data. Users cannot enter new data in a closed semester, even if it is visible.

Important: At least one semester must be visible, and must have started. While semesters may have overlapping dates, they cannot have the same dates.

@foreach ($semesters as $semester) @endforeach
Code Name Start Date End Date Visible Save
{{ $semester->code }} {{ $semester->name }}
@stop @section('included-js') @stop @section('javascript') // ------------------------------------------------------------------------ // Page Load // ------------------------------------------------------------------------ $('.datetimepicker').datetimepicker({ format: 'm/d/y H:i:s' }); // ------------------------------------------------------------------------ // Events // ------------------------------------------------------------------------ $('.semester-save').on('click', function(e) { e.preventDefault(); var id = ($(this).siblings('.semester-code').data('id')); var start = ($(this).siblings('.semester-start').find('.datetimepicker').val()); var end = ($(this).siblings('.semester-end').find('.datetimepicker').val()); var visible = ($(this).siblings('.semester-visible').find(':selected').val()); $.post( "{{ URL::action('SemestersController@update') }}", { id: id, start: start, end: end, visible: visible }, function(data) { location.reload(true); } ).fail(function() { alert( "error" ); }); }); // ------------------------------------------------------------------------ // Functions // ------------------------------------------------------------------------ function selectSchoolandProgram(semester, role) { switch(role) { case 1: $('#school option[value="0"]').prop('selected', true); $('#program option[value="0"]').prop('selected', true); break; case 2: var school_id = semester.find('.semester-school').data('school-id'); $('#school option[value="'+school_id+'"]').prop('selected', true); fetchPrograms(); $('#program option[value="0"]').prop('selected', true); break; case 3: case 4: var school_id = semester.find('.semester-school').data('school-id'); var program_id = semester.find('.semester-program').data('program-id'); $('#school option[value="'+school_id+'"]').prop('selected', true); fetchPrograms(); $('#program option[value="'+program_id+'"]').prop('selected', true); break; } } @stop