📄 ntype_modi.asp
字号:
<!--#include file="../nUser/config.asp"-->
<!--#include file="../nUser/conn.asp"-->
<!-- #include file="inc/Session.asp" -->
<%
'''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''
Dim act,ClassID,title,date,nType
if(request("id")<>"") then
ID=Cint(Request("id"))
else
call connclose()
call alertstr("错误的ID号",1)
end if
act=Request("act")
if(act="mod") then
title=trim(request.Form("title"))
nType=Cint(request.Form("nType"))
ndate=trim(request.Form("date"))
nPower=request.Form("nPower")
if(title="" or len(title)<1) then
call alertstr("类别名称不能为空",1)
response.End()
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from kheu_nType where id="&ID,conn,3,3
if not rs.eof and not rs.bof then
rs("nType")=nType
rs("title")=title
rs("date")=ndate
rs("nPower")=nPower
rs.update
rs.close
set rs=nothing
response.Write("<script>alert(""成功修改栏目!"");location.href=""nType.asp"";</script>")
else
rs.close
set rs=nothing
response.Write("<script>alert(""没有找到要修改的栏目!"");</script>")
end if
else
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from kheu_nType where id="&ID,conn,3,1
if rs.Eof or rs.Bof then
rs.close
set rs=nothing
call connclose()
call alertstr("栏目不存在,请重新加载",1)
else
title=rs("title")
nType =rs("nType")
date=rs("date")
nPower=rs("nPower")
rs.close
set rs = Nothing
end if
'获得大类
dim first
dim i
set rs=server.CreateObject("adodb.recordset")
sql="select * from kheu_nType where nType=0 order by id asc"
rs.open sql,conn,3,1
if rs.eof or rs.bof then
response.Write("暂时没有分类")
rs.close
set rs=nothing
call connclose()
else
first=rs.GetRows()
rs.close
set rs=nothing
end if
'获得所有par_id=<>的类别------主类:par_id=0
Function getcatalogs(cid,parentid,str)
Dim Sql,rstemp,TemptempStr,tempStr
tempStr=str&" "
sql="select * from kheu_nType where nType="&ParentID
Set rstemp = Conn.Execute(Sql)
do while Not rstemp.Eof
if(rstemp("id")=nType) then
sele=" selected"
else
sele=""
end if
if rstemp("id")<>cid then
getcatalogs = getcatalogs &"<option value="&rstemp("id")&sele&">│"&tempStr&"└"&rstemp("title")&"</option>"&Chr(10)
end if
getcatalogs = getcatalogs & getcatalogs(cid,rstemp("id"),tempStr)
rstemp.MoveNext
loop
rstemp.close
Set rstemp = Nothing
End Function
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>栏目修改</title>
<link href="Css.css" rel="stylesheet">
</head>
<body>
<table width="100%" height="30" border="0" cellpadding="0" cellspacing="0" background="Images/main_bg.gif">
<tr>
<td bgcolor="#006699" onMouseOver="javascript:this.bgColor='#0066cc'" onMouseOut="javascript:this.bgColor='#006699'">
<div align="center" class="style1">
欢迎使用『秦直道』多用户博客管理系统V2.0版</div></td>
</tr>
</table>
<table width="100%" height="22" border="0" cellpadding="0" cellspacing="0" bgcolor="#FF9900">
<tr>
<td><div align="center" class="style1">修改博客日志分类栏目</div></td>
</tr>
</table>
<div align="center">
<table width="100%" border="0" cellspacing="5" cellpadding="0" style="border:1px solid #000000; ">
<form action="nType_modi.asp?act=mod" method="post" name="ClassForm" onSubmit="return check(this);">
<tr>
<td height="5" colspan="2"></td>
</tr>
<tr>
<td width="18%"><div align="center">类别名称</div></td>
<td> <div align="center">
<input value="<%=title%>" name="title" style="width:70%; float:left">(<a href="nType_Html.asp?id=<%=ID%>"><font color="#008000">生成静态</font></a>)
</div></td>
</tr>
<tr>
<td><div align="center">父 栏 目</div></td>
<td>
<div align="left">
<select name="nType" >
<%
for i=0 to ubound(first,2)
if(first(0,i)=nType) then
sele=" selected"
else
sele=""
end if
response.Write("<option value="&first(0,i)&sele&">├"&first(3,i)&"</option>"&Chr(10))
response.Write(getcatalogs(id,first(0,i),""))
next
%>
</select>
</div></td>
</tr>
<tr>
<td><div align="center">目录启分</div></td>
<td nowrap> <div align="left">
<input name="nPower" type="value" style="width:78%;" value="<%=nPower%>">
<BR>[<font color="#FF0000"> * </font>多少积分以上的用户有权修改此目录文档 ]</div></td>
</tr>
<tr>
<td><div align="center">添加日期</div></td>
<td><div align="left">
<input value="<%If date="" then Response.Write(Now()) else Response.Write(date) %>" type="text" style="width:78%;" name="date">
</div></td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<input type="submit" name="submit" value=" 确 定 ">
<input name="id" value="<%=ID%>" type="hidden" id="id">
<input type="button" name="Submit2" onClick="history.back();" value=" 返 回 ">
</div></td>
</tr>
</form>
</table>
</div>
<%
end if
%>
<script language="JavaScript">
function check(obj)
{
if(obj.title.value==""){
alert("栏目名称不能为空!");
obj.title.focus();
obj.title.select();
return false;
}
if(obj.nPower.value==""){
alert("栏目起始分值不能为空!");
obj.nPower.focus();
obj.nPower.select();
return false;
}
if(obj.date.value==""){
alert("栏目修改时间不能为空!");
obj.date.focus();
obj.date.select();
return false;
}
}
</script>
</body>
</html>
<%
call connclose()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -