edit.php 8.2 KB

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