?? admin_class_ok.asp
字號(hào):
<%@ 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">①類別直接與之前發(fā)布的信息相關(guān)聯(lián),刪除類別可能會(huì)影響到之前發(fā)布的信息。<br>
②點(diǎn)擊類別名稱進(jìn)入相應(yīng)下級(jí)分類,點(diǎn)擊相應(yīng)的分類操作屬性進(jìn)行相應(yīng)操作。</font><br>
<font color="red">③如:要添加二級(jí)分類——>先點(diǎn)擊大類進(jìn)入二級(jí)類——>添加二級(jí)類別</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">添加幫助一級(jí)類別</Th>
</TR>
<TR>
<TD width=40% height=25 class="forumRowHighlight" align=center><b>幫助一級(jí)類別名稱</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">添加幫助二級(jí)類別</Th>
</TR>
<TD width=40% height=25 class="forumRowHighlight" align=center><b>所屬幫助一級(jí)分類</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>幫助二級(jí)分類名稱</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("您必須輸入二級(jí)分類名稱!");
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
'查找數(shù)據(jù)庫,檢查二級(jí)分類是否已經(jīng)存在
if rs.recordcount >= 1 then
if rs("typename")=Lcase(request.form("help_type_name")) then
response.write "<script language='javascript'>"
response.write "alert('此二級(jí)分類已經(jīng)存在,請(qǐng)選用其它名稱!');"
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
'添加一個(gè)二級(jí)分類到數(shù)據(jù)庫
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">幫助一級(jí)類別修改</Th>
</TR>
<TD width=40% height=25 class="forumRowHighlight" align=center><b>幫助一級(jí)類別名稱</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">幫助二級(jí)類別修改</Th>
</TR>
<tr>
<td width="40%" class="forumRowHighlight" align=center><b>所屬一級(jí)分類</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>二級(jí)分類名稱</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("您必須輸入二級(jí)分類名稱!");
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>"+"錯(cuò)誤,數(shù)據(jù)庫操作錯(cuò)誤,沒有找到此條信息。"
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>"+"錯(cuò)誤,數(shù)據(jù)庫操作錯(cuò)誤,沒有找到此條信息"
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
'查找數(shù)據(jù)庫,檢查大類是否已經(jīng)存在
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('此類別已經(jīng)存在,請(qǐng)選用其它名稱!');"
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" -->
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -