<style>
    .equitycof{margin-right: 0px;}
</style>
<div class="col-md-10" role="main" id="bnb">
        <nav class="breadcrumb"></i> 积分商城模块<span class="c-gray en">&gt;</span>积分商城配置</nav>
        <div class="sjsc_xgpz">                       
            <div class="title-box" style="border:0;">
                        <p class="t-p" style="width: 500px;display: inline-block;margin-top: 20px;margin-bottom: 10px;">商城开通</p>
                        <button type="button" class="sjxg_fh" data-dismiss="modal" style="margin-top:25px;">返回</button>
                    </div>
            <div class="bs-example">
                <form action="<?php echo empty($id)?site_url('score/shop/save'):site_url('score/shop/save/'.$id);?>" method="post" class="registerForm regiswidth">
                    <div class="form-group">
                        <span class="changeInfo-span">*联系人：</span>
                        <div class="changeInfo-input" style="float: right;width: 643px;margin: 2px auto!important;">
                            <input type="text" name="name" class="form-control" maxlength="5"  value="<?php echo empty($name)?'':$name;?>">
                            <p>
                                
                                <div class="t-e biu_e">
                                    <img src="<?php echo asset_url('images/explain.png');?>" alt="" style="display:block;float:left;margin-top: 3px;margin-right:5px;">
                                    <span class="thread_tle" style="display: block;">提示：请输入2-5个汉字。</span>
                                </div>
                            </p>
                        </div>
                    </div>               
                    <div class="form-group">
                        <span class="changeInfo-span">*联系电话：</span>
                        <div class="changeInfo-input" style="float: right;width: 643px;margin: 2px auto!important;">
                            <input type="text" name="tel" class="form-control" maxlength="13" id="nameFocus" value="<?php echo empty($tel)?'':$tel;?>">
                            <p>
                                
                                <div class="t-e biu_e">
                                    <img src="<?php echo asset_url('images/explain.png');?>" alt="" style="display:block;float:left;margin-top: 3px;margin-right:5px;">
                                    <span class="thread_tle" style="display: block;">提示：请带区号输入联系人电话(例如：0517-88532778)。</span>
                                </div>
                            </p>
                        </div>
                    </div> 
                    <div class="form-group">  
                        <span class="changeInfo-span">*联系手机：</span>
                        <div class="changeInfo-input" style="float: right;width: 643px;margin: 2px auto!important;">
                           <input type="text" name="phone" class="form-control" maxlength="11" id="nameFocus" value="<?php echo empty($phone)?'':$phone;?>">
                            <p>
                                
                                <div class="t-e biu_e">
                                    <img src="<?php echo asset_url('images/explain.png');?>" alt="" style="display:block;float:left;margin-top: 3px;margin-right:5px;">
                                    <span class="thread_tle" style="display: block;">提示：请填写联系人手机。</span>
                                </div>
                            </p>
                        </div>
                    </div> 
                    <div class="form-group">    
                        <span class="changeInfo-span">联系QQ：</span>
                        <div class="changeInfo-input" style="float: right;width: 643px;margin: 2px auto!important;">
                           <input type="text" name="qq" class="form-control" maxlength="11" id="nameFocus" value="<?php echo empty($qq)?'':$qq;?>">
                            <p>
                                
                                <div class="t-e biu_e">
                                    <img src="<?php echo asset_url('images/explain.png');?>" alt="" style="display:block;float:left;margin-top: 3px;margin-right:5px;">
                                    <span class="thread_tle" style="display: block;">提示：请填写联系人QQ号。</span>
                                </div>
                            </p>
                        </div>
                    </div>                                  
                    <div class="form-group">    
                        <span class="changeInfo-span">*联系地址：</span>
                        <div class="changeInfo-input" style="float: right;width: 643px;margin: 2px auto!important;">
                           <input type="text" name="addr" class="form-control" maxlength="" id="nameFocus" value="<?php echo empty($addr)?'':$addr;?>">
                            <p>
                                
                                <div class="t-e biu_e">
                                    <img src="<?php echo asset_url('images/explain.png');?>" alt="" style="display:block;float:left;margin-top: 3px;margin-right:5px;">
                                    <span class="thread_tle" style="display: block;">提示：请填写联系地址,最多20个汉字含符号。</span>
                                </div>
                            </p>
                        </div>
                    </div>                              
                    <div class="form-group">    
                        <span class="changeInfo-span">*兑换使用积分：</span>
                        <div c lass="examp">
                            <select name="type" class="selectmr" style="width:150px" data-bv-notempty data-bv-notempty-message="请选择一项">
                            <option value="" >请选择分类</option>
                            <?php foreach ($extcredits as $id => $value) {
                                if($value['available']){
                            ?>  
                                <option value="<?php echo $id?>" <?php if($type == $id){?>selected<?php } ?> ><?php echo empty($value['title']) ? 'extcredit'.$id : $value['title'];?></option>
                            <?php }?>
                            <?php }?>
                            </select>
                        </div>
                    </div>                
                    <button type="submit" class="edit_btn  equitycof h5a-btn btn  btn-primary" id="save">保存修改</button>
                </form>
                </div>    
        </div>
    </div>
<script type="text/javascript">
    jQuery(document).ready(function($) {
        $("button[type=button]").on('click', function(event) {
            event.preventDefault();
            /* Act on the event */
            location.href="javascript:history.go(-1)";
        });
    });
    $(function(){
        $('.registerForm').bootstrapValidator({
            message: 'This value is not valid',
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh',
            },  
            fields: {
                name: {
                    message: '联系人',
                    validators: {
                        notEmpty: {
                            message: '联系人不能是空的'
                        },
                        regexp: {
                            regexp: /^([\u4e00-\u9fa5]){2,5}|\s+$/,
                            message: '请输入2-5个汉字',

                        }                        
                    }
                },
                tel: {
                    message: '电话号码',
                    validators: {
                        notEmpty: {
                            message: '电话号码不能是空的'
                        },
                        regexp: {
                            regexp: /^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+$/i,
                            message: '电话号码不正确',

                        }
                    }
                },
                phone: {
                    message: '手机号码',
                    validators: {
                        notEmpty: {
                            message: '手机号码不能是空的'
                        },
                        regexp: {
                            regexp: /^(13[0-9]|14[0-9]|15[0-9]|17[0-9]|18[0-9])\d{8}?/i,
                            message: '手机号码不正确',

                        }
                    }
                },
                // qq: {
                //     message: 'QQ',
                //     validators: {
                //         notEmpty: {
                //             message: 'QQ号码不能为空'
                //         },
                //         regexp: {
                //             regexp: /^[1-9][0-9]{4,9}?/i,
                //             message: 'QQ号码不正确',

                //         }
                //     }
                // },
                addr  : {
                    message: '联系地址',
                    validators: {
                        notEmpty: {
                            message: '请填写联系地址'
                        },
                        stringLength: {
                            max: 20,
                            message: '联系地址最多20个字符'
                        }
                    }
                },
                selectmr:{
                    message:'兑换使用积分',
                    validators:{
                        notEmpty:{
                            message:'请选择一项'
                        }
                    }
                }      
            }
        })        
    })
</script>