<%
if session("admin")<>"on" then
Response.Redirect"login.asp"
end if
%>
<!--#include file="config.asp" -->
<!--#include file="mdb/conn.asp" -->
<html>
<head>
<script language="Javascript">
function openScript(url, width, height){
	var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );
}
function openem()
{ 
openScript('upload.asp',350,200); 
}
</script>
<%
typeid=Request.QueryString("typeid")
if Request.QueryString("cz")="editfile" then
id=Request.QueryString("id")
sql = "SELECT * FROM desktop where id="&id 
Set rs = Server.CreateObject("ADODB.Recordset")
rs.OPEN sql,Conn,1,1
name=rs("name")
dx=rs("dx")
typeid=rs("typeid")
lx=rs("lx")
minipic=rs("minipic")
pic=rs("pic")
url=rs("url")
hot=rs("hot")
jj=html_1(rs("jj"))
rs.close
Set rs=Nothing
function html_1(fString)
	fString = Replace(fString, "</P><P>" , CHR(10) & CHR(10))
	fString = Replace(fString, "<BR>" , CHR(10))
	html_1= fString
end function
title="编辑文件"
cz="editfile"
else
title="添加文件"
cz="addfile"
end if
%>
<title><%=title%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
a {  font-family: "宋体"; font-size: 9pt; font-style: normal; line-height: 13pt; font-weight: normal; font-variant: normal; text-transform: none; color: <%=fontcolor%>; text-decoration: none}
a:hover {  font-family: "宋体"; font-size: 9pt; font-style: normal; line-height: 13pt; font-weight: normal; font-variant: normal; text-transform: none; color: <%=fontcolor%>; text-decoration: underline}
td {  font-family: "宋体"; font-size: 9pt; font-style: normal; line-height: 13pt; font-weight: normal; font-variant: normal; text-transform: none; color: <%=fontcolor%>}
br {  font-family: "宋体"; font-size: 9pt; font-style: normal; line-height: 13pt; font-weight: normal; font-variant: normal; text-transform: none; color: <%=fontcolor%>}
.bk { font-size: 9pt; border: 1px <%=xcolor%> solid}
body {  font-family: "宋体"; font-size: 9pt; font-style: normal; line-height: 13pt; font-weight: normal; font-variant: normal; text-transform: none}
.an {  font-family: "宋体"; font-size: 9pt; background-color: <%=bgcolor%>; border: 1px <%=xcolor%> solid; color: <%=fontcolor%>}
.xzy {  border: <%=xcolor%> solid; border-width: 0px 1px 1px}
.zx {  border: <%=xcolor%> solid; border-width: 0px 0px 1px 1px}
.sxz {  border: <%=xcolor%> solid; border-width: 1px 0px 1px 1px}
.s {  border: <%=xcolor%>; border-style: solid; border-top-width: 1px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px}
.y {  border: <%=xcolor%>; border-style: solid; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px}
.font {  font-family: "Arial Black"; font-size: 14pt; color: <%=fontcolor%>}
.x {  border: <%=xcolor%>; border-style: solid; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px}
.z {  border: <%=xcolor%>; border-style: solid; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 1px}
.sx {  border: <%=xcolor%>; border-style: solid; border-top-width: 1px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px}
-->
</style>
</head>

<body bgcolor="<%=bgcolor%>" text="#000000">
<!--#include file="top.asp" -->
<table width="774" border="0" cellspacing="0" cellpadding="5" bgcolor="<%=titlecolor%>" class="xzy" align="center">
  <tr> 
  <td>管理选项：<a href="admin.asp">管理首页</a> | <a href="adminfile.asp">管理文件</a> | <a href="loginout.asp">退出管理</a></td>
 </tr>
</table>
<table width="774" border="0" cellspacing="0" cellpadding="5" align="center" background="images/xc_4_bj.jpg">
  <form name="form" method="post" action="savefile.asp?cz=<%=cz%>&typeid=<%=typeid%>&id=<%=id%>">
    <tr> 
      <td height="5" colspan="2"></td>
    </tr>
    <tr> 
      <td class="sxz" width="115" align="right">文件名称：</td>
      <td class="bk" width="565"> 
        <input type="text" name="name" class="an" maxlength="50" value="<%=name%>">
        <input type="submit" name="Submit2" value="添加" class="an">
        * </td>
    </tr>
    <tr> 
      <td class="zx" width="115" align="right">文件大小：</td>
      <td class="xzy" width="565"> 
        <input type="text" name="dx" class="an" maxlength="50" value="<%=dx%>">
      </td>
    </tr>
    <tr> 
      <td class="zx" width="115" align="right">所属分类：</td>
      <td class="xzy" width="565"> 
        <select name="typeid">
          <%
sql = "SELECT * FROM type" 
Set rs = Server.CreateObject("ADODB.Recordset")
rs.OPEN sql,Conn,1,1
if rs.eof and rs.bof then
Response.Write"<option>还没有任何分类</option>"
else
do while not rs.eof
Response.Write"<option value='"&rs("id")&"'"
if typeid=rs("id") then Response.Write" selected"
Response.Write">"&rs("name")&"</option>"
rs.movenext
loop
end if
rs.close
set rs=nothing
conn.close
Set conn=Nothing
%>
        </select>
        * </td>
    </tr>
    <tr> 
      <td class="zx" width="115" align="right">文件类型：</td>
      <td class="xzy" width="565"> 
        <select name="lx">
          <%
if lx=1 then
Response.Write"<option value='1' selected>Flash</option><option value='0'>照片</option>"
else
Response.Write"<option value='1'>Flash</option><option value='0' selected>照片</option>"
end if
%>
        </select>
        * </td>
    </tr>
    <tr> 
      <td class="zx" width="115" align="right">缩略图：</td>
      <td class="xzy" width="565"> 
        <input type="text" name="minipic" class="an" maxlength="200" value="<%=minipic%>">
        [<a href="JavaScript:openem()">上传图片</a>] </td>
    </tr>
    <tr> 
      <td class="zx" width="115" align="right">放大图或FLASH文件：</td>
      <td class="xzy" width="565"> 
        <input type="text" name="pic" class="an" maxlength="200" value="<%=pic%>">
        * </td>
    </tr>
    <tr> 
      <td class="zx" width="115" align="right">供下载文件：</td>
      <td class="xzy" width="565"> 
        <input type="text" name="url" class="an" maxlength="200" value="<%=url%>">
      </td>
    </tr>
    <tr> 
      <td class="zx" valign="top" width="115" align="right">文件简介：</td>
      <td class="xzy" valign="top" width="565"> 
        <textarea name="jj" class="an" cols="40" rows="5"><%=jj%></textarea>
      </td>
    </tr>
  </form>
</table>
<table width="774" border="0" cellspacing="0" cellpadding="5" align="center">
  <tr> 
    <td height="5"></td>
  </tr>
  
  <tr> 
   
    <td class="bk" bgcolor="<%=titlecolor%>">请注意，必须填写带有“*”项目，缩略图如果不填写则使用默认图片</td>
  </tr>
</table>
</body>
</html>
