Bez popisu

permissionedit.blade.php 4.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. @extends('admin/master')
  2. @section('content')
  3. <body>
  4. @if(count($errors) > 0)
  5. <div class="Huialert Huialert-info" id="error">
  6. @foreach($errors->all() as $error)
  7. <li>{{$error}}</li>
  8. @endforeach
  9. </div>
  10. @endif
  11. <div class="page-container" style="margin-top:60px;">
  12. <form action="/admin/permission/update" method="post" class="form form-horizontal">
  13. <input type="hidden" name="_token" value="{{ csrf_token() }}" />
  14. <input type="hidden" name="id" value="{{$permission['id']}}">
  15. <div class="row cl">
  16. <label class="form-label col-xs-4 col-sm-2">
  17. 名称:</label>
  18. <div class="formControls col-xs-6 col-sm-6">
  19. <input type="text" class="input-text" @if(old('name')) value="{{old('name')}}" @else value="{{$permission['name']}}" @endif placeholder="" name="name">
  20. </div>
  21. </div>
  22. <div class="row cl">
  23. <label class="form-label col-xs-4 col-sm-2">
  24. 说明:</label>
  25. <div class="formControls col-xs-6 col-sm-6">
  26. <input type="text" class="input-text" @if(old('description')) value="{{old('description')}}" @else value="{{$permission['description']}}" @endif placeholder="" name="description">
  27. </div>
  28. </div>
  29. <div class="row cl">
  30. <label class="form-label col-xs-4 col-sm-2">父级权限:</label>
  31. <div class="formControls col-xs-6 col-sm-6"> <span class="select-box">
  32. <select class="select" size="1" name="parent_id">
  33. @if (old('parent_id'))
  34. @if((old('parent_id'))==0)
  35. <option value="0" selected >一级权限</option>
  36. @foreach($permissions as $v)
  37. <option value="{{$v['id']}}">
  38. {{$v['name']}}[{{$v['description']}}]
  39. </option>
  40. @endforeach
  41. @else
  42. <option value="0">一级权限</option>
  43. @foreach($permissions as $v)
  44. <option value="{{$v['id']}}"
  45. @if($v['id']==old('parent_id')) selected @endif>{{$v['name']}}[{{$v['description']}}]
  46. </option>
  47. @endforeach
  48. @endif
  49. @else
  50. @if($permission['parent_id']==0)
  51. <option value="0" selected >一级权限</option>
  52. @foreach($permissions as $v)
  53. <option value="{{$v['id']}}">
  54. {{$v['name']}}[{{$v['description']}}]
  55. </option>
  56. @endforeach
  57. @else
  58. <option value="0">一级权限</option>
  59. @foreach($permissions as $v)
  60. <option value="{{$v['id']}}"
  61. @if($v['id']==$permission['parent_id']) selected @endif>{{$v['name']}}[{{$v['description']}}]
  62. </option>
  63. @endforeach
  64. @endif
  65. @endif
  66. </select>
  67. </span>
  68. </div>
  69. </div><br><br>
  70. <div class="row cl">
  71. <div class="col-9 col-offset-2">
  72. <button class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">&nbsp;&nbsp;修改&nbsp;&nbsp;</button>&nbsp;
  73. <button class="btn btn-default" type="reset" onclick="return_index();">&nbsp;&nbsp;返回&nbsp;&nbsp;</button>&nbsp;
  74. {{--<a href="javascript:void(0)" class="btn btn-default radius" onclick="redirect('{{url('/admin/permission/index')}}')">返回并查看结果</a>--}}
  75. </div>
  76. </div>
  77. </form>
  78. </div>
  79. <!--_footer 作为公共模版分离出去-->
  80. <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
  81. <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
  82. <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
  83. <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
  84. <!--/_footer 作为公共模版分离出去-->
  85. <!--请在下方写此页面业务相关的脚本-->
  86. <script type="text/javascript">
  87. $(function(){
  88. setTimeout("$('#error').hide()",3000);
  89. });
  90. /*返回*/
  91. function return_index(){
  92. location.href='/admin/permission/index';
  93. }
  94. </script>
  95. </body>
  96. @endsection