📄 man_file.asp
字号:
<%
if session("username")="" or session("usertype")="" then
response.Write"<script>"
response.Write"parent.location.href='default.asp';"
response.Write"</script>"
end if
%>
<!--#include file="conn.asp"-->
<%
if request("act")="add" then
set rsd=server.CreateObject("adodb.recordset")
dsql="select * from net_file order by id desc"
rsd.open dsql,conn,3,2
rsd.addnew
rsd("title")=request("title")
rsd("path")=request("cover")
rsd("filetype")=request("filetype")
rsd("toinfo")=request("toinfo")
rsd.update
rsd.close
response.Redirect("man_file.asp?id="&request("toinfo")&"")
response.End()
end if
%>
<%
if request("act")="edit" then
set rst=server.CreateObject("adodb.recordset")
strsql="select * from net_file where id="&request("id")&""
rst.open strsql,conn,3,2
rst("title")=request("title")
rst("path")=request("cover")
rst("filetype")=request("filetype")
rst("toinfo")=request("toinfo")
rst.update
rst.close
response.Redirect("man_file.asp?id="&request("toinfo")&"")
response.End()
end if
%>
<%
if request("act")="del" then
conn.execute "delete * from net_file where id="&request("id")&""
response.Redirect("man_file.asp")
response.End()
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>类别管理</title>
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<TABLE cellSpacing=0 cellPadding=0 width=99% align=center border=0>
<TR>
<TD height="25" style="HEIGHT: 16px"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="77%">管理文件</td>
</tr>
</table></TD>
</TR>
<TR>
<TD height=12 colSpan=2><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td bgcolor="#CCCCCC" height="1"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></TD>
</TR>
<TR>
<TD height="140" colSpan=2 vAlign=top> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> <table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td height="52" align="left" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#CCCCCC"> <table width="100%" border="0" cellpadding="0" cellspacing="1">
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from net_file where toinfo="&request("id")&" order by id asc"
rs.open sql,conn,1,1
if rs.eof then
response.Write("<tr>")
response.Write("</td>")
response.Write("<div align='center'>没有内容!</div>")
response.Write("</td>")
response.Write("</tr>")
rs.close
else
i=1
do while not rs.eof
%>
<form action="man_file.asp?act=edit&id=<%=rs("id")%>" name="post<%=i%>" id="post<%=i%>" method="post">
<tr>
<td width="5%" height="25" bgcolor="#FFFFFF">
<div align="center">名称:</div></td>
<td width="10%" bgcolor="#FFFFFF"> <div align="center">
<input name="title" type="text" class="input_main" value="<%=rs("title")%>" size="18">
</div></td>
<td width="5%" bgcolor="#FFFFFF">
<div align="center">地址:
<input name="toinfo" type="hidden" id="toinfo" value="<%=request("id")%>">
</div></td>
<td width="23%" bgcolor="#FFFFFF">
<div align="center">
<input name="cover" type="text" id="cover" class="input_main" size="25" value="<%=rs("path")%>">
<input type="button" name="Submit<%=i%>" value="上传" class="sub" onClick="window.open('upfile.asp?formname=<%="post"&i%>','','status=no,scrollbars=no,top=160,left=250,width=420,height=120')">
</div></td>
<td width="5%" align="center" bgcolor="#FFFFFF">类型:</td>
<td width="4%" align="center" bgcolor="#FFFFFF">
<input name="filetype" type="text" id="filetype" size="3" class="input_main" value="<%=rs("filetype")%>">
</td>
<td width="9%" bgcolor="#FFFFFF">
<div align="center">
<input name="edit" type="submit" class="sub" id="edit" value="修改">
<input name="del" type="button" id="del" value="删除" class="sub" onClick="javascript:window.location.href='man_file.asp?id=<%=rs("id")%>&act=del';">
</div></td>
</tr>
</form>
<%
rs.movenext
i=i+1
if rs.eof then exit do
loop
rs.close
end if
%>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="25" align="left" valign="top"> <div align="left"><font color="#0066CC">
</font>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td><div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td bgcolor="#CCCCCC" height="1"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</div></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25"><font color="#0066CC">*</font>添加文件</td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#CCCCCC"><table width="100%" border="0" cellpadding="0" cellspacing="1">
<form name="addclass" id="addclass" method="post" action="man_file.asp?act=add">
<tr>
<td width="5%" bgcolor="#FFFFFF">
<div align="center">名称:</div></td>
<td width="10%" bgcolor="#FFFFFF">
<div align="center">
<input name="title" type="text" class="input_main" id="title" size="18">
</div></td>
<td width="5%" bgcolor="#FFFFFF">
<div align="center">地址:
<input name="toinfo" type="hidden" id="toinfo" value="<%=request("id")%>">
</div></td>
<td width="23%" bgcolor="#FFFFFF">
<div align="center">
<input name="cover" type="text" class="input_main" id="cover" size="25">
<input type="button" name="Submit3" value="上传" class="sub" onClick="window.open('upfile.asp?formname=addclass','','status=no,scrollbars=no,top=160,left=250,width=420,height=120')">
</div></td>
<td width="5%" align="center" bgcolor="#FFFFFF">类型:</td>
<td width="4%" align="center" bgcolor="#FFFFFF">
<input name="filetype" type="text" class="input_main" id="filetype" size="3">
</td>
<td width="9%" bgcolor="#FFFFFF">
<div align="center">
<input type="submit" name="Submit" value="提交" class="sub" onClick="return subclick();">
</div></td>
</tr>
</form>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></TD>
</TR>
</TABLE>
</body>
</html>
<SCRIPT LANGUAGE="JavaScript">
<!--
function subclick()
{
if (addclass.smlname.value =="")
{
alert("类型名称不能为空!");
addclass.smlname.focus();
return (false);
}
if (addclass.tobig.options[addclass.tobig.selectedIndex].value<1 )
{
alert("!!请选择大类");
addclass.tobig.focus();
return (false);
}
}
//-->
</SCRIPT>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -