index.blade.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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_permissions)
  32. <?php $i=1; ?>
  33. @foreach($all_permissions 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/permissions/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/permissions/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/permissions/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">Permission 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">Permission 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 pull-right">
  76. <label></label>
  77. <button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> Save Permission</button>
  78. </div>
  79. </form>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. @stop
  85. @section('script')
  86. <script src="{{ asset('/assets/') }}/js/jquery.dataTables.min.js"></script>
  87. <script src="{{ asset('/assets/') }}/js/dataTables.bootstrap.min.js"></script>
  88. <script src="{{ asset('/assets/') }}/switch/rcswitcher.js"></script>
  89. <script src="{{ asset('/assets/') }}/alert/sweetalert.min.js"></script>
  90. <script src="{{ asset('/assets/') }}/alert/pnotify-init.js"></script>
  91. <script src="{{ asset('/assets/') }}/alert/notify.js"></script>
  92. <script type="text/javascript">
  93. $(document).ready(function() {
  94. var table=$("#example").DataTable({
  95. "searching": true,
  96. "lengthChange": true,
  97. "ordering": true,
  98. stateSave: true
  99. });
  100. });
  101. </script>
  102. @if(Session::has('msg'))
  103. <div class="alert alert-success center-block msg_alt" >
  104. <a class="close" data-dismiss="alert" href="#">&times;</a>
  105. <strong><i class="fa fa-check"></i></strong>&nbsp;
  106. {{Session::get('msg')}}
  107. </div>
  108. @endif
  109. @stop