No Description

index_five_year_plans.blade.php 2.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. @extends('layouts.master')
  2. @section('navigation')
  3. @if(Auth::user()->role==1)
  4. @include('local.managers.admins._navigation')
  5. @elseif(Auth::user()->role==2)
  6. @include('local.managers.sCoords._new_navigation')
  7. @elseif(Auth::user()->role==3)
  8. @include('local.managers.pCoords._new_navigation')
  9. @endif
  10. @stop
  11. @section('main')
  12. <div class="row">
  13. <div class="table-responsive">
  14. <table class="table table-bordered datatable">
  15. <thead>
  16. <tr>
  17. <th class="active col-sm-2 col-md-2">Program</th>
  18. <th class="active col-sm-2 col-md-2">School</th>
  19. @foreach($quinquenniums as $quinquennium)
  20. <th class="active">{{ date('Y', strtotime($quinquennium->start_date)) }}-{{ date('Y', strtotime($quinquennium->end_date)) }} Quinquennium</th>
  21. @endforeach
  22. </tr>
  23. </thead>
  24. @foreach($programs as $program)
  25. <tr>
  26. <th class="active col-sm-2 col-md-2"> {{ $program->name }} </th>
  27. <td class="col-sm-2 col-md-2"> {{ $program->school->name }} </td>
  28. @foreach($quinquenniums as $quinquennium)
  29. <td>
  30. <?php $five_year_plan = FiveYearPlan::where('program_id', $program->id)->where('quinquennium_id', $quinquennium->id)->first(); ?>
  31. @if($five_year_plan)
  32. <a class="btn btn-sm btn-default" href="{{ URL::action('FiveYearPlansController@show', array($program->id, $five_year_plan->id)) }}">
  33. <span class="glyphicon glyphicon-eye-open"></span>
  34. View
  35. </a>
  36. @if(date('Y-m-d') <= $current_quinquennium->five_year_plan_due_date)
  37. <a class="btn btn-sm btn-default" href="{{ URL::action('FiveYearPlansController@edit', array($program->id, $five_year_plan->id)) }}">
  38. <span class="glyphicon glyphicon-pencil"></span>
  39. Edit
  40. </a>
  41. @endif
  42. @elseif(
  43. $quinquennium->id == $current_quinquennium->id // Quinquennium is running
  44. && date('Y-m-d') >= $current_quinquennium->start_date // Current date
  45. && date('Y-m-d') <= $current_quinquennium->end_date)
  46. <a class="btn btn-sm btn-default" href="{{ URL::action('FiveYearPlansController@create', array($program->id)) }}">
  47. <span class="glyphicon glyphicon-plus"></span>
  48. Create
  49. </a>
  50. @elseif( $current_quinquennium->start_date < $quinquennium->start_date)
  51. Available {{ date('M/d/Y', strtotime($quinquennium->start_date)) }}
  52. @else
  53. Plan not available
  54. @endif
  55. </td>
  56. @endforeach
  57. </tr>
  58. @endforeach
  59. </table>
  60. </div>
  61. </div>
  62. @stop
  63. @section('included-js')
  64. @stop
  65. @section('javascript')
  66. table = $('.datatable').dataTable({
  67. "columnDefs": [
  68. { "searchable": true, "sortable": true, "targets": [0, 1]},
  69. ]
  70. });
  71. $('a.toggle-vis').on('click', function (e) {
  72. e.preventDefault();
  73. // Get the column API object
  74. var column = table.column( $(this).attr('data-column') );
  75. // Toggle the visibility
  76. column.visible( ! column.visible() );
  77. } );
  78. @stop