<?php
	!defined('DIRCMS_MANAGE') && exit('Access Denied!');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>会员管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="stylesheet" type="text/css" href="admin/template/css/style.css" />
<script type="text/javascript" src="images/js/jquery.min.js"></script>
<script type="text/javascript" src="admin/template/js/admin.js"></script>
<script language="javascript">
$(document).ready(function(){
	$('#stype').val('<?php echo $stype;?>');
});
</script>
</head>
<body>
<div id="wrap">
	<div class="tab">
		<ul>
			<li><a href="?file=member&action=manage">已审会员</a></li>
			<li><a href="javascript:void(0);" class="on">待审会员</a></li>	
			<li><a href="?file=member&action=add">添加会员</a></li>		
		</ul>
	</div>
	<div class="main">
		<div class="search">
			<form action="?" method="get" name="search">
			<input type="hidden" name="file" value="<?php echo $file;?>"> 
			<input type="hidden" name="action" value="<?php echo $action;?>"> 
				<fieldset>
					<legend>会员查找</legend>
						搜索条件：
						<select name="stype" id="stype">
							<option value="username">用户名</option>
							<option value="id">用户ID</option>
						</select>
						&nbsp;&nbsp;
						<input type="text" name="k" size="35" value="<?php echo $k?htmlspecialchars(stripslashes($k)):'';?>" />
						<input type="submit" class="button" value="开始查找" />
				</fieldset>
			</form>
		</div>
		<table cellspacing="0" class="datalist" id="list">
		<tr>
			<th width="40" class="firstcol">反选</th>
			<th width="129">用户名</th>
			<th width="75">会员组</th>
			<th width="75">会员等级</th>
			<th width="75">会员模型</th>
			<th width="52"><a title="按照资金降序排序" href="<?php echo ADMIN_FILE;?>?file=member&action=check&orderby=<?php echo urlencode('amount DESC');?>">资金</a></th>
			<th width="49"><a title="按照积分降序排序" href="<?php echo ADMIN_FILE;?>?file=member&action=check&orderby=<?php echo urlencode('point DESC');?>">积分</a></th>
			<th width="109"><a title="按照注册时间降序排序" href="<?php echo ADMIN_FILE;?>?file=member&action=check&orderby=<?php echo urlencode('regtime DESC');?>">注册时间</a></th>
			<th width="107"><a title="按照登录时间降序排序" href="<?php echo ADMIN_FILE;?>?file=member&action=check&orderby=<?php echo urlencode('logintime DESC');?>">上次登录</a></th>
			<th width="100">管理操作</th>
		</tr>
		<form action="" method="post" name="myform">
		<input type="hidden" name="do_submit" value="1" />
		<?php if($result){foreach($result as $val){if($val['id']!=ADMIN_FOUNDERS || $_userid=ADMIN_FOUNDERS){?>
		<tr>
			<td width="40" align="center">
			<input type="hidden" name="modelid[<?php echo $val['id'];?>]" value="<?php echo $val['modelid'];?>" />
			<input type="hidden" name="groupid[<?php echo $val['id'];?>]" value="<?php echo $val['groupid'];?>" />
			<input type="checkbox" name="id[]" <?php if($val['id']==ADMIN_FOUNDERS)echo 'disabled="disabled"';?> value="<?php echo $val['id'];?>" class="checkbox" />
			</td>
		  <td width="129"><?php echo $val['islocked']?'<a title="用户被锁定" href="'.ADMIN_FILE.'?file=member&action=manage&field=islocked&fieldid=1"><font color="#ff0000">[锁]</font></a>':'';?> <a href="<?php echo $val['spaceurl'];?>" target="_blank"><?php if($val['islocked'])echo '<u>';?><?php echo $val['username'];?><?php if($val['islocked'])echo '</u>';?></a></td>
			<td width="75" align="center"><?php echo $val['membergroup'];?></td>
			<td width="75" align="center"><?php echo $val['membergrade'];?></td>
			<td width="75" align="center"><?php echo $val['membermodel'];?></td>
			<td width="52" align="center"><font color="#FF0000"><b><?php echo $val['amount'];?></b></font></td>
			<td width="49" align="center"><font color="#33CC00"><b><?php echo $val['point'];?></b></font></td>
			<td width="109" align="center"><?php echo date('Y-m-d',$val['regtime']);?></td>
			<td width="107" align="center"><?php echo date('Y-m-d',$val['logintime']);?></td>
			<td width="100" align="center"><a href="<?php echo ADMIN_FILE;?>?file=<?php echo $file;?>&action=edit&id=<?php echo $val['id'];?>">修改</a> <a href="member/index.php?file=msg&action=send&sendtouser=<?php echo $val['username'];?>">发短信</a></td>
		</tr>
		<?php }}?>
		<tr>
			<td width="40" align="center">
			<input type="checkbox" name="chkall2" value="1" class="checkbox" onclick="check_all(this)" /></td>
			<td colspan="9" align="left">
			<input type="radio" value="delete" class="radio" name="do" />删除
			&nbsp;&nbsp;
			<input type="radio" value="passed" class="radio" name="do" checked="checked" />审核
			&nbsp;&nbsp;
			<input type="button" value="执行操作" class="button" onclick="if(confirm('确定进行选定操作吗？')){this.form.submit();}" />
			</td>
		</tr>
		</form>
		<?php }else{?>
		<tr><td colspan="10">尚未任何待审核会员...</td></tr>	
		<?php }?>
		<tr>
			<td colspan="10"><?php echo $pages;?></td>
		</tr>
		</table>
	</div>
</div>
</body>
</html>