📄 admin_classmanage.asp
字号:
<!--#include file="setup.asp"-->
<!--#include file="../WoLib/Function.asp"-->
<!-- #include file="CheckAdmin.asp" -->
<%
if CookieUserName=empty then error("您还未<a href=Login.asp?ReturnUrl="&ReturnUrl&">登录</a>")
if UserRoleID <> 1 then Alert("您没有权限进入后台")
if RequestCookies("Userpass")="" or RequestCookies("Userpass")<>session("pass") then Response.Write ("<script>top.location.href='login.asp';</script>")
action = request("action")
act = request("act")
Child_ID = Request("Child_ID")
Set Rs = Server.CreateObject("ADODB.Recordset")
if action = "add" then
sql = "Select * from Wo_SrcChild where 1>2"
Rs.open Sql,conn,1,2
Rs.AddNew
Rs("Child_TypeID") = 1
Rs("Child_Name") = Request("Child_Name")
Rs("Child_IsUse") = Request("Child_IsUse")
Rs("Child_OrderBy") = Request("Child_OrderBy")
Rs.Update
if err.number = 0 then
Response.Redirect("Admin_ClassManage.asp")
Response.end
end if
elseif action = "edit" then
sql = "Select * from Wo_SrcChild where Child_ID="&Request("Child_ID")
Rs.open Sql,conn,1,2
if not Rs.eof then
Rs("Child_Name") = Request("Child_Name")
Rs("Child_IsUse") = Request("Child_IsUse")
Rs("Child_OrderBy") = UCase(Request("Child_OrderBy"))
Rs.Update
end if
if err.number = 0 then
Response.Redirect("Admin_ClassManage.asp")
Response.end
end if
elseif action = "del" then
Sql = "Delete From Wo_SrcChild Where Child_ID="&Child_ID
Conn.execute(Sql)
Response.Redirect("Admin_ClassManage.asp")
Response.end
end if
if act = "edit" then
Sql = "Select * from Wo_SrcChild Where Child_ID="&Child_ID
Rs.open Sql,conn,1,2
if not Rs.eof then
Child_ID = Rs("Child_ID")
Child_Name = Rs("Child_Name")
Child_IsUse = Rs("Child_IsUse")
Child_OrderBy = Rs("Child_OrderBy")
end if
Rs.Close
Set Rs = Nothing
end if
if act = "" then act = "add"
%>
<script language="javascript">
<!--
function frm_onsubmit(frm){
var frm = eval(frm);
if(frm.Child_Name.value==""){
alert("类别名称不能为空!");
frm.Child_Name.focus();
return false;
}
if(frm.Child_OrderBy.value=="" || isNaN(frm.Child_OrderBy.value)){
alert("类别的排序不能为空,且只能为数字!");
frm.Child_OrderBy.focus();
return false;
}
if(confirm("您确定要操作此类别吗?")){
return true;
}
return false;
}
function isDel(id){
if(confirm("您确定要删除此类别吗?")){
location.href="Admin_ClassManage.asp?Action=del&Child_ID="+id;
}
}
-->
</script>
<link href="Img/Admin.css" rel="stylesheet" type="text/css">
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<table cellspacing=1 cellpadding=0 width=100% id=CommonListArea>
<tr id=CommonListTitle3>
<td align="center">编号</td>
<td align="center">页面名称</td>
<td align="center">是否使用</td>
<td align="center">排序</td>
<td align="center">操作</td>
</tr>
<%
sql="SELECT * From Wo_SrcChild order by Child_IsUse,Child_OrderBy"
set RS=conn.execute(sql)
while not Rs.eof
%>
<tr<%= Tr_MouseOver %> bgcolor="#FFFFFF">
<td height="22" align="center"> <%=Rs("Child_ID")%></td>
<td align="center"> <%=rs("Child_Name")%></td>
<td align="center"><%
if Rs("Child_IsUse") = true then
Response.write("使用")
else
Response.write("<font color='#ff0000'>不使用</font>")
end if
%></td>
<td align="center"> <%=rs("Child_OrderBy")%></td>
<td align="center">
<a href="javascript:isDel(<%=Rs("Child_ID")%>);">删除</a>
<a href="Admin_ClassManage.asp?act=edit&Child_ID=<%=Rs("Child_ID")%>">编辑</a>
</td>
</tr>
<%
Rs.MoveNext
Wend
%>
</table>
<br>
<form action="Admin_ClassManage.asp" method="post" onSubmit="return frm_onsubmit(this);" name="frmdata">
<table cellspacing=1 cellpadding=0 width=100% id=CommonListArea>
<tr id=CommonListTitle3>
<td colspan="2">
<strong> 站点栏目管理</strong></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="17%" height="23"> 类别名称:</td>
<td width="83%" height="23">
<input type="text" name="Child_Name" size="40" maxlength="40" value="<%=Child_Name%>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="23"> 排列顺序:</td>
<td height="23">
<input type="text" name="Child_OrderBy" size="40" maxlength="50" value="<%=Child_OrderBy%>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="23"> 是否使用:</td>
<td height="23">
<input type="radio" name="Child_IsUse" value="1" <% if Child_IsUse = true or Child_IsUse = "" then Response.write(" Checked") %>>
使用
<input type="radio" name="Child_IsUse" value="0" <% if Child_IsUse = false then Response.write(" Checked") %>>
不使用</td>
</tr>
<tr bgcolor="#ffffff">
<td height="30" colspan="2" align="center">
<input type="submit" name="Submit" value=" 提交 ">
<input type="reset" name="Submit2" value=" 重置 ">
<input type="button" name="button" value="重新添加" onClick="javascript:location.href='Admin_ClassManage.asp';">
<input type="hidden" name="Child_ID" value="<%=Child_ID%>">
<input type="hidden" name="action" value="<%=act%>">
</td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td height="22"><div align="right"></td>
</tr>
</table>
<%
Set Rs = Nothing
Set Conn = Nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -