<?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:inporting();">
	<input type="button" class="btn" value="查看装备数据" onClick="javascript:location.href='?mod=<?=$mod?>&file=<?=$file?>&action=manage'"></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% id="content0">
<form method="get" name="search" action="?">
  <tr>
    <td width=20%><strong>装备搜索</strong></td>
    <td width=40%>装备代码：<input name='itemid' type='text' size='30' value='<?=$itemid?>'><br>
	装备名称：<input name='itemname' type='text' size='30' value='<?=$itemname?>'></td>
	<td width=40%>
<input name='mod' type='hidden' value='<?=$mod?>'>
<input name='file' type='hidden' value='<?=$file?>'>
<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" id="content1">
  <tr>
    <td style="text-align:center;color:darkgreen;font-size:14px;font-weight:bold">共 <font color=red><?=$sumnums?></font> 条装备数据! </td>
  </tr>
</table>
<table cellpadding="2" cellspacing="1" class="tableborder" width=100% id="content2">
<tr align="center">
<td width="15%" class="tablerowhighlight" style="font-size:14px;text-align:center;font-weight:bold">装备ID号</td>
<td width="20%" class="tablerowhighlight" style="font-size:14px;font-weight:bold">装备名称</td>
<td width="65%" class="tablerowhighlight" style="font-size:14px;text-align:center;font-weight:bold">装备说明</td>
</tr>
<?php 
if(is_array($items))
{
foreach($items as $item){ ?>
<tr align="center">
<td style="text-align:center"><?=$item['itemid']?></td>
<td style="font-weight:bold"><?=$item['itemname']?></td>
<td style="font-weight:bold;text-align:left"><?=$item['itemmemo']?></td>
</tr>
<?php } 
}
?>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="30" id="content3">
  <tr>
    <td align="center"><?=$pages?></td>
  </tr>
</table>
<script language="javascript">
function inporting(){
    if(confirm("请确认已将新的items.csv放到了网站根目录！\n\n导入新数据，会删除原来的数据且不可恢复，是否继续？")){ 
   document.getElementById("content0").style.display="none";
   document.getElementById("content1").style.display="none";
   document.getElementById("content2").style.display="none";
   document.getElementById("content3").style.display="none";
   document.getElementById("part_one").style.display="block";
   window.location.href='?mod=<?=$mod?>&file=<?=$file?>&action=import';
   }
}
 function window.onload(){
   if(document.body.readyState=="complete"){
     part_one.style.display='none';
   }
 }
</script>
</body>
</html>
