edit_entry_req.blade.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. @extends('admin.layout.index')
  2. @push('css-head')
  3. @endpush
  4. @section('content')
  5. <!-- Page header -->
  6. <div class="page-header page-header-light">
  7. <div class="breadcrumb-line breadcrumb-line-light header-elements-md-inline">
  8. <div class="d-flex">
  9. <div class="breadcrumb">
  10. <a href="{{url('/admin')}}" class="breadcrumb-item"><i class="icon-home2 mr-2"></i> Dashboard</a>
  11. <a href="{{url('/admin/institutes')}}" class="breadcrumb-item"> Institutes</a>
  12. <span class="breadcrumb-item active">{{$course->institute->name}} ({{$serial}}/{{$total_courses}})</span>
  13. </div>
  14. </div>
  15. </div>
  16. </div>
  17. <!-- /page header -->
  18. <!-- Content area -->
  19. <div class="content">
  20. <div class="card">
  21. <div class="card-body">
  22. @if (count($errors) > 0)
  23. <div class="alert alert-danger alert-no-border alert-txt-colored alert-close alert-dismissible fade show" role="alert">
  24. <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  25. <span aria-hidden="true">×</span>
  26. </button>
  27. <strong>Whoops!</strong> There were some problems with your input.
  28. <ul>
  29. @foreach ($errors->all() as $error)
  30. <li>{{ $error }}</li>
  31. @endforeach
  32. </ul>
  33. </div>
  34. @endif
  35. {!!Form::model($course,['method'=>'PETCH','url'=>['admin/institutes/update_entry_req',$course->id]])!!}
  36. <div class="row">
  37. <div class="col-md-8">
  38. <div class="form-group">
  39. <label>Course Name:</label>
  40. <input type="text" class="form-control" name="courseName" value="{{$course->name}}" id="courseName" disabled>
  41. </div>
  42. </div>
  43. <div class="col-md-4">
  44. <div class="form-group">
  45. <label>Course Length (month):</label>
  46. <input type="number" class="form-control" min="0" name="courseLength" value="{{$course->length}}" id="courseLength" disabled>
  47. </div>
  48. </div>
  49. </div>
  50. <div class="row">
  51. <div class="col-md-12">
  52. <div class="form-group">
  53. <label>Keywords</label>
  54. <input type="text" class="form-control tokenfield" name="tags" value="@foreach($selected_tags as $tag){{$tag}}@if(!$loop->last) , @endif @endforeach">
  55. </div>
  56. </div>
  57. </div>
  58. <div class="row">
  59. <div class="col-md-12">
  60. <div class="form-group">
  61. <label>Entry Requirements</label>
  62. <textarea class="form-control summernote" name="entry_requirement">{!! $course->entry_requirement !!}</textarea>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="text-right">
  67. <a href="{{ url()->current() }}" class="btn btn-secondary pull-left">
  68. Refresh
  69. <i class="icon-reload-alt ml-2"></i>
  70. </a>
  71. <button type="submit" class="btn btn-primary">Submit <i class="icon-paperplane ml-2"></i></button>
  72. </div>
  73. {!! Form::close() !!}
  74. </div>
  75. </div>
  76. </div>
  77. <!-- /content area -->
  78. @endsection
  79. @push('scripts')
  80. <script type="text/javascript" src="{{ asset('assets//global/js/plugins/forms/selects/select2.min.js')}}"></script>
  81. <script type="text/javascript" src="{{ asset('assets/global/js/plugins/forms/tags/tagsinput.min.js')}}"></script>
  82. <script type="text/javascript" src="{{ asset('assets/global/js/plugins/forms/tags/tokenfield.min.js')}}"></script>
  83. <script type="text/javascript" src="{{ asset('assets/global/js/plugins/editors/summernote/summernote.min.js')}}"></script>
  84. <script type="text/javascript">
  85. $(document).ready(function(){
  86. $('.select2').select2();
  87. $('.tokenfield').tokenfield();
  88. $('.summernote').summernote();
  89. });
  90. $('.destination').on('change', function(){
  91. var destination = $('.destination option:selected').val();
  92. var select_tag = $('.institute');
  93. $.get("{{ route('admin.ajax-get', ['name'=>'sams_institutes']) }}", {
  94. destination : destination, type : 'all'
  95. }).done(function(res){
  96. select_tag.empty().append('<option disabled="" selected="" value="">Choose One..</option>');
  97. res.forEach(function(row){
  98. select_tag.append(
  99. $('<option></option>').val(row.institute_id+'::'+row.institute_name).html(row.institute_name)
  100. );
  101. });
  102. });
  103. $('.institute').empty().append('<option disabled="" selected="" value="">Choose One..</option>');
  104. $('.level').empty().append('<option disabled="" selected="" value="">Choose One..</option>');
  105. $('.campus').empty().append('<option disabled="">Choose One..</option>');
  106. $('.intake').empty().append('<option disabled="">Choose One..</option>');
  107. });
  108. $('.institute').on('change', function(){
  109. var institute = $('.institute option:selected').val();
  110. var select_tag = $('.level');
  111. $.get("{{ route('admin.ajax-get', ['name'=>'sams_levels']) }}", {
  112. institute : institute, group : 0
  113. }).done(function(res){
  114. select_tag.empty().append('<option disabled="" selected="" value="">Choose One..</option>');
  115. res.forEach(function(row){
  116. select_tag.append(
  117. $('<option></option>').val(row.id+'::'+row.name).html(row.name)
  118. );
  119. });
  120. });
  121. $.get("{{ route('admin.ajax-get', ['name'=>'sams_campuses']) }}", {
  122. institute : institute
  123. }).done(function(campuses){
  124. var select_tag = $('.campus');
  125. select_tag.empty().append('<option disabled="">Choose One..</option>');
  126. if(campuses.length > 0){
  127. campuses.forEach(function(row){
  128. select_tag.append(
  129. $('<option></option>').val(row.id+'::'+row.name).html(row.name)
  130. );
  131. });
  132. $('#instituteDiv').removeClass('col-md-8');
  133. $('#instituteDiv').addClass('col-md-4');
  134. $('#campusDiv').removeClass('d-none');
  135. }else{
  136. $('#instituteDiv').addClass('col-md-8');
  137. $('#instituteDiv').removeClass('col-md-4');
  138. $('#campusDiv').addClass('d-none');
  139. }
  140. });
  141. $.get("{{ route('admin.ajax-get', ['name'=>'sams_intakes']) }}", {
  142. institute : institute
  143. }).done(function(intakes){
  144. var select_tag = $('.intake');
  145. select_tag.empty().append('<option disabled="">Choose One..</option>');
  146. if(intakes.length > 0){
  147. intakes.forEach(function(row){
  148. select_tag.append(
  149. $('<option></option>').val(row.intake).html(getMonthName(row.intake))
  150. );
  151. });
  152. }else{
  153. select_tag.empty().append('<option disabled="">Choose One..</option>');
  154. }
  155. });
  156. });
  157. $('.level').on('change', function(){
  158. var institute = $('.institute option:selected').val();
  159. var level = $('.level option:selected').val();
  160. var select_tag = $('.intake');
  161. $.get("{{ route('admin.ajax-get', ['name'=>'sams_intakes']) }}", {
  162. institute : institute, level : level
  163. }).done(function(intakes){
  164. select_tag.empty().append('<option disabled="">Choose One..</option>');
  165. if(intakes.length > 0){
  166. intakes.forEach(function(row){
  167. select_tag.append(
  168. $('<option></option>').val(row.intake).html(getMonthName(row.intake))
  169. );
  170. });
  171. }else{
  172. select_tag.empty().append('<option disabled="">Choose One..</option>');
  173. }
  174. });
  175. });
  176. function getMonthName(monthNumber) {
  177. var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
  178. return months[monthNumber - 1];
  179. }
  180. </script>
  181. @endpush