<!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" />
<link type="text/css" rel="stylesheet" href="<?php echo $this->basedir;?>images/admin/public.css" />
<link type="text/css" rel="stylesheet" href="<?php echo $this->basedir;?>images/admin/style.css" />
<link href="../../images/admin/public.css" rel="stylesheet" type="text/css" />
<link href="../../images/admin/style.css" rel="stylesheet" type="text/css" />
<script src="<?php echo $this->basedir;?>js/calendar.js" language="javascript"></script>
<body>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
  <tr align="center" valign="top">
    <td width="*" align="center" valign="top">
	<!-- ######### begin ######### -->
      <div class="Block">
        <div class="BlockBar">添加新服务器</div>
        <table cellspacing="1" cellpadding="4" class="tab">
		<form id="form1" name="form1" method="post" action="<?php echo $this->installdir;?>server/add/">
			   <tr class="row">
				<td width="17%" class="align-center">服务器名称：</td>
				<td width="83%">
			     <input name="name" type="text" id="name" size="30" />
			     * 限50个字符				</td>
			  </tr>
			   <tr class="row">
			     <td class="align-center">点播服务器：</td>
			     <td><input name="helixserver" type="text" id="helixserver" size="50" />
			     * 限250个字符</td>
	        </tr>
			   <tr class="row">
			     <td class="align-center">下载服务器：</td>
			     <td><input name="ftpserver" type="text" id="ftpserver" size="50" /></td>
			   </tr>
			   <tr class="row">
			     <td class="align-center">所属服务器：</td>
			     <td><select name="parentid" id="parentid">
			       <option value="0">主服务器</option>
				   <?php echo $this->Option;?>
			       </select>
			     </td>
	        </tr>
			   <tr class="row">
			     <td class="align-center">最高上限数：</td>
			     <td><input name="maxnum" type="text" id="maxnum" value="0" size="5" />
			     0表示无限制(当启用分流服务器后如果该服务器超过最高上限则转发用户到分流服务器)</td>
	        </tr>
			   <tr class="row">
			     <td class="align-center">&nbsp;</td>
			     <td><input type="submit" class="btn" value=" 添 加 " />&nbsp;<input type="button" class="btn" value=" 返回上一页 " onclick="history.back()" /></td>
	        </tr>
        </form>
        </table>
	  </div>
		<div class="BlockBar">服务器列表</div>
        <table border="0" cellpadding="4" cellspacing="1" class="tab">
          <tr class="sub">
            <td width="9%" class="align-center">编号</td>
            <td width="17%" class="align-center">服务器名</td>
            <td width="42%" class="align-center">点播服务器/下载服务器</td>
            <td width="12%" class="align-center">所属服务器</td>
            <td width="7%" class="align-center">上限</td>
            <td width="13%" class="align-center">管理</td>
          </tr>
		  <?php
		  if (is_array($this->server)){
		  foreach($this->server as $row){?>
          <tr class="rows">
            <td class="align-center"><?php echo $row['self']['sid'];?></td>
            <td><?php echo $row['self']['name'];?></td>
            <td><?php echo $row['self']['helixserver'];?> | <?php echo $row['self']['ftpserver'];?></td>
            <td>主服务器</td>
            <td class="align-center"><?php echo $row['self']['maxnum'];?></td>
            <td class="align-center"><a href="<?php echo $this->installdir;?>server/modify/id/<?php echo $row['self']['sid'];?>/">编辑</a> <a href="<?php echo $this->installdir;?>server/delete/id/<?php echo $row['self']['sid'];?>/" onclick="return confirm('确认删除吗')">删除</a> <a href="<?php echo $this->installdir;?>server/modify/id/<?php echo $row['self']['sid'];?>/do/locked/"t><?php echo $row['self']['locked'] ? '隐藏中' : '启用中';?></a></td>
          </tr>
		  <?php
			if (isset($row['nodes'])){
			foreach((array)$row['nodes'] as $rs){?>
			   <tr class="row">
				<td class="align-center"><?php echo $rs['sid'];?></td>
				<td>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $rs['name'];?></td>
				<td><?php echo $rs['helixserver'];?> | <?php echo $rs['ftpserver'];?></td>
				<td><?php echo $rs['parentid'];?>号服务器</td>
				<td class="align-center"><?php echo $rs['maxnum'];?></td>
				<td class="align-center"><a href="<?php echo $this->installdir;?>server/modify/id/<?php echo $rs['sid'];?>/">编辑</a> <a href="<?php echo $this->installdir;?>server/delete/id/<?php echo $rs['sid'];?>/" onclick="return confirm('确认删除吗')">删除</a> <a href="<?php echo $this->installdir;?>server/delete/id/<?php echo $rs['sid'];?>/do/locked/"><?php echo $rs['locked'] ? '隐藏中' : '启用中';?></a></td>
			  </tr>
			<?php
			}
			}?>
		  <?php
		  }
		 }else{
		 	echo '<tr class="align-center"><td colspan="5">暂无任何记录!</td></tr>';
		 }?>
      </table>
		<?php echo $this->PrintPage;?>
      </div>
    </td>
  </tr>
</table>
<?php
echo $this->render('copyright');
?>
</body>
</html>

