<%@ Language=VBScript %>
<% Response.Buffer = True %>
<!--#include file="../../connoklin.asp"-->
<!--#include file="../Config.asp"-->
<HTML>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css.css" type="text/css">
<title><%=website%>后台管理</title>
<SCRIPT src="time.js"></SCRIPT>
<script language="javascript">
function check_input(theform)  
{  
 if (theform.Title.value=="")
	{   alert("标题必须填写！");
	    theform.Title.focus();
	    return (false);
	}
}
</script>
<SCRIPT language=JavaScript>
<!--
if (window == top)top.location.href = "<%=webpath%>index.asp"; //frames.htm为框架网页
// 
-->
</SCRIPT>
<style>
body,td,input,textarea {font-size:9pt}
</style>
<script language=javascript>

function doSave(){
	objField.value = eWebEditor1.getHTML();
	self.close();
}

function setValue(){
	try{
		if (eWebEditor1.bInitialized){
			eWebEditor1.setHTML(objField.value);
		}else{
			setTimeout("setValue();",1000);
		}
	}
	catch(e){
		setTimeout("setValue();",1000);
	}
}
</script>
<%
           set rs=server.CreateObject("adodb.recordset")
           sql="select * from smallclass"
           rs.open sql,conn,1,1
%>
<script language="JavaScript">
var num;
var calArray=new Array();
<%
dim j
j=0
do while not rs.eof
%>
calArray[<%=j%>]=new Array("<%=rs("SmallClassName")%>","<%=rs("SmallClassName")%>","<%=rs("BigClassName")%>");
<%
j=j+1
rs.movenext
loop
rs.close
set rs=nothing
%>
num=<%=j%>
function givevalue(myvalue){
document.theform.Class2.length = 0;
 for (i=0;i < num; i++)
  {
   if (calArray[i][2] == myvalue)
     {
      document.theform.Class2.options[document.theform.Class2.length] = new Option(calArray[i][1], calArray[i][0],"","");                 
      }        
  }
}
</script>
</HEAD>
<BODY leftMargin=0 rightMargin=0 topMargin=0 marginwidth="0" marginheight="0" bgcolor="#FFFFFF" text="#000000">
<table width="98%" border="0" cellspacing="2" cellpadding="0" height="300" align="center">
  <tr>
    <td height="12" align="center">&nbsp;</td>
  </tr>
  <tr>
    <td height="20" align="center"><font class="t16"><b>文章管理</b></font>&nbsp;&nbsp;&nbsp;&nbsp;[<a href="News_add.asp">新增</a>]</td>
  </tr>
  <tr>
    <td align="center" valign="top">
	<form name="theform" method="post" action="News_add_ok.asp" onSubmit="return check_input(this)">
	  <table width="780" border="0" cellspacing="1" cellpadding="1" align="center" bgcolor="#000000" bordercolordark=FFFFFF>
        <tr>
          <td width="96" height="26" align="center" bgcolor="6E7A8C"><font color="#FFFFFF">类别</font></td>
          <td width="441" height="26" bgcolor="#FFFFFF">
		  <select name="Class1" class="input" id="Class1" onChange="givevalue(document.theform.Class1.options[document.theform.Class1.selectedIndex].value)" style="width:100">
                  <%
				  
          dim firstid
           set rs=server.CreateObject("adodb.recordset")
           sql="select * from bigclass order by bigclassid"
           rs.open sql,conn,1,1
		    if rs.eof or rs.bof then
           %>
                  <option selected>没有大类</option>
                  <%
           else
           rs.movefirst
           firstid=rs("bigclassname")
           '在没有选择大类（页面刚载入）时要载入的大类。
           %>
                  <option value="<%=rs("bigclassname")%>" selected><%=rs("bigClassName")%></option>
                  <%
           rs.movenext
           do while not rs.eof
           %>
                  <option value="<%=rs("bigclassname")%>"><%=rs("bigClassName")%></option>
                  <%
           rs.movenext
           loop
		   end if
           rs.close
           set rs=nothing
		   
           %>
              </select><select name="Class2" class="input" id="Class2" style="width:100">
                  <%
           set rs=server.CreateObject("adodb.recordset")
           sql="select * from smallClass where bigclassname='"&firstid&"'"
		   response.Write sql
           rs.open sql,conn,1,1
           do while not rs.eof
           %>
                  <option value="<%=rs("smallClassName")%>"><%=rs("smallClassName")%></option>
                  <%
           rs.movenext
           loop
           rs.close
           set rs=nothing
           %>
                </select></td>
          <td width="403" height="180" rowspan="7" align="center" bgcolor="#FFFFFF">
		    <input name="Sketch" type="hidden" id="Sketch">
		    <IFRAME src="upload.asp" id="Result" frameBorder="0" width="230" height="100%"></IFRAME></td>
        </tr>
        <tr>
          <td width="96" height="26" align="center" bgcolor="6E7A8C"><font color="#FFFFFF">标题</font></td>
          <td width="441" height="26" bgcolor="#FFFFFF"><input name="Title" type="text" class="input" id="Title" size="70">          </td>
          </tr>
		          <tr>
          <td width="96" height="26" align="center" bgcolor="6E7A8C"><font color="#FFFFFF">排序</font></td>
          <td height="26" bgcolor="#FFFFFF"><input name="flag" type="text" class="input" id="flag" value="0" size="8" onKeyUp="value=value.replace(/[^0-9]/g,'')" onBlur="value=value.replace(/[^0-9]/g,'')" 
 onfocus="value=value.replace(/[^0-9]/g,'')"  onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">
            一定要数字</td>
        </tr>
        <tr>
          <td height="350" align="center" bgcolor="6E7A8C"><font color="#FFFFFF">正文</font></td>
          <td height="350" colspan="2" bgcolor="#FFFFFF">
<INPUT name="Fbody" type="hidden" value="">
<IFRAME ID="FileBody" src="../../Edit.asp?id=Fbody&style=standard" frameborder="0" scrolling="no" width="650" height="100%"></IFRAME>
<script language=javascript>
setTimeout("setValue();",1000);
</script>		  </td>
          </tr>
		          <tr>
          <td height="26" align="center" bgcolor="6E7A8C"><font color="#FFFFFF">发布人</font></td>
          <td height="26" colspan="2" bgcolor="#FFFFFF"><input name="author" type="text" class="input" id="author" value="管理员" size="20">
			</td>
        </tr>
      </table>
	  <input name="submit" type="submit" class="input" value="  确 定  ">
	</form>
      </td>
  </tr>
</table>
</BODY></HTML>
