<!--#include file="conn.asp"-->
<%if session("admin")="1" then
exec="select * from test where id="&request.form("id")
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,3
rs("aa")=request.form("aa")
rs("cc")=request.form("cc")
rs("bb")=request.form("bb")
rs.update
else
exec="select * from test where id='"&request.form("id")&"' and user_total in ("&session("admin")&")"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,3
if rs.eof then
rs("aa")=request.form("aa")
rs("cc")=request.form("cc")
rs("bb")=request.form("bb")
user_total = trim(rs("user_total"))
if user_total<>"" then
rs("user_total")=user_total + "," + session("admin")
else
rs("user_total")=user_total + session("admin")
end if
rs.update
end if
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect "list.asp"