<?php
/*
	[Phpup.Net!] (C)2009-2011 Phpup.net.
	This is NOT a freeware, use is subject to license terms

	$Id: admin.class.php 2010-08-24 10:42 $
*/

if(!defined('IN_PHPUP')) {
	exit('Access Denied');
}
?>
<?php include ROOT_PATH.'/views/admin/header.php';?>
<body>

<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <A HREF="index.php?con=<?php echo $GLOBALS['setting']['adminpath'];?>&act=user" <?php if(empty($_REQUEST['utype'])){?>class="on"<?php }?>><em>全部</em></A>
		<?php foreach($GLOBALS['user_group'] as $k=>$v){?><span>|</span>
		<A HREF="index.php?con=<?php echo $GLOBALS['setting']['adminpath'];?>&act=user&utype=<?php echo $k;?>" <?php if($_REQUEST['utype']==$k){?> class="on"<?php }?>><em><?php echo $v['groupname'];?></em></A>
		<?php }?>
	</div>
</div>
<form method="post" action="" name="searchform">
<INPUT TYPE="hidden" NAME="usertype" value="<?php echo $_GET['act'];?>">
<table width="100%" cellspacing="0" class="search-form">
    <tbody>
		<tr>
		<td><div class="explain-col">会员名： <INPUT TYPE="text" NAME="username" class="input-text"> <input type="submit" name="dosubmit" class="button" value="搜索"> 
		</div>
		</td>
		</tr>
    </tbody>
</table>
</form>
<div class="table-list">
<TABLE cellpadding="1" cellspacing="1" width="100%">
<thead>
<TR>
	<TH style="text-align:left;">用户名</TH>
	<TH style="text-align:left;">邮箱</TH>
	<TH>资金</TH>
	<TH>验证</TH>
	<TH>注册时间</TH>
	<TH>用户组</TH>
	<TH>操作</TH>
</TR>
</thead>
<tbody>
<?php foreach($userlist['data'] as $key=>$val){?>
<TR class="tr<?php echo $key%2;?>" id="user<?php echo $val['uid'];?>">
	<TD>
	<div id="username-<?php echo $val['uid'];?>" onmouseover="this.style.backgroundColor='#ff8800';" onmouseout="this.style.backgroundColor='';" onclick="modifyValue('usernameinput-<?php echo $val['uid'];?>');"><?php echo $val['username'];?>
	</div>
	<input class="hideinput" id="usernameinput-<?php echo $val['uid'];?>" ondblclick="confirmValue('user',this.value,'usernameinput-<?php echo $val['uid'];?>','uid');">
	</TD>

	<TD>
	<div id="email-<?php echo $val['uid'];?>" onmouseover="this.style.backgroundColor='#ff8800';" onmouseout="this.style.backgroundColor='';" onclick="modifyValue('emailinput-<?php echo $val['uid'];?>');"><?php echo $val['email'];?>
	</div>
	<input class="hideinput" id="emailinput-<?php echo $val['uid'];?>" ondblclick="confirmValue('user',this.value,'emailinput-<?php echo $val['uid'];?>','uid');">
	</TD>

	
	<TD align="center"><?php echo $val['money'];?></TD>
	
	<td  align="center">
	<div id="allowed-<?php echo $val['uid'];?>" onmouseover="this.style.backgroundColor='#ff0000';" onmouseout="this.style.backgroundColor='';" onclick="updateVal('user','allowedinput-<?php echo $val['uid'];?>','uid','',['是','否']);">
	<?php echo $val['allowed']?'是':'否';?>
	</div>
	<INPUT TYPE="text" class="hideinput" id="allowedinput-<?php echo $val['uid'];?>" value="<?php echo intval(!$val['allowed']);?>" title='nochange'>
	</td>

	<TD  align="center"><?php echo date('Y-m-d',$val['updatetime']);?></TD>

	<td align="center">
	<?php if($GLOBALS['session']->get('adminid')==$val['uid']){?>
	<?php echo $GLOBALS['user_group'][$val['usertype']]['groupname']?$GLOBALS['user_group'][$val['usertype']]['groupname']:'普通会员';?>
	<?php } else{?>
	<div id="usertype-<?php echo $val['uid'];?>" onmouseover="this.style.backgroundColor='#ff8800';" onmouseout="this.style.backgroundColor='';" onclick="modifyValue('usertypeinput-<?php echo $val['uid'];?>');"><?php echo $GLOBALS['user_group'][$val['usertype']]['groupname']?$GLOBALS['user_group'][$val['usertype']]['groupname']:'普通会员';?>
	</div>

	<select class="hideinput" id="usertypeinput-<?php echo $val['uid'];?>" onchange="confirmValue('user',this.value,'usertypeinput-<?php echo $val['uid'];?>','uid');">
	<?php foreach($GLOBALS['user_group'] as $k=>$v){?>
	<option value="<?php echo $k;?>" <?php $val['usertype']==$k?'selected':'';?>><?php echo $v['groupname'];?></option>
	<?php }?>
	</select>
	<?php }?>
	</td>
	<TD align="center">
	<A HREF="index.php?con=<?php echo $GLOBALS['setting']['adminpath'];?>&act=usermodify&updateid=<?php echo $val['uid'];?>">修改</A>
	<?php if($GLOBALS['session']->get('adminid')!=$val['uid']){?><A HREF="javascript:deleteVal('user','<?php echo $val['uid'];?>','user<?php echo $val['uid'];?>','uid')">删除</A><?php }?>
	</TD>
</TR>
<?php }?>
</tbody>
</TABLE>
</div>
<div class="pages"><?php echo $userlist['pageinfo'];?></div>

</body>
</html>
