<?php 
defined('IN_HS') or exit('Access Denied');
include admintpl('header');
?>
<body>
<div id="part_one" align=center STYLE="width:100%;margin-top:300px;position:absolute;color:#f00;font-size:14px;"><img src="/admin/skin/images/ajax_loader.gif">
<div style="padding-top:20px">正在读取数据，请等待...</div></div>
<table cellpadding='2' cellspacing='1' border='0' align='center' class='tableBorder'>
  <tr>
    <td class='pagemenu' align="center"><input type="button" class="btn" value="全部帐号" onClick="javascript:location.href='?mod=<?=$mod?>&file=<?=$file?>&action=<?=$action?>&idserver=<?=$idserver?>'">
	<input type="button" class="btn" value="GM帐号" onClick="javascript:location.href='?mod=<?=$mod?>&file=<?=$file?>&action=<?=$action?>&idserver=<?=$idserver?>&user_priv=65535'"> 
	<input type="button" class="btn" value="普通帐号" onClick="javascript:location.href='?mod=<?=$mod?>&file=<?=$file?>&action=<?=$action?>&idserver=<?=$idserver?>&user_priv=1'">
	<input type="button" class="btn" style="color:#F00" value="已冻结帐号" onClick="javascript:location.href='?mod=<?=$mod?>&file=<?=$file?>&action=<?=$action?>&idserver=<?=$idserver?>&deleted=1'">	
	</td>
  </tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="10">
  <tr>
    <td ></td>
  </tr>
</table>
<table cellpadding="2" cellspacing="1" class="tableborder" width=100%>
<form method="get" name="search" action="?">
  <tr>
    <td width=20%><strong>帐号搜索</strong></td>
    <td width=40%>帐号名称：
      <input name='username' type='text' size='30' value='<?=$username?>'></td>
	<td width=40%>
<input name='mod' type='hidden' value='<?=$mod?>'>
<input name='file' type='hidden' value='<?=$file?>'>
<input name='idserver' type='hidden' value='<?=$idserver?>'>
<input name='action' type='hidden' value='<?=$action?>'>
<input name='submit' type='submit' class='btn' value=' 搜索 '></td>
</tr>
</form>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="30">
  <tr>
    <td style="text-align:center;color:darkgreen;font-size:14px;font-weight:bold">当前分区：<font color="blue"><?=$servername?></font> <?php if($deleted==1) { ?>已冻结帐号<?php }elseif($user_priv==65535) { ?>GM帐号<?php }elseif($user_priv==1) { ?>普通帐号<?php }elseif($idx) { ?>搜索到ID为<?=$idx?>的帐号<?php }else{ ?> 全部帐号<? } ?>：共 <font color=red><?=$sumnums?></font> 条!	<br>
   <span style="color:#555;font-size:12px">提示：单击ID链接可打开仓库管理，单击用户名称可打开下属角色信息。双击密码下的双击修改可以修改游戏登陆密码。</span> </td>
  </tr>
</table>
<table cellpadding="2" cellspacing="1" class="tableborder" width=100%>
<tr align="center">
<td width="10%" class="tablerowhighlight" style="font-size:14px;text-align:center;font-weight:bold">ID</td>
<td width="30%" class="tablerowhighlight" style="font-size:14px;font-weight:bold">用户名</td>
<td width="20%" class="tablerowhighlight" style="font-size:14px;text-align:center;font-weight:bold">密码</td>
<td width="10%" class="tablerowhighlight" style="font-size:14px;text-align:center;font-weight:bold">类型</td>
<td width="10%" class="tablerowhighlight" style="font-size:14px;text-align:center;font-weight:bold">状态</td>
<td width="20%" class="tablerowhighlight" style="font-size:14px;text-align:center;font-weight:bold">最后登录</td>
</tr>
<?php 
if(is_array($members))
{
foreach($members as $member){ ?>
<tr align="center">
<td style="text-align:center"><a title="打开该仓库" style="TEXT-DECORATION: underline" href="?mod=<?=$mod?>&file=banklist&action=manage&idserver=<?=$idserver?>&AccountID=<?=$member['idx']?>" target="_blank"><?=$member['idx']?></a></td>
<td style="font-weight:bold" id="name_<?=$member['idx']?>"><a style="TEXT-DECORATION: underline" href="?mod=<?=$mod?>&file=fsolist&action=manage&idserver=<?=$idserver?>&AccountID=<?=$member['idx']?>" target="_blank" title="打开下属角色"><?=$member['username']?></a>
<a style="TEXT-DECORATION: underline;color:orange" href="?username=<?=$member['username']?>&mod=member&file=member&action=manage" target="_blank" title="打开该帐号的网站帐号信息">[网站帐号]</a>
</td>
<td id="pass_<?=$member['idx']?>" onDblClick="changepass(<?=$member['idx']?>,<?=$idserver?>)" style="font-weight:bold;text-align:center">双击修改</td>
<td style="text-align:center" id="priv_<?=$member['idx']?>"><?php if($member['user_priv'] == 65535){ ?> <input style="color:#900;font-weight:bold" name="button" type="button" class="btn" onClick="savepriv(<?=$member['idx']?>,<?=$idserver?>)" value="GM帐号"> <?php }else{ ?><input name="button" type="button" class="btn" onClick="savepriv(<?=$member['idx']?>,<?=$idserver?>)" value="普通帐号"><? }?></td>
<td style="text-align:center" id="lock_<?=$member['idx']?>"><?php if($member['deleted'] == 0){ ?> <input style="color:green" name="button" type="button" class="btn" onClick="savelock(<?=$member['idx']?>,<?=$idserver?>)" value=" 正常 "> <?php }else{ ?><input style="color:#F00" name="button" type="button" class="btn" onClick="savelock(<?=$member['idx']?>,<?=$idserver?>)" value="冻结中"><? }?></td>
<td title="最后登录IP：<?=$member['latest_login_ip']?>" style="text-align:center"><?=$member['latest_login_date']?></td>
</tr>
<?php } 
}
?>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="30">
  <tr>
    <td align="center"><?=$pages?></td>
  </tr>
</table>
<script language="javascript">
<?php
sajax_show_javascript();
?>
function changepass(idx,idserver){
 document.getElementById("pass_"+idx).innerHTML="<input id='ipass_"+idx+"' type='text' style='width:150px' value='' onBlur='savepass("+idx+","+idserver+",this.value)'>";
 document.getElementById("ipass_"+idx).focus();
 document.getElementById("name_"+idx).style.color="#FF0000";
}
function savepass(idx,idserver,npass){

 x_savepass(idx,idserver,npass,savepass_cb)
 
 function savepass_cb(z){
  if(z == "true"){
    document.getElementById("pass_"+idx).innerHTML="<font color=green>修改成功</font>";
    document.getElementById("name_"+idx).style.color="#555";
  }else{
    window.alert(z);
	document.getElementById("pass_"+idx).innerHTML="双击修改";
	document.getElementById("name_"+idx).style.color="#555";
  }
 }
}

function savepriv(idx,idserver){

 x_savepriv(idx,idserver,savepriv_cb)
 
 function savepriv_cb(z){
    document.getElementById("priv_"+idx).innerHTML=z;
 }
}

function savelock(idx,idserver){

 x_savelock(idx,idserver,savelock_cb)
 
 function savelock_cb(z){
    document.getElementById("lock_"+idx).innerHTML=z;
 }
}
 function window.onload(){
   if(document.body.readyState=="complete"){
     part_one.style.display='none';
   }
 }
</script>
</body>
</html>
