index.blade.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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="row">
  10. <div class="col-md-7">
  11. <div class="panel panel-default">
  12. <!-- Default panel contents -->
  13. <div class="panel-heading"></div>
  14. <header class="panel-heading" style="height:50px;">
  15. <div class="pull-left">
  16. {{$title1}}
  17. </div>
  18. </header>
  19. <div class="panel-body">
  20. <div class="clearfix"></div>
  21. <table class="table table-bordered" id="example">
  22. <thead>
  23. <tr>
  24. <th>#</th>
  25. <th>Role Name</th>
  26. <th>Display Name</th>
  27. <th>Action</th>
  28. </tr>
  29. </thead>
  30. <tbody>
  31. @if($all_roles)
  32. <?php $i=1; ?>
  33. @foreach($all_roles as $row)
  34. <tr>
  35. <td>{{ $i++ }}</td>
  36. <td>{{ $row->name }}</td>
  37. <td>{{ $row->display_name }}</td>
  38. <td>
  39. @if(\Auth::user()->utype==1)
  40. <a href="{{ url('admin/roles/edit') }}/{{ $row->id }}" class='btn btn-default btn-sm' data-toggle="tooltip" title="Edit" data-placement="top"><i class="fa fa-edit"></i></a>
  41. <a href="{{ url('admin/roles/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>
  42. @endif
  43. </td>
  44. </tr>
  45. @endforeach
  46. @endif
  47. </tbody>
  48. </table>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="col-md-5">
  53. <div class="panel panel-default">
  54. <!-- Default panel contents -->
  55. <div class="panel-heading"></div>
  56. <header class="panel-heading" style="height:50px;">
  57. <div class="pull-left">
  58. {{$title2}}
  59. </div>
  60. </header>
  61. <div class="panel-body">
  62. <div class="clearfix"></div>
  63. <form action="{{ url('admin/roles/store') }}" enctype="multipart/form-data" method="POST" role="form">
  64. {{ csrf_field() }}
  65. <div class="form-group {{ $errors->has('name') ? 'has-error' : '' }}">
  66. <label for="name">Roles Name <i class="text-danger">*</i></label>
  67. <input type='text' name="name" id="name" class="form-control" value="{{ old('name') }}" placeholder="Name">
  68. <lebel class="text-danger"> {{ $errors->first('name') }}</lebel>
  69. </div>
  70. <div class="form-group {{ $errors->has('display_name') ? 'has-error' : '' }}">
  71. <label for="display_name">Display Name <i class="text-danger">*</i></label>
  72. <input type='text' name="display_name" id="display_name" class="form-control" value="{{ old('display_name') }}" placeholder="Display Name">
  73. <lebel class="text-danger"> {{ $errors->first('display_name') }}</lebel>
  74. </div>
  75. <div class="form-group {{ $errors->has('permission') ? 'has-error' : '' }}" style="height: 310px;overflow: scroll;">
  76. <label for="permission">Assign Permission <i class="text-danger">*</i></label>
  77. <div style="color: green;margin-bottom: 15px" class="checkbox">
  78. <label ><input type="checkbox" name="permission" id="select_all" /> Select All Items </label></br>
  79. </div>
  80. @foreach($all_permissions as $info)
  81. <div class="checkbox">
  82. <label><input type="checkbox" name="permission[]" value="{{ $info->id }}"> {{ $info->display_name }} </label>
  83. </div>
  84. @endforeach
  85. <lebel class="text-danger"> {{ $errors->first('permission') }}</lebel>
  86. </div>
  87. <div class="form-group pull-right">
  88. <label></label>
  89. <button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> Save Role</button>
  90. </div>
  91. </form>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. <div class="modal fade" id="modalPreview">
  97. <div class="modal-dialog" style='width: 50%;'>
  98. </div>
  99. </div>
  100. @stop
  101. @section('style')
  102. <style>
  103. .modal-dialog {
  104. width: 70% !important;
  105. height: 70% !important;
  106. }
  107. .modal-content {
  108. height: auto;
  109. min-height: 70% !important;
  110. border-radius: 0;
  111. }
  112. </style>
  113. @stop
  114. @section('script')
  115. <script src="{{ asset('/assets/') }}/js/jquery.dataTables.min.js"></script>
  116. <script src="{{ asset('/assets/') }}/js/dataTables.bootstrap.min.js"></script>
  117. <script src="{{ asset('/assets/') }}/switch/rcswitcher.js"></script>
  118. <script src="{{ asset('/assets/') }}/alert/sweetalert.min.js"></script>
  119. <script src="{{ asset('/assets/') }}/alert/pnotify-init.js"></script>
  120. <script src="{{ asset('/assets/') }}/alert/notify.js"></script>
  121. <script type="text/javascript">
  122. $(document).ready(function() {
  123. $('body').on('hidden.bs.modal', '.modal', function () {
  124. $(this).removeData('bs.modal');
  125. });
  126. var table=$("#example").DataTable({
  127. "searching": true,
  128. "lengthChange": true,
  129. "ordering": true,
  130. stateSave: true
  131. });
  132. });
  133. </script>
  134. <script type="text/javascript">
  135. $('#select_all').click(function(event) {
  136. if(this.checked) {
  137. // Iterate each checkbox
  138. $(':checkbox').each(function() {
  139. this.checked = true;
  140. });
  141. }
  142. else {
  143. $(':checkbox').each(function() {
  144. this.checked = false;
  145. });
  146. }
  147. });
  148. </script>
  149. @if(Session::has('msg'))
  150. <div class="alert alert-success center-block msg_alt" >
  151. <a class="close" data-dismiss="alert" href="#">&times;</a>
  152. <strong><i class="fa fa-check"></i></strong>&nbsp;
  153. {{Session::get('msg')}}
  154. </div>
  155. @endif
  156. @stop