⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_class_ok.asp

📁 全球商务网站系统介绍 GLOBALEC.COM.CN[生成HTML版] 系统概述: 软件名称:全球商务网站系统 当前版本:V1.0 最新版本:V1.1 运行环境:WINNT+(IIS)
💻 ASP
字号:
<%@ codepage ="936" %>
<%
if Request.Cookies("globalec")("globalecmaster")="" or Request.Cookies("globalec")("masterflag")="" then
response.write "<script language='javascript'>"
response.write"this.location.href='../login.asp';</SCRIPT>" 
response.end
end if
if instr(Request.Cookies("globalec")("masterflag"),"102")=0 then
response.redirect "../err.asp"
response.end
end if
%>
<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.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()
rs1.close
set rs1=nothing
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> 
         <font color="blue">①类别直接与之前发布的信息相关联,删除类别可能会影响到之前发布的信息。<br>
	    ②点击类别名称进入相应下级分类,点击相应的分类操作属性进行相应操作。</font><br>
		 <font color="red">③如:要添加二级分类——>先点击大类进入二级类——>添加二级类别</font>
[<a href="sort.asp">返回大类</a>]    </td> 
  </tr> 
</table>
<br>
<%
if request("action") ="add_help_sort" then 
call add_help_sort()
elseif request("action")="add_help_sort_ok" then
call add_help_sort_ok()

elseif request("action")="add_help_type" then
call add_help_type()
elseif request("action")="add_help_type_ok" then
call add_help_type_ok()

elseif request("action")="edit_help_sort" then
call edit_help_sort()
elseif request("action")="edit_help_type" then
call edit_help_type()

elseif request("action")="savedit_1" then
call savedit_1()
elseif request("action")="savedit_2" then
call savedit_2()

elseif request("action")="del_help_sort" then
call del_help_sort()
elseif request("action")="del_help_type" then
call del_help_type()

else
call linkinfo()
end if
%>
<%
end sub
sub add_help_sort()
%>
<TABLE width=100% border="0" align="center" cellPadding=3 cellSpacing=1 class="tableBorder">
    <FORM name=FORM1 onsubmit="return FORM1_onsubmit()" action=admin_class_ok.asp?action=add_help_sort_ok method=post>
<TR> 
      <Th colSpan=2 height="25" class="tableHeaderText">添加帮助一级类别</Th> 
    </TR>
<TR>
<TD width=40% height=25 class="forumRowHighlight" align=center><b>帮助一级类别名称</b></TD>
<TD width=60% height=25 class="forumRowHighlight"><INPUT maxLength=16 size=40 name=class_name></TD>
</TR>
<TR>
<TD colSpan=2 height="27" align=center class="forumRowHighlight">
<INPUT type=submit value='确 定 添 加' name=Submit2>
</TD>
</TR>
</FORM>
</TABLE>
<SCRIPT language=javascript>
function FORM1_onsubmit()
{
if(document.FORM1.class_name.value.length<1)
{
alert("您必须输入大类名称!");
document.FORM1.class_name.focus();
return false;
}
}
</SCRIPT>
<%
end sub
sub add_help_type()
%>
<TABLE width=100% border="0" align="center" cellPadding=3 cellSpacing=1 class="tableBorder">
    <FORM name=FORM1 onsubmit="return FORM1_onsubmit()" action=admin_class_ok.asp?action=add_help_type_ok method=post>
<TR> 
      <Th colSpan=2 height="25" class="tableHeaderText">添加帮助二级类别</Th> 
    </TR>
<TD width=40% height=25 class="forumRowHighlight" align=center><b>所属帮助一级分类</b></TD>
<TD width=60% height=25 class="forumRowHighlight"><select name="help_sort_id"> 
<%
sqlsort="select * from help_sort where sortid="&request("sortid")&""
set rssort=conn.execute(sqlsort) 
response.write"<OPTION value='"&rssort("sortid")&"' selected>"&rssort("sort")&"</OPTION>"
%> 
<%
set rsc=conn.execute("select * from help_sort")
do while not rsc.eof
response.write "<option value='"&rsc("sortid")&"'>"&rsc("sort")&"</option>"&chr(13)+chr(10)
rsc.movenext
loop
rsc.close
%>
</select></TD>
</TR>
<TR>
<TD width=40% height=25 class="forumRowHighlight" align=center><b>帮助二级分类名称</b></TD>
<TD width=60% height=25 class="forumRowHighlight"><input type="text" name="help_type_name" size="40"></TD>
</TR>
<TR>
<TD colSpan=2 height="27" align="center" class="forumRowHighlight"> <INPUT type=submit size=3 value='确 定 添 加' name=Submit2></TD>
</TR>
</form>
</TABLE>  
<SCRIPT language=javascript>
function FORM1_onsubmit()
{
if(document.FORM1.help_type_name.value.length<1)
{
alert("您必须输入二级分类名称!");
document.FORM1.help_type_name.focus();
return false;
}
}
</SCRIPT>
<%
end sub
sub add_help_type_ok()
set rs=server.createobject("adodb.recordset")
sqltext="select * from help_type where typename='"&request.form("help_type_name")&"' and sortid=" & request.form("help_sort_id")&""
rs.open sqltext,conn,1,1
'查找数据库,检查二级分类是否已经存在
if rs.recordcount >= 1 then 
if rs("typename")=Lcase(request.form("help_type_name")) then
response.write "<script language='javascript'>"
response.write "alert('此二级分类已经存在,请选用其它名称!');"
response.write"javascript:history.back(-1)</SCRIPT>"
response.end
rs.close
end if
else
set rs=server.createobject("adodb.recordset")
sqltext="select * from help_type"
rs.open sqltext,conn,3,3
'添加一个二级分类到数据库
rs.addnew
rs("typename")=Replace_Text(request.form("help_type_name"))
rs("sortid")=request.form("help_sort_id")
rs.update
response.redirect "type.asp?sortid="&request.form("help_sort_id")&""
end if
end sub
sub edit_help_sort()
set rs=server.createobject("adodb.recordset")
sqltext="select * from help_sort where sortid="+Cstr(request("id"))
rs.open sqltext,conn,1,1
%>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableBorder">
<form name=FORM1 action="Admin_Class_Ok.asp?action=savedit_1" method=post>
<input type=hidden name=id value="<%=Cstr(request("id"))%>">
<TR> 
<Th colSpan=2 height="25" class="tableHeaderText">帮助一级类别修改</Th> 
    </TR>
<TD width=40% height=25 class="forumRowHighlight" align=center><b>帮助一级类别名称</b></TD>
<td width="60%" class="forumRowHighlight"> 
<input type="text" name="help_sort_name" size='25' value=<%=rs("sort")%>>
</td>
</tr>
<tr> 
<td height="30" colspan="2" class="forumRowHighlight" align="center"> 
<input type="submit" name="Submit" value="确 定 修 改">
</td>
</tr>
</form>
</table>
<SCRIPT language=javascript>
function FORM1_onsubmit()
{
if(document.FORM1.class_name.value.length<1)
{
alert("您必须输入大类名称!");
document.FORM1.class_name.focus();
return false;
}
}
</SCRIPT>
<%
rs.close
set rs=nothing
end sub
sub edit_help_type()
set rs=server.createobject("adodb.recordset")
sqltext="select * from help_type where typeid="+Cstr(request("id"))
rs.open sqltext,conn,1,1
set rs2=server.createobject("adodb.recordset")
sqltext2="select * from help_sort where sortid="+Cstr(rs("sortid"))
rs2.open sqltext2,conn,1,1
%>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableBorder">
    <form name=form1 action=Admin_Class_Ok.asp?action=savedit_2 method=post>
<input type=hidden name=id value=<%=Cstr(request("id"))%>>
<input type=hidden name=sortid value=<%=Cstr(request("sortid"))%>>
<TR> 
      <Th colSpan=2 height="25" class="tableHeaderText">帮助二级类别修改</Th> 
    </TR>
<tr> 
<td width="40%" class="forumRowHighlight" align=center><b>所属一级分类</b></td>
<td width="60%" class="forumRowHighlight"><select name="forum_setting" id="forum_setting" disabled=true>
	<option value="0"><%=rs2("sort")%> 
	</select></td>
</tr>
<tr> 
<td width="40%" class="forumRowHighlight" align=center><b>二级分类名称</b></td>
<td width="60%"> 
<input type="text" name="help_type_name" size='40' value=<%=rs("typename")%>>
</td>
</tr>
<tr> 
<td height="30" colspan="2" class="forumRowHighlight" align="center">
<input type="submit" name="Submit" value="确 定 修 改">
</td>
</tr>
</form>
</table>
<SCRIPT language=javascript>
function FORM1_onsubmit()
{
if(document.FORM1.help_type_name.value.length<1)
{
alert("您必须输入二级分类名称!");
document.FORM1.help_type_name.focus();
return false;
}
}
</SCRIPT>
<%
rs.close
rs2.close
set rs=nothing
set rs2=nothing
end sub
sub savedit_1()
set rs= server.createobject ("adodb.recordset")
sql ="select * from help_sort where sortid="+Cstr(request("id"))
rs.Open sql,conn,1,3
if rs.eof and rs.bof then
body=body+"<br>"+"错误,数据库操作错误,没有找到此条信息。"
else
rs("sort")=Trim(Request.Form ("help_sort_name"))
rs.Update
end if 
response.redirect "sort.asp"
end sub
sub savedit_2()
set rs= server.createobject ("adodb.recordset")
sql ="select * from help_type where typeid="+Cstr(request("id"))
rs.Open sql,conn,1,3
if rs.eof and rs.bof then
body=body+"<br>"+"错误,数据库操作错误,没有找到此条信息"
else
rs("typename")=Trim(Request.Form ("help_type_name"))
rs.Update
end if 
response.redirect "type.asp?sortid="&request("sortid")&""
end sub
sub del_help_sort()
conn.execute("delete from [help_sort] where sortid="+Cstr(request("id")))
conn.execute("delete from [help_type] where sortid="+Cstr(request("id")))
response.redirect "sort.asp"
end sub
sub del_help_type()
conn.execute("delete from [help_type] where typeid="+Cstr(request("id")))
response.redirect "type.asp?sortid="&request("sortid")&""
end sub
sub add_help_sort_ok()
set rs=server.createobject("adodb.recordset")
sqltext="select * from help_sort where sort='"&request.form("class_name")&"'"
rs.open sqltext,conn,1,1
'查找数据库,检查大类是否已经存在
if rs.recordcount >= 1 then 
if rs("help_sort_name")=Replace_Text(request.form("class_name")) then
response.write "<script language='javascript'>"
response.write "alert('此类别已经存在,请选用其它名称!');"
response.write"javascript:history.back(-1)</SCRIPT>"
response.end
end if
else
set rs=server.createobject("adodb.recordset")
sqltext="select * from help_sort"
rs.open sqltext,conn,3,3
rs.addnew
rs("sort")=request.form("class_name")
rs.update
response.redirect "sort.asp"
end if
end sub
%>
<br>
<!--#include file="../copy.asp" -->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -