<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file = "tuzh_pri.asp"-->
<!--#include file="../connadmin.asp"-->
<%id=request("id")
set newsrs=server.createobject("adodb.recordset")
sql="select * from news where id="&id
newsrs.open sql,conn,1,1
if newsrs.bof or newsrs.eof then
response.Write("该新闻不存在")
response.End()
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../img/css.css"><title></title>
<title>无标题文档</title>
<Script Language=JavaScript>
function doChange(objText, objDrop){
	if (!objDrop) return;
	var str = objText.value;
	var arr = str.split("|");
	objDrop.length=0;
	for (var i=0; i<arr.length; i++)
	{
		objDrop.options[i] = new Option(arr[i], arr[i]);
	}
}
function picload(hiddenvalue, objDrop){
	if (!objDrop) return;
	var str = hiddenvalue;
	var arr = str.split("|");
	objDrop.length=0;
	for (var i=0; i<arr.length; i++)
	{
		objDrop.options[i] = new Option(arr[i], arr[i]);
	}
}
function doChangepic(objText, objDrop, dopic){
	if (!objDrop) return;
	var str = objText.value;
	var pic,pkpic;
	var arr = str.split("|");
	objDrop.length=0;
	for (var i=0; i<arr.length; i++)
	{
		objDrop.options[i] = new Option(arr[i], arr[i]);
	    pic=arr[i];
	}
	if(dopic.value==""){
	okpic="image/uploadfile/";
	okpic+=pic;
	dopic.value=okpic;}
}
function doch(dd,hh){
var strin;
strin="image/uploadfile/";
strin+=dd.value;
hh.value=strin;
}   

</Script>
</head>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from yikind"
rs.open sql,conn,1,1
dim lm1
lm1=""
do while not rs.eof
if rs("yiid")=newsrs("yiid") then
oklmid=newsrs("yiid")
lm1=lm1&"<option value='"&rs("yiid")&"' selected>"&rs("yiname")&"</option>"
else
lm1=lm1&"<option value='"&rs("yiid")&"'>"&rs("yiname")&"</option>"
end if
rs.movenext
loop
rs.close
'*************************************
set rs2=server.createobject("adodb.recordset")
sql="select * from erkind where yiid="&oklmid
rs2.open sql,conn,1,1
dim lm2
lm2=""
do while not rs2.eof
if rs2("erid")=newsrs("erid") then
lm2=lm2&"<option value='"&rs2("erid")&"' selected>"&rs2("ername")&"</option>"
else
lm2=lm2&"<option value='"&rs2("erid")&"'>"&rs2("ername")&"</option>"
end if
rs2.movenext
loop
rs2.close

'*************************************
sql="select erid,yiid,ername from erkind"
rs.open sql,conn,3,1%>

<script language = "JavaScript">
var lmcount;
lm=new Array();
<%count=0
do while not rs.eof
%>
lm[<%=count%>]=new Array("<%= trim(rs(2))%>","<%= trim(rs(1))%>","<%= trim(rs(0))%>");
<%
count=count+1
rs.movenext
loop
rs.close
%>
lmcount=<%=count%>;
function changelangmu1(langmu1){
document.form1.langmu2.length=1; 
var langmu1=langmu1;
var i;
for (i=0;i<lmcount; i++){
if (lm[i][1]==langmu1){ 
document.form1.langmu2.options[document.form1.langmu2.length]=new Option(lm[i][0], lm[i][2]);
}        
}
} 
</script>
<body>
<form name="form1" method="post" action="do.asp">
  <table width="626" border="1" cellpadding="0" cellspacing="0">
    <tr> 
      <td width="66">&nbsp;</td>
      <td valign="top"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber1">
          <tr> 
            <td align="center" height="20">一级栏目</td>
            <td align="center" height="20">二级栏目</td>
          </tr>
          <tr> 
            <td align="center" height="20"> <select size="1" name="langmu" onChange="changelangmu1(document.form1.langmu.value)">
                <option value="" selected>请选择一级栏目</option>
                <%=lm1%> </select> &nbsp; </td>
            <td align="center" height="20"> &nbsp; <select size="1" name="langmu2">
                <option selected value="">请选择二级栏目</option>
                <%=lm2%></select></td>
          </tr>
        </table></td>
    </tr>
    <tr> 
      <td width="66">标题</td>
      <td><input name="txttitle" type="text" id="txttitle2" value="<%=newsrs("title")%>"></td>
    </tr>
    <tr> 
      <td width="66">&nbsp;</td>
      <td width="554"><textarea name="txtcontent" style="display:none"><%=Server.HTMLEncode(newsrs("Content"))%></textarea> 
        <iframe id="eWebEditor1" src="../image/ewebeditor.asp?id=txtcontent&style=s_coolblue&originalfilename=myText1&savefilename=myText2&savepathfilename=myText3" frameborder="0" scrolling="no" width="550" height="350"></iframe> 
      </td>
    </tr>
    <tr> 
      <td width="66">&nbsp;</td>
      <td><input type="text" name="newstime" value="<%=newsrs("newstime")%>">
        (格式如下2005-9-9 8:18:35)</td>
    </tr>
    <tr> 
      <td width="66">首页图片名</td>
      <td><input name="shoupic" type="text" id=shoupic2  value="<%=newsrs("shoupic")%>" size="40" maxlength="50"></td>
    </tr>
    <tr> 
      <td width="66">&nbsp;</td>
      <td><input type="hidden" name="action" value="modi"> <input type="hidden" name="newsid" value="<%=newsrs("id")%>"> 
        <input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置"></td>
    </tr>
  </table>
</form>
<%newsrs.close
conn.close%>
</body>
</html>
