 @extends('layouts.master')

 @section('navigation')
     @include('local.managers.admins._new_navigation')
 @stop

 @section('main')
     <div class="row">
         <div class="col-md-12">

             <p>This report contains the Assessment for all Students for all Schools and Programs during the following
                 semester(s):</p>
             <ul>
                 @foreach (Session::get('semesters_info') as $semester_info)
                     <li>{{ $semester_info }}</li>
                 @endforeach
             </ul>


             <!-- <h3>Table of Contents</h3> -->
             <!-- <ol id="table-of-contents" class="upper-roman">

                </ol> -->


             <table class="table table-condensed table-bordered datatable">
                 <thead>
                     <tr class="center-text">
                         <th>Semester</th>
                         <th>School or College</th>
                         <th>Program ID</th>
                         <th>Program Code</th>
                         <th>Outcome</th>
                         <th>Student Number</th>
                         <th>Student Program</th>
                         <th>Criteria</th>
                         <th>Courses</th>
                         <th>Expected Result For Achievement</th>
                         <th>Student Result</th>
                     </tr>
                 </thead>
                 <tfoot>
                     <tr class="column-search">
                         <th><select class="column-search-select form-control">
                                 <option value=""></option>
                             </select></th>
                         <th><select class="column-search-select form-control">
                                 <option value=""></option>
                             </select></th>
                         <th><select class="column-search-select form-control">
                                 <option value=""></option>
                             </select></th>
                         <th><select class="column-search-select form-control">
                                 <option value=""></option>
                             </select></th>
                         <th><select class="column-search-select form-control">
                                 <option value=""></option>
                             </select></th>
                         <th><select class="column-search-select form-control">
                                 <option value=""></option>
                             </select></th>
                         <th><select class="column-search-select form-control">
                                 <option value=""></option>
                             </select></th>
                         <th><input class="column-search-bar form-control" type="text" placeholder="Buscar" /></th>
                         <th><select class="column-search-select form-control">
                                 <option value=""></option>
                             </select></th>
                         <th><select class="column-search-select form-control">
                                 <option value=""></option>
                             </select></th>
                         <th><select class="column-search-select form-control">
                                 <option value=""></option>
                             </select></th>
                     </tr>
                 </tfoot>
                 <tbody>
                     @foreach ($total_assessments as $total_assessment)
                         <tr>
                             <td>{{ $total_assessment->semester }}</td>
                             <td>{{ $total_assessment->school }}</td>
                             <td>{{ $total_assessment->program }}</td>
                             <td>{{ $total_assessment->program_code }}</td>
                             <td>{{ $total_assessment->outcome }}</td>
                             <td>{{ $total_assessment->student_number }}</td>
                             <td>{{ $total_assessment->student_conc_code }}</td>
                             <td>{{ $total_assessment->criterion }}</td>
                             <td>{{ $total_assessment->course }}</td>
                             <td>{{ $total_assessment->expected_result }}</td>
                             <td>{{ $total_assessment->result }}</td>
                         </tr>
                     @endforeach
                 </tbody>
             </table>
         </div>
     </div>
     <span class="js-vars" data-pdf-url="{{ URL::action('OutcomesController@totalAssessmentReport') }}"></span>
 @stop

 @section('included-js')
     @include('global._datatables_js')
 @stop


 @section('javascript')

     // Build table of contents
     var outcome = $('.outcome');
     var str ='';
     str+='<li><a href="#'+outcome.attr('id')+'">'+outcome.text()+'</a>
         <ol class="schools upper-alpha">';

             /*$('[id^='+outcome.attr('id')+'-].school:visible').each(function(e){
             var school = $(this);
             str+='<li><a href="#'+school.attr('id')+'">'+school.text()+'</a>
                 <ol class="programs">';

                     $('[id^='+school.attr('id')+'-].program:visible').each(function(e){

                     var program = $(this);
                     if(!program.hasClass('no-courses'))
                     str+='<li><a href="#'+program.attr('id')+'">'+program.text()+'</a></li>';
                     else
                     str+='<li>'+program.text()+'</li>';

                     });

                     str+='</ol>
             </li>';
             });*/

             str+='</ol>
     </li>';

     //$('#table-of-contents').append(str);


     // ----------------------------------------------------------------------------
     // Events
     //

     $('.to-top').on('click', function(e) {
     e.preventDefault();

     $(this).scrollTop(0);
     $('html').animate({scrollTop:0}, 1);
     $('body').animate({scrollTop:0}, 1);
     })

 @stop
