<%



praname=request.form("dowork")
if praname="" then 
   error("请选择你要做的工作！")
else
	sql2="select * from [doing] where doname='"&praname&"'"
	rs1.Open sql2,Conn1,1,3
        addexp=rs1("addexp")
	addlover=rs1("addlover")
	delmoney=rs1("price")
	dellife=rs1("dellife")
	rs1.close

sql1="select * from [job] where username='"&Request.Cookies("username")&"'"
rs1.Open sql1,Conn1,1,3

if rs1.eof and rs1.bof then
  error("有没有搞错？！！你还没有职业，请你你先申请职业！")
else 
	if rs("userlife")<dellife then
 		error("有没有搞错？！！你不要命了！")
	else
	   if rs("money")<delmoney then
  		error("有没有搞错？！！不留生活费了,不活了你！")
	   end if
	end if


	rs1("exp")=rs1("exp")+addexp
	rs1("lover")=rs1("lover")+addlover
	rs1("wenxue")=rs1("wenxue")+5
	rs1("yishu")=rs1("yishu")+5
	rs1("jiaoji")=rs1("jiaoji")+5
	rs1("tiyu")=rs1("tiyu")+5
	rs1("jishu")=rs1("jishu")+5
	rs1.update

	rs("experience")=rs("experience")+addexp
	rs("userlife")=rs("userlife")-dellife
	rs("money")=rs("money")-delmoney
	rs.update
succeed("恭喜你,通过努力你虽然付出了"&delmoney&"个金币、"&dellife&"点体力,但是你增长了"&addlover&"点爱心、"&addexp&"点经验，其他各项属性增长5点！<meta http-equiv=refresh content=6;url='work.asp?jobsel=practice'>")
end if
rs1.close
 
end if
%>