add.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <link rel="stylesheet" href="/css/assist/successPage.css">
  2. <div class="hgc_layout">
  3. <div class="hgc_content">
  4. <div class="module backModule">
  5. <h2>
  6. <span>人员信息</span>
  7. <a href="javascript:history.back(-1);" class="backIcon"><img src="/images/assist/icon_hgc_backPrev.svg" /> 返回</a>
  8. </h2>
  9. </div>
  10. </div>
  11. </div>
  12. <div class="main-content-inner">
  13. <div class="page-content" style="margin-top:15px;">
  14. <div class="row" style="margin:0px">
  15. <div class="col-xs-12">
  16. <!-- PAGE CONTENT BEGINS -->
  17. <form class="form-horizontal" action="<?php echo $this->createUrl('assistHome/add')?>" method="post" id="userInfoSubmit">
  18. <div class="form-group">
  19. <label class="control-label col-xs-12 col-sm-3 no-padding-right">人员姓名<span class="errorMessage">*</span>:</label>
  20. <div class="col-xs-12 col-sm-9">
  21. <input type="text" name="real_name" id="admin-real_name" class="col-xs-10 col-sm-3 addborder addheight" value="" placeholder="请填写人员姓名">
  22. <span class="real-name-tips"></span>
  23. </div>
  24. </div>
  25. <div class="form-group">
  26. <label class="control-label col-xs-12 col-sm-3 no-padding-right">登录账号:</label>
  27. <div class="col-sm-9" style="line-height:32px">
  28. <input type="text" name="user_name" id="admin-user_name" class="col-xs-10 col-sm-3 addborder addheight" placeholder="请填写11位有效手机号" value="">
  29. <span class="user-name-tips"></span>
  30. </div>
  31. </div>
  32. <div class="form-group">
  33. <label class="control-label col-xs-12 col-sm-3 no-padding-right">登录密码:</label>
  34. <div class="col-sm-9">
  35. <input type="text" name="password" class="col-xs-10 col-sm-3 addborder addheight" value="123456">
  36. <span class="password-tips"></span>
  37. </div>
  38. </div>
  39. <div class="form-group">
  40. <label class="control-label col-xs-12 col-sm-3 no-padding-right">确认密码:</label>
  41. <div class="col-sm-9">
  42. <input type="text" name="re_password" class="col-xs-10 col-sm-3 addborder addheight" value="123456">
  43. </div>
  44. </div>
  45. <div class="form-group">
  46. <label class="control-label col-xs-12 col-sm-3 no-padding-right">用户状态:</label>
  47. <div class="col-sm-9 mt6">
  48. <span class="inline blue">
  49. <input type="radio" name="status" value="1" checked >
  50. <span class="lbl middle"> 有效</span>
  51. </span>
  52. &nbsp; &nbsp; &nbsp;
  53. <span class="inline blue">
  54. <input type="radio" name="status" value="0" >
  55. <span class="lbl middle"> 冻结</span>
  56. </span>
  57. </div>
  58. </div>
  59. <div class="form-group">
  60. <label class="control-label col-xs-12 col-sm-3 no-padding-right">性别:</label>
  61. <div class="col-sm-9 mt6">
  62. <span class="inline blue">
  63. <input type="radio" name="sex" value="1" checked >
  64. <span class="lbl middle"> 男</span>
  65. </span>
  66. &nbsp; &nbsp; &nbsp;
  67. <span class="inline blue">
  68. <input type="radio" name="sex" value="0" >
  69. <span class="lbl middle"> 女</span>
  70. </span>
  71. </div>
  72. </div>
  73. <div class="form-group">
  74. <label class="control-label col-xs-12 col-sm-3 no-padding-right">用户权限:</label>
  75. <div class="col-sm-9 mt6">
  76. <span class="inline blue">
  77. <input type="checkbox" name="cutting_limit" value="1" checked >
  78. <span class="lbl middle"> 素材切割</span>
  79. </span>
  80. &nbsp; &nbsp; &nbsp;
  81. <span class="inline blue">
  82. <input type="checkbox" name="scan_limit" value="1" checked>
  83. <span class="lbl middle"> 扫描处理</span>
  84. </span>
  85. </div>
  86. </div>
  87. <div class="clearfix form-actions">
  88. <div class="col-md-offset-3 col-md-9">
  89. <button class="btn btn-success btn-sm" type="submit" id="schoolSubmit">
  90. <i class="ace-icon fa fa-check bigger-110"></i>
  91. 提交
  92. </button>
  93. </div>
  94. </div>
  95. </form>
  96. <!-- PAGE CONTENT ENDS -->
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. <script type="text/javascript">
  102. $(function(){
  103. $('#schoolSubmit').click(function(){
  104. var real_name=$('#admin-real_name').val(),
  105. user_name=$('#admin-user_name').val(),
  106. password=$('input[name=password]').val(),
  107. re_password=$('input[name=re_password]').val();
  108. if(real_name==''){
  109. $('.real-name-tips').html('请输入人员姓名 ').show();
  110. return false;
  111. }
  112. if(getByteLen(real_name)>10){
  113. $('.real-name-tips').html('人员姓名长度不超过10位 ').show();
  114. return false;
  115. }
  116. if(user_name==''){
  117. $('.user-name-tips').html('请输入11位手机号 ').show();
  118. return false;
  119. }
  120. if(!isPhoneNo(user_name)){
  121. $('.user-name-tips').html('手机号格式不正确 ').show();
  122. return false;
  123. }
  124. if(password==''){
  125. $('.password-tips').html('请输入用户密码').show();
  126. return false;
  127. }
  128. console.log(password);
  129. console.log(re_password);
  130. if(password!=re_password){
  131. $('.password-tips').html('两次输入密码不一致').show();
  132. return false;
  133. }
  134. });
  135. function getByteLen(val) {
  136. var len = 0;
  137. for (var i = 0; i < val.length; i++) {
  138. var a = val.charAt(i);
  139. if (a.match(/[^\x00-\xff]/ig) != null)
  140. {
  141. len += 1;
  142. }
  143. else
  144. {
  145. len += 1;
  146. }
  147. }
  148. return len;
  149. }
  150. function isPhoneNo(phone) {
  151. var pattern = /^1[345789]\d{9}$/;
  152. return pattern.test(phone);
  153. }
  154. });
  155. </script>