index.blade.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. @extends('layouts.master')
  2. @section('content')
  3. <!-- DataTables -->
  4. <link rel="stylesheet" href="{{ asset('/assets/') }}/css/dataTables.bootstrap.min.css">
  5. <link rel="stylesheet" href="{{ asset('/assets/') }}/switch/rcswitcher.css">
  6. <link rel="stylesheet" href="{{ asset('/assets/') }}/alert/pnotify.css">
  7. <link rel="stylesheet" href="{{ asset('/assets/') }}/alert/sweetalert.css">
  8. <link rel="stylesheet" href="{{ asset('/assets/') }}/alert/sweet-alert-animations.css">
  9. <div class="panel panel-default">
  10. <!-- Default panel contents -->
  11. <div class="panel-heading"></div>
  12. <header class="panel-heading" style="height:50px;">
  13. <div class="pull-left">
  14. {{$title}}
  15. </div>
  16. <div>
  17. @if(\Auth::user()->utype==1)
  18. <a href="{{ url('admin/education_level/add') }}" class="btn btn-sm btn-info pull-right"><i class="fa fa-plus"></i> Add Education Level</a> <br><br>
  19. @endif
  20. </div>
  21. </header>
  22. <div class="panel-body">
  23. <div class="clearfix"></div>
  24. <table class="table table-bordered table-striped" id="example">
  25. <thead>
  26. <tr>
  27. <th>#</th>
  28. <th>Level Name</th>
  29. <th>Status</th>
  30. <th>Action</th>
  31. </tr>
  32. </thead>
  33. <tbody>
  34. @if($all)
  35. <?php $i=1; ?>
  36. @foreach($all as $row)
  37. <tr>
  38. <td>{{ $i++ }}</td>
  39. <td>{{ $row->level_name }}</td>
  40. <td style="text-align: center;">
  41. <input type="checkbox" name="status{{ $row->id }}" @if($row->status == 1) {{ 'checked' }} @endif data-id="{{ $row->id }}">
  42. </td>
  43. <td>
  44. @if(\Auth::user()->utype==1)
  45. <a href="{{ url('admin/education_level/edit') }}/{{ $row->id }}" class='btn btn-default btn-sm' data-toggle="tooltip" title="Edit" data-placement="top"><i class="fa fa-edit"></i></a>
  46. <a href="{{ url('admin/education_level/delete') }}/{{ $row->id }}" class='btn btn-default btn-sm' onclick="return confirm('Are you sure to delete this item ?')" data-toggle="tooltip" title="Delete" data-placement="top"><i class="fa fa-trash-o"></i></a>
  47. @endif
  48. </td>
  49. </tr>
  50. @endforeach
  51. @endif
  52. </tbody>
  53. </table>
  54. </div>
  55. </div>
  56. <div class="modal fade" id="modalPreview">
  57. <div class="modal-dialog" style='width: 70%;'>
  58. </div>
  59. </div>
  60. @stop
  61. @section('style')
  62. <style>
  63. .modal-dialog {
  64. width: 70% !important;
  65. height: 70% !important;
  66. }
  67. .modal-content {
  68. height: auto;
  69. min-height: 70% !important;
  70. border-radius: 0;
  71. }
  72. </style>
  73. @stop
  74. @section('script')
  75. <script src="{{ asset('/assets/') }}/js/jquery.dataTables.min.js"></script>
  76. <script src="{{ asset('/assets/') }}/js/dataTables.bootstrap.min.js"></script>
  77. <script src="{{ asset('/assets/') }}/switch/rcswitcher.js"></script>
  78. <script src="{{ asset('/assets/') }}/alert/sweetalert.min.js"></script>
  79. <script src="{{ asset('/assets/') }}/alert/pnotify.js"></script>
  80. <script src="{{ asset('/assets/') }}/alert/notify.js"></script>
  81. <script type="text/javascript">
  82. $(document).ready(function(){
  83. $('[data-toggle="tooltip"]').tooltip();
  84. $("input[type='checkbox']").rcSwitcher();
  85. });
  86. $(document).ready(function() {
  87. $('body').on('hidden.bs.modal', '.modal', function () {
  88. $(this).removeData('bs.modal');
  89. });
  90. var table=$("#example").DataTable({
  91. "searching": true,
  92. "lengthChange": true,
  93. "ordering": true,
  94. stateSave: true
  95. });
  96. $("input[type='checkbox']").rcSwitcher().on({'toggle.rcSwitcher': function( e, dataObj, changeType ){
  97. var id = $(this).data('id');
  98. var urll="{{ url('admin/education_level/status') }}/"+id;
  99. var msg_success = 'Status Updated Successfully.';
  100. var msg_error = 'Something went wrong!';
  101. $.ajax({
  102. url:urll,
  103. success: function(data){
  104. notify('success',msg_success);
  105. },
  106. error: function (data) {
  107. notify('error',msg_error);
  108. }
  109. });
  110. }
  111. });
  112. });
  113. </script>
  114. @stop
  115. @if(Session::has('msg'))
  116. <div class="alert alert-success center-block msg_alt" >
  117. <a class="close" data-dismiss="alert" href="#">&times;</a>
  118. <strong><i class="fa fa-check"></i></strong>&nbsp;
  119. {{Session::get('msg')}}
  120. </div>
  121. @endif