<!--------MetInfo 网站管理系统------->
<!--这是一个免费开源程序，您可以在不用于商业目的的前提下对程序进行修改和再发布-->
<!--版权所有：www.MetInfo.com.cn-->

<%@language=vbscript codepage=936 %>
<!--#include file="../inc/conn.asp"-->
<!--#include file="../admin.asp"-->
<!--#include file="../Inc/Function.asp"-->
<%
dim ID 
ID=request("id")
dim rs
dim sql
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from lanmu where mxtype=2"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
subcat = new Array();
        <%
        count = 0
        do while not rs.eof 
        %>
subcat[<%=count%>] = new Array("<%= trim(rs("lmname"))%>","<%= trim(rs("bigclass"))%>","<%= trim(rs("id"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.myform.bigclass1.length = 1; 
    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.myform.bigclass1.options[document.myform.bigclass1.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
    }    

function AddItem(strFileName){
  document.myform.IncludePic.checked=true;
  document.myform.DefaultPicUrl.value=strFileName;
  document.myform.DefaultPicList.options[document.myform.DefaultPicList.length]=new Option(strFileName,strFileName);
  document.myform.DefaultPicList.selectedIndex+=1;
  if(document.myform.UploadFiles.value==''){
	document.myform.UploadFiles.value=strFileName;
  }
  else{
    document.myform.UploadFiles.value=document.myform.UploadFiles.value+"|"+strFileName;
  }
}

function CheckForm()
{
    if (editor.EditMode.checked==true)
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerText;
    else
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerHTML; 

	if (document.myform.title.value.length == 0) {
		alert("文章标题没有填写.");
		document.myform.title.focus();
		return false;
	}
	return true;
}
</script><head>
<link href="../css/metinfo.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gbk">
</head>


<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top"><table width="95%" border="0" cellpadding="2" cellspacing="1" class="table_southidc">
        <form method="POST" name="myform" onSubmit="return CheckForm();" action="News_save.asp?action=Add" target="_self">
          <tr> 
            <td class="back_southidc" height="30" colspan="3" align="center">增加文章</td>
          </tr>
		  <input name="class1" type="hidden" value="<%=ID%>" >
          <tr bgcolor="#ECF5FF"> 
            <td width="119" height="25"><font color="#FF0000">*</font>文章标题：</td>
            <td width="476" colspan="2"> <input name="title" type="text" class="input" size="50" maxlength="200"></td>
          </tr> 
		<%
		dim rs1
        set rs1=server.createobject("adodb.recordset")
        sql = "select * from lanmu where bigclass="&Cint(ID)
        rs1.open sql,conn,1,1
		if rs1.eof and rs1.bof then
		
		set rsb=server.createobject("adodb.recordset")
		sql = "select * from lanmu where id="&Cint(ID)
		rsb.open sql,conn,1,1%>
		 <tr bgcolor="#ECF5FF"> 
         <td height="25"><font color="#FF0000">*</font>所属栏目：</td>
         <td colspan="2"><input name="bigclass" type="hidden" value=0 >
           <%=trim(rsb("lmname"))%></td>
         </tr> 
		<%
		rsb.close
		set rsb=nothing
		else
		%>
		 <tr bgcolor="#ECF5FF"> 
         <td height="25"><font color="#FF0000">*</font>所属栏目：</td>
         <td colspan="2">
		 <select name="bigclass" onChange="changelocation(document.myform.bigclass.options[document.myform.bigclass.selectedIndex].value)" size="1">
         <option selected value="<%=trim(rs1("id"))%>"><%=trim(rs1("lmname"))%></option>
           <%
			dim selclass
		    selclass=rs1("id")
			rs1.movenext
		    do while not rs1.eof
			%>
             <option value="<%=trim(rs1("id"))%>"><%=trim(rs1("lmname"))%></option>
             <%
		     rs1.movenext
    	    loop
             rs1.close
			%>
              </select>
			<select name="bigclass1"> 
			<option value=0>请选择三级栏目</option>
			<%
			set rs2=server.createobject("adodb.recordset")
			sql="select * from lanmu where bigclass="&selclass
			rs2.open sql,conn,1,1
			if not(rs2.eof and rs2.bof) then
			%>
		    <%do while not rs2.eof%>
            <option value="<%=rs2("id")%>"><%=rs2("lmname")%></option>
            <%
			    rs2.movenext
				loop
			end if
	        rs2.close
			%>
         </select> </td>
          </tr>
		  	<%
			end if
			%>
			<tr bgcolor="#ECF5FF"> 
          <td width="120" valign="middle"><b>内容关键字:</b><br></td>
          <td width="596" colspan="2" valign="top"><input name="keywords" type="text"  size="50"  /> 用于优化网页，便于搜索引擎收录。          </td>
          </tr>
          <tr bgcolor="#ECF5FF"> 
          <td width="120" height="25" valign="middle"><b>内容简短描述:</b><br>用于优化网页，便于搜索引擎收录。</td>
          <td width="596" colspan="2" valign="top"> <textarea name="description" cols="86" rows="5" ></textarea> </td>
          </tr>
          <tr bgcolor="#ECF5FF"> 
            <td height="25" valign="top"><font color="#FF0000">*</font>文章内容：</td>
            <td colspan="2" valign="top"> <textarea name="Content" style="display:none"></textarea> 
              <iframe ID="editor" src="../../editor/editor.asp" frameborder=1 scrolling=no width="620" height="405"></iframe>              </td>
          </tr>
         <tr bgcolor="#ECF5FF"> 
            <td height="25">图片文章：</td>
            <td colspan="2"><input name="tpnews" type="checkbox" value="yes" class="xz" />是 
             <font color="#FF0000">（图片文章将在页面文章列表中以图片形式展示，选择此项时请添加形象图片！）</font></td>
          </tr>
		  <tr>
			<td height="22" bgcolor="#ECF5FF">形象图片：		</td>
            <td width="120" bgcolor="#ECF5FF"> <input name="DefaultPicUrl" type="text" id="DefaultPicUrl" size="30" maxlength="200"></td>
            <td width="120" bgcolor="#ECF5FF"><iframe style="top:2px" ID="UploadFiles" src="../../editor/upload_Photo.asp?PhotoUrlID=5" frameborder=0 scrolling=no width="320" height="25"></iframe></td>
          </tr>
		           <tr bgcolor="#ECF5FF"> 
            <td height="25">推荐文章：</td>
            <td colspan="2"> <input name="tjnews" type="checkbox" value="yes" class="xz" />是 
              <font color="#FF0000">（选择“是”将在推荐文章中显示！）</font></td>
          </tr>
          <tr bgcolor="#ECF5FF"> 
            <td height="25"><font color="#FF0000">*</font>发布人：</td>
            <td colspan="2"> <input name="user" type="text" class="input" value="<%=session("AdminName")%>" size="30"></td>
          </tr>
         <tr> 
            <td height="30" align="center" bgcolor="#ECF5FF"><div align="left">点击次数：</div></td>
            <td height="30" colspan="2" align="center" bgcolor="#ECF5FF"><div align="left">
              <input name="Hits" type="text" id="Hits" value=0 size="5" maxlength="50" />
              （点击次数越多，热门信息中排名越靠前）
            </div></td>
          </tr>
          <tr> 
            <td height="30" align="center" bgcolor="#ECF5FF"><div align="left">录入时间：</div></td>
            <td height="30" colspan="2" align="center" bgcolor="#ECF5FF"><div align="left">
              <input name="Infotime" type="text" id="Infotime" value="<%=now()%>" maxlength="50" />
            当前时间为：<%=now()%> 注意不要改变格式。</div></td>
          </tr>
          <tr> 
            <td height="30" colspan="3" align="center" bgcolor="#ECF5FF"> <input type="submit" name="Submit" value="提交" class="tj">
              　 
              <input type="reset" name="Submit" value="重置" class="tj"> </td>
          </tr>
        </form>
    </table></td>
  </tr>
</table>