<%if session("user")="" then
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"window.close();</SCRIPT>"
response.end
end if
if session("id")="" then 
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"window.close()';</SCRIPT>"
response.end
end if%>
<!--#include file="conn/conn.asp"-->
<!--#include file="conn/nosql.asp"-->
<!--#include file="conn/config.asp"-->
<%

Set rs2= Server.CreateObject("ADODB.Recordset") 
rs2.open"select * from snsn_user where username='"&session("user")&"'",conn,1,3
act=nosql(request("act"))
if act="zz" then
if rs2("zy")=nosql(request("zy")) then
response.write "<script language='javascript'>"
response.write "alert('转职失败，您的职业已经是"""&nosql(request("zy"))&"""！');"
response.write"this.location.href='zhuanzhi.asp';</SCRIPT>"
response.End
else
if rs2("jifen")-nosql(request("qian"))<0 then
response.write "<script language='javascript'>"
response.write "alert('转职失败，您的帐户金额不足！');"
response.write"this.location.href='zhuanzhi.asp';</SCRIPT>"
response.End
else
conn.execute"update snsn_user set zy='"&nosql(request("zy"))&"',jifen=jifen-"&nosql(request("qian"))&" where username='"&session("user")&"'"
''刷新积分
Set rs12= Server.CreateObject("ADODB.Recordset") 
rs12.open"select * from snsn_user where username='"&session("user")&"'",conn,1,3
session("jifen")=rs12("jifen")
response.write "<script language='javascript'>"
response.write "alert('转职成功，下次登陆后即会生效！');"
response.write"window.opener.location.reload();window.close()</SCRIPT>"
response.End
end if
end if
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>转职圣殿-<%=webname%></title>

<style type="text/css">
<!--
.go-wenbenkuang {font-family: "??";font-size: 9pt;color: #333333;background-color: #eeeeee;cursor: hand;padding: 1px;height: 19px;border-top: 1px solid #FFFFFF;border-right: 1px solid #a2a2a2;border-bottom: 1px solid #a2a2a2;border-left: 1px solid #FFFFFF;}
.z12 {
	font-size: 12px;
}
.style1 {color: #FF0000}
-->
</style>
</head>

<body>
<%Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open"select zhuanzhi from snsn_config",conn,1,1
%>
<form name="form1" method="post" action="?act=zz">
  <table width="200"  border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC" class="z12">
    <tr align="center" bgcolor="#FFFFFF">
      <td height="21" bgcolor="efefef">转 职 圣 殿</td>
    </tr>
    <tr align="center" bgcolor="#FFFFFF">
      <td height="21">请选择职业:
        <input name="zy" type="radio" value="官" <%if rs2("zy")="官" then%>checked<%end if%>>
        官
        <input type="radio" name="zy" value="商"  <%if rs2("zy")="商" then%>checked<%end if%>>
        商</td>
    </tr>
    <tr align="center" bgcolor="#FFFFFF">
      <td height="21" bgcolor="#FFFFFF">需要银两:<span class="style1"><%=rs("zhuanzhi")%>
        <input name="qian" type="hidden" id="qian" value="<%=rs("zhuanzhi")%>">
      </span></td>
    </tr>
    <tr align="center" bgcolor="#FFFFFF">
      <td height="21"><input name="Submit" type="submit" class="go-wenbenkuang" onClick="return confirm('确定转职')" value="转职">      <input name="Submit2" type="button" class="go-wenbenkuang" onClick="window.close()" value="取消"></td>
    </tr>
  </table>
</form>
</body>
</html>
