<!--#include file="Admin.asp" -->
<!--#include file="cf.asp" -->
<!--#include file="adminconn.asp" -->
<!--#include file="../include/safe.asp"-->
<%
dim rs
dim sql
dim count
set rs=server.createobject("adodb.recordset")
'sql = "select * from SmallClass2 where SmallClassID in ("&session("strsmallidtype")&") order by SmallClassID asc"
sql = "select * from SmallClass2 order by SmallClassID asc"
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("SmallClassName"))%>","<%= trim(rs("BigClassName"))%>","<%= trim(rs("SmallClassName"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        %>
onecount=<%=count%>;

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

function CheckForm()
{
     document.addNEWS.cnWords.value = document.frames.cnEditBox.getHTML(true);     
     document.addNEWS.imageNum.value = document.frames.cnEditBox.document.all("editImageNum").value;
     document.addNEWS.editFirstImageName.value = document.frames.cnEditBox.document.all("editFirstImageName").value;

	if (document.addNEWS.title.value.length == 0) {
		alert("新闻标题没有填写.");
		document.addNEWS.title.focus();
		return false;
	}
		if (document.addNEWS.user.value.length == 0) {
		alert("新闻发布人没有填写");
		document.addNEWS.user.focus();
		return false;
	}
	return true;
}
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../include/css.css" type="text/css">
<title>添加新闻</title>
</head>

<body leftmargin="0" topmargin="0" bgcolor="#FFFFEE">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="2">
  <form name="addNEWS" method="post" action="addinfo_ok2.asp" onSubmit="return CheckForm();">
    <tr> 
      <td height="30" colspan="3" align="center">&nbsp;</td>
    </tr>
    <tr> 
      <td width="188" height="25"><font color="#FF0000">*</font>新闻标题：</td>
      <td colspan="2">
<input name="title" type="text" class="input" size="70" maxlength="100"></td>
    </tr>
	<tr>
  <td height="25" align="left">&nbsp; 文章属性：</td>
  <td colspan="3">
        <select class='css_select' name="oStyle" type="text" id="oStyle">
          <option value="s">标题样式</option>
          <option value="s01">粗体</option>
          <option value="s02">斜体</option>
        </select>
        <select class='css_select' name="oColor" type="text" id="oColor">
          <option value="links">标题颜色</option>
          <option value="a01" style="background-color:#FF0000;"></option>
          <option value="a02" style="background-color:#0000FF;"></option>
          <option value="a03" style="background-color:#00FFFF;"></option>
          <option value="a04" style="background-color:#FF9900;"></option>
          <option value="a05" style="background-color:#339966;"></option>
        </select>
        <select class='css_select' name="top" type="text" id="top">
          <option value="0">文章置顶</option>
          <option value="1">置顶是</option>
          <option value="0">置顶否</option>
          </select>
		 <select class='css_select' name="tuijian" type="text" id="tuijian">
                <option value="0" selected>文章推荐</option>
                <option value="1">推荐是</option>
                <option value="0">推荐否</option>
        </select></td>
</tr>
    <tr> 
      <td height="25"><font color="#FF0000">*</font>新闻类别：</td>
      <td colspan="2"> 
        <%
        'sql = "select * from BigClass2 where urlok=0 and  bigclassid in ("&session("strbigidtype")&") order by bigclassid desc"
		sql = "select * from BigClass2 where urlok=0 order by bigclassid desc"
        rs.open sql,conn,1,1
		if rs.eof and rs.bof then
			response.write "请先添加栏目。"
		else
		%>
        <select name="BigClassName" onChange="changelocation(document.addNEWS.BigClassName.options[document.addNEWS.BigClassName.selectedIndex].value)" size="1">
          <option selected value="<%=trim(rs("BigClassName"))%>"><%=trim(rs("BigClassName"))%></option>
          <%
			dim selclass
		    selclass=rs("BigClassName")
        	rs.movenext
		    do while not rs.eof
			%>
          <option value="<%=trim(rs("BigClassName"))%>"><%=trim(rs("BigClassName"))%></option>
          <%
		        rs.movenext
    	    loop
		end if
        rs.close
			%>
        </select> <select name="SmallClassName">
          <option value="" selected>请指定版面</option>
          <%
			'sql="select * from SmallClass2 where BigClassName='" & selclass & "' and SmallClassID in ("&session("strsmallidtype")&")"
			sql="select * from SmallClass2 where BigClassName='" & selclass & "' "
			rs.open sql,conn,1,1
			if not(rs.eof and rs.bof) then
			%>
          <option value="<%=rs("SmallClassName")%>"><%=rs("SmallClassName")%></option>
          <% rs.movenext
				do while not rs.eof%>
          <option value="<%=rs("SmallClassName")%>"><%=rs("SmallClassName")%></option>
          <%
			    rs.movenext
				loop
			end if
	        rs.close
			%>
          <%
			ranNum=int(9*rnd)+10
			iddata=month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum
			%>
        </select></td>
    </tr>
		 <tr> 
      <td width="188" height="25">&nbsp; 首页小图：</td>
      <td width="221">
<input name="pic_url" type="text" class="input" id="pic_url" size="30" maxlength="255"></td>
      <td width="463"><iframe border=0 frameborder=0 framespacing=0 height=22 width=300 marginheight=0 marginwidth=0 name=new_date noresize scrolling=no  src="upload.asp" vspale="0"></iframe></td>
    </tr>
    <tr> 
      <td height="25" valign="top"><font color="#FF0000">*</font>新闻内容：</td>
      <td colspan="2" valign="top"> 
         <textarea name="demo" style="display:none"></textarea><iframe id="demo" src="./SouthidcEditor/ewebeditor.asp?id=demo&style=s_yellow" frameborder="0" scrolling="no" width="550" height="350"></iframe></td>
    </tr>
    
    <tr> 
      <td height="25"><font color="#FF0000">*</font>发布人：</td>
      <td colspan="2"> 
        <input name="user" type="text" class="input" value="<%=session("adminuser")%>" size="30"></td>
    </tr>
	    <tr> 
      <td height="25"><font color="#ff0000">*</font>文章来源：</td>
      <td colspan="2"> 
        <input name="come" type="text" class="input" id="come" value="电子报纸管理系统" size="30" maxlength="30"></td>
    </tr> 
    <tr> 
      <td height="25">图片新闻：</td>
      <td colspan="2"> 
        <input type="radio" name="ok" value="true">
        是 
        <input name="ok" type="radio" value="false" checked>
        否 　<font color="#FF0000">选择此项时请注意文章中是否添加有图片 ！</font></td>
    </tr> 
    <tr> 
      <td height="30" colspan="3" align="center"> 
        <input type="submit" name="Submit" value="提交" class="input">
        <input name="subsave" type="hidden" value="subok">
        <input type="reset" name="Submit2" value="重置" class="input"> 
 </td>
    </tr>
  </form>
  <tr> 
    <td height="30" colspan="3" align="center">&nbsp;</td>
  </tr>
</table>
</body>
</html>
