<%
worktype=request.querystring("type")

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 rs1("lastwork")=date() then
     if rs1("todaynum")<3 then
	rs1("todaynum")=rs1("todaynum")+1
	rs1.update
     else
	error("天哪,你不要命了!一天最多只能工作三次!")
	rs1.close
     end if
  else
     rs1("lastwork")=date()
     rs1("todaynum")=1
     rs1.update
  end if
if worktype=rs1("worktype") then 
  addexp=20+15*rs1("num")
select case worktype
  case ""
    error("出错了！^^")
  case "教师"
	rs("experience")=rs("experience")+addexp
	rs.update
	rs1("exp")=rs1("exp")+addexp
	rs1("lover")=rs1("lover")+3
	rs1("wenxue")=rs1("wenxue")+addexp
	rs1("yishu")=rs1("yishu")+5
	rs1("jiaoji")=rs1("jiaoji")+5
	rs1("tiyu")=rs1("tiyu")+5
	rs1("jishu")=rs1("jishu")+5
	rs1("time")=rs1("time")+1
	rs1.update
	rs1.close
	succeed("经过一天工作,你增加了"&addexp&"经验值,文采值增加"&addexp&"点,其他各项属性增加5点！<meta http-equiv=refresh content=3;url='work.asp?jobsel=gowork'>")
  case "作家"
	rs("experience")=rs("experience")+addexp
	rs.update
	rs1("exp")=rs1("exp")+addexp
	rs1("lover")=rs1("lover")+3
	rs1("wenxue")=rs1("wenxue")+addexp
	rs1("yishu")=rs1("yishu")+5
	rs1("jiaoji")=rs1("jiaoji")+5
	rs1("tiyu")=rs1("tiyu")+5
	rs1("jishu")=rs1("jishu")+5
	rs1("time")=rs1("time")+1
	rs1.update
	rs1.close
	succeed("经过一天工作,你增加了"&addexp&"经验值,文采值增加"&aadexp&"点,其他各项属性增加5点！<meta http-equiv=refresh content=3;url='work.asp?jobsel=gowork'>")
  case "画家"
	rs("experience")=rs("experience")+addexp
	rs.update
	rs1("exp")=rs1("exp")+addexp
	rs1("lover")=rs1("lover")+3
	rs1("wenxue")=rs1("wenxue")+5
	rs1("yishu")=rs1("yishu")+addexp
	rs1("jiaoji")=rs1("jiaoji")+5
	rs1("tiyu")=rs1("tiyu")+5
	rs1("jishu")=rs1("jishu")+5
	rs1("time")=rs1("time")+1
	rs1.update
	rs1.close
	succeed("经过一天工作,你增加了"&addexp&"点经验值、"&addexp&"点艺术值,其他各项属性增加5点！<meta http-equiv=refresh content=3;url='work.asp?jobsel=gowork'>")
  case "歌手"
	rs("experience")=rs("experience")+addexp
	rs.update
	rs1("exp")=rs1("exp")+addexp
	rs1("lover")=rs1("lover")+3
	rs1("wenxue")=rs1("wenxue")+5
	rs1("yishu")=rs1("yishu")+addexp
	rs1("jiaoji")=rs1("jiaoji")+5
	rs1("tiyu")=rs1("tiyu")+5
	rs1("jishu")=rs1("jishu")+5
	rs1("time")=rs1("time")+1
	rs1.update
	rs1.close
	succeed("经过一天工作,你增加了"&addexp&"点经验值、"&addexp&"点艺术值,其他各项属性增加5点！<meta http-equiv=refresh content=3;url='work.asp?jobsel=gowork'>")
  case "记者"
	rs("experience")=rs("experience")+addexp
	rs.update
	rs1("exp")=rs1("exp")+addexp
	rs1("lover")=rs1("lover")+3
	rs1("wenxue")=rs1("wenxue")+5
	rs1("yishu")=rs1("yishu")+5
	rs1("jiaoji")=rs1("jiaoji")+addexp
	rs1("tiyu")=rs1("tiyu")+5
	rs1("jishu")=rs1("jishu")+5
	rs1("jishu")=rs1("jishu")+5
	rs1("time")=rs1("time")+1
	rs1.update
	rs1.close
	succeed("经过一天工作,你增加了"&addexp&"点经验值、"&addexp&"点交际值,其他各项属性增加5点！<meta http-equiv=refresh content=3;url='work.asp?jobsel=gowork'>")
  case "商人"
	rs("experience")=rs("experience")+addexp
	rs.update
	rs1("exp")=rs1("exp")+addexp
	rs1("lover")=rs1("lover")+3
	rs1("wenxue")=rs1("wenxue")+5
	rs1("yishu")=rs1("yishu")+5
	rs1("jiaoji")=rs1("jiaoji")+addexp
	rs1("tiyu")=rs1("tiyu")+5
	rs1("jishu")=rs1("jishu")+5
	rs1("time")=rs1("time")+1
	rs1.update
	rs1.close
	succeed("经过一天工作,你增加了"&addexp&"点经验值、"&addexp&"点交际值,其他各项属性增加5点！<meta http-equiv=refresh content=3;url='work.asp?jobsel=gowork'>")
  case "警察"
	rs("experience")=rs("experience")+addexp
	rs.update
	rs1("exp")=rs1("exp")+addexp
	rs1("lover")=rs1("lover")+3
	rs1("wenxue")=rs1("wenxue")+5
	rs1("yishu")=rs1("yishu")+5
	rs1("jiaoji")=rs1("jiaoji")+5
	rs1("tiyu")=rs1("tiyu")+addexp
	rs1("jishu")=rs1("jishu")+5
	rs1("time")=rs1("time")+1
	rs1.update
	rs1.close
	succeed("经过一天工作,你增加了"&addexp&"点经验值、"&addexp&"点体育值,其他各项属性增加5点！<meta http-equiv=refresh content=3;url='work.asp?jobsel=gowork'>")
  case "体育"
	rs("experience")=rs("experience")+addexp
	rs.update
	rs1("exp")=rs1("exp")+addexp
	rs1("lover")=rs1("lover")+3
	rs1("wenxue")=rs1("wenxue")+5
	rs1("yishu")=rs1("yishu")+5
	rs1("jiaoji")=rs1("jiaoji")+5
	rs1("tiyu")=rs1("tiyu")+addexp
	rs1("jishu")=rs1("jishu")+5
	rs1("time")=rs1("time")+1
	rs1.update
	rs1.close
	succeed("经过一天工作,你增加了"&addexp&"点经验值、"&addexp&"点体育值,其他各项属性增加5点！<meta http-equiv=refresh content=3;url='work.asp?jobsel=gowork'>")
  case "医护"
	rs("experience")=rs("experience")+addexp
	rs.update
	rs1("exp")=rs1("exp")+addexp
	rs1("lover")=rs1("lover")+3
	rs1("wenxue")=rs1("wenxue")+5
	rs1("yishu")=rs1("yishu")+5
	rs1("jiaoji")=rs1("jiaoji")+5
	rs1("tiyu")=rs1("tiyu")+5
	rs1("jishu")=rs1("jishu")+addexp
	rs1("time")=rs1("time")+1
	rs1.update
	rs1.close
	succeed("经过一天工作,你增加了"&addexp&"点经验值、"&addexp&"点技术值,其他各项属性增加5点！<meta http-equiv=refresh content=3;url='work.asp?jobsel=gowork'>")
  case "科技"
	rs("experience")=rs("experience")+addexp
	rs.update
	rs1("exp")=rs1("exp")+addexp
	rs1("lover")=rs1("lover")+3
	rs1("wenxue")=rs1("wenxue")+5
	rs1("yishu")=rs1("yishu")+5
	rs1("jiaoji")=rs1("jiaoji")+5
	rs1("tiyu")=rs1("tiyu")+5
	rs1("jishu")=rs1("jishu")+addexp
	rs1("time")=rs1("time")+1
	rs1.update
	rs1.close
	succeed("经过一天工作,你增加了"&addexp&"点经验值、"&addexp&"点技术值,其他各项属性增加5点！<meta http-equiv=refresh content=3;url='work.asp?jobsel=gowork'>")
end select
    
else
	addexp=5+5*rs1("num")
	rs("experience")=rs("experience")+addexp
	rs.update
	rs1("exp")=rs1("exp")+addexp
	rs1("lover")=rs1("lover")+3
	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("jishu")=rs1("jishu")+5
	rs1("time")=rs1("time")+1
	rs1.update
	rs1.close
	succeed("虽然你没做本职工作,但是经过一天努力,你还是增加了"&addexp&"经验值,其他各项属性增加5点！<meta http-equiv=refresh content=3;url='work.asp?jobsel=gowork'>")
end if
 
end if

%>