<?
require_once("module/module.build_version.php");
$versions = new CModuleVersion();
$versions->Init();

$svn_version = 0;
$server_version=0;
if($versions->GetSize()>0)
{
	$svn_version = $versions->modules[0]->Svn_version;
	if($svn_version == "") $svn_version = 0;
	$server_version=$versions->modules[0]->Server_version;
}
?>
<span class="big">服务端版本</span> 
<span class="link" id="release_server_version" onclick="click_buildversion(<?php echo $svn_version?>, '<?php echo $server_version?>')"><img src="imgs/b_bookmark.png" class="icon">构建新版本</span>
<hr size=1 width=80% align=left color=#CCCCCC>
<table border=0 cellspacing='1' cellpadding='0' bgcolor='#cccccc'>
	<tr bgcolor="#efefef" height=24>
		<td width=100 align=center><b>服务端版本号</td>
		<td width=120 align=center><b>对应客户端版本</td>
		<td width=80 align=center><b>SVN版本</td>
		<td width=80 align=center><b>编译状态</td>
		<td width=120 align=center><b>编译时间</td>
		<td width=80 align=center><b>发布状态</td>
		<td width=100 align=center><b>发布者</td>
		<td width=120 align=center><b>发布时间</td>
	</tr>
	<?php if($versions->GetSize()>0){?>
	<tr bgcolor="#efefef" height=24>
		<td align=center><?php echo $versions->modules[0]->Server_version?></td>
		<td align=center>[ <?php echo $versions->modules[0]->Client_version_min?>,  <?php echo $versions->modules[0]->Client_version_max?> ]</td>
		<td align=center><?php echo $versions->modules[0]->Svn_version?></td>
		<td align=center><?php echo $Config["version_complie"][$versions->modules[0]->Complie_state]?></td>
		<td align=center><?php echo $versions->modules[0]->Comlie_time?></td>
		<td align=center>
			<?php if($versions->modules[0]->Release_state==1){?>
				<input type=button value=" 发布 " class=txtput onclick="click_releaseversion()">
			<?php } else {?>
				<?php echo $Config["version_release"][$versions->modules[0]->Release_state] ?>
			<?php }?>
		</td>
		<td align=center><?php echo $versions->modules[0]->Comlie_username?></td>
		<td align=center><?php echo $versions->modules[0]->Release_time?></td>
	</tr>
	<?php }?>
	<?php 
		for($i=1;$i<$versions->GetSize();$i++){
	?>
	<tr bgcolor="#efefef" height=24>
		<td align=center><?php echo $versions->modules[$i]->Server_version?></td>
		<td align=center>[ <?php echo $versions->modules[$i]->Client_version_min?>, <?php echo $versions->modules[$i]->Client_version_max?> ]</td>
		<td align=center><?php echo $versions->modules[$i]->Svn_version?></td>
		<td align=center><?php echo $Config["version_complie"][$versions->modules[$i]->Complie_state]?></td>
		<td align=center><?php echo $versions->modules[$i]->Comlie_time?></td>
		<td align=center><?php echo $Config["version_release"][$versions->modules[$i]->Release_state] ?></td>
		<td align=center><?php echo $versions->modules[$i]->Comlie_username?></td>
		<td align=center><?php echo $versions->modules[$i]->Release_time?></td>
	</tr>
	<?php }?>
</table>

<script>
	function click_buildversion(svn_version, server_version)
	{
		OpenDialog("dialog/dialog.php?dlg=dlg_build&svn_version="+svn_version+"&server_version="+server_version, 600,400);
	}
	
	function click_releaseversion()
	{
		OpenDialog("dialog/dialog.php?dlg=dlg_release", 600,400);
	}
</script>