<!--#include file="conn.asp"-->
<!--#include file="inc/cook2.asp"-->
<!--#include file="inc/dimflag.asp" -->
<!--#include file="inc/htmlconfig.asp"-->
<!--#include file="top.asp"-->
<%
tid = int(Request("tid"))
id=request.QueryString("id")
word=request("word")
page=request("page")
xcid=request("xcid")

select case action
case "save"
set rs=server.CreateObject("adodb.recordset")
sql="select * from com_down where id="&id
rs.open sql,conn,1,3
rs("Cid")=request("Cid")
rs("type")=tid
rs("date")=request("date")
rs("titlecn")=trim(request("titlecn"))
rs("titleen")=trim(request("titleen"))
rs("textcn")=trim(request("textcn"))
rs("texten")=trim(request("texten"))
rs("bookpicm")=trim(request("bookpicm"))
rs("picsize")=trim(request("picsize"))

rs.update
rs.close
set rs=nothing

response.Redirect "down_manage.asp?page="&page&"&word="&word&"&xcid="&xcid&"&tid="&tid&""
response.End
end select
%>
<form name="myform" method="post" action="?action=save&id=<%=id%>&xcid=<%=xcid%>&word=<%=word%>&page=<%=page%>&tid=<%=tid%>" >
 <%
set rs=server.CreateObject("adodb.recordset")
sql="select * from com_down where id="&id
rs.open sql,conn,1,1
%>
<div id="container">
<div class="top_but">
 <li class="left">&nbsp;</li>
 <li><a href="down_manage.asp?tid=<%=tid%>"><img src="images/but_11.gif" alt="管理"></a></li>
 <li><img src="images/but_8.gif" alt="刷新" onClick="window.location.reload(true);"></li>
 <li><img src="images/but_9.gif" alt="打印" onClick="window.print() "/></li>
</div>

<div class="tableAll titlebgcolor">
 <li style="width:30px">&nbsp;</li>
 <li style="width:700px">修改内容</li>
</div>
<div class="tableAll trbgcolor">
  <li style="width:30px;">&nbsp;</li>
 <li style="width:100px;">选择分类</li>
 <li>
<%
  set rs1=server.CreateObject("adodb.recordset")
  rs1.open "select * from com_class where type="&tid&" and Cid=0 and LevelID=0 order by pid asc, id desc",conn,1,1
  %>
   <select name="Cid" size="1" >
    <%
    do while not rs1.eof
	%>
    <option value="<%=rs1("ID")%>" <%if rs("cid")=rs1("id") then%>selected<%end if%>><%=rs1("ClassNamecn")%>
  <%
  set rs2=server.CreateObject("adodb.recordset")
  rs2.open "select * from com_class where type="&tid&" and Cid="&rs1("ID")&" order by pid asc, id desc",conn,1,1
  %>
    <%
    do while not rs2.eof
	%>
    <option value="<%=rs2("ID")%>" <%if rs("cid")=rs2("id") then%>selected<%end if%>>&nbsp;&nbsp;-&nbsp;<%=rs2("ClassNamecn")%>
    <%
    rs2.movenext
    loop
	%>
    <%
	rs2.close
	set rs2=nothing
	%>
    <%
    rs1.movenext
    loop
	%>
    <%
	rs1.close
	set rs1=nothing
	%>
    </select>
    </li>
</div>
<div class="tableAll trbgcolor">
 <li style="width:30px">&nbsp;</li>
 <li style="width:100px">中文名称</li>
 <li><input name="titlecn" type="text" value="<%=trim(rs("titlecn"))%>" size="45"></li>
</div>
<div class="tableAll trbgcolor">
 <li style="width:30px">&nbsp;</li>
 <li style="width:100px">英文名称</li>
 <li><input name="titleen" type="text" value="<%=trim(rs("titleen"))%>" size="45"></li>
</div>
<div class="tableAll trbgcolor">
 <li style="width:30px">&nbsp;</li>
 <li style="width:100px">资料上传</li>
 <li><input name="bookpicm" type="text" id="bookpicm" size="60" value="<%=trim(rs("bookpicm"))%>"></li>
 <li><iframe ID="UploadFiles" src="update_file.asp?editname=bookpicm&booksize=picsize&filepath=upload_files" frameborder=0 scrolling=no width="200" height="20"></iframe></li>      
</div>
<div class="tableAll trbgcolor">
 <li style="width:30px">&nbsp;</li>
 <li style="width:100px">资料大小</li>
 <li><input name="picsize" type="text" size="10" readonly value="<%=trim(rs("picsize"))%>"> KB</li>
</div><div class="tableAll trbgcolor">
<li style="width:30px;">&nbsp;</li>
<li style="width:100px">发布时间</li>
<li><input name="date" type="text" id="date" value="<%=rs("date")%>"></li>
</div>
<script>
	KindEditor.ready(function(K) {
		var editor1 = K.create('textarea[name="textcn"]',{
			uploadJson : '../sy_kind/asp/upload_json.asp',
			fileManagerJson : '../sy_kind/asp/file_manager_json.asp',
			allowFileManager : true,
		});
		var editor2 = K.create('textarea[name="texten"]',{
			uploadJson : '../sy_kind/asp/upload_json.asp',
			fileManagerJson : '../sy_kind/asp/file_manager_json.asp',
			allowFileManager : true,
		});
		
	});
</script>
<div class="clear"></div> 
<div class="tableAll trbgcolor">
<li style="width:30px;">&nbsp;</li>
<li style="width:90%;"><textarea id="textcn" name="textcn" style="width:100%;height:280px;"><%=rs("textcn")%></textarea></li>
</div>
<%if Const_webEn =1 then%>
<div class="clear"></div> 
<div class="tableAll trbgcolor">
<li style="width:30px;">&nbsp;</li>
<li style="width:90%;"><textarea id="texten" name="texten" style="width:100%;height:280px;"><%=rs("texten")%></textarea></li>
</div>
<%end if%>

<div class="tableAll trbgcolor">
 <li style="width:30px">&nbsp;</li>
 <li style="width:100px">&nbsp;</li>
 <li><input class="button" type="submit" name="Submit" value="确认ok，修改" > </li>
</div>
</div>
</form>
<!--#include file="footer.asp"-->