list.blade.php 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. <span class="breadcrumb-item active">Courses</span>
  12. </div>
  13. </div>
  14. <div class="header-elements pull-right d-none">
  15. <div class="breadcrumb justify-content-center">
  16. <a href="{{ url('admin/courses/bulk-entry') }}" class="breadcrumb-elements-item">
  17. <i class="icon-file-excel mr-1"></i>
  18. Bulk Entry
  19. </a>
  20. <a href="{{ url('admin/courses/create') }}" class="breadcrumb-elements-item">
  21. <i class="icon-googleplus5 mr-1"></i>
  22. Create One
  23. </a>
  24. </div>
  25. </div>
  26. </div>
  27. </div>
  28. <!-- /page header -->
  29. <!-- Content area -->
  30. <div class="content">
  31. <div class="card" style="padding:15px;">
  32. <div class="row">
  33. <div class="col-md-3">
  34. <select class="form-control" id="institute">
  35. <option disabled="" selected="" value="0">All Institutes</option>
  36. @foreach($institutes as $row)
  37. <option value="{{$row->id}}">{{$row->name}}</option>
  38. @endforeach
  39. </select>
  40. </div>
  41. <div class="col-md-7">
  42. <input type="text" class="form-control" id="search" placeholder="Search Course">
  43. </div>
  44. <div class="col-md-2" style="display:grid;">
  45. <button type="submit" class="btn btn-primary" id="searchButton">Search <i class="icon-folder-search ml-2"></i></button>
  46. </div>
  47. </div>
  48. </div>
  49. <div id="loadData"></div>
  50. </div>
  51. <!-- /content area -->
  52. @endsection
  53. @push('scripts')
  54. <script src="{{ asset('/assets/global/js/plugins/notifications/sweet_alert.min.js') }}"></script>
  55. <script src="{{ asset('/assets/global/js/plugins/forms/styling/switchery.min.js') }}"></script>
  56. <script type="text/javascript">
  57. $(document).ready(function(){
  58. $('[data-toggle="tooltip"]').tooltip();
  59. get_data();
  60. });
  61. $('#searchButton').on('click', function(){
  62. get_data();
  63. });
  64. function get_data(){
  65. var base = '{{url('/')}}';
  66. var institute = $('#institute').find('option:selected').val();
  67. var search = $('#search').val();
  68. $.ajax({
  69. method: 'GET',
  70. url: base+'/admin/courses/load',
  71. data: {'institute' : institute,'search' : search},
  72. success: function(response){ // What to do if we succeed
  73. //console.log(response);
  74. $('#loadData').html(response);
  75. },
  76. error: function(jqXHR, textStatus, errorThrown) { // What to do if we fail
  77. console.log(JSON.stringify(jqXHR));
  78. console.log("AJAX error: " + textStatus + ' : ' + errorThrown);
  79. }
  80. });
  81. }
  82. </script>
  83. @endpush