No Description

index_five_year_plans.blade.php 4.2KB

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