<%@ LANGUAGE=VBScript codepage ="936" %>
<!--#include file="../showchat.asp"-->
<%Response.Expires=0
Response.ExpiresAbsolute = Now() - 1
Response.AddHeader "Pragma","No-Cache"
Response.AddHeader "Cache-Control","Private"
Response.CacheControl = "No-Cache"
cwjh_name=Session("cwjh_name")
cwjh_grade=Session("cwjh_grade")
if cwjh_name="" then Response.Redirect "../error.asp?id=440"
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("cwjh_usermdb")
rs.open "SELECT * FROM 用户 where 姓名='"&cwjh_name&"'",conn
if rs.bof or rs.eof then
	rs.close
	conn.close
	set conn=nothing
	set rs=nothing
	Response.Redirect "error.asp?id=453"
	response.end
end if
dl_sj=DateDiff("n",rs("登录"),now())
if dl_sj<15 and cwjh_grade<10 then
	rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
	Response.Write "<script language=JavaScript>{alert('上线时间还不到15分钟不能领取薪水\n先去签到上会班再说吧,一会点名!');location.href = 'javascript:history.back()';}</script>"
	response.end
end if
if rs("会员等级")<>0 then
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.Write "<script language=JavaScript>{alert('等级会员请不要到这里来!');location.href = 'javascript:history.back()';}</script>"
response.end
end if
if rs("会员")=true and clng(DateDiff("d",now(),rs("会员结束")))>0 then
	pd=paodian
	pdstr="泡点制会员"
else
	pd=1
	pdstr="非泡点会员"
		rs.close
		set rs=nothing
		conn.close
		set conn=nothing
		Response.Write "<script language=JavaScript>{alert('你不是泡点制会员，请止步!');location.href = 'javascript:history.back()';}</script>"
		response.end
end if
if Session("cwjh_grade")>=6 then
 Response.Write "<script language=JavaScript>{alert('这不是官府应该来的地方！');location.href = 'javascript:history.back()';}</script>"
 Response.End
end if
pai=rs("门派")
rs.close
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("cwjh_usermdb")
tmprs=conn.execute("Select count(*) As 数量 from 用户 where allvalue>100 and 介绍人='"&cwjh_name&"'")
jsren=tmprs("数量")
rs.open "Select * from 用户 where 姓名='"&cwjh_name&"'",conn
mdate=rs("领钱")
'if CDate(mdate)=now() then
'if day(mdate)>=day(now()) and month(mdate)=month(now()) and year(mdate)=year(now()) then 
if  DateDiff("d",rs("领钱"),now())=0 then
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	Response.Write "<script Language=Javascript>alert('天呀，["&cwjh_name &"]今天你来领过钱的！忘记了？');window.close();</script>"
	response.end
end if
yin=rs("银两")+rs("存款")
if yin>(rs("会员等级")+1)*500000000 then
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	Response.Write "<script Language=Javascript>alert('天呀，["&cwjh_name &"]你现在有这么多的银两你还想要呀！！');window.close();</script>"
	response.end
end if
dj=rs("等级")
hy=rs("会员等级")
if trim(rs("身份"))="掌门" then
	'如是掌门统计人数
	tmprs=conn.execute("Select count(*) As 数量 from 用户 where 门派='"&rs("门派")&"'")
	renshu=tmprs("数量")
	'算钱数
	money=((hy+1)*500000+cint(renshu)*50000+jsren*50000+dj*50000+500000)*2+1000000
	conn.execute("update 用户 set 银两=银两+"&money&",领钱=now() where 姓名='"&cwjh_name&"'")
else
	'个人按会员乘10万
	money=((rs("会员等级")+1)*500000+jsren*50000+dj*50000+500000)*2+1000000
	conn.execute("update 用户 set 银两=银两+"&money&",领钱=now() where 姓名='"&cwjh_name&"'")
end if
rs.close
rs.open "Select * from 用户 where 姓名='"&cwjh_name&"'",conn
conn.execute "update 用户 set 会员金卡=会员金卡+2 where 姓名='"&cwjh_name&"'"
%>
<html>
<head>
<title>工资领取处</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type=text/css>
TD {FONT-FAMILY: "宋体"; FONT-SIZE: 9pt}
BODY {FONT-FAMILY: "宋体"; FONT-SIZE: 9pt}
SELECT {FONT-FAMILY: "宋体"; FONT-SIZE: 9pt}
A {COLOR: #FFC106; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt; TEXT-DECORATION: none}
A:hover {COLOR: #cc0033; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt; TEXT-DECORATION: underline}
</STYLE>
</head>
<body bgcolor="#CCCCCC" text="#000000" leftmargin="0" background="../jhimg/bk_hc3w.gif">
<div align="center">
<p><font color="#000000"><b><font size="+3">工资领取处</font></b></font> <br>
<br>
<font size=+1> <b><%=cwjh_name%></b></font>你是<font color="#0000FF">[<%=rs("门派")%>]</font>
的<font color="#FF0000"> [<%=rs("身份")%>] </font>拉人：<font color="#FF0000"><b><%=jsren%>个</b></font>       
战斗等级:<font color="#FF0000"><%=rs("等级")%>级</font>       
<%if trim(rs("身份"))="掌门" then%>       
你有弟子:<font color="#FF0000"><b><%=renshu%>个</b></font> <%end if%><br>多多努力，多多拉人！       
<br>
今天你从江湖领取到了<b><font color="#FF0000"><%=money%>两</font></b>，小心保存，不要乱花！       
<%
rs.close
conn.close
set rs=nothing
set conn=nothing
says="<font color=red>【小道消息】["&cwjh_name&"]</font><font color=green>今天刚领了"&money&"两的工资,大家还不快去,等一下就没有了!</font>"
call showchat(says)
%>
<br>
</p>
<p align="center"><br>
<font color="#FF0000" size="+1"><b>工资计算方法</b></font><br>
<font color="#0000FF">泡点制会员掌门：</font>（会员等级x50万+弟子数x5万+介绍人数x5万+战斗等级x5万）x2+（100万会员费）<br>
<font color="#0000FF">泡点制会员弟子：</font>（会员等级x50万+介绍人数x5万+战斗等级x5万）x2+（100万会员费）</p>
<p align="center"><b><font color="#FF00FF">泡点制会员另外领取金卡<img border="0" src="jk.GIF">2元！</font></b></p>
<p align="center">&nbsp;</p>
<p align="center">
<input type=button value=关闭窗口 onClick='window.close()' name="button">
</p>
</div>
</body>
</html>