<!--#include file="ljconn.asp"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
else
if session("flag")>1 then
response.Write "<p align=center><font color=red>您没有此项目管理权限！</font></p>"
response.End
end if
end if
%>
<%
id=request("id")
action=request.QueryString("action")
'//添加新数据
select case action
case "add"
if request("name2")="" then
response.Write("<script laguage='javascript'>alert('名称不能为空');history.go(-1);</script>")
response.end()
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from aaa",conn,1,3
rs.AddNew
rs("name")=trim(request("name2"))
rs("px")=int(request("px"))
rs("aid")=int(request("aid"))
rs("aaid")=int(request("aaid"))
rs("img")=trim(request("img"))
'rs("changyong")=int(request("changyong"))
rs.Update
rs.Close
set rs=nothing
response.redirect url&"nclass1.asp?aid="&int(request("aid"))&"&name="&trim(request("name"))&"&aaid="&int(request("aaid"))
'//修改数据
case "edit"
if request("name3")="" then
response.Write("<script laguage='javascript'>alert('名称不能为空');history.go(-1);';</script>")
response.end()
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from aaa where id="&request.QueryString("id"),conn,1,3
rs("name")=trim(request("name3"))
rs("px")=int(request("px"))
rs("img")=trim(request("imgs"))
rs.update
rs.close
set rs=nothing
response.redirect url&"nclass1.asp?aid="&int(request("aid"))&"&name="&trim(request("name"))&"&aaid="&int(request("aaid"))
'//删除数据
case "del"
'id=request.QueryString("id")
'conn.execute ("delete from aaa where aaid="&request.QueryString("id"))
'conn.execute ("delete from shop_books where aaid="&request.QueryString("id"))
'response.redirect url&"nclass.asp?id="&anclassid&"&anclass="&anclass
end select
%>
