📄 class_ok.asp
字号:
<%@ codepage ="936" %>
<!--#include file="../../conn/conn.asp" -->
<!--#include file="../../Inc/Commoncode.asp" -->
<!--#include file="../checkvalid.asp" -->
<%
If Not FRAdminLevel(307) Then
Call ErrorMsg()
End If
wid=request.QueryString("wid")
%>
<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()
sub main()
%>
<table width="98%" border="0" cellspacing="1" cellpadding="0" align=center class="tableBorder">
<tr>
<th height=25 colspan="2" class="tableHeaderText"><%call ChannelNametitle()%>管理 </th>
</tr>
<tr>
<td width="10%" height=25 class="forumRowHighlight"> <B>操作选项</B></td>
<FORM name=searchForm action="index.asp?wid=<%=wid%>" method=post onSubmit="javascript:if(doSearch()==false) return false;"><td class="forumRowHighlight">
关键字:<input name="keywords" type="text" value="<%=keywords%>">
所属类别:
<select name="typeid" size="1">
<%
set rs1=conn.execute("select * from job_hrnewsType where type_fid="&wid)
do while not rs1.eof
response.write "<option value='"&rs1("typeid")&"'>"&rs1("type")&" 类信息</option>"&chr(13)+chr(10)
rs1.movenext
loop
rs1.close
%>
</select> <input name=submit type="submit" class="inputs" id=submit value="立刻查找">
</td></form>
</tr>
<tr>
<td height=25 class="forumRowHighlight"> </td>
<td class="forumRowHighlight"><a href="addinfo.asp?wid=<%=wid%>">添加<%call ChannelNametitle()%>
</a> | <a href="index.asp?wid=<%=wid%>">管理<%call ChannelNametitle()%>
</a> | <a href="Class_Ok.asp?action=add_class_1&wid=<%=wid%>">添加信息类别</a> | <a href="type.asp?wid=<%=wid%>">管理信息类别</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&wid=<%=wid%> method=post>
<TABLE width=100% border="0" align="center" cellPadding=3 cellSpacing=1 class="tableBorder">
<TR>
<Th colSpan=2 height="28" class="tableHeaderText">添加<%call ChannelNametitle()%>类别</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 name=Submit2 type=submit class="inputs" value='确 定 添 加'> </TD>
</TR>
</TABLE>
</FORM>
<%
end sub
sub edit_class_1()
set rs=server.createobject("adodb.recordset")
sqltext="select * from job_hrnewstype where typeid="+Cstr(request("id"))
rs.open sqltext,conn,1,1
%>
<form name=form1 action="class_ok.asp?action=savedit_1&wid=<%=wid%>" 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">修改<%call ChannelNametitle()%>类别</Th>
</TR>
<tr>
<td width="40%" class="forumRowHighlight" align=center><b>要修改的类别名称:</b></td>
<td width="60%" class="forumRowHighlight"> <input type="text" name="class_1_name" size='40' value="<%=rs("type")%>"> </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 job_hrnewstype where type_fid="&wid&" and 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
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><div align=center><br><br>分类修改成功!</div></td></tr>"
response.write"<tr align=center><td height=30 class=forumRowHighlight><a href='type.asp?wid="&wid&"'><< 返回上一页</a></td>"
response.write"</tr>"
response.write"</table>"
end sub
sub del_class_1()
conn.execute("delete from job_hrnewstype where typeid="+request("id"))
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><div align=center><br><br>分类删除成功!</div></td></tr>"
response.write"<tr align=center><td height=30 class=forumRowHighlight><a href='type.asp?wid="&wid&"'><< 返回上一页</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 job_hrnewstype where type='"&request.form("class_name")&"' and type_fid="&wid
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&wid="&wid&"';</script>"
end if
else
set rs=server.createobject("adodb.recordset")
sqltext="select * from job_hrnewstype"
rs.open sqltext,conn,3,3
rs.addnew
rs("type")=Replace_Text(request.form("class_name"))
rs("type_fid")=wid
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><div align=center><br><br>添加类别成功!</div></td></tr>"
response.write"<tr align=center><td height=30 class=forumRowHighlight><a href='type.asp?wid="&wid&"'><< 返回上一页</a></td>"
response.write"</tr>"
response.write"</table>"
end if
end sub
%>
<!--#include file="../inc/copy.asp" -->
<%
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -