📄 addfenlei.asp
字号:
<%Server.ScriptTimeout=5000%>
<%
response.buffer=true
id=1
%>
<!-- #include file=../database.asp -->
<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from ourusers where Ltrim(Rtrim(username))='supervisor'"
rs.open sql,conn,1,1
if not rs.eof then
if trim(rs("pass"))<>session("pass") then
response.write "<br>错误的密码!"
rs.close
set rs=nothing
conn.close
set conn=nothing
response.end
else
rs.close
end if
else
response.write "错误:用户不存在!"
rs.close
set rs=nothing
conn.close
set conn=nothing
response.end
end if%>
<!-- Design and Edit By QianFengyun 2000-5-20 -->
<!-- #include file=../change.asp -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0041)http://www.china114net.com 中国114网 -->
<html>
<head>
<title><%=titlename%></title>
<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>
<link rel="stylesheet" type="text/css" href="../html/style.css">
<script language="javascript">
function singleDelete(id){
if (confirm('真的要删除吗?'))
//this.location.href="superdelfenlei.asp?id=1&fid="+id
top.left.frmrigh.main.location="superdelfenlei.asp?id=1&fid="+id
}
function singleDeletelink(id){
if (confirm('真的要删除吗?'))
//this.location.href="dellink.asp?id=1&fid="+id
top.left.frmrigh.main.location="dellink.asp?id=1&fid="+id
}
</script>
<script language=JavaScript>
<!--
function form_onsubmit(obj)
{
ValidationPassed = true;
if(obj.inname.value=="")
{
alert("请输入中文的分类名称!\n");
ValidationPassed = false;
obj.inname.focus();
return;
}
if(obj.fenleidirect.value=="")
{
alert("请输入中文的分类名称!\n");
ValidationPassed = false;
obj.fenleidirect.focus();
return;
}
return true;
}
-->
</script>
</head>
<BODY vlink=0000ff leftmargin="0" topmargin="10" marginwidth="0" marginheight="0" bgcolor=ccbbaa onload="JavaScript:form1.inname.focus();">
<%fid=request("fid")
if isNumeric(fid)=0 or fid="" then fid=0
if fid<0 then fid=0
sql="select * from fenlei where id="&fid
rs.open sql,conn,1,1
if rs.eof or rs.bof then
'response.write "没有这个分类!进入添加一级分级"
rs.close
fid=0
else
expediency=rs("expediency")
%><table width=700 border="0" cellspacing="0" cellpadding="0" align="center" bgcolor=<%=tablebgcolor1%> height=20>
<TR align="center">
<TD bgColor=<%=tablebgcolorbian%>><img src=images/blank.gif height=1 width=1></TD>
</TR>
<TR align="center">
<TD height=3><img src=images/blank.gif height=1 width=1></TD>
</TR>
<tr>
<td>
选择分类 > <a href=addfenlei.asp?id=1&fid=0>总分类</a>
<%
for i=1 to expediency-1
response.write " > <a href=addfenlei.asp?id="&id&"&fid="&rs(10+i)&">"&trim(rs(i))&"</a>"
next
response.write " > "&trim(rs(i))
rs.close
%>
</td>
</tr>
<TR align="center">
<TD bgColor=<%=tablebgcolorbian%>><img src=images/blank.gif height=1 width=1></TD>
</table>
<table width=700 border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<%
sql="select id,num,fenlei"&expediency+1&" from fenlei where father="&fid
rs.open sql,conn,1,1
if not rs.eof then
response.write "<br>共有以下几个分类:"
tnum=rs.recordcount
num=int(tnum/3)
if (tnum mod 3)<>0 then
num=num+1
end if
end if
do while not rs.eof
response.write "<td valign=top>"
if num<1 then
response.write "<li><a href=addfenlei.asp?id="&id&"&fid="&rs("id")&">"&trim(rs(2))&"</a><i>("&rs("num")&")</i><a href='javascript:singleDelete("&rs("id")&")'>删</a><a href=makefenlei.asp?fid="&rs("id")&" target=main>制</a></li>"
rs.movenext
else
for nn=1 to num
if not rs.eof then
response.write "<li><a href=addfenlei.asp?id="&id&"&fid="&rs("id")&">"&trim(rs(2))&"</a><i>("&rs("num")&")</i><a href='javascript:singleDelete("&rs("id")&")'>删</a><a href=supereditfenlei.asp?fid="&rs("id")&" target=main><font color=ff0000>修</font></a><a href=makefenlei.asp?fid="&rs("id")&" target=main>制</a></li>"
rs.movenext
else
exit for
end if
next
end if
response.write "</td>"
loop
response.write "</tr></table>"
rs.close
end if
if fid=0 then%>
<table width=700 border="0" cellspacing="0" cellpadding="0" align="center" bgcolor=<%=tablebgcolor1%> height=20>
<TR align="center">
<TD bgColor=<%=tablebgcolorbian%>><img src=images/blank.gif height=1 width=1></TD>
</TR>
<TR align="center">
<TD height=3><img src=images/blank.gif height=1 width=1></TD>
</TR>
<tr>
<td>
选择分类 > 总分类 <a href=makefenlei.asp?fid=0>制</a>
</td>
</tr>
<TR align="center">
<TD bgColor=<%=tablebgcolorbian%>><img src=images/blank.gif height=1 width=1></TD>
</TR>
</table>
<table width=700 border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<%
sql="select id,num,fenlei1 from fenlei where father=0 order by id"
rs.open sql,conn,1,1
if not rs.eof then
response.write "<br>共有以下几个分类:"
tnum=rs.recordcount
num=int(tnum/3)
if (tnum mod 3)<>0 then
num=num+1
end if
end if
do while not rs.eof
response.write "<td valign=top>"
if num<1 then
response.write "<li><a href=addfenlei.asp?id="&id&"&fid="&rs("id")&">"&trim(rs(2))&"</a><i>("&rs("num")&")</i><a href='javascript:singleDelete("&rs("id")&")'>删</a><a href=supereditfenlei.asp?fid="&rs("id")&" target=main><font color=ff0000>修</font></a><a href=makefenlei.asp?fid="&rs("id")&" target=main>制</a></li>"
rs.movenext
else
for nn=1 to num
if not rs.eof then
response.write "<li><a href=addfenlei.asp?id="&id&"&fid="&rs("id")&">"&trim(rs(2))&"</a><i>("&rs("num")&")</i><a href='javascript:singleDelete("&rs("id")&")'>删</a><a href=supereditfenlei.asp?fid="&rs("id")&" target=main><font color=ff0000>修</font></a><a href=makefenlei.asp?fid="&rs("id")&" target=main>制</a></li>"
rs.movenext
else
exit for
end if
next
end if
response.write "</td>"
'if rs.eof then exit do
loop
response.write "</tr></table>"
rs.close
end if
%>
<br>
<FORM action=addfenlei2.asp?id=<%=id%>&fid=<%=fid%> method=post name=form1 onSubmit="return ValidationPassed" target=main>
<p align=center>添加分类</p>
<br>
<table width=320 border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>注意:请选择所要添加的分类,如果是在本目录下了,请在最下面的表单输入即可</td>
</tr>
</table>
<br>
<br>
<TABLE border=0 class=font style="MARGIN-TOP: -20px; POSITION: relative"
width=320 align="center" cellpadding="0" cellspacing="0">
<TBODY>
<TR align=center>
<TD colspan="2">
<TABLE border=0 class=font width="100%" cellpadding="0" cellspacing="0">
<TR>
<TD height=2 bgcolor="#ececff"><img src="blank.gif" width=1 height=1></TD>
<TD height=2 bgcolor="#ececff"><img src="blank.gif" width=1 height=1></TD>
</TR>
<TR>
<TD height="25" colspan="2">1.*分类名称:
<input maxlength=50 name="inname" size=28 class="input">
</TD>
</TR>
<TR>
<TD height="25" colspan="2">1.*目录名称:
<input maxlength=50 name="fenleidirect" size=28 class="input">
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD colspan="2"> </TD>
</TR>
<TR>
<TD width="5%"> </TD>
<TD width="95%" height="30" align="center">
<input name=submit type=submit value=" 添 加 " class="p9" style="background-color: rgb(145,148,195); color: rgb(255,255,255)" onclick="form_onsubmit(this.form)">
<input name=b1 type=reset value=" 重 写 " class="p9" style="background-color: rgb(145,148,195); color: rgb(255,255,255)">
</TD>
</TR>
<TR>
<TD colspan="2" height=2 bgcolor="ececff"><img src="blank.gif" width=1 height=1></TD>
</TR>
</TBODY>
</TABLE>
</FORM>
<table width=700 border="0" cellspacing="0" cellpadding="0" align="center" bgcolor=<%=tablebgcolor1%> height=20>
<TR align="center">
<TD bgColor=<%=tablebgcolorbian%>><img src=images/blank.gif height=1 width=1></TD>
</TR>
<TR align="center">
<TD height=3><img src=images/blank.gif height=1 width=1></TD>
</TR>
<tr>
<td>
网站
</td>
</tr>
<TR align="center">
<TD bgColor=<%=tablebgcolorbian%>><img src=images/blank.gif height=1 width=1></TD>
</TR>
</table>
<table width=700 align=center>
<tr><td>
<%
sql="select * from linking where fenleiid="&fid
rs.open sql,conn,1,1
if not rs.eof then
response.write "<br>"
do while not rs.eof
response.write "<li><a href=../r.asp?id="&rs("id")&" target=_blank>"&server.htmlencode(trim(rs("sitename")))&"</a> <a href=editlink.asp?id=1&editid="&rs("id")&" target=main>修改</a> <a href='javascript:singleDeletelink("&rs("id")&")'>删</a></li>"
rs.movenext
loop
else
response.write "还没有网站加入这个类别下!"
end if
rs.close
%></td></tr></table>
<hr width=700 align=center size=1 color=<%=tablebgcolorbian%>>
</BODY>
</HTML>
<%set rs=nothing
conn.close
set conn=nothing%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -