<%@ page contentType="text/html; charset=GBK"%>
<%@ page import="java.sql.*,gbase.db.*" %>
<jsp:useBean id="myEnv" scope="application" class="com.jdon.web.UserEnvFront"/>
<jsp:setProperty name="myEnv" property="*"/>
<LINK href="images/style.css" type=text/css rel=stylesheet>
<%@ page import="java.util.*,gbase.init.*,
                 com.jivesoftware.util.*,
                 com.jivesoftware.forum.*,
                 com.jivesoftware.forum.util.*"
%>
<%String web_account= request.getParameter("web_account")==null?"":request.getParameter("web_account");%>
<%@ include file="workcheck.jsp" %>
<%
DBOperation theDBOperation = new DBOperation();

String id = request.getParameter("id") == null ? "" :request.getParameter("id");
String action = request.getParameter("action") == null ? "" :request.getParameter("action");
String title="";
String title_desc="";
String bar_id="";
String special_id="";
String content="";
String create_date="";

if(action.equals("update") || action.equals("view"))
{
String sql = "select * from web_titleinfo  where web_account='"+web_account+"' and id="+id+"";
ResultSet rs =theDBOperation.getResultSet(sql);
if(rs.next())
{
title=rs.getString("title")==null?"":rs.getString("title");
title_desc=rs.getString("title_desc")==null?"":rs.getString("title_desc");
bar_id=rs.getString("bar_id")==null?"":rs.getString("bar_id");
special_id=rs.getString("special_id")==null?"":rs.getString("special_id");
content=rs.getString("content")==null?"":rs.getString("content");
create_date=rs.getString("create_date")==null?"":rs.getString("create_date");
}
}
%>
<html>
<head>
<title>
标题信息管理
</title>
</head>
<body leftmargin="0" topmargin="0">
<TABLE style="BORDER-RIGHT: #c5cfda 1px solid; BORDER-TOP: #c5cfda 1px solid; BACKGROUND: #ffffff; BORDER-LEFT: #c5cfda 1px solid; BORDER-BOTTOM: #c5cfda 1px solid" cellSpacing=1 cellPadding=0 width="98%" border=0>
  <TBODY>
  <TR bgColor=#ecf3fb>
    <TD class=title background=images/menu1.gif colSpan=8 
    height=29>&nbsp;标题信息管理</TD></TR>
  <TR>
    <TD class=title style="BORDER-BOTTOM: #b8d0f2 1px solid; HEIGHT: 4px" colSpan=8>
<!--正文内容-->
<BR>
<form name="main" method="post" action="web_titleinfo_save.jsp?web_account=<%=web_account%>">
<input name="action" type="hidden" value="<%=action%>">
<input name="id" type="hidden" value="<%=id%>">
<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="title" type="text" size="50" maxlength="50" value="<%=title%>">&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=title_desc rows=4 cols=70 ><%=title_desc%></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;
	             <%
	               DBOperation theSelectDBOperation = new DBOperation();
	               String select_sql = "select * from bar_menu where content_type='2' and web_account='"+web_account+"'";
                       ResultSet select_rs =theSelectDBOperation.getResultSet(select_sql);
	             %>
	             <select name="bar_id">
                        <option value="">--请选择--</option>
                        <%while(select_rs.next()){%>
	                <option value="<%=select_rs.getString("id")%>"><%=select_rs.getString("name")%></option>
	                <%}%>
	             </select>
                </td>
	</tr>
	<tr>
	    <td colspan="2" align="left"  bgColor=#e9f0f4>&nbsp;&nbsp;&nbsp;&nbsp;信息内容(在线编辑器)</td>
	</tr>
	<tr>
	   <td colspan="2">
	   <textarea name="content" style="display:none"><%=content%></textarea>
              <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
                <tr>
                  <td>
                   <IFRAME ID="onlineEditor" src="htmledit/ewebeditor.htm?id=content&style=standard600&skin=office2003" frameborder="0" scrolling="no" width="100%" height="408"></IFRAME>
                  <br/>
		  </td>
                </tr>
             </table>
	   </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 = "javascript: if(check_validate(main)){main.submit();}" style="cursor:hand">
			<A href="javascript:document.form1.reset();"><IMG src="images/btn/reset.gif" border=0></A>
			<%}%>
			<A href="javascript:window.location='web_titleinfo_list.jsp?web_account=<%=web_account%>';"><IMG src="images/btn/back.gif"  border=0></A>
		</td>
	</tr>
</table>
</div>
</form>
</TD>
</TR>
</TBODY>
</TABLE>
</body>
<Script Language="javaScript">
function isSpace(str) {
      var len = str.length;
      for(var i=0; i< len; i++) {
        temp = str.substring(i,i+1);
        if (temp != " ") {
            return false;
        }
      }
      return true;
    }
    function  check_validate(theForm) {
        if (isSpace(theForm.title.value)) {
            alert("标题名称不能为空！");
            theForm.title.focus();
            return false;
        }
        if (isSpace(theForm.bar_id.value)) {
            alert("请选择所属栏目！");
            theForm.bar_id.focus();
            return false;
        }
        if (isSpace(theForm.title.value)) {
            alert("标题名称不能为空！");
            theForm.title.focus();
            return false;
        }
        return true;
    }
main.bar_id.value='<%=bar_id%>';    
</Script>
</html>
