admin_add.tpl.php 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. defined('IN_ADMIN') or exit('No permission resources.');
  3. $show_validator = true;
  4. include $this->admin_tpl('header');?>
  5. <script type="text/javascript">
  6. <!--
  7. $(function(){
  8. $.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
  9. $("#username").formValidator({onshow:"<?php echo L('input').L('username')?>",onfocus:"<?php echo L('username').L('between_2_to_20')?>"}).inputValidator({min:2,max:20,onerror:"<?php echo L('username').L('between_2_to_20')?>"}).ajaxValidator({
  10. type : "get",
  11. url : "",
  12. data :"m=admin&c=admin_manage&a=public_checkname_ajx",
  13. datatype : "html",
  14. async:'false',
  15. success : function(data){
  16. if( data == "1" )
  17. {
  18. return true;
  19. }
  20. else
  21. {
  22. return false;
  23. }
  24. },
  25. buttons: $("#dosubmit"),
  26. onerror : "<?php echo L('user_already_exist')?>",
  27. onwait : "<?php echo L('connecting_please_wait')?>"
  28. });
  29. $("#password").formValidator({onshow:"<?php echo L('input').L('password')?>",onfocus:"<?php echo L('password').L('between_6_to_20')?>"}).inputValidator({min:6,max:20,onerror:"<?php echo L('password').L('between_6_to_20')?>"});
  30. $("#pwdconfirm").formValidator({onshow:"<?php echo L('input').L('cofirmpwd')?>",onfocus:"<?php echo L('input').L('passwords_not_match')?>",oncorrect:"<?php echo L('passwords_match')?>"}).compareValidator({desid:"password",operateor:"=",onerror:"<?php echo L('input').L('passwords_not_match')?>"});
  31. $("#email").formValidator({onshow:"<?php echo L('input').L('email')?>",onfocus:"<?php echo L('email').L('format_incorrect')?>",oncorrect:"<?php echo L('email').L('format_right')?>"}).regexValidator({regexp:"email",datatype:"enum",onerror:"<?php echo L('email').L('format_incorrect')?>"});
  32. })
  33. //-->
  34. </script>
  35. <div class="pad_10">
  36. <div class="common-form">
  37. <form name="myform" action="?m=admin&c=admin_manage&a=add" method="post" id="myform">
  38. <table width="100%" class="table_form contentWrap">
  39. <tr>
  40. <td width="80"><?php echo L('username')?></td>
  41. <td><input type="test" name="info[username]" class="input-text" id="username"></input></td>
  42. </tr>
  43. <tr>
  44. <td><?php echo L('password')?></td>
  45. <td><input type="password" name="info[password]" class="input-text" id="password" value=""></input></td>
  46. </tr>
  47. <tr>
  48. <td><?php echo L('cofirmpwd')?></td>
  49. <td><input type="password" name="info[pwdconfirm]" class="input-text" id="pwdconfirm" value=""></input></td>
  50. </tr>
  51. <tr>
  52. <td><?php echo L('email')?></td>
  53. <td>
  54. <input type="text" name="info[email]" value="" class="input-text" id="email" size="30"></input>
  55. </td>
  56. </tr>
  57. <tr>
  58. <td><?php echo L('realname')?></td>
  59. <td>
  60. <input type="text" name="info[realname]" value="" class="input-text" id="realname"></input>
  61. </td>
  62. </tr>
  63. <tr>
  64. <td><?php echo L('userinrole')?></td>
  65. <td>
  66. <select name="info[roleid]">
  67. <?php
  68. if($_SESSION['roleid'] != 1) unset($roles[0]);
  69. foreach($roles as $role)
  70. {
  71. ?>
  72. <option value="<?php echo $role['roleid']?>" <?php echo (($role['roleid']==$roleid) ? 'selected' : '')?>><?php echo $role['rolename']?></option>
  73. <?php
  74. }
  75. ?>
  76. </select>
  77. </td>
  78. </tr>
  79. </table>
  80. <div class="bk15"></div>
  81. <input type="hidden" name="info[admin_manage_code]" value="<?php echo $admin_manage_code?>" id="admin_manage_code"></input>
  82. <input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="button">
  83. </form>
  84. </div>
  85. </div>
  86. </body>
  87. </html>