<%@ page contentType="text/html; charset=GBK"%>
<%@ page import="java.sql.*,gbase.db.*" %>
<%@ include file="../checkLogin.jsp" %>
<SCRIPT language="JavaScript" src="../js/util.js"></SCRIPT>
<LINK href="../css/css.css" rel=stylesheet>
<%
DBOperation theDBOperation = new DBOperation();

String forumID=request.getParameter("forumID")==null?"":request.getParameter("forumID");
String action = request.getParameter("action") == null ? "" :request.getParameter("action");
String name="";
String description="";
String jive_right="";

if(action.equals("update") || action.equals("view"))
{
String sql = "select a.forumID,a.name,a.description,b.jive_right from jiveforum a,web_jive b where a.forumID=b.forumID and a.forumID="+forumID+"";
ResultSet rs =theDBOperation.getResultSet(sql);
if(rs.next())
{
name=rs.getString("name")==null?"":rs.getString("name");
description=rs.getString("description")==null?"":rs.getString("description");
jive_right=rs.getString("jive_right")==null?"":rs.getString("jive_right");
}
}
%>
<html>
<head>
<title>
论坛栏目管理
</title>
</head>
<body leftmargin="0" topmargin="0">

<!--导航-->
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
       <tr>
		<td width="100%" height="20"  bgcolor="#eeeeee" class="p2">您当前所在的位置>>论坛栏目管理</td>
	   </tr>
       <tr>
          <td width="100%" height="2"> <img border="0" src="../images/spacer.gif" width="1" height="3"></td>
       </tr>
    </table>
<!--标题-->
  <div align="center">
   <table border="0" width="100%" cellspacing="0" cellpadding="0" height="34">
	<tr>
		<td width="159" background="../images/back_board2.gif" nowrap valign="bottom"><span class="title01">&nbsp;<span class="style1">新增/修改论坛栏目管理</span></span></td>
		<td valign="bottom" align="right" width="642"></td>
	</tr>
	<tr>
		<td bgcolor="#2C9CC4" colspan="2"><img border="0" src="../images/bline_3.gif" width="1" height="2"></td>
	</tr>
</table>
</div><br>
<form name="form1" method="post" action="jive_bar_save.jsp">
<input name="action" type="hidden" value="<%=action%>">
<input name="forumID" type="hidden" value="<%=forumID%>">
<div align="center">
<table width="85%" class="p1" border="0" cellSpacing="1" cellPadding="3" align="center" bgColor="#cccccc">
        <tr>
		<td align="right"  bgColor=#e9f0f4 width=150">论坛栏目名称：</td>
		<td onmouseover='vbscript:me.bgcolor="#F5F5F5"'	onmouseout='vbscript:me.bgcolor="#FFFFFF"' bgColor=#ffffff>&nbsp;
			<input name="name" type="text" size="50" maxlength="25" value="<%=name%>">&nbsp;
                </td>
	</tr>
	<tr>
		<td align="right"  bgColor=#e9f0f4>论坛栏目描述：</td>
		<td onmouseover='vbscript:me.bgcolor="#F5F5F5"'	onmouseout='vbscript:me.bgcolor="#FFFFFF"' bgColor=#ffffff>&nbsp;
			<TEXTAREA name=description rows=6 cols=70 ><%=description%></TEXTAREA>
		</td>
	</tr>
	<tr>
		<td align="right"  bgColor=#e9f0f4 width=150">权限设置：</td>
		<td onmouseover='vbscript:me.bgcolor="#F5F5F5"'	onmouseout='vbscript:me.bgcolor="#FFFFFF"' bgColor=#ffffff>
		    &nbsp;<input type="radio" value="3"  name="jive_right"><B>注册用户</B> -- 只有注册用户可以阅读和发表消息。 
		    <BR>
		    &nbsp;<input type="radio" value="4"  name="jive_right"><B>注册用户，来客可读</B> -- 来客只能阅读，注册用户可以阅读和发布消息。
		    <BR>
		    &nbsp;<input type="radio" value="2"  name="jive_right"><B>无限制<B> -- 任何人都可以阅读和发布消息。
                </td>
	</tr>
</table>

<table border="0" cellpadding="3" class="p1" width="90%" bordercolor="#D7D7D7" style="border-collapse: collapse" cellspacing="0">
	<tr>
		<td width="30%" align="right">　</td>
		<td width="70%" height="0">
		        <%if(!action.equals("view")){%>
			<img border="0" src="../images/btn/confirm.gif"  onclick = "check_validate(document.form1)" style="cursor:hand">
			<A href="javascript:document.form1.reset();"><IMG src="../images/btn/reset.gif" border=0></A>
			<%}%>
			<A href="javascript:history.back();"><IMG src="../images/btn/back.gif"  border=0></A>
		</td>
	</tr>
</table>
</div>
</form>
</body>
<Script Language="javaScript">
    function  check_validate(theForm) {
        if (isSpace(theForm.name.value)) {
            alert("论坛栏目名称不能为空！");
            theForm.name.focus();
            return false;
        }
        var jive_right=get_jive_right();
        if(isSpace(jive_right)) {
            alert("请选择相应的权限设置！");
            //theForm.jive_right.focus();
            return false;
        }
        theForm.submit();
    }
    function  modify_init(jive_right)
    { 
        var doc_jive_right=document.getElementsByName("jive_right"); 
        for(var i=0;i<doc_jive_right.length;i++) 
          { 
          if(doc_jive_right[i].value==jive_right) 
            {
             doc_jive_right[i].checked=true
             break; 
            } 
          }
    }      
    function  get_jive_right()
    {   
        var doc_jive_right=document.getElementsByName("jive_right"); 
        var jive_right="";
        for(var i=0;i<doc_jive_right.length;i++) 
          { 
          if(doc_jive_right[i].checked==true) 
            { 
             jive_right=doc_jive_right[i].value; 
             break; 
            } 
          } 
        return jive_right;
    }
   modify_init('<%=jive_right%>')
</Script>
</html>
