edit.blade.php 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. @extends('layouts.master')
  2. @section('content')
  3. <div class="content">
  4. <div class="row">
  5. <form action="{{ url('admin/roles/update/'.$role->id) }}" enctype="multipart/form-data" method="POST" role="form">
  6. <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
  7. <header class="panel-heading" style="height:50px;">
  8. <div class="pull-left">
  9. {{$title}}
  10. </div>
  11. <div>
  12. @if(\Auth::user()->utype==1)
  13. <a style="margin-left: 3px" href="{{ url('admin/roles') }}" class="btn btn-sm btn-info pull-right"><i class="fa fa-list"></i> Roles List</a> <br><br>
  14. @endif
  15. </div>
  16. </header>
  17. </div>
  18. <div class="col-md-12">
  19. <div class="panel panel-default">
  20. <div class="panel-body">
  21. {{ csrf_field() }}
  22. <div class="col-md-6 col-md-offset-3">
  23. <div class="form-group {{ $errors->has('name') ? 'has-error' : '' }}">
  24. <label for="name">Roles Name <i class="text-danger">*</i></label>
  25. <input type='text' name="name" id="name" class="form-control" value="{{ $role->name }}" placeholder="Name">
  26. <lebel class="text-danger"> {{ $errors->first('name') }}</lebel>
  27. </div>
  28. <div class="form-group {{ $errors->has('display_name') ? 'has-error' : '' }}">
  29. <label for="display_name">Display Name <i class="text-danger">*</i></label>
  30. <input type='text' name="display_name" id="display_name" class="form-control" value="{{ $role->display_name }}" placeholder="Display Name">
  31. <lebel class="text-danger"> {{ $errors->first('display_name') }}</lebel>
  32. </div>
  33. <div class="form-group {{ $errors->has('permission') ? 'has-error' : '' }}" style="height: 310px;overflow: scroll;">
  34. <label for="permission">Assign Permission <i class="text-danger">*</i></label>
  35. <div style="color: green;margin-bottom: 15px" class="checkbox">
  36. <label ><input type="checkbox" name="select-all" id="select_all" /> Select All Items </label></br>
  37. </div>
  38. @foreach($all_permissions as $value)
  39. <label>{{ Form::checkbox('permission[]', $value->id, in_array($value->id, $rolePermissions) ? true : false, array('class' => 'name')) }}
  40. {{ $value->display_name }}</label>
  41. <br/>
  42. @endforeach
  43. <lebel class="text-danger"> {{ $errors->first('permission') }}</lebel>
  44. </div>
  45. <div class="form-group pull-right">
  46. <label for="level_name"></label>
  47. <button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> Update</button>
  48. <a href="{{ url('admin/roles') }}" class="btn btn-default">
  49. <i class="fa fa-times"></i> Cancel</a>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </form>
  56. </div>
  57. </div>
  58. @stop
  59. @section('script')
  60. <script type="text/javascript">
  61. $('#select_all').click(function(event) {
  62. if(this.checked) {
  63. // Iterate each checkbox
  64. $(':checkbox').each(function() {
  65. this.checked = true;
  66. });
  67. }
  68. else {
  69. $(':checkbox').each(function() {
  70. this.checked = false;
  71. });
  72. }
  73. });
  74. </script>
  75. @if(Session::has('msg'))
  76. <div class="alert alert-success center-block msg_alt" >
  77. <a class="close" data-dismiss="alert" href="#">&times;</a>
  78. <strong><i class="fa fa-check"></i></strong>&nbsp;
  79. {{Session::get('msg')}}
  80. </div>
  81. @endif
  82. @stop