<!--#include file="conn.asp"-->
<!--#include file="admin.asp"-->
<!--#include file="Inc/Function.asp"-->

<%
dim ID,rsArticle,FoundErr,ErrMsg
ID=trim(request("ID"))
FoundErr=False
if ID="" then 
	response.Redirect("ArticleManage.asp")
end if
sql="select * from News where ID=" & ID & ""
Set rsArticle= Server.CreateObject("ADODB.Recordset")
rsArticle.open sql,conn,1,1
if FoundErr=True then
	call WriteErrMsg()
else
%>
<%
dim rs
dim sql
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from SmallClass_New 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.myform.SmallClassName.length = 1; 
    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.myform.SmallClassName.options[document.myform.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
    }    

</script>
<!-- #include file="Inc/Head.asp" -->

<form method="POST" name="myform" action="News_Modify_Save.asp?action=Modify">
  <table width="750" border="0" align="center" cellpadding="4" cellspacing="1" class="table_southidc">
    <tr bgcolor="#A4B6D7">
      <td height="30" colspan="3" align="center" class="back_southidc"><b>修 改 新 闻</b></td>
    </tr>
    <tr>
      <td width="150" height="22" align="right" bgcolor="#ECF5FF"><font color="#FF0000">*</font>新闻标题：</td>
      <td colspan="2" bgcolor="#ECF5FF"><input name="title" type="text"   style="overflow:visible;"   class="input" value="<%=rsArticle("Title")%>"></td>
    </tr>
    <tr>
      <td height="36" align="right" bgcolor="#ECF5FF">备注/副标题：</td>
      <td height="36" colspan="2" bgcolor="#ECF5FF"><textarea name="title_fu" cols="80" rows="5" class="input" id="title_fu"><%=rsArticle("title_fu")%></textarea></td>
    </tr>
    <tr id=ChannelType1 <%if trim(rsArticle("PicOpen"))="1" then response.Write "style='display:none'"%>>
      <td height="36" align="right" bgcolor="#ECF5FF"><span class="TableRow2005">图片上传：</span></td>
      <td height="36" colspan="2" bgcolor="#ECF5FF"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="6%" height="25" align="center"><span class="TableRow2005">
              <input name="PicOpen" type="radio"  onClick="ChannelType1.style.display='none'; ChannelType2.style.display='';" value="1" >
            </span></td>
            <td width="94%" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td height="3"></td>
                </tr>
              </table>
                <font color="#FF0000">开启　　此处用于首页图片调用可根据需要选定开启。如果不需要可不必开启！</font></td>
          </tr>
      </table></td>
    </tr>
    <tr id=ChannelType2  <%if trim(rsArticle("PicOpen"))="2" then response.Write "style='display:none'"%>>
      <td align="right" bgcolor="#ECF5FF">调用图片：</td>
      <td width="300" align="center" bgcolor="#ECF5FF"><span class="TableRow2005">关闭<input name="PicOpen" type="radio"  onClick="ChannelType1.style.display='';     ChannelType2.style.display='none';" value="2">
      </span>
        <input name="DefaultPicUrl" type="text" id="DefaultPicUrl" value="<%=rsArticle("DefaultPicUrl")%>" size="30" maxlength="50">
          <input name="PhotoSize6" type="text" id="PhotoSize6" size="8" readonly style="display:none " ></td>
      <td width="310" bgcolor="#ECF5FF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="22" align="center"><iframe style="top:2px" id="UploadFiles" src="Upfile/upload_Photo.asp?PhotoUrlID=6" frameborder=0 scrolling=no width="270" height="22"></iframe></td>
        </tr>
        <tr>
          <td height="20" align="center"><a alt='
<table border=0 ><tr><td>
<img src=../<%=rsArticle("DefaultPicUrl")%>  width=200 >
</td></tr></table>'> 查看已经上传的图片</a></td>
          </tr>
      </table>      </td>
    </tr>
    
    <tr>
      <td height="22" align="right" bgcolor="#ECF5FF"><font color="#FF0000">*</font>新闻类别：</td>
      <td colspan="2" bgcolor="#ECF5FF"><strong>
        <%
	if session("purview")=3 or session("purview")=4 then
		response.write rsArticle("BigClassName") & "<input name='BigClassName' type='hidden' value='" & rsArticle("BigClassName") & "'>&gt;&gt;"
	else		
        sql = "select * from BigClass_New"
        rs.open sql,conn,1,1
		if rs.eof and rs.bof then
			response.write "请先添加栏目。"
		else
		%>
        <select name="BigClassName" onChange="changelocation(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].value)" size="1">
          <%
		    do while not rs.eof
			%>
          <option <% if rs("BigClassName")=rsArticle("BigClassName") then response.Write("selected") end if%> value="<%=trim(rs("BigClassName"))%>"><%=trim(rs("BigClassName"))%></option>
          <%
		        rs.movenext
    	    loop
		end if
        rs.close
			%>
        </select>
        <%
	end if
	if session("purview")=4 then
		response.write rsArticle("SmallClassName") & "<input name='SmallClassName' type='hidden' value='" & rsArticle("SmallClassName") & "'>"
	else
	%>
        <select name="SmallClassName">
          <option value="" <%if rsArticle("SmallClassName")="" then response.write "selected"%>>不指定小类</option>
          <%
			sql="select * from SmallClass_New where BigClassName='" & rsArticle("BigClassName") & "'"
			rs.open sql,conn,1,1
			if not(rs.eof and rs.bof) then
				do while not rs.eof%>
          <option <% if rs("SmallClassName")=rsArticle("SmallClassName") then response.Write("selected") end if%> value="<%=rs("SmallClassName")%>"><%=rs("SmallClassName")%></option>
          <%
			    	rs.movenext
				loop
			end if
	        rs.close
			%>
        </select>
        <%
	end if
	%>
      </strong></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#ECF5FF"><font color="#FF0000">*</font>新闻内容： </td>
      <td colspan="2" bgcolor="#ECF5FF"><div align=center>
          <textarea name="Content" style="display:none"><%=rsArticle("content")%></textarea>
          <iframe id="eWebEditor1" src="Southidceditor/ewebeditor.asp?id=content&style=southidc" frameborder="0" scrolling="no" width="600" height="450"></iframe>
      </div></td>
    </tr>
    <tr>
      <td height="22" align="right" bgcolor="#ECF5FF"><font color="#FF0000">*</font>发布人：</td>
      <td colspan="2" bgcolor="#ECF5FF"><input name="user" type="text"   style="overflow:visible;"  value="<%=session("AdminName")%>"></td>
    </tr>
    <tr>
      <td height="22" align="right" bgcolor="#ECF5FF">信息作者：</td>
      <td colspan="2" bgcolor="#ECF5FF"><INPUT name="author" type="text"   style="overflow:visible;"   id="author" value="<%=rsArticle("author")%>">
          <SELECT onChange="author.value=this.value;" name="font">
            <OPTION value="" selected>选择作者</OPTION>
            <OPTION value="<%=session("AdminName")%>"><%=session("AdminName")%></OPTION>
            <OPTION value="佚名">佚名</OPTION>
            <OPTION value="本站">本站</OPTION>
            <OPTION value="不详">不详</OPTION>
            <OPTION value="未知">未知</OPTION>
        </SELECT>
          <span style="color: #ECF5FF">author</span></td>
    </tr>
    <tr>
      <td height="22" align="right" bgcolor="#ECF5FF">信息来源：</td>
      <td colspan="2" bgcolor="#ECF5FF"><INPUT   type="text"   style="overflow:visible;"   name="ComeFrom" id="ComeFrom" value="<%=rsArticle("ComeFrom")%>">
          <SELECT onChange="ComeFrom.value=this.value;" name="select">
            <OPTION value="" selected>选择来源</OPTION>
            <OPTION value="本站原创">本站原创</OPTION>
            <OPTION value="本站整理">本站整理</OPTION>
            <OPTION value="不详">不详</OPTION>
            <OPTION value="转载">转载</OPTION>
        </SELECT>
          <span style="color: #ECF5FF">ComeFrom</span></td>
    </tr>
    <tr>
      <td height="22" align="right" bgcolor="#ECF5FF"><span class="TableRow2005">浏览等级</span>：</td>
      <td colspan="2" bgcolor="#ECF5FF"><span class="TableRow2005">
        <SELECT name=UserGroup>
          <% if rsArticle("UserGroup")=999 then%>
          <OPTION value=999 selected>管理员</OPTION>
          <OPTION value=0  >匿名用户</OPTION>
          <OPTION value=1  >普通会员</OPTION>
          <OPTION value=2  >高级会员</OPTION>
          <OPTION value=3  >VIP 会员</OPTION>
          <% elseif rsArticle("UserGroup")=0 then%>
          <OPTION value=999 >管理员</OPTION>
          <OPTION value=0 selected>匿名用户</OPTION>
          <OPTION value=1>普通会员</OPTION>
          <OPTION value=2>高级会员</OPTION>
          <OPTION value=3>VIP 会员</OPTION>
          <% elseif rsArticle("UserGroup")=1 then%>
          <OPTION value=999>管理员</OPTION>
          <OPTION value=0  >匿名用户</OPTION>
          <OPTION value=1  selected>普通会员</OPTION>
          <OPTION value=2  >高级会员</OPTION>
          <OPTION value=3  >VIP 会员</OPTION>
          <% elseif rsArticle("UserGroup")=2 then%>
          <OPTION value=999>管理员</OPTION>
          <OPTION value=0  >匿名用户</OPTION>
          <OPTION value=1  >普通会员</OPTION>
          <OPTION value=2  selected>高级会员</OPTION>
          <OPTION value=3 >VIP 会员</OPTION>
          <% elseif rsArticle("UserGroup")=3 then%>
          <OPTION value=999>管理员</OPTION>
          <OPTION value=0  >匿名用户</OPTION>
          <OPTION value=1  >普通会员</OPTION>
          <OPTION value=2  >高级会员</OPTION>
          <OPTION value=3  selected>VIP 会员</OPTION>
          <%end if%>
        </SELECT>
        </span><span class="TableRow2005"> <span style="color: #ECF5FF">UserGroup</span>　　　　　　　　　　　　　初始点击数：
          <input name="Hits" type="text" class="input" id="Hits" value="<%=rsArticle("Hits")%>" size="5" maxlength="10">
          <span style="color: #ECF5FF">Hits</span></span></td>
    </tr>
    <tr>
      <td height="22" align="right" bgcolor="#ECF5FF">立即发布：</td>
      <td colspan="2" bgcolor="#ECF5FF"><input name="ok" type="checkbox" id="ok" value="yes" <% if rsArticle("ok")=true then response.Write("checked") end if%>>
        是 <font color="#0000FF">（否则审核后才能发布。）</font><span style="color: #ECF5FF">ok</span></td>
    </tr>
    <tr>
      <td height="22" align="right" bgcolor="#ECF5FF">是否推荐：</td>
      <td colspan="2" bgcolor="#ECF5FF"><input name="tuijian" type="checkbox" id="tuijian" value="yes" <% if rsArticle("tuijian")=true then response.Write("checked") end if%>>
        是 <font color="#0000FF">（如果选中的话将在首页作为推荐法显示）</font><span style="color: #ECF5FF">tuijian</span></td>
    </tr>
    <tr>
      <td height="22" align="right" bgcolor="#ECF5FF">是否头条：</td>
      <td colspan="2" bgcolor="#ECF5FF"><input name="top" type="checkbox" id="top" value="yes" <% if rsArticle("top")=true then response.Write("checked") end if%>>
        是<font color="#0000FF"> （如果选中的话将在首页头条显示）</font><span style="color: #ECF5FF">top</span></td>
    </tr>
    <tr>
      <td height="22" align="right" bgcolor="#ECF5FF">是否评论：</td>
      <td colspan="2" bgcolor="#ECF5FF"><input name="pl" type="checkbox" id="pl" value="yes" <% if rsArticle("pl")=true then response.Write("checked") end if%>>
        是<font color="#0000FF"> （如果选中的话将开启评论）</font><span style="color: #ECF5FF">pl</span></td>
    </tr>
    <tr>
      <td height="22" align="right" bgcolor="#ECF5FF">录入时间：</td>
      <td colspan="2" bgcolor="#ECF5FF"><input name="AddDate" type="text"   style="overflow:visible;"   id="AddDate" value="<%=rsArticle("AddDate")%>" maxlength="50">
        当前时间为：<%=now()%> 注意不要改变格式。</td>
    </tr>
    <tr bgcolor="#E3E3E3">
      <td height="22" colspan="3" align="center" bgcolor="#ECF5FF">
      <input name="ID" type="hidden" id="ID" value="<%=rsArticle("ID")%>">        <input  name="Save" type="submit"  id="Save" value=" 保 存 ">      </td>
    </tr>
  </table>
</form>
<!-- #include file="Inc/Foot.asp" -->
<%
end if
rsArticle.close
set rsArticle=nothing
call CloseConn()
%>
