class_ok.asp
来自「实现一个用JSP、Servlet技术实现的小型物流网站系统。实现功能如下:管理员」· ASP 代码 · 共 287 行
ASP
287 行
<%@ codepage ="936" %>
<%
if session("globalecmaster")="" or session("masterflag")="" then
response.write "<script language='javascript'>"
response.write"parent.location.href='../login.asp';</SCRIPT>"
response.end
end if
'权限限制^^^^^^^^^^^^^^^^^^^^
dim ishavegant
ishavegant=false
in_str=split(session("masterflag"),",")
for each ins in in_str
if trim(ins)="23" then
ishavegant=true
end if
next
if ishavegant=false then
response.redirect "../err.asp"
response.end
end if
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%>
<% data_path="../../" 'ACC连接数据库路径,对SQL无效 %>
<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
<!--#include file="../../inc/FileSystem.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../css/style.css" rel=stylesheet type=text/css>
</head>
<%
dim body
call main()
set rs=nothing
conn.close
set conn=nothing
sub main()
%>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align=center class="tableBorder">
<tr>
<th height=25 colspan="2" class="tableHeaderText">专项商机类别管理 </th>
</tr>
<tr>
<td colspan="2" class="forumRowHighlight"><p><B>注意</B>:<BR>
①类别直接与发布的信息相关联,删除类别可能会影响到以前发布的专项商机信息。<BR> </td>
</tr>
<tr>
<td width="12%" height=25 class="forumRowHighlight"> <B>操作选项</B></td>
<td width="88%" class="forumRowHighlight"><a href="index.asp">管理专项商机</a> | <a href="add_vipinfo.asp">添加专项商机</a> | <a href="type.asp">管理商机类别</a> | <a href="class_ok.asp?action=add_class_1">添加专项类别</a> | [<a href="javascript:location.reload()">刷新页面</a>]</td>
</tr>
</table>
<font color="<%=TableContentColor%>">
<%
if request("action") ="add_class_1" then
call add_class_1()
elseif request("action")="add_class_1_ok" then
call add_class_1_ok()
elseif request("action")="edit_class_1" then
call edit_class_1()
elseif request("action")="savedit_1" then
call savedit_1()
elseif request("action")="del_class_1" then
call del_class_1()
else
call linkinfo()
end if
%>
<p><%=body%></p>
</font>
<%
end sub
sub add_class_1()
%>
<SCRIPT language=javascript>
function FORM1_onsubmit()
{
if(document.FORM1.class_name.value.length<1)
{
alert("您必须输入大类名称!");
document.FORM1.class_name.focus();
return false;
}
}
</SCRIPT>
<FORM name=FORM1 onSubmit="return FORM1_onsubmit()" action=class_ok.asp?action=add_class_1_ok method=post>
<TABLE width=100% border="0" align="center" cellPadding=3 cellSpacing=1 class="tableBorder">
<TR>
<Th colSpan=2 height="28" class="tableHeaderText">添加专项商机类别</Th>
</TR>
<TR>
<TD width=41% height=25 class="forumRowHighlight" align=center><b>要添加的类别名称:</b></TD>
<TD width=59% height=25 class="forumRowHighlight"><INPUT maxLength=16 size=25 name=class_name></TD>
</TR>
<TR>
<TD colSpan=2 height="27" align=center class="forumRowHighlight"> <INPUT type=submit value='确 定 添 加' name=Submit2> </TD>
</TR>
</TABLE>
</FORM>
<%
end sub
sub edit_class_1()
set rs=server.createobject("adodb.recordset")
sqltext="select * from Yixiang_vipinfo_class where typeid="+Cstr(request("id"))
rs.open sqltext,conn,1,1
%>
<form name=form1 action="class_ok.asp?action=savedit_1" method=post>
<input type=hidden name=id value="<%=Cstr(request("id"))%>">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableBorder">
<TR>
<Th colSpan=2 height="28" class="tableHeaderText">修改专项商机类别</Th>
</TR>
<tr>
<td width="40%" class="forumRowHighlight" align=center><b>要修改的类别名称:</b></td>
<td width="60%" class="forumRowHighlight"> <input name="class_1_name" type="text" value="<%=rs("type")%>" size='40' maxlength="16"> </td>
</tr>
<tr>
<td height="30" colspan="2" class="forumRowHighlight" align="center"> <input type="submit" name="Submit" value="确 定 修 改"> </td>
</tr>
</table>
</form>
<%
rs.close
set rs=nothing
end sub
sub savedit_1()
set rs= server.createobject ("adodb.recordset")
sql = "select * from Yixiang_vipinfo_class where typeid="+Cstr(request("id"))
rs.Open sql,conn,1,3
if rs.eof and rs.bof then
body=body+"<br>"+"错误,数据库操作错误,没有找到此条信息。"
else
rs("type")=Replace_Text(Request.Form ("class_1_name"))
rs.Update
typeid =rs("typeid")
end if
response.write"<br><table cellpadding=2 cellspacing=1 border=0 width=100% class=tableBorder align=center>"
response.write"<TR>"
response.write"<TH class=tableHeaderText colSpan=2 height=25>专项商机类别管理</TH>"
response.write"</TR><tr><td height=85 valign=top class=forumRow align=center>"
Set RsVip=Server.CreateObject("Adodb.Recordset")
SqlVip="Select * from yixiang_vipinfo Where viptype="&typeid&" "
RsVip.Open SqlVip,Conn,1,3
IF NOt RsVip.Eof Then
ID1=RsVip("vipinfo_id")
RsVip.Movelast
ID2=RsVip("vipinfo_id")
end if
RsVip.Close
Set RsVip=Nothing
%>
<script language="javascript">
function return_ok(Content)
{
//弹出确认对话框,为真则生成当前分类信息
var i=confirm(Content);
if(i)
{
document.write("<iframe src='../../manage/makehtml/vipinfo/makelist.asp?all=all' scrolling='no' height=30 width='100%' frameborder='0'></iframe><br><br>")
document.write("<iframe src='../../manage/makehtml/vipinfo/makedetail.asp?all=update&id1=<%=ID1%>&id2=<%=ID2%>' scrolling='no' height=30 width='100%' frameborder='0'></iframe><br><br>")
}
else
{
document.write("分类修改成功");
}
}
</script>
<%
Response.Write "<div align=center><br><br><script>return_ok('您是否需要生成当前分类信息?')</script></div></td></tr>"
response.write"<tr align=center><td height=30 class=forumRowHighlight><a href='type.asp'><< 返回上一页</a></td>"
response.write"</tr>"
response.write"</table>"
end sub
sub del_class_1()
'删除当前分类
Filename=HOPE_InstallDir&"vipinfo/"&Cstr(request("id"))&".html"
Call FileDel(FileName) '删除当前ID的页面文件
FIlePath=HOPE_InstallDir&"vipinfo/" '文件所在位置
Call Del_Page(FIlePath,Cstr(request("id"))) '方法四:删除分页文件
Set RsInfo=Server.CreateObject("Adodb.Recordset")
SqlInfo="Select * From yixiang_vipinfo Where viptype="&Cstr(request("id"))&""
RsInfo.Open SqlInfo,Conn,1,1
do WHile NOt RsInfo.Eof
TID=RsInfo("viptype")
ClassID=RsInfo("vipinfo_id")
Filename=HOPE_InstallDir&"UploadFile/"&RsInfo("picture")
if RsInfo("picture")<>"nopicture.gif" then
Call FileDel(FileName) '删除大类ID里所有页面文件的图片
end if
Filename=HOPE_InstallDir&"vipinfo/offerdetail/"&TID&"-"&ClassID&".html"
Call FileDel(FileName) '删除大类ID里所有的页面文件
if RsInfo.Eof Then Exit Do
RsInfo.MoveNext
Loop
Conn.Execute("Delete From yixiang_vipinfo Where viptype="&Cstr(request("id"))&"")
set rs=server.createobject("adodb.recordset")
sqltext="delete from Yixiang_vipinfo_class where typeid="&Cstr(request("id"))
rs.open sqltext,conn,3,3
response.write"<br><table cellpadding=2 cellspacing=1 border=0 width=100% class=tableBorder align=center>"
response.write"<TR>"
response.write"<TH class=tableHeaderText colSpan=2 height=25>专项商机类别管理</TH>"
response.write"<TR><tr><td height=85 valign=top class=forumRow>"
Response.write "<div align=center>"
%>
<script language="javascript">
function Del_Save(Content)
{
//弹出确认对话框,为真则生成当前分类信息
var i=confirm(Content);
if(i)
{
document.write("<iframe src='../../manage/makehtml/vipinfo/makelist.asp?all=all' scrolling='no' height=30 width='100%' frameborder='0'></iframe><br><br>")
}
else
{
document.write("分类修改成功");
}
}
</script>
<%
Response.Write "<div align=center><br><br><script>Del_Save('您是否需要生成当前分类信息?')</script></div></td></tr>"
Response.write "</div></td></tr>"
response.write"<tr align=center><td height=30 class=forumRowHighlight><a href='type.asp'><< 返回上一页</a></td>"
response.write"</tr>"
response.write"</table><br>"
end sub
sub add_class_1_ok()
set rs=server.createobject("adodb.recordset")
sqltext="select * from Yixiang_vipinfo_class where type='"&request.form("class_name")&"'"
rs.open sqltext,conn,1,1
'查找数据库,检查大类是否已经存在
if rs.recordcount >= 1 then
if rs("type")=Replace_Text(request.form("class_name")) then
response.write"<SCRIPT language=JavaScript>alert('此类别已经存在,请选用其它名称!');"
response.write"this.location.href='class_ok.asp?action=add_class_1';</SCRIPT>"
end if
else
set rs=server.createobject("adodb.recordset")
sqltext="select * from Yixiang_vipinfo_class"
rs.open sqltext,conn,3,3
rs.addnew
rs("type")=Replace_Text(request.form("class_name"))
rs.update
response.write"<br><table cellpadding=2 cellspacing=1 border=0 width=100% class=tableBorder align=center>"
response.write"<TR>"
response.write"<TH class=tableHeaderText colSpan=2 height=25>专项商机类别管理</TH>"
response.write"<TR><tr><td height=85 valign=top class=forumRow>"
Response.write("<iframe src='../../manage/makehtml/vipinfo/makelist.asp?all=all' scrolling='no' height=30 width='100%' frameborder='0'></iframe>")
Response.write "<div align=center><br><br>添加专项商机类别成功!</div></td></tr>"
response.write"<tr align=center><td height=30 class=forumRowHighlight><a href='type.asp'><< 返回上一页</a></td>"
response.write"</tr>"
response.write"</table>"
end if
end sub
%>
<!--#include file="../copy.asp" -->
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?