<!--{include file="<!--{$oetplpath}-->block_head.tpl"}-->
<!--{if $a == "run"}-->
<div class="oemarry_layout">
  <div class="oe_top_nav"><i></i>会员管理->会员列表</div>
  <div class="oe_content">
	
	<form id="serform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post">
	<div class="oe_txtwrap">
	  <span style="display:none;">
	  查看范围：
	  <select name="viewtype" id="viewtype" onchange="changeGetAdmin();">
	    <option value='0'>所有数据</option>
	    <option value='1'<!--{if $viewtype == '1'}--> selected<!--{/if}-->>我的数据</option>
	    <option value='2'<!--{if $viewtype == '2'}--> selected<!--{/if}-->>下属数据</option>
	  </select>
	  <span id='json_sadminid'>
	  <!--{if $viewtype == '2'}-->
	  <!--{hook mod='subadmin' type='select' name='sadminid' text='=全部=' value=$sadminid}-->
	  <!--{/if}-->
	  </span>
	  <script type="text/javascript">
	  function changeGetAdmin() {
		  $type = $('#viewtype').val();
		  if ($type == 2) {
			  oemarrySelectSubAdmin("sadminid", "<!--{$sadminid}-->", "=全部=");
		  }
		  else {
			  $("#json_sadminid").html("");
		  }
	  }
	  </script>
	  &nbsp;&nbsp;
	  </span>

	  类型：
	  <select name="stype" id="stype">
	    <option value="">=不限=</option>
		<option value="1"<!--{if $stype == '1'}--> selected<!--{/if}-->>个人</option>
		<option value="2"<!--{if $stype == '2'}--> selected<!--{/if}-->>商家</option>
	  </select>&nbsp;
	  用户名：<input type="text" name="susername" id="susername" class="input-100" value="<!--{$susername}-->" />&nbsp;
	  邮箱：<input type="text" name="semail" id="semail" class="input-100" value="<!--{$semail}-->" />&nbsp;
	  手机：<input type="text" name="smobile" id="smobile" class="input-100" value="<!--{$smobile}-->" />&nbsp;
	  审核状态：
		<select name="sflag" id="sflag">
		<option value=""></option>
		<option value="1"<!--{if $sflag == '1'}--> selected<!--{/if}-->>待审核</option>
		<option value="2"<!--{if $sflag == '2'}--> selected<!--{/if}-->>已通过</option>
		<option value="3"<!--{if $sflag == '3'}--> selected<!--{/if}-->>未通过</option>
		</select>
	  &nbsp;
		登录状态：
		<select name="slogin" id="slogin">
		  <option value="">=不限=</option>
		  <option value="1"<!--{if $slogin == '1'}--> selected<!--{/if}-->>正常</option>
		  <option value="2"<!--{if $slogin == '2'}--> selected<!--{/if}-->>锁定</option>
		</select>
	  <br />
	  所在地区：
		<!--{area type='select' name='sarea' depth='1' child='1' text='=请选择=' value=$sarea1}-->
		<span id="json_sarea2">
		  <!--{if $sarea1 > 0}-->
		  <!--{area type='select' name='sarea' depth='2' child='1' text='=请选择=' parentid=$sarea1 value=$sarea2}-->
		  <!--{else}-->
		  <select name="sarea2" id="sarea2"><option value="">=请选择=</option></select>
		  <!--{/if}-->
		</span>
		<span id="json_sarea3">
		  <!--{if $sarea2 > 0}-->
		  <!--{area type='select' name='sarea' depth='3' child='1' text='=请选择=' parentid=$sarea2 value=$sarea3}-->
		  <!--{else}-->
		  <select name="sarea3" id="sarea3"><option value="">=请选择=</option></select>
		  <!--{/if}-->
		</span>
		<span id="json_sarea4">
		  <!--{if $sarea3 > 0}-->
		  <!--{area type='select' name='sarea' depth='4' text='=请选择=' parentid=$sarea3 value=$sarea4}-->
		  <!--{/if}-->
		</span>
		&nbsp;
		邮箱认证：
		<select name="semailrz" id="semailrz">
		  <option value="">=不限=</option>
		  <option value="1"<!--{if $semailrz == '1'}--> selected<!--{/if}-->>已认证</option>
		  <option value="2"<!--{if $semailrz == '2'}--> selected<!--{/if}-->>未认证</option>
		</select>
		&nbsp;
		手机认证：
		<select name="smobilerz" id="smobilerz">
		  <option value="">=不限=</option>
		  <option value="1"<!--{if $smobilerz == '1'}--> selected<!--{/if}-->>已认证</option>
		  <option value="2"<!--{if $smobilerz == '2'}--> selected<!--{/if}-->>未认证</option>
		</select>
		&nbsp;
		头像：
		<select name="simg" id="simg">
		  <option value="">=不限=</option>
		  <option value="1"<!--{if $simg == '1'}--> selected<!--{/if}-->>待审核</option>
		  <option value="2"<!--{if $simg == '2'}--> selected<!--{/if}-->>已通过</option>
		</select>


		&nbsp;&nbsp;<input type="submit" name="btn_search" id="btn_search" class="button_2" value="搜索" />

	</div>
	</form>

    <div class="oe_tools_bar clearfix">
      <a class="icon-checkbox-unchecked" href="javascript:;" id="selAll" onclick="oemarrySelectAll(this, 'selall');">全选/反选</a>
      <a class="icon-remove-2" onclick="oemarryDialogFormDel('myform');">删除</a>
      <span class="fr"><a class="icon-plus" href="<!--{$oefile}-->&c=<!--{$c}-->&a=add">添加</a></span>
    </div>
    
	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->&a=del" method="post">
    <table class="oe_table_list table_cs">
	  <tr>
	    <th width="7%">UID</th>
		<th width="4%">类型</th>
		<th width="12%">用户名</th>
		<th width="15%">店铺</th>
		<th width="4%">性别</th>
		<th width="6%">头像</th>
		<th width="8%">地区</th>
		<th width="5%">审核</th>
		<th width="5%">登录</th>
		<th width="10%">注册时间</th>
		<th width="7%">余额</th>
		<th>操作</th>
	  </tr>
	  <!--{if empty($user)}-->
	  <tr>
	    <td class="text_center" colspan="12">没有符合条件的信息！</td>
	  </tr>
	  <!--{else}-->
	  <!--{foreach $user as $volist}-->
	  <tr>
	    <td class="text_center"><input type="checkbox" name="id[]" id="id[]" class="selall" value="<!--{$volist.userid}-->" /><!--{$volist.userid}--></td>
		<td class="text_center">
		<!--{if $volist.type == '2'}-->
		<font color="blue">商家</font>
		<!--{else}-->
		个人
		<!--{/if}-->
		</td>
		<td><!--{$volist.username}--></td>
		<td><!--{if !empty($volist.shopname)}--><!--{$volist.shopname|filterhtml:12}--><!--{else}-->~~<!--{/if}--></td>
		<td class="text_center">
		<!--{if $volist.gender == '2'}-->
		女
		<!--{elseif $volist.gender == '1'}-->
		男
		<!--{else}-->
		..
		<!--{/if}-->
		</td>
		<td class="text_center">
		<!--{if !empty($volist.headimg)}-->
		<img src="<!--{$volist.headimg}-->" width="20px" height="20px" f="viewimg" />
		<!--{else}-->
		~~
		<!--{/if}-->
		</td>
		<td class="text_center"><!--{$volist.province}--> <!--{$volist.city}--></td>
		<td class="text_center">
		<!--{if $volist.flag=='1'}-->
			<input type="hidden" id="attr_flag<!--{$volist.userid}-->" value="flagclose" />
			<img id="flag<!--{$volist.userid}-->" src="<!--{$urlpath}-->tpl/static/images/img_open.gif" onClick="oemarryUpdateFlag('flag', '<!--{$volist.userid}-->');" style="cursor:pointer;">	
		<!--{else}-->
			<input type="hidden" id="attr_flag<!--{$volist.userid}-->" value="flagopen" />
			<img id="flag<!--{$volist.userid}-->" src="<!--{$urlpath}-->tpl/static/images/img_close.gif" onClick="oemarryUpdateFlag('flag', '<!--{$volist.userid}-->');" style="cursor:pointer;">
		<!--{/if}-->
		</td>
		<td class="text_center">
		<!--{if $volist.loginstatus=='0'}-->
			<input type="hidden" id="attr_login<!--{$volist.userid}-->" value="loginopen" />
			<img id="login<!--{$volist.userid}-->" src="<!--{$urlpath}-->tpl/static/images/img_close.gif" onClick="oemarryUpdateFlag('login', '<!--{$volist.userid}-->');" style="cursor:pointer;">
		<!--{else}-->
			<input type="hidden" id="attr_login<!--{$volist.userid}-->" value="loginclose" />
			<img id="login<!--{$volist.userid}-->" src="<!--{$urlpath}-->tpl/static/images/img_open.gif" onClick="oemarryUpdateFlag('login', '<!--{$volist.userid}-->');" style="cursor:pointer;">	
		<!--{/if}-->
		</td>
		<td><!--{$volist.regtime|date_format:"%Y/%m/%d %H:%M"}--></td>
		<td>¥<!--{doubleval($volist.money)}--></td>
		<td class="text_center">
		 <a class="oe_ico_orange" href="<!--{$oefile}-->&c=<!--{$c}-->&a=loginuser&id=<!--{$volist.userid}-->" target="_blank">登录</a>
		 <a href="javascript:;" onclick="oemarry_varpop_money('<!--{$volist.userid}-->');" class="oe_ico_green">余额</a>
		 <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.userid}-->&<!--{$comeurl}-->" class="oe_ico_blue">管理</a>
		 <a href="javascript:;" onclick="oemarryDialogUrlDel('<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.userid}-->&<!--{$comeurl}-->');" class="oe_ico_red">删除</a>
		</td>
	  </tr>
	  <!--{/foreach}-->
	  <!--{/if}-->
	</table>
	</form>

	<div class="oe_page_box"><!--{$showpage}--></div>

  </div>
</div>
<!--{/if}-->

<!--{if $a == 'add'}-->
<div class="oemarry_layout">
  <div class="oe_top_nav">
	<i></i>会员管理->添加会员
	<span><a href="<!--{$oefile}-->&c=<!--{$c}-->">&lt;&lt;返回列表</a></span>
  </div>
  <div class="oe_content">
    <h6>添加会员</h6>
	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post" />
	<input type="hidden" name="a" id="a" value="saveadd" />
    <table class="oe_table_wrap">
	  <tr>
	    <th width="13%">会员类型：<span class="f_red">*</span></th>
		<td width="37%">
		  <select name="type" id="type">
		    <option value="">=请选择=</option>
			<option value="1" selected>个人</option>
			<option value="2">商家</option>
		  </select>
		  （个人和商家会员都可以开通店铺）
		</td>
		<th width="13%">用户名：(唯一)<span class="f_red">*</span></th>
		<td width="37%">
		  <input type="text" name="username" id="username" class="input-150" />
		  <span class="oe_trap">（由3~16个字符组成）</span>
		</td>
	  </tr>
	  <tr>
	    
		<th>登录密码：<span class="f_red">*</span></th>
		<td>
		  <input type="password" name="password" id="password" class="input-150" />
		  <span class="oe_trap">（由6~16个字符组成）</span>
		</td>
		<th>支付密码：<span class="f_red">*</span></th>
		<td>
		  <input type="password" name="payword" id="payword" class="input-150" />
		  <span class="oe_trap">（不能与登录密码相同）</span>
		</td>
	  </tr>
	  <tr>
	    <th>邮箱：(唯一)<span class="f_red"></span></th>
		<td>
		  <input type="text" name="email" id="email" class="input-150" />
		  <span class="oe_trap">（用于接收网站邮件或登录）</span>
		</td>
	    <th>邮箱认证：<span class="f_red"></span></th>
		<td>
		  <input type="radio" name="emailrz" id="emailrz" value="1" />是，
		  <input type="radio" name="emailrz" id="emailrz" value="0" checked />否
		</td>
	  </tr>
	  <tr>
		<th>手机：(唯一)<span class="f_red"></span></th>
		<td>
		  <input type="text" name="mobile" id="mobile" class="input-150" />
		  <span class="oe_trap">（用于接收网站短信或登录）</span>
		</td>
		<th>手机认证：<span class="f_red"></span></th>
		<td>
		  <input type="radio" name="mobilerz" id="mobilerz" value="1" />是，
		  <input type="radio" name="mobilerz" id="mobilerz" value="0" checked />否
		</td>
	  </tr>

	  <tr>
		<th>所在地区：<span class="f_red"></span></th>
		<td colspan="3">
		<!--{area type='select' name='area' depth='1' child='1' text='=请选择='}-->
		<span id="json_area2">
		  <select name="area2" id="area2"><option value="">=请选择=</option></select>
		</span>
		<span id="json_area3">
		  <select name="area3" id="area3"><option value="">=请选择=</option></select>
		</span>
		<span id="json_area4">
		
		</span>
		</td>
	  </tr>

	  <tr>
		<th>会员头像：<span class="f_red"></span> </th>
		<td colspan="3">
		  <table class="oe_table_wrap">
		    <tr>
			  <td width="150px">
				  <div class="oe_img_upload">
					<label class="_uploadbtn">上传头像<input type="file" name="img" id="img" value="" /></label>
					<label class="_uploading" id="img_loading">
					  <img src="<!--{$urlpath}-->tpl/admin/images/loading.gif" />上传中...
					</label>
					<input type="hidden" id="img_thumb" name="headimg" value="" />
					<input type="hidden" id="img_url" name="drawimg" value="" />
				  </div>
				  <script type="text/javascript">
				  $(function(){
					  $("#img").live("change", function(){
						oemarryUploadImg("img", "<!--{$oefile}-->&c=index&a=uploadimg&module=avatar&thumbfiles=img_url");
					  });
				  });
				  </script>
			  </td>
			  <td width="50px">预览：</td>
			  <td width="30px">
			  <img src="<!--{$urlpath}-->tpl/static/images/waitimg.jpg" width="30px" height="30px" id="img_preview" />
			  </td>
			  <td>
				  头像状态：
				  <select name="headflag" id="headflag">
					<option value="0">=未上传=</option>
					<option value="-2">待审核</option>
					<option value="-1">未通过</option>
					<option value="1">通过</option>
				  </select>
			  </td>
			</tr>
		  </table>
		</td>
	  </tr>
	  <tr>
	    <th>审核状态：<span class="f_red">*</span> </th>
		<td>
		  <select name="flag" id="flag">
			<option value="0">待审核</option>
			<option value="1" selected>已通过</option>
			<option value="2">未通过</option>
		  </select>
		</td>
		<th>登录状态：<span class="f_red">*</span></th>
		<td>
		<input type="radio" name="loginstatus" id="loginstatus" value="1" checked />正常，
		<input type="radio" name="loginstatus" id="loginstatus" value="0" />锁定
		</td>
	  </tr>
	  <tr>
		<th>姓名：<span class="f_red"></span> </th>
		<td>
		  <input type="text" name="realname" id="realname" class="input-100" />&nbsp;&nbsp;
		  性别：
		  <select name="gender" id="gender">
		    <option value="">=请选择=</option>
			<option value="1">男</option>
			<option value="2">女</option>
		  </select>
		</td>
		<th>地址：<span class="f_red"></span> </th>
		<td><input type="text" name="address" id="address" class="input-b" /></td>
	  </tr>
	  <tr>
		<th>自我介绍：<span class="f_red"></span> </th>
		<td colspan="3"><textarea name="intro" id="intro" style="width:50%;height:40px;"></textarea></td>
	  </tr>
	  <tr>
	    <td></td>
		<td colspan="3"> <input type="button" id="btn_save" class="button_2" value="添加保存" /> (温馨提示：如果开启了OElove整合，在后台添加会员，不会同步到OElove系统）</td>
	  </tr>
	</table>
	</form>
  </div>
</div>
<script type="text/javascript">
$(function(){

	$("#username").bind("blur", function(){ //检测帐号
		if ($(this).val().length > 0) {
			$.ajax({
				type: "POST",
				url: "<!--{$oefile}-->&c=<!--{$c}-->",
				cache: false,
				data: {a:"check", type:"username", name:$(this).val(), r:get_rndnum(8)},
				dataType: "json",
				success: function(data) {
					$json = eval(data);
					$response = $json.response;
					$result = $json.result;
					if ($response == '1') {
						oemarryCheckOk("username", "该用户名可用");
					}
					else {
						if ($result.length == 0) {
							$result = "该用户名已存在";
						}
						oemarryCheckError("username", $result);
					}
				},
				error: function() {
					ToastShow("检测失败，请检查网络...");
				}
			});
		}
	});

	$("#email").bind("blur", function(){ //检测邮箱
		if ($(this).val().length > 0) {
			$.ajax({
				type: "POST",
				url: "<!--{$oefile}-->&c=<!--{$c}-->",
				cache: false,
				data: {a:"check", type:"email", name:$(this).val(), r:get_rndnum(8)},
				dataType: "json",
				success: function(data) {
					$json = eval(data);
					$response = $json.response;
					$result = $json.result;
					if ($response == '1') {
						oemarryCheckOk("email", "该邮箱可用");
					}
					else {
						if ($result.length == 0) {
							$result = "该邮箱已存在";
						}
						oemarryCheckError("email", $result);
					}
				},
				error: function() {
					ToastShow("检测失败，请检查网络...");
				}
			});
		}
	});

	$("#mobile").bind("blur", function(){ //检测手机
		if ($(this).val().length > 0) {
			$.ajax({
				type: "POST",
				url: "<!--{$oefile}-->&c=<!--{$c}-->",
				cache: false,
				data: {a:"check", type:"mobile", name:$(this).val(), r:get_rndnum(8)},
				dataType: "json",
				success: function(data) {
					$json = eval(data);
					$response = $json.response;
					$result = $json.result;
					if ($response == '1') {
						oemarryCheckOk("mobile", "该手机可用");
					}
					else {
						if ($result.length == 0) {
							$result = "该手机已存在";
						}
						oemarryCheckError("mobile", $result);
					}
				},
				error: function() {
					ToastShow("检测失败，请检查网络...");
				}
			});
		}
	});

	$("#btn_save").bind("click", function(){
		if ($("#type").val() == "") {
			ToastShow("请选择类型", "type");
			return false;
		}
		if ($("#username").val().length == 0) {
			ToastShow("请填写用户名", "username");
			return false;
		}
		if ($("#password").val().length < 6 || $("#password").val().length > 16) {
			ToastShow("请填写正确的密码", "password");
			return false;
		}
		if ($("#payword").val().length == 0) {
			ToastShow("请填写支付密码", "payword");
			return false;
		}
		if ($("#payword").val() == $("#password").val()) {
			ToastShow("支付密码不能与登录密码相同", "payword");
			return false;
		}
		$("#myform").submit();
	});

});
</script>
<!--{/if}-->


<!--{if $a == 'edit'}-->
<div class="oemarry_layout">
  <div class="oe_top_nav">
	<i></i>会员管理->编辑会员
	<span><a href="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->">&lt;&lt;返回列表</a></span>
  </div>
  <div class="oe_content">
    <h6>编辑会员</h6>
	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post" />
	<input type="hidden" name="a" id="a" value="saveedit" />
	<input type="hidden" name="id" id="id" value="<!--{$id}-->" />
    <table class="oe_table_wrap">
	  <tr>
	    <th width="13%">会员类型：<span class="f_red">*</span></th>
		<td width="37%">
		  <select name="type" id="type">
		    <option value="">=请选择=</option>
			<option value="1"<!--{if $user.type == '1'}--> selected<!--{/if}-->>个人</option>
			<option value="2"<!--{if $user.type == '2'}--> selected<!--{/if}-->>商家</option>
		  </select>
		  （个人和商家会员都可以开通店铺）
		</td>
		<th width="13%">所在地区：<span class="f_red"></span></th>
		<td width="37%">
		<!--{area type='select' name='area' depth='1' child='1' text='=请选择=' value=$user.area1}-->
		<span id="json_area2">
		  <!--{if $user.area1 > 0}-->
		  <!--{area type='select' name='area' depth='2' child='1' text='=请选择=' parentid=$user.area1 value=$user.area2}-->
		  <!--{else}-->
		  <select name="area2" id="area2"><option value="">=请选择=</option></select>
		  <!--{/if}-->
		</span>
		<span id="json_area3">
		  <!--{if $user.area2 > 0}-->
		  <!--{area type='select' name='area' depth='3' child='1' text='=请选择=' parentid=$user.area2 value=$user.area3}-->
		  <!--{else}-->
		  <select name="area3" id="area3"><option value="">=请选择=</option></select>
		  <!--{/if}-->
		</span>
		<span id="json_area4">
		  <!--{if $user.area3 > 0}-->
		  <!--{area type='select' name='area' depth='4' text='=请选择=' parentid=$user.area3 value=$user.area4}-->
		  <!--{/if}-->
		</span>

		</td>
	  </tr>
	  <tr>
	    <th>用户名：(唯一)<span class="f_red">*</span></th>
		<td>
		  <input type="text" name="username" id="username" class="input-150" value="<!--{$user.username}-->" />
		  <span class="oe_trap">（由3~16个字符组成）</span>
		</td>
		<th>性别：</th>
		<td>
		  <select name="gender" id="gender">
		    <option value="">=请选择=</option>
			<option value="1"<!--{if $user.gender == '1'}--> selected<!--{/if}-->>男</option>
			<option value="2"<!--{if $user.gender == '2'}--> selected<!--{/if}-->>女</option>
		  </select>
		</td>
	  </tr>
	  <tr>
	    <th>邮箱：(唯一)<span class="f_red"></span></th>
		<td>
		  <input type="text" name="email" id="email" class="input-150" value="<!--{$user.email}-->" />
		  <span class="oe_trap">（用于接收网站邮件或登录）</span>
		</td>
	    <th>邮箱认证：<span class="f_red"></span></th>
		<td>
		  <input type="radio" name="emailrz" id="emailrz" value="1"<!--{if $user.emailrz == '1'}--> checked<!--{/if}--> />是，
		  <input type="radio" name="emailrz" id="emailrz" value="0"<!--{if $user.emailrz == '0'}--> checked<!--{/if}--> />否
		</td>
	  </tr>
	  <tr>
		<th>手机：(唯一)<span class="f_red"></span></th>
		<td>
		  <input type="text" name="mobile" id="mobile" class="input-150" value="<!--{$user.mobile}-->" />
		  <span class="oe_trap">（用于接收网站短信或登录）</span>
		</td>
		<th>手机认证：<span class="f_red"></span></th>
		<td>
		  <input type="radio" name="mobilerz" id="mobilerz" value="1"<!--{if $user.mobilerz == '1'}--> checked<!--{/if}--> />是，
		  <input type="radio" name="mobilerz" id="mobilerz" value="0"<!--{if $user.mobilerz == '0'}--> checked<!--{/if}--> />否
		</td>
	  </tr>
	  <tr>
		<th>会员头像：<span class="f_red"></span> </th>
		<td colspan="3">
		  <table class="oe_table_wrap">
		    <tr>
			  <td width="150px">
				  <div class="oe_img_upload">
					<label class="_uploadbtn">上传头像<input type="file" name="img" id="img" value="" /></label>
					<label class="_uploading" id="img_loading">
					  <img src="<!--{$urlpath}-->tpl/admin/images/loading.gif" />上传中...
					</label>
					<input type="hidden" id="img_thumb" name="headimg" value="<!--{$user.headimg}-->" />
					<input type="hidden" id="img_url" name="drawimg" value="" />
				  </div>
				  <script type="text/javascript">
				  $(function(){
					  $("#img").live("change", function(){
						oemarryUploadImg("img", "<!--{$oefile}-->&c=index&a=uploadimg&module=avatar&thumbfiles=img_url");
					  });
				  });
				  </script>
			  </td>
			  <td width="50px">预览：</td>
			  <td width="80px">
			  <!--{if !empty($user.headimg)}-->
			  <img src="<!--{$urlpath}--><!--{$user.headimg}-->" width="30px" height="30px" id="img_preview" />
			  <!--{else}-->
			  <img src="<!--{$urlpath}-->tpl/static/images/waitimg.jpg" width="30px" height="30px" id="img_preview" />
			  <!--{/if}-->
			  <a href="javascript:;" class="_removeimg" f="removeimg" data-preview="img_preview" data-thumb="img_thumb">移除</a>
			  </td>
			  <td>
				  头像状态：
				  <select name="headflag" id="headflag">
					<option value="0">=未上传=</option>
					<option value="-2"<!--{if $user.headflag == '-2'}--> selected<!--{/if}-->>待审核</option>
					<option value="-1"<!--{if $user.headflag == '-1'}--> selected<!--{/if}-->>未通过</option>
					<option value="1"<!--{if $user.headflag == '1'}--> selected<!--{/if}-->>通过</option>
				  </select>
			  </td>
			</tr>
		  </table>
		</td>
	  </tr>
	  <tr>
	    <th>审核状态：<span class="f_red">*</span> </th>
		<td>
		  <select name="flag" id="flag">
			<option value="0"<!--{if $user.flag == '0'}--> selected<!--{/if}-->>待审核</option>
			<option value="1"<!--{if $user.flag == '1'}--> selected<!--{/if}-->>已通过</option>
			<option value="2"<!--{if $user.flag == '2'}--> selected<!--{/if}-->>未通过</option>
		  </select>
		</td>
		<th>登录状态：<span class="f_red">*</span></th>
		<td>
		<input type="radio" name="loginstatus" id="loginstatus" value="1"<!--{if $user.loginstatus == '1'}--> checked<!--{/if}--> />正常，
		<input type="radio" name="loginstatus" id="loginstatus" value="0"<!--{if $user.loginstatus == '0'}--> checked<!--{/if}--> />锁定
		</td>
	  </tr>
	  <tr>
		<th>姓名：<span class="f_red"></span> </th>
		<td>
		  <input type="text" name="realname" id="realname" class="input-100" value="<!--{$user.realname}-->" />&nbsp;&nbsp;
		</td>
		<th>地址：<span class="f_red"></span> </th>
		<td><input type="text" name="address" id="address" class="input-b" value="<!--{$user.address}-->" /></td>
	  </tr>
	  <tr>
		<th>登录密码：<span class="f_red"></span> </th>
		<td><input type="password" name="password" id="password" class="input-150" maxlength="16" />（不修改请留空，6~16个字符）</td>
		<th>支付密码：<span class="f_red"></span> </th>
		<td><input type="password" name="payword" id="payword" class="input-150" maxlength="16" />（不修改请留空）</td>
	  </tr>
	  <tr>
		<th>自我介绍：<span class="f_red"></span> </th>
		<td colspan="3"><textarea name="intro" id="intro" style="width:50%;height:40px;"><!--{$user.intro}--></textarea></td>
	  </tr>
	  <tr>
		<th>注册时间：<span class="f_red"></span> </th>
		<td><!--{$user.regtime|date_format:"%Y-%m-%d %H:%M:%S"}--></td>
		<th>注册IP：<span class="f_red"></span> </th>
		<td><!--{$user.regip}--></td>
	  </tr>
	  <tr>
		<th>登录时间：<span class="f_red"></span> </th>
		<td><!--{$user.logintime|date_format:"%Y-%m-%d %H:%M:%S"}--> 登录次数：<!--{$user.logintimes}--></td>
		<th>登录IP：<span class="f_red"></span> </th>
		<td><!--{$user.loginip}--></td>
	  </tr>
	  <tr>
		<th>帐户余额：<span class="f_red"></span> </th>
		<td>¥<!--{doubleval($user.money)}--></td>
		<th>冻结资金：<span class="f_red"></span> </th>
		<td>¥<!--{doubleval($user.freeze)}--></td>
	  </tr>
	  <tr>
	    <td></td>
		<td colspan="3"> <input type="button" id="btn_save" class="button_2" value="编辑保存" /> </td>
	  </tr>
	</table>
	</form>
  </div>
</div>
<script type="text/javascript">
$(function(){

	$("#username").bind("blur", function(){ //检测帐号
		if ($(this).val().length > 0) {
			$.ajax({
				type: "POST",
				url: "<!--{$oefile}-->&c=<!--{$c}-->",
				cache: false,
				data: {a:"check", type:"username", name:$(this).val(), userid:"<!--{$id}-->", r:get_rndnum(8)},
				dataType: "json",
				success: function(data) {
					$json = eval(data);
					$response = $json.response;
					$result = $json.result;
					if ($response == '1') {
						oemarryCheckOk("username", "该用户名可用");
					}
					else {
						if ($result.length == 0) {
							$result = "该用户名已存在";
						}
						oemarryCheckError("username", $result);
					}
				},
				error: function() {
					ToastShow("检测失败，请检查网络...");
				}
			});
		}
	});

	$("#email").bind("blur", function(){ //检测邮箱
		if ($(this).val().length > 0) {
			$.ajax({
				type: "POST",
				url: "<!--{$oefile}-->&c=<!--{$c}-->",
				cache: false,
				data: {a:"check", type:"email", name:$(this).val(), userid:"<!--{$id}-->", r:get_rndnum(8)},
				dataType: "json",
				success: function(data) {
					$json = eval(data);
					$response = $json.response;
					$result = $json.result;
					if ($response == '1') {
						oemarryCheckOk("email", "该邮箱可用");
					}
					else {
						if ($result.length == 0) {
							$result = "该邮箱已存在";
						}
						oemarryCheckError("email", $result);
					}
				},
				error: function() {
					ToastShow("检测失败，请检查网络...");
				}
			});
		}
	});

	$("#mobile").bind("blur", function(){ //检测手机
		if ($(this).val().length > 0) {
			$.ajax({
				type: "POST",
				url: "<!--{$oefile}-->&c=<!--{$c}-->",
				cache: false,
				data: {a:"check", type:"mobile", name:$(this).val(), userid:"<!--{$id}-->", r:get_rndnum(8)},
				dataType: "json",
				success: function(data) {
					$json = eval(data);
					$response = $json.response;
					$result = $json.result;
					if ($response == '1') {
						oemarryCheckOk("mobile", "该手机可用");
					}
					else {
						if ($result.length == 0) {
							$result = "该手机已存在";
						}
						oemarryCheckError("mobile", $result);
					}
				},
				error: function() {
					ToastShow("检测失败，请检查网络...");
				}
			});
		}
	});

	$("#btn_save").bind("click", function(){
		if ($("#type").val() == "") {
			ToastShow("请选择类型", "type");
			return false;
		}
		if ($("#username").val().length == 0) {
			ToastShow("请填写用户名", "username");
			return false;
		}
		$("#myform").submit();
	});

});
</script>
<!--{/if}-->
</body>
</html>