123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- {template 'common/header'}
-
- {if $do == 'add'}
- <ol class="breadcrumb we7-breadcrumb">
- <a href="{php echo url('mc/member/display')}"><i class="wi wi-back-circle"></i> </a>
- <li>
- <a href="{php echo url('mc/member/display')}">会员管理</a>
- </li>
- <li>
- 添加会员
- </li>
- </ol>
- <form action="./index.php?c=mc&a=member&do=add" method="post" class="we7-form" role="form" id="form1">
- <div class="form-group">
- <label class="col-sm-2 control-label">会员姓名</label>
- <div class="col-sm-9 col-xs-12">
- <input type="text" name="realname" value="" class="form-control"/>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">手机号</label>
- <div class="col-sm-9 col-xs-12">
- <input type="text" name="mobile" value="" class="form-control"/>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">登录密码</label>
- <div class="col-sm-9 col-xs-12">
- <input type="password" name="password" value="" class="form-control"/>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">邮箱</label>
- <div class="col-sm-9 col-xs-12">
- <input type="text" name="email" value="" class="form-control"/>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">{$creditnames['credit1']['title']}</label>
- <div class="col-sm-9 col-xs-12">
- <input type="text" name="credit1" value="0" class="form-control"/>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">{$creditnames['credit2']['title']}</label>
- <div class="col-sm-9 col-xs-12">
- <input type="text" name="credit2" value="0" class="form-control"/>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">会员组</label>
- <div class="col-sm-9 col-xs-12">
- <select name="groupid" class="form-control we7-select">
- {loop $_W['account']['groups'] $group}
- <option value="{$group['groupid']}">{$group['title']}</option>
- {/loop}
- </select>
- </div>
- </div>
-
- <div class="form-group">
- <div class="">
- <input type="hidden" name="token" value="{$_W['token']}"/>
- <input type="hidden" name="form" value="{$_W['token']}"/>
- <input type="submit" value="提交" class="btn btn-primary"/>
- </div>
- </div>
- </form>
- <script>
- require(['validator'], function(){
- var credit2_title = "{$creditnames['credit2']['title']}";
- var credit1_title = "{$creditnames['credit1']['title']}";
- $(function(){
- $('#form1').bootstrapValidator({
- fields: {
- realname: {
- validators: {
- notEmpty: {
- message: '姓名不能为空'
- }
- }
- },
- mobile: {
- validators: {
- notEmpty: {
- message: '手机不能为空'
- },
- regexp: {
- regexp: /1\d{10}/,
- message: '手机号格式不正确'
- },
- remote: {
- url: "{php echo url('mc/member/add');}",
- data: function(validator) {
- return {
- type: 'mobile',
- data: validator.getFieldElements('mobile').val()
- };
- },
- message: '手机号已经被占用'
- }
- }
- },
- email: {
- validators: {
- regexp: {
- regexp: /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/i,
- message: '邮箱格式不正确'
- },
- remote: {
- url: "{php echo url('mc/member/add');}",
- data: function(validator) {
- return {
- type: 'email',
- data: validator.getFieldElements('email').val()
- };
- },
- message: '邮箱已经被占用'
- }
- }
- },
- password: {
- validators: {
- notEmpty: {
- message: '密码不能为空'
- },
- stringLength: {
- min: 8,
- max: 15,
- message: '密码最少为8位'
- }
- }
- },
- credit1: {
- validators: {
- regexp: {
- regexp: /^[0-9]\d*$/i,
- message: credit1_title + '格式不正确'
- }
- }
- },
- credit2: {
- validators: {
- regexp: {
- regexp: /^[0-9]\d*$/i,
- message: credit2_title + '格式不正确'
- }
- }
- }
- }
- });
- });
- });
- </script>
- {/if}
- {template 'common/footer'}
|