<%@ Language=VBScript %>
<%Option Explicit%>
<!-- #INCLUDE FILE = "../inc.asp" -->
<%
Dim oChat
Dim i
CheckAdminLogin()

Dim iRoomID
iRoomID = Request.QueryString("RoomID")

Set oChat = Server.CreateObject("LSChat.ChatRooms")
oChat.Configure g_SiteName, g_SiteDomain, g_DBString, g_ErrFile, g_ScriptName
Dim rst
Set rst = oChat.GetChatRoom(iRoomID)

Dim sRun, iRunMinutes
iRunMinutes = rst("RunMinutes")
If iRunMinutes < 60 Then
	sRun = "<b>" & iRunMinutes & "</b>分钟" 
ElseIf iRunMinutes >= 60 Then
	sRun = "<b>" & Fix(iRunMinutes/60) & "</b>小时"
	If iRunMinutes Mod 60 <> 0 Then sRun = sRun & "<b>" & iRunMinutes Mod 60 & "</b>分钟"
End If
%>
<html>
<head>
<title>检阅房间页面</title>
<script src="../inc.js" language="javascript"></script>
<link rel="stylesheet" href="manager.css" type="text/css">
<script language="javascript">
function submitform(value)
{
	if(form.Priority.value==""||!fucCheckNUM(form.Priority.value))
		{alert("房间序号不能为空，只能填写数字！");
		form.Priority.focus();
		return false;
		}
	if(form.RoomName.value=="")
		{alert("房间名称不能为空！");
		form.RoomName.focus();
		return false;
		}
	if(form.Welcome.value=="")
		{alert("欢迎致词不能为空！");
		form.Welcome.focus();
		return false;
		}
	if(form.Description.value=="")
		{alert("房间描述不能为空！");
		form.Description.focus();
		return false;
		}
	if(form.Style.value=="")
		{alert("样式不能为空！");
		form.Style.focus();
		return false;
		}
	if(form.Capacity.value==""||!fucCheckNUM(form.Capacity.value))
		{alert("人数限制不能为空，只能填写数字！");
		form.Capacity.focus();
		return false;
		}
	var url;
	switch(value){
		case "修改":
			url = "m_mroom.asp";
			if(!window.confirm("您已经选择修改房间，请确认！"))
				return false;
			break;
		case "删除":
			url = "m_droom.asp";
			if(!window.confirm("您已经选择删除房间，该操作不能恢复，请确认！"))
				return false;
			break;

	}
	form.action = url;
	form.submit();
}

function fucCheckNUM(NUM) 
{ 
	var i,j,strTemp; 
	strTemp="0123456789"; 
	if (NUM.length== 0) 
		return false; 
	for (i=0;i<NUM.length;i++) 
		{j=strTemp.indexOf(NUM.charAt(i)); 
		if (j==-1) 
			{ 
			//说明有字符不是数字 
			return false; 
			}
		} 
	//说明是数字 
	return true; 
}

</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="manager.css" type="text/css">
</head>
<body <%=g_BodyTag%>>
<table width="80%" border="0" cellspacing="0" cellpadding="0" align="center" class="solid1">
  <tr>
    <td bgcolor="#FFFFFF"> 
      <table width="100%" border="0" cellspacing="1" cellpadding="3">
        <form name="form" method="post">
          <tr> 
            <td align="center" background="images/admin_bg_1.gif"><font color="#FFFFFF">[<b>系统提示</b>] 
              本聊房间已稳定运行<%=sRun%>，共发布了<b><%=rst("Messages")%></b>条内容，总字节数为<%=rst("Words")%>。 
              </font> </td>
          </tr>
          <tr> 
            <td bgcolor="#DEE5FA">索引序号： 
              <input type="hidden" name="RoomID" value="<%=rst("RoomID")%>">
              <input type="text" name="Priority" value="<%=rst("Priority")%>" size="3" maxlength="3">
              房间名称： 
              <input type="text" name="RoomName" value="<%=rst("RoomName")%>" size="15" maxlength="15">
              状态： 
              <select name="State">
                <%If rst("State") = 1 Then%>
                <option value="1" selected class="Open">开放</option>
                <option value="0" class="Close">关闭</option>
                <%Else%>
                <option value="1" class="Open">开放</option>
                <option value="0" selected class="Close">关闭</option>
                <%End If%>
              </select>
            </td>
          </tr>
          <tr> 
            <td bgcolor="#DEE5FA">欢迎致词： 
              <textarea name="Welcome" rows="4" cols="85"><%=rst("WelCome")%></textarea>
            </td>
          </tr>
          <tr> 
            <td bgcolor="#DEE5FA">房间说明： 
              <textarea name="Description" rows="4" cols="85"><%=rst("Description")%></textarea>
            </td>
          </tr>
          <tr> 
            <td bgcolor="#DEE5FA">样式文件： 
              <input type="text" name="Style" value="<%=rst("Style")%>" size="15" maxlength="15">
            </td>
          </tr>
          <tr> 
            <td bgcolor="#DEE5FA"> Emote功能： 
              <select name="Emote">
                <%If rst("Emote") Then%>
                <option value="1" selected class="Open">开</option>
                <option value="0" class="Close">关</option>
                <%Else%>
                <option value="1" class="Open">开</option>
                <option value="0" selected class="Close">关</option>
                <%End If%>
              </select>
              最大用户限制： 
              <input type="text" name="Capacity" maxlength="3" value="<%=rst("Capacity")%>" size="3">
              （如果不限人数，就填写0） </td>
          </tr>
          <tr> 
            <td align="right" bgcolor="#DEE5FA"> 
              <input type="button" name="back" value="返回" onClick="history.go(-1);">
              <input type="button" name="DelRoom" value="删除" onclick="submitform(this.value);">
              <input type="button" name="ModifyRoom" value="修改" onclick="submitform(this.value);">
            </td>
          </tr>
        </form>
      </table>
    </td>
  </tr>
</table>
<!-- #INCLUDE File = "../bottom.asp" -->
</body>
</html>
<%
rst.Close
Set rst = Nothing
Set oChat = Nothing
%>