<% If session("admin_flag")=1 Then %>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from jjh_admin order by admin_id DESC"
rs.open sql,conn,1,1
%>
<% if request("type")="new" then%>
<% End If %>
<%
dim rs1,rs2
dim sql1,sql2
If Request.Form("ok")="确定新增" Then
admin_name=request("admin_name")
admin_flag=request("admin_flag")
admin_password=md5(request("admin_password"))
End If
If request("action")="add" Then
set rs1=server.CreateObject("adodb.recordset")
rs1.Open "jjh_admin",conn,3,3
rs1.addnew
rs1("admin_name")=admin_name
rs1("admin_flag")=admin_flag
rs1("admin_password")=admin_password
rs1.update
rs1.close
response.Redirect("zl.asp")
end if
%>
<% if request("type")="edit" then
if request.querystring("admin_id")="" then
errmsg=errmsg+" "+"
请指定操作的对象!"
call diserror()
response.end
else
if not isinteger(request.querystring("admin_id")) then
errmsg=errmsg+" "+"
非法的新闻ID参数!"
call diserror()
response.end
end if
end if
sql2="select * from jjh_admin where admin_id="&cint(request.querystring("admin_id"))
set rs2=server.createobject("adodb.recordset")
rs2.open sql2,conn,1,1
%>
<%
rs2.close
set rs2=nothing
End If %>
<%
dim rs3,rs4,rs5
dim sql3,sql4,sql5
if request.form("okla")="确定修改" then
admin_name=request("admin_name")
admin_flag=request("admin_flag")
admin_password=md5(request("admin_password"))
End If
If request("action")="edit" Then
set rs3=server.CreateObject("adodb.recordset")
sql3="select * from jjh_admin where admin_id="&cint(request.querystring("admin_id"))
rs3.open sql3,conn,3,3
rs3("admin_name")=admin_name
rs3("admin_flag")=admin_flag
rs3("admin_password")=admin_password
rs3.update
rs3.close
response.Redirect("zl.asp")
end if
%>
<% If request("type")="del" Then
if request.querystring("admin_id")="" then
errmsg=errmsg+" "+"
请指定操作的对象!"
call diserror()
response.end
else
if not isinteger(request.querystring("admin_id")) then
errmsg=errmsg+" "+"
非法的新闻ID参数!"
call diserror()
response.end
end if
end if
sql4="select * from jjh_admin where admin_id="&cint(request.querystring("admin_id"))
set rs4=server.createobject("adodb.recordset")
rs4.open sql4,conn,1,1
%>
<% End If %>
<%
dim rs6
dim sql6
if request.Form("oklala")="确定删除" then
if request.Form("admin_id")="" then
founderr=true
errmsg=errmsg+" "+"
你必须指定操作的对象!"
else
if not isInteger(request.form("admin_id")) then
founderr=true
errmsg=errmsg+" "+"
非法的新闻id参数。"
end if
end if
if request("action")="del" then
set rs6=server.createobject("adodb.recordset")
sql6="select * from jjh_admin where admin_id="&cint(request.querystring("admin_id"))
rs6.open sql6,conn,1,3
rs6.delete
rs6.close
set rs6=nothing
response.Redirect("zl.asp")
end if
end if
else
%>
<%
dim rs9,sql9
set rs9=server.CreateObject("adodb.recordset")
sql9="select * from jjh_admin where admin_id="&session("admin_id")&""
rs9.open sql9,conn,3,3 %>
<%
rs9.close
dim rs8
dim sql8
if request.form("okla1")="确定修改" then
admin_name=request("admin_name")
admin_password=md5(request("admin_password"))
End If
If request("action")="edit" Then
set rs8=server.CreateObject("adodb.recordset")
sql8="select * from jjh_admin where admin_id="&session("admin_id")&""
rs8.open sql8,conn,3,3
rs8("admin_name")=admin_name
rs8("admin_password")=admin_password
rs8.update
rs8.close
response.Redirect("zl.asp")
end if
%>
<% End If %>