{include file="public/header" /}
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>



<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>会员管理</h3>
                <h5></h5>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>


    <form id="user_form" enctype="multipart/form-data" method="post">
        <input type="hidden" name="form_submit" value="ok" />
        <input type="hidden" name="member_id" value="<?php echo $member_array['member_id'];?>" />
        <input type="hidden" name="old_member_avatar" value="<?php echo $member_array['member_avatar'];?>" />
        <input type="hidden" name="member_name" value="<?php echo $member_array['member_name'];?>" />
        <table class="ds-default-table">
            <tbody>
                <tr class="noborder">
                    <td colspan="2" class="required"><label>{$Think.lang.member_index_name}:</label></td>
                </tr>
                <tr class="noborder">
                    <td class="vatop rowform"><?php echo $member_array['member_name'];?></td>
                    <td class="vatop tips"></td>
                </tr>
                <tr>
                    <td colspan="2" class="required"><label for="member_password">{$Think.lang.member_edit_password}:</label></td>
                </tr>
                <tr class="noborder">
                    <td class="vatop rowform"><input type="text" id="member_password" name="member_password" class="txt"></td>
                    <td class="vatop tips">{$Think.lang.member_edit_password_keep}</td>
                </tr>
                <tr>
                    <td colspan="2" class="required"><label class="validation" for="member_email">{$Think.lang.member_index_email}:</label></td>
                </tr>
                <tr class="noborder">
                    <td class="vatop rowform"><input type="text" value="<?php echo $member_array['member_email'];?>" id="member_email" name="member_email" class="txt"></td>
                    <td class="vatop tips">{$Think.lang.member_index_email}</td>
                </tr>
                <tr>
                    <td colspan="2" class="required"><label for="member_truename">{$Think.lang.member_index_true_name}:</label></td>
                </tr>
                <tr class="noborder">
                    <td class="vatop rowform"><input type="text" value="<?php echo $member_array['member_truename'];?>" id="member_truename" name="member_truename" class="txt"></td>
                    <td class="vatop tips"></td>
                </tr>
                <tr>
                    <td colspan="2" class="required"><label>{$Think.lang.member_edit_sex}:</label></td>
                </tr>
                <tr class="noborder">
                    <td class="vatop rowform"><ul>

                                <input type="radio" <?php if($member_array['member_sex'] == 0){ ?>checked="checked"<?php } ?> value="0" name="member_sex" id="member_sex0">
                                       <label for="member_sex0">{$Think.lang.member_edit_secret}</label>

                                <input type="radio" <?php if($member_array['member_sex'] == 1){ ?>checked="checked"<?php } ?> value="1" name="member_sex" id="member_sex1">
                                       <label for="member_sex1">{$Think.lang.member_edit_male}</label>

                                <input type="radio" <?php if($member_array['member_sex'] == 2){ ?>checked="checked"<?php } ?> value="2" name="member_sex" id="member_sex2">
                                       <label for="member_sex2">{$Think.lang.member_edit_female}</label>

                        </ul></td>
                    <td class="vatop tips"></td>
                </tr>
                <!--V3-B11 显示所在地-->
                <tr>
                    <td colspan="2" class="required"><label class="member_areainfo">所在地区:</label></td>
                </tr>
                <tr class="noborder">
                    <td class="vatop rowform"  colspan="2">
                        <span id="region" class="w400">
                            <input type="hidden" value="<?php echo $member_array['member_provinceid'];?>" name="province_id" id="province_id">
                            <input type="hidden" value="<?php echo $member_array['member_cityid'];?>" name="city_id" id="city_id">
                            <input type="hidden" value="<?php echo $member_array['member_areaid'];?>" name="area_id" id="area_id" class="area_ids" />
                            <input type="hidden" value="<?php echo $member_array['member_areainfo'];?>" name="area_info" id="area_info" class="area_names" />
                            <?php if(!empty($member_array['member_areaid'])){?>
                            <span><?php echo $member_array['member_areainfo'];?></span>
                            <input type="button" value="{$Think.lang.ds_edit}" style="background-color: #F5F5F5; width: 60px; height: 32px; border: solid 1px #E7E7E7; cursor: pointer" class="edit_region" />
                            <select style="display:none;">
                            </select>
                            <?php }else{?>
                            <select>
                            </select>
                            <?php }?>
                        </span>
                    </td>

                </tr>


                <tr>
                    <td colspan="2" class="required"><label class="member_mobile">手机号码:</label></td>
                </tr>
                <tr class="noborder">
                    <td class="vatop rowform"><input type="text" value="<?php echo $member_array['member_mobile'];?>" id="member_mobile" name="member_mobile" class="txt"></td>
                    <td class="vatop tips"></td>
                </tr>

                <tr>
                    <td colspan="2" class="required"><label class="member_qq">QQ:</label></td>
                </tr>
                <tr class="noborder">
                    <td class="vatop rowform"><input type="text" value="<?php echo $member_array['member_qq'];?>" id="member_qq" name="member_qq" class="txt"></td>
                    <td class="vatop tips"></td>
                </tr>
                <tr>
                    <td colspan="2" class="required"><label class="member_ww">{$Think.lang.member_edit_wangwang}:</label></td>
                </tr>
                <tr class="noborder">
                    <td class="vatop rowform"><input type="text" value="<?php echo $member_array['member_ww'];?>" id="member_ww" name="member_ww" class="txt"></td>
                    <td class="vatop tips"></td>
                </tr>

                <tr>
                    <td colspan="2" class="required"><label>{$Think.lang.member_index_inform}:</label></td>
                </tr>
                <tr class="noborder">
                    <td class="vatop rowform onoff">
                        <label for="inform_allow1" class="cb-enable <?php if($member_array['inform_allow'] == '1'){ ?>selected<?php } ?>" ><span>{$Think.lang.member_edit_allow}</span></label>
                        <label for="inform_allow2" class="cb-disable <?php if($member_array['inform_allow'] == '2'){ ?>selected<?php } ?>" ><span>{$Think.lang.member_edit_deny}</span></label>
                        <input id="inform_allow1" name="inform_allow" <?php if($member_array['inform_allow'] == '1'){ ?>checked="checked"<?php } ?>  value="1" type="radio">
                        <input id="inform_allow2" name="inform_allow" <?php if($member_array['inform_allow'] == '2'){ ?>checked="checked"<?php } ?> value="2" type="radio">
                    </td>
                    <td class="vatop tips"></td>
                </tr>
                <tr>
                    <td colspan="2" class="required"><label>{$Think.lang.member_edit_allowbuy}:</label></td>
                </tr>
                <tr class="noborder">
                    <td class="vatop rowform onoff">
                        <label for="isbuy_1" class="cb-enable <?php if($member_array['is_buy'] == '1'){ ?>selected<?php } ?>" ><span>{$Think.lang.member_edit_allow}</span></label>
                        <label for="isbuy_2" class="cb-disable <?php if($member_array['is_buy'] == '0'){ ?>selected<?php } ?>" ><span>{$Think.lang.member_edit_deny}</span></label>
                        <input id="isbuy_1" name="isbuy" <?php if($member_array['is_buy'] == '1'){ ?>checked="checked"<?php } ?>  value="1" type="radio">
                        <input id="isbuy_2" name="isbuy" <?php if($member_array['is_buy'] == '0'){ ?>checked="checked"<?php } ?> value="0" type="radio">
                    </td>
                    <td class="vatop tips">{$Think.lang.member_edit_allowbuy_tip}</td>
                </tr>
                <tr>
                    <td colspan="2" class="required"><label>{$Think.lang.member_edit_allowtalk}:</label></td>
                </tr>
                <tr class="noborder">
                    <td class="vatop rowform onoff">
                        <label for="allowtalk_1" class="cb-enable <?php if($member_array['is_allowtalk'] == '1'){ ?>selected<?php } ?>" ><span>{$Think.lang.member_edit_allow}</span></label>
                        <label for="allowtalk_2" class="cb-disable <?php if($member_array['is_allowtalk'] == '0'){ ?>selected<?php } ?>" ><span>{$Think.lang.member_edit_deny}</span></label>
                        <input id="allowtalk_1" name="allowtalk" <?php if($member_array['is_allowtalk'] == '1'){ ?>checked="checked"<?php } ?>  value="1" type="radio">
                               <input id="allowtalk_2" name="allowtalk" <?php if($member_array['is_allowtalk'] == '0'){ ?>checked="checked"<?php } ?> value="0" type="radio"></td>
                    <td class="vatop tips">{$Think.lang.member_edit_allowtalk_tip}</td>
                </tr>
                <tr>
                    <td colspan="2" class="required"><label>{$Think.lang.member_edit_allowlogin}:</label></td>
                </tr>
                <tr class="noborder">
                    <td class="vatop rowform onoff">
                        <label for="memberstate_1" class="cb-enable <?php if($member_array['member_state'] == '1'){ ?>selected<?php } ?>" ><span>{$Think.lang.member_edit_allow}</span></label>
                        <label for="memberstate_2" class="cb-disable <?php if($member_array['member_state'] == '0'){ ?>selected<?php } ?>" ><span>{$Think.lang.member_edit_deny}</span></label>
                        <input id="memberstate_1" name="memberstate" <?php if($member_array['member_state'] == '1'){ ?>checked="checked"<?php } ?>  value="1" type="radio">
                               <input id="memberstate_2" name="memberstate" <?php if($member_array['member_state'] == '0'){ ?>checked="checked"<?php } ?> value="0" type="radio"></td>
                    <td class="vatop tips"></td>
                </tr>



                <!--V3-B11 手机号码-->
                <tr>
                    <td colspan="2" class="required"><label>手机号码验证:</label></td>
                </tr>
                <tr class="noborder">
                    <td class="vatop rowform onoff">
                        <label for="membermobilebind_1" class="cb-enable <?php if($member_array['member_mobile_bind'] == '1'){ ?>selected<?php } ?>" ><span>已验证</span></label>
                        <label for="membermobilebind_2" class="cb-disable <?php if($member_array['member_mobile_bind'] == '0'){ ?>selected<?php } ?>" ><span>未验证</span></label>
                        <input id="membermobilebind_1" name="membermobilebind" <?php if($member_array['member_mobile_bind'] == '1'){ ?>checked="checked"<?php } ?>  value="1" type="radio">
                               <input id="membermobilebind_2" name="membermobilebind" <?php if($member_array['member_mobile_bind'] == '0'){ ?>checked="checked"<?php } ?> value="0" type="radio"></td>
                    <td class="vatop tips"></td>
                </tr>
                <tr>
                    <td colspan="2" class="required"><label>邮箱验证:</label></td>
                </tr>
                <tr class="noborder">
                    <td class="vatop rowform onoff">
                        <label for="memberemailbind_1" class="cb-enable <?php if($member_array['member_email_bind'] == '1'){ ?>selected<?php } ?>" ><span>已验证</span></label>
                        <label for="memberemailbind_2" class="cb-disable <?php if($member_array['member_email_bind'] == '0'){ ?>selected<?php } ?>" ><span>未验证</span></label>
                        <input id="memberemailbind_1" name="memberemailbind" <?php if($member_array['member_email_bind'] == '1'){ ?>checked="checked"<?php } ?>  value="1" type="radio">
                               <input id="memberemailbind_2" name="memberemailbind" <?php if($member_array['member_email_bind'] == '0'){ ?>checked="checked"<?php } ?> value="0" type="radio"></td>
                    <td class="vatop tips"></td>
                </tr>
                <tr>
                    <td colspan="2" class="required"><label>{$Think.lang.member_index_points}:</label></td>
                </tr>
                <tr class="noborder">
                    <td class="vatop rowform">{$Think.lang.member_index_points}&nbsp;<strong class="red"><?php echo $member_array['member_points']; ?></strong>&nbsp;{$Think.lang.points_unit}</td>
                    <td class="vatop tips"></td>
                </tr>
                <tr>
                    <td colspan="2" class="required"><label>经验值:</label></td>
                </tr>
                <tr class="noborder">
                    <td class="vatop rowform">经验值&nbsp;<strong class="red"><?php echo $member_array['member_exppoints']; ?></strong>&nbsp;{$Think.lang.points_unit}</td>
                    <td class="vatop tips"></td>
                </tr>
                <tr>
                    <td colspan="2" class="required"><label>{$Think.lang.member_index_available}{$Think.lang.member_index_prestore}:</label></td>
                </tr>
                <tr class="noborder">
                    <td class="vatop rowform">{$Think.lang.member_index_available}&nbsp;<strong class="red"><?php echo $member_array['available_predeposit']; ?></strong>&nbsp;{$Think.lang.currency_zh}</td>
                    <td class="vatop tips"></td>
                </tr>
                <tr>
                    <td colspan="2" class="required"><label>{$Think.lang.member_index_frozen}{$Think.lang.member_index_prestore}:</label></td>
                </tr>
                <tr class="noborder">
                    <td class="vatop rowform">{$Think.lang.member_index_frozen}&nbsp;<strong class="red"><?php echo $member_array['freeze_predeposit']; ?></strong>&nbsp;{$Think.lang.currency_zh}</td>
                    <td class="vatop tips"></td>
                </tr>
            </tbody>
            <tfoot>
                <tr class="tfoot">
                    <td colspan="15"><a href="JavaScript:void(0);" class="btn" id="submitBtn"><span>{$Think.lang.ds_submit}</span></a></td>
                </tr>
            </tfoot>
        </table>
    </form>

    <script type="text/javascript" src="{$Think.config.url_domain_root}static/common/js/mlselection.js" charset="utf-8"></script>
    <script type="text/javascript" src="{$Think.config.url_domain_root}static/home/js/common.js" charset="utf-8"></script>
    <script type="text/javascript">
        $(function() {
	         regionInit("region");
            $("#submitBtn").click(function() {
                if ($("#user_form").valid()) {
                    $("#user_form").submit();
                }
            });
            $('#user_form').validate({
                errorPlacement: function(error, element) {
                    error.appendTo(element.parent().parent().prev().find('td:first'));
                },
                rules: {
                    member_password: {
                        maxlength: 20,
                        minlength: 6
                    },
                    member_email: {
                        required: true,
                        email: true,
                        remote: {
                            url: ADMIN_URL+'member/ajax?branch=check_email',
                            type: 'get',
                            data: {
                                user_name: function() {
                                    return $('#member_email').val();
                                },
                                member_id : '<?php echo $member_array['member_id'];?>'
                            }
                        }
                    }
                },
                messages: {
                    member_password: {
                        maxlength: '{$Think.lang.member_edit_password_tip}',
                        minlength: '{$Think.lang.member_edit_password_tip}'
                    },
                    member_email: {
                        required: '{$Think.lang.member_edit_email_null}',
                        email: '{$Think.lang.member_edit_valid_email}',
                        remote: '{$Think.lang.member_edit_email_exists}'
                    }
                }
            });
        });
    </script> 
</div>    
