<?php 
defined('IN_HS') or exit('Access Denied');
include admintpl('header');
?>
<style>
.selecton{BORDER-RIGHT: #e6cf87 1px dashed; PADDING-RIGHT: 20px; BORDER-TOP: #e6cf87 1px dashed; DISPLAY: block; PADDING-LEFT: 20px; FONT-SIZE: 12px; BORDER-LEFT: #e6cf87 1px dashed; PADDING-TOP: 0px; BORDER-BOTTOM: #e6cf87 1px dashed
}
</style>
<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="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> 共 <font color=red><?=$sumnums?></font> 条!数据&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;排列方式：
   <select name="select" onChange="location.href=this.options[this.selectedIndex].value;" style="background:#eee;font-size:14px;color:#900">
   <option value="">-------- 排序方式 --------</option>
   <option value="?mod=<?=$mod?>&file=banklist&action=manage&idserver=<?=$idserver?>&ordertype=BankMoney&username=<?=$username?>" <?php if($ordertype == "BankMoney") { ?> selected<? } ?>>--- 按金钱从高到低排列 ---</option>
   </select><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="25%" 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;color:red">仓库密码</td>
<td width="25%" 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" id="trline_<?=$member['AccountID']?>" value="closes">
<td style="text-align:center" id="iduser_<?=$member[AccountID]?>"><a style="TEXT-DECORATION: underline" href="?mod=<?=$mod?>&file=acclist&action=manage&idserver=<?=$idserver?>&idx=<?=$member['AccountID']?>" target="_blank" title="打开该帐号"><?=$member['AccountID']?></a></td>
<td style="font-weight:bold;"><a style="TEXT-DECORATION: underline" href="?mod=<?=$mod?>&file=fsolist&action=manage&idserver=<?=$idserver?>&AccountID=<?=$member['AccountID']?>" target="_blank" title="打开该帐号下属角色"><?=$member['username']?></a></td>
<td style="text-align:center" id="Pass_<?=$member['AccountID']?>" onDblClick="changepass(<?=$member['AccountID']?>,<?=$idserver?>)" <?php if($member['Password']) { ?>value="******"<? }else{ ?>value=""<? } ?>
  ><?php if($member['Password']) { ?>******<? } ?></td>
<td style="text-align:center" value="<?=$member['BankMoney']?>" id="Money_<?=$member['AccountID']?>" onDblClick="changemoney(<?=$member['AccountID']?>,<?=$idserver?>,this.value)"><?=$member['BankMoney']?></td>
<td style="text-align:center" id="button_<?=$member['AccountID']?>">
<input style="color:#555" name="button" type="button" class="btn" onClick="showcontent(<?=$member[AccountID]?>)" value="打开装备数据"></td>
</tr>
<tr align="center">
<td colspan="7" style="display:none;padding-left:0px;width:0px;height:0px" id="content_<?=$member['AccountID']?>">
<table cellpadding="2" cellspacing="1" class="tableborder2" width="100%">
  <tbody>
	<tr>
      <td style="text-align:right"><strong>装备数据：</strong></td>
      <td>
	  <textarea type="text" id="Items<?=$member['AccountID']?>" cols="100%" rows="8"><?=$member['Items']?></textarea></td>
      </tr>
	<tr>
      <td><input style="color:#f00;font-weight:bold" name="button" type="button" class="btn" onClick="javascript:openwinx('?mod=<?=$mod?>&file=searchitem&idserver=<?=$idserver?>','','800','600')" value=" !查询道具 "></td>
      <td><input style="color:#333" name="button" type="button" class="btn" onClick="savecontents('<?=$member[AccountID]?>','<?=$idserver?>')" value=" 保存数据 "> <input style="color:#f00" name="button" type="button" class="btn" onClick="checkonline('<?=$idserver?>','<?=$member[AccountID]?>')" value=" 检查是否在线 "> <input style="color:chocolate" name="button" type="button" class="btn" onClick="goback('<?=$member[AccountID]?>')" value=" 返回 "></td>
      </tr>
</table></td>
</tr>
<?php } 
}
?>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="30">
  <tr>
    <td align="center" id="pages"><?=$pages?></td>
  </tr>
</table>
<script language="javascript">
<?php
sajax_show_javascript();
?>
function changemoney(iduser,idserver,oldmoney){
 document.getElementById("Money_"+iduser).innerHTML="<input id='iMoney_"+iduser+"' type='text' value='"+oldmoney+"' style='width:170px' onBlur=savemoney("+iduser+","+idserver+",this.value)>";
 document.getElementById("iMoney_"+iduser).select();
}
function savemoney(iduser,idserver,oldmoney){
  var newmoney = document.getElementById("iMoney_"+iduser).value;
  if (newmoney == "") newmoney=0;
  x_savemoney(iduser,idserver,newmoney,savemoney_cb)
 
 function savemoney_cb(z){
  if(z == "true"){
    window.alert("更新仓库存款成功！");
	document.getElementById("Money_"+iduser).innerHTML=newmoney;
	document.getElementById("Money_"+iduser).value=newmoney;
  }else{
    window.alert(z);
	document.getElementById("Money_"+iduser).innerHTML=oldmoney;
  }
 }
}


function changepass(iduser,idserver){
 document.getElementById("Pass_"+iduser).innerHTML="<input id='iPass_"+iduser+"' type='text' style='width:170px' onBlur=savepass("+iduser+","+idserver+")>";
 document.getElementById("iPass_"+iduser).focus();
}
function savepass(iduser,idserver){
  var newpass = document.getElementById("iPass_"+iduser).value;
  var oldpass = document.getElementById("Pass_"+iduser).value;
  x_savepass(iduser,idserver,newpass,savepass_cb)
 
 function savepass_cb(z){
  if(z == "true"){
    window.alert("密码更新成功！");
	if (newpass =="")
	{
	  thisnewpass ="";
	}else{
	  thisnewpass ="******"
	}
	document.getElementById("Pass_"+iduser).innerHTML=thisnewpass;
	document.getElementById("Pass_"+iduser).value=thisnewpass;
  }else{
    window.alert(z);
	document.getElementById("Pass_"+iduser).innerHTML=oldpass;
  }
 }
}

function savecontents(iduser,idserver){
 var Items=document.getElementById("Items"+iduser).value;

 x_savecontents(iduser,idserver,Items,savecontents_cb)
 
 function savecontents_cb(z){
  if( z == "true"){
   window.alert("更新成功！");
   
   var a = document.getElementsByTagName("tr");
   for (var i=0; i<a.length; i++)
   if (a[i].value == "closes") a[i].style.display = "block";
   document.getElementById("pages").style.display="block";
   document.getElementById("button_"+iduser).style.display="block";
   document.getElementById("content_"+iduser).style.display="none";
 
	}else{
	window.alert(z);
	}
 }
}

function checkonline(idserver,AccountID){

 x_checkonline(idserver,AccountID,checkonline_cb)
 
 function checkonline_cb(z){
    window.alert(z);
 }
}

function showcontent(iduser)
{
   var a = document.getElementsByTagName("tr");
   for (var i=0; i<a.length; i++)
   if (a[i].value == "closes") a[i].style.display = "none";
   document.getElementById("trline_"+iduser).style.display="block";
   document.getElementById("content_"+iduser).style.display="block";
   document.getElementById("pages").style.display="none";
   document.getElementById("button_"+iduser).style.display="none";
}

function goback(iduser)
{
   var a = document.getElementsByTagName("tr");
   for (var i=0; i<a.length; i++)
   if (a[i].value == "closes") a[i].style.display = "block";
   document.getElementById("pages").style.display="block";
   document.getElementById("button_"+iduser).style.display="block";
   document.getElementById("content_"+iduser).style.display="none";
}

 function window.onload(){
   if(document.body.readyState=="complete"){
     part_one.style.display='none';
   }
 }
</script>
</body>
</html>
