You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.2 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
  1. @extends('admin.layouts.app')
  2. @section('title', '管理员添加')
  3. @section('content')
  4. <h5 class="sub-header"><a href="/fladmin/user">管理员列表</a> > 管理员添加</h5>
  5. <form id="addarc" method="post" action="/fladmin/user/doadd" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
  6. <table class="table table-striped table-bordered">
  7. <tbody>
  8. <tr>
  9. <td align="right">用户名:</td>
  10. <td><input name="username" type="text" id="username" value="" class="required" style="width:30%" placeholder="在此输入用户名"></td>
  11. </tr>
  12. <tr>
  13. <td align="right">密码:</td>
  14. <td><input name="pwd" type="password" id="pwd" value="" class="required" style="width:60%"></td>
  15. </tr>
  16. <tr>
  17. <td align="right">邮箱:</td>
  18. <td><input name="email" type="text" id="email" value="" style="width:60%"></td>
  19. </tr>
  20. <tr>
  21. <td align="right">角色:</td>
  22. <td>
  23. <select name="role_id" id="role_id">
  24. <?php if($rolelist){foreach($rolelist as $row){ ?>
  25. <option value="<?php echo $row["id"]; ?>"><?php echo $row["name"]; ?></option>
  26. <?php }} ?>
  27. </select>
  28. </td>
  29. </tr>
  30. <tr>
  31. <td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></td>
  32. </tr>
  33. </tbody></table></form><!-- 表单结束 -->
  34. <script>
  35. $(function(){
  36. $(".required").blur(function(){
  37. var $parent = $(this).parent();
  38. $parent.find(".formtips").remove();
  39. if(this.value=="")
  40. {
  41. $parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>');
  42. }
  43. else
  44. {
  45. $parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
  46. }
  47. });
  48. //重置
  49. $('#addarc input[type="reset"]').click(function(){
  50. $(".formtips").remove();
  51. });
  52. $("#addarc").submit(function(){
  53. $(".required").trigger('blur');
  54. var numError = $('#addarc .onError').length;
  55. if(numError){return false;}
  56. });
  57. });
  58. </script>
  59. @endsection