📄 admin_board.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--===============================================================-->
<!--Mfkiqpl旅行社旅游线路预订程序源代码仅供学习或部分旅行社网站用---->
<!--任何单位或个人不得随意修改、截取其中代码或做不法用途------------->
<!--版权归属:mfkiqpl http://www.zjjnet.com 所有-------------------->
<!--请务必保留以下版权信息------------------------------------------->
<!--作者:mfkiqpl----------------------------------------------------->
<!--QQ:31827726 mail:mfkiqpl@126.com--------------------------------->
<!--主页地址:http://www.zjjnet.com----------------------------------->
<!----------------欢迎各位站长与本人小站进行友情链接----------------->
<!--===============================================================-->
<!--#include file="conn.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
managemode
dim action
action=trim(request("action"))
select case action
case "add"
add
case "del"
del
case "edit"
edit
case "addok"
addok
case "delok"
delok
case "editok"
editok
case else
response.write("<script>alert('错误的传递参数!');history.back(1);</script>")
end select
sub add
%>
<script>
function check(){
if(form1.t1.value==''){
alert('类名必须填写!');
return false;
}
}
</script>
<table width="618" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<form action="?action=addok" method="post" name="form1" onSubmit="return check();">
<tr bgcolor="#f5f5f5">
<td width="134" height="28"> </td>
<td width="274" align="center" bgcolor="#f5f5f5">内 容</td>
<td width="206" align="center" bgcolor="#f5f5f5">说 明</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="28" align="center" bgcolor="#f5f5f5">类别名称:</td>
<td>
<input name="t1" type="text" id="t1" size="25" maxlength="40"> </td>
<td> 40汉字以内。*必填</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="28" align="center" bgcolor="#f5f5f5">相对说明:</td>
<td>
<input name="t2" type="text" id="t2" size="30" maxlength="50"> </td>
<td> 50汉字以内。*可选</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="28" align="center" bgcolor="#f5f5f5">排序情况:</td>
<td>
<input name="t3" type="text" id="t3" size="10">
*可选</td>
<td> 默认排序情况,数字越大排得越前</td>
</tr>
<tr align="center" bgcolor="#FFFFFF">
<td height="30" colspan="3"><input type="submit" name="Submit" value="确 定 添 加"></td>
</tr>
</form>
</table>
<%
end sub
sub addok
dim t1,t2,t3
t1=replace(trim(request("t1")),"'","’")
t2=replace(trim(request("t2")),"'","’")
t3=replace(trim(request("t3")),"'","’")
if not isNumeric(t3) then
response.write("<script>alert('错误的参数!排序必须为数字!\r\r请返回修正!');history.go(-1);</script>")
end if
sql="insert into board (board,xid,bio) values('"&t1&"','"&t3&"','"&t2&"')"
conn.execute(sql)
response.write("<script>alert('添加成功!按确定返回!');location='admin_board.asp?action=add';</script>")
end sub
sub del
set rs=conn.execute("select * from board order by xid desc")
%>
<table width="618" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr align="center" bgcolor="#f5f5f5">
<td width="28" height="26">ID</td>
<td width="203">类别名称</td>
<td width="287">相对说明</td>
<td width="53">排序</td>
<td width="41">删除</td>
</tr>
<%
while not rs.eof
%>
<tr bgcolor="#FFFFFF">
<td height="26" align="center"><%=rs("id")%></td>
<td> <%=rs("board")%></td>
<td> <%=rs("bio")%></td>
<td align="center"><%=rs("xid")%></td>
<td align="center"><a href="?action=delok&id=<%=rs("id")%>"><img src="images/mfk26.gif" width="14" height="15" border="0"></a></td>
</tr>
<%
rs.movenext
wend
closers(rs)
%>
<tr bgcolor="#FFFFFF">
<td height="26" colspan="5" align="center">要删除类,请先确认已经没有此类别的线路。如有此类别的线路删除不成功。</td>
</tr>
</table>
<%
end sub
sub delok
dim id
id=trim(request("id"))
if not isNumeric(id) then
response.write("<script>alert('错误的参数!请从有效链接进入!');history.go(-1);</script>")
end if
set rs=conn.execute("select id,x_leiid from xianlu where x_leiid="&id)
if not rs.eof then
closers(rs)
response.write("<script>alert('被删除的类别下面有线路,无法删除!\r\r要删除此类别请先删除属于此类别的线路!');history.go(-1);</script>")
else
conn.execute ("delete from board where id="&id)
response.write("<script>alert('此类删除成功!按确定返回!');location='admin_board.asp?action=del';</script>")
end if
end sub
sub edit
set rs=conn.execute("select * from board order by xid desc")
%>
<table width="618" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr align="center" bgcolor="#f5f5f5">
<td width="27" height="26">ID</td>
<td width="200">类别名称</td>
<td width="280">相对说明</td>
<td width="50">排序</td>
<td width="55">修改</td>
</tr>
<%
while not rs.eof
%>
<tr bgcolor="#FFFFFF">
<form action="?action=editok" method="post" name="form<%=rs("id")%>">
<td height="26" align="center"><input name="id" type="hidden" size="2" value=<%=rs("id")%> readonly><%=rs("id")%></td>
<td align="center"><input name="board" type="text" size="25" value=<%=rs("board")%>></td>
<td align="center"><input name="bio" type="text" size="36" value=<%=rs("bio")%>></td>
<td align="center"><input name="xid" type="text" size="3" value=<%=rs("xid")%>></td>
<td align="center"><input type="submit" name="Submit2" value="修改"></td>
</form>
</tr>
<%
rs.movenext
wend
%>
<tr align="center" bgcolor="#FFFFFF">
<td height="26" colspan="5">排序数字的大小与排序的前后成正比。</td>
</tr>
</table>
<%
end sub
sub editok
dim id,board,bio,xid
id=trim(request("id"))
xid=trim(request("xid"))
board=replace(trim(request("board")),"'","’")
bio=replace(trim(request("bio")),"'","’")
if not isNumeric(xid) then
founderr=true
founderrmsg="排序内容必须为数字!\r"
end if
if board="" then
founderr=true
founderrmsg=founderrmsg&"类别名不能为空!\r"
end if
if not isNumeric(id) then
founderr=true
founderrmsg=founderrmsg&"传递参数错误!请确定你从有效链接进入!"
end if
if founderr then
response.write("<script>alert('找到以下错误:\r"&founderrmsg&"');history.go(-1);</script>")
else
sql="update board set board='"&board&"',bio='"&bio&"',xid="&xid&" where id="&id
conn.execute(sql)
response.write("<script>alert('此次修改操作成功!按确定返回!');location='admin_board.asp?action=edit';</script>")
end if
end sub
manageend
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -