<!--#include virtual="/show/userhead.asp"-->

<script>document.getElementById('o_1').setAttribute("class", "ed"); document.getElementById("t_1").style.display="";document.getElementById('s_1_1').setAttribute("class", "ed4");</script>

<meta name="keywords" content="<%=webname%>,<%=webkeywords%>">
<meta name="description" content="<%=webdescription%>">

<%
'call chktel()
'call iszizhu()

jiesuanzhouqi2=2 '未认证商户结算周期

response.Cookies("dateaa")=""
response.Cookies("datebb")=""
response.Cookies("dingdan")=""
response.Cookies("zhuangtai")=""


'随机数
Const stringmodarr = "0123456789"
dim randarr2,strlength
strlength = Len(stringmodarr)
Randomize timer
For i = 1 To 4 
randarr2 = randarr2&Mid(stringmodarr,Int(Rnd * strlength + 1),1)  
Next 
get_timeh=timer()*100
get_timeh=right("00"&get_timeh,2)
get_timeh=replace(get_timeh,".","0")
randarr = Right((year(Now())),2)&Right(("00"&Month(Now())),2)&Right(("00"&Day(Now())),2)&Right(("00"&hour(Now())),2)&Right(("00"&minute(Now())),2)&Right(("00"&second(Now())),2)&get_timeh&randarr2

'开通VIP
if SafeRequest("c")="vip" then
Application.Lock
sql="select * from ayname where aynameid="&clng(request.Cookies("aynameid"))&"" 
rs.open sql,conn,1,3
if cint(rs("isvipid"))=1 then call PopErr("您已经是尊贵VIP了，不需要重复开通")
if ccur(rs("ayyue"))<ccur(vipj) then call PopErr2("开通尊贵VIP需要金额300元，您的账号余额不足，请先充值","/user/chong")

aycaiwuyue=ccur(rs("ayyue"))-300
if ccur(aycaiwuyue)<0 then aycaiwuyue=0
rs("ayyue")=aycaiwuyue
rs("ayxiaofei")=ccur(rs("ayxiaofei"))+300
rs("isvipid")=1

if isnull(trim(rs("vipdate")))=false and trim(rs("vipdate"))<>"" then
rs("vipdate")=DateAdd("yyyy",1,rs("vipdate"))
else
rs("vipdate")=now()
end if

rs.update
rs.close

'财务
conn.Execute("Insert Into "&request.Cookies("cwku")&"(aycaiwuleibie,aycaiwuuser,aycaiwudingdan,aycaiwudate,aycailiushui,aycaiwujine,aycaiwuyue,aycwfsjin,aycwinjin,aycaiwubody) values('2','"&request.Cookies("aynameid")&"','"&randarr&"','"&now()&"','"&randarr&"','"&Formatnumber(vipj,3,true,-1,0)&"','"&Formatnumber(aycaiwuyue,3,true,-1,0)&"','"&Formatnumber(vipj,3,true,-1,0)&"','"&Formatnumber(vipj,3,true,-1,0)&"','开通VIP')")
call logadd(request.Cookies("aynameid"),"开通VIP成功",0,0)
call PopErr2("开通VIP成功","index")
Application.Unlock	
end if


'消保解冻
if SafeRequest("c")="jd" then
sql="select * from ayname where aynameid="&clng(request.Cookies("aynameid"))&"" 
rs.open sql,conn,1,3
if cint(rs("ayisxiaobao"))=0 then call PopErr("非入籍商家")
if ccur(rs("ayisxiaojin"))<=0 then call PopErr("保证金错误")

'if DateDiff("d",rs("xbdate"),now())<=10 then 
'call logadd(request.Cookies("aynameid"),"加入消保金额10天后才可以解冻",0,1)
'call PopErr("加入消保金额10天后才可以解冻")
'end if

'yjin=rs("ayisxiaojin")
'rs("ayisxiaobao")=0
'rs("ayisxiaojin")=0
'aycaiwuyue=ccur(rs("ayyue"))+ccur(yjin)
'rs("ayyue")=ccur(rs("ayyue"))+ccur(yjin)
'rs.update
rs.close

'财务
conn.Execute("Insert Into "&request.Cookies("cwku")&"(aycaiwuleibie,aycaiwuuser,aycaiwudingdan,aycaiwudate,aycailiushui,aycaiwujine,aycaiwuyue,aycwfsjin,aycwinjin,aycaiwubody) values('7','"&request.Cookies("aynameid")&"','"&randarr&"','"&now()&"','"&randarr&"','"&Formatnumber(yjin,3,true,-1,0)&"','"&Formatnumber(aycaiwuyue,3,true,-1,0)&"','"&Formatnumber(yjin,3,true,-1,0)&"','"&Formatnumber(yjin,3,true,-1,0)&"','解冻消费者保证金')")
call logadd(request.Cookies("aynameid"),"解冻保证金操作成功",0,0)
call PopErr2("解冻保证金操作成功","myname")
end if

%>
<DIV id=main2> 
<DIV style="PADDING-LEFT:0px">
<DIV id=main_right_content>

<SCRIPT LANGUAGE="JavaScript">
function chayu()
{
document.getElementById('chaxunyue').innerHTML="<strong class=red>"+document.getElementById("yu").value+"</span>";
}
</script>

<TABLE width="99%" align="center" style="font-size:14px;">
  <TBODY>
  <TR> 
    <TD height="30" colspan="4">
<%
sql="select ayjuzt,ayjubaouid,ayjubaozt from ayjubao where ayjubaouid="&request.Cookies("aynameid")&" and ayjuzt=0 and ayjubaozt=1" 
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then%>


<div id="protectts">
<strong>
<A href="tousu" style="color:#FF0000; font-size:16px;">##重要提示##：您有投诉未处理完成！请在24小时内做出回复或联系买家撤销投诉！【查看详情】<br>
24小时内未作出任何回复也未撤销投诉的，商家ID将被冻结！！！</A>
</strong>
</div><br>


<%end if
rs.close


if trim(request.Cookies("kamiku"))="" then call PopErr2("获取身份信息出错ES01，请重新登录","/index/exit")
if trim(request.Cookies("flku"))="" then call PopErr2("获取身份信息出错ES02，请重新登录","/index/exit")
if trim(request.Cookies("spku"))="" then call PopErr2("获取身份信息出错ES03，请重新登录","/index/exit")
if trim(request.Cookies("ddku"))="" then call PopErr2("获取身份信息出错ES04，请重新登录","/index/exit")
if trim(request.Cookies("cwku"))="" then call PopErr2("获取身份信息出错ES05，请重新登录","/index/exit")
if trim(request.Cookies("rzku"))="" then call PopErr2("获取身份信息出错ES06，请重新登录","/index/exit")

sql="select * from ayname where aynameid="&clng(request.Cookies("aynameid"))&"" 
rs.open sql,conn,1,1
if trim(request.Cookies("kamiku"))<>trim(rs("kamiku")) then call PopErr2("系统数据已更新ES01，请重新登录","/index/exit")
if trim(request.Cookies("flku"))<>trim(rs("flku")) then call PopErr2("系统数据已更新ES01，请重新登录","/index/exit")
if trim(request.Cookies("spku"))<>trim(rs("spku")) then call PopErr2("系统数据已更新ES02，请重新登录","/index/exit")
if trim(request.Cookies("ddku"))<>trim(rs("ddku")) then call PopErr2("系统数据已更新ES03，请重新登录","/index/exit")
if trim(request.Cookies("cwku"))<>trim(rs("cwku")) then call PopErr2("系统数据已更新ES04，请重新登录","/index/exit")
if trim(request.Cookies("rzku"))<>trim(rs("rzku")) then call PopErr2("系统数据已更新ES05，请重新登录","/index/exit")
istelrz=rs("istelrz")
ismailrz=rs("ismailrz")
ayxiaofei=rs("ayxiaofei")
aydongjie=rs("aydongjie")

if ccur(rs("aychengjiao"))>0 then 
	if isnull(trim(rs("aygename")))=true or trim(rs("aygename"))="" then
	call PopErr2("还未设置店铺个性链接，请尽快设置，个性链接是店铺首页的唯一链接","mylink")
	end if
end if
%>	

<table width="98%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="35">
      <span style="font-size: 18px; font-weight: bold">
        <%if hour(now())>0 and hour(now())<5 then response.Write "凌晨好 "
if hour(now())>4 and hour(now())<9 then response.Write "早上好 "
if hour(now())>8 and hour(now())<12 then response.Write "上午好 "
if hour(now())>11 and hour(now())<14 then response.Write "中午好 "
if hour(now())>13 and hour(now())<19 then response.Write "下午好 "
if hour(now())>18 and hour(now())<22 then response.Write "晚上好 "
if hour(now())>21 and hour(now())<=24 then response.Write "深夜好 "
if hour(now())>=0 and hour(now())<=4 then response.Write "凌晨好 "
%>
<%=rs("aytrueuser")%></span>
      
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

	<!--
	  <%if rs("ismailrz")=1 then%>
      <img src="<%=ossurl%>images/renzheng/rzmail.jpg" alt="已认证" width="25" height="25" title="已认证"/>
      <%else%>
      <a href="mailrenzheng"><img src="<%=ossurl%>images/renzheng/rzmailh.jpg" alt="未认证" width="25" height="25" border="0" title="未认证"/></a>
	  <%end if%>
	-->
    
      &nbsp;
      <%if rs("istelrz")=1 then%>
      <img src="<%=ossurl%>images/renzheng/rztel.jpg" alt="手机已认证" width="25" height="25" title="手机已认证"/>
      <%else%>
      <a href="renzheng"><img src="<%=ossurl%>images/renzheng/rztelh.jpg" alt="手机未认证" width="25" height="25" border="0" title="手机未认证"/></a>
      <%end if%>
      
      &nbsp;
      <%if rs("sfzisok")=1 then%>
      <img src="<%=ossurl%>images/renzheng/sfz1.jpg" alt="实名已认证" width="30" height="24" title="实名已认证"/>
      <%else%>
      <a href="renzheng"><img src="<%=ossurl%>images/renzheng/sfz2.jpg" alt="实名未认证" width="30" height="24" border="0" title="实名未认证"/></a>
      <%end if%>
      
      &nbsp;
      <%if rs("ayisxiaobao")=1 then%>
      <a href="vip"><img src="<%=ossurl%>images/renzheng/vip1.jpg" alt="VIP会员" width="36" height="23" border="0" title="VIP会员"/></a>
      <%else%>
      <a href="/user/chong"><img src="<%=ossurl%>images/renzheng/vip1_2.jpg" alt="非VIP会员" width="36" height="23" border="0" title="非VIP会员"/></a>
      <%end if%>
      
      &nbsp;
      <%if rs("ischengxin")=1 then%>
      <img src="<%=ossurl%>images/kexin.gif"  height="25" border="0" 
	  title="
【系统自动评定】
需要开通VIP会员
完成手机认证与实名认证，并且有一定交易量
不含有虚假/无效卡密 
可以积极处理收到的投诉
可信商家支持开通代理功能，支持加急提现与秒结算
提示：未能积极处理投诉问题，将取消可信标识"/>
      <%else%>
      <img src="<%=ossurl%>images/kexin2.gif" height="25" border="0" 
	  title="
【系统自动评定】
需要开通VIP会员
完成手机认证与实名认证，并且有一定交易量
不含有虚假/无效卡密 
可以积极处理收到的投诉
可信商家支持开通代理功能，支持加急提现与秒结算
提示：未能积极处理投诉问题，将取消可信标识"/>
      <%end if%>	
      
      &nbsp;
      <%if rs("isvipid")=0 then%>
      <a href="vip"><img src="<%=ossurl%>images/vip2.gif" alt="非尊贵VIP" width="26" height="26" border="0" title="年费<%=vipj%>元
【尊贵VIP享有的特权】
嵌套代码权限
1-4位个性短链接
不限次数修改个性链接
不限短信通知次数
查看代理需求信息
平台推荐推广
享受结算优先
投诉问题专人处理"/></a>
      <%else%>
      <a href="vip"><img src="<%=ossurl%>images/vip1.gif" alt="尊贵VIP" width="26" height="26" border="0" title="到期时间<%if isnull(trim(rs("vipdate")))=false and trim(rs("vipdate"))<>"" then response.Write DateValue(rs("vipdate"))%>
尊贵VIP享有的特权
使用嵌套代码
1-4位个性短链接
不限次数修改个性链接
不限短信通知次数
查看代理需求信息
平台推荐推广
享受结算优先
投诉问题专人处理"/></a>
      <%end if%>
      	

      



      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <span style="font-weight: bold; color: #FF6600; font-size:15px">您已签署并遵守[电子协议]：<a href="/index/xieyi" target="_blank" style="color: #FF6600">《寄售平台服务协议》</a></span>
      <br>

      </td>
    </tr>
</table></TD>
    </TR>
  <TR>
    <TD width="25%" height="30">
    <%zhye=ccur(rs("ayyue"))+ccur(rs("ayalipayyu"))%>
    账户余额：<span id="chaxunyue" style="cursor:pointer" onClick="chayu()"><strong class="red">***.**</strong></span> 元
      <%
	  jiesuanfangshi=rs("ayjiesuanms")
	  %>
      <input name="yu" type="hidden" id="yu" value="<%=zhye%>">
      </TD>
    <TD width="25%">今日收入：<strong><span title="只统计成功订单金额,不含充值,收款,返款,解冻消保金,引荐返点金额,代理入款" id="jinjin"><img src="<%=ossurl%>images/jload.gif" /></span></strong> 元</TD>
    <TD width="25%">累计成交订单：<strong><%=rs("aychengjiao")%></strong> 笔</TD>
    <TD width="25%">
    结算模式：
      <%
	  if cint(rs("ayjiesuanms"))=1 then response.Write("大额结算模式")
	  if cint(rs("ayjiesuanms"))=2 then response.Write("中额结算模式")
	  if cint(rs("ayjiesuanms"))=3 then response.Write("系统自动结算")
	  if cint(rs("ayjiesuanms"))=4 then response.Write("小额结算模式")
	  if cint(rs("ayjiesuanms"))=5 then response.Write("手动提现模式")
	   %>
       </TD>
  </TR>
  

  <TR>
    <TD height="30">今日成交订单：<STRONG><span id="jindd"><img src="<%=ossurl%>images/jload.gif"></span></STRONG> 笔</TD>
    <TD>今日卖出卡量：<STRONG><span id="jinkami"><img src="<%=ossurl%>images/jload.gif"></span></STRONG> 张</TD>
    <TD>今日卖出成本：<STRONG><span id="jincb"><img src="<%=ossurl%>images/jload.gif"></span></STRONG> 元</TD>
    <TD>今日获得利润：<STRONG><span title="已扣除平台手续费" id="jlirun"><img src="<%=ossurl%>images/jload.gif"></span></STRONG> 元</TD>
  </TR>
  <TR>
    <TD height="30">昨日成交订单：<STRONG><span id="zjindd"><img src="<%=ossurl%>images/jload.gif"></span></STRONG> 笔</TD>
    <TD>昨日获得利润：<STRONG><span title="已扣除平台手续费" id="zlirun"><img src="<%=ossurl%>images/jload.gif"></span></STRONG> 元</TD>
    <TD>上次结算金额：<STRONG><span id="lastjiesuan"><img src="<%=ossurl%>images/jload.gif"></span></STRONG> 元</TD>
    <TD>上次结算时间：<span id="lastjiesuandate"><img src="<%=ossurl%>images/jload.gif"></span></TD>
  </TR>

  
  </TBODY></TABLE>


<br>
	<DIV class=right_title>快捷操作</DIV>
	<TABLE width="99%" align="center" class=table_style_1 > 
  <TBODY>
  <TR>
    <TD width="30"><A href="myname"><IMG align=absMiddle src="<%=ossurl%>images/00.gif" width=30  height=35></A></TD>
    <TD>&nbsp;<a href="myname">商家信息</a></TD>
    <TD width="30"><A href="anquan"><IMG src="<%=ossurl%>images/11.gif" width=30 height=35 border="0" align=absMiddle></A></TD>
    <TD>&nbsp;<a href="anquan">修改密码</a></TD>
    
    <TD width="30"><A href="jiesuan"><IMG src="<%=ossurl%>images/22.gif" width=30 height=35 border="0" align=absMiddle></A></TD>
    <TD>&nbsp;<a href="tixian">余额提现</a></TD>
        
    <TD width="30"><A href="chong"><IMG src="<%=ossurl%>images/44.gif" width=30 height=35 border="0" align=absMiddle></A></TD>
    <TD>&nbsp;<a href="chong">账户充值</a></TD>
  </TR>

  <TR>
    <TD><A href="mydingdan"><IMG src="<%=ossurl%>images/33.gif" width=30 height=35 border="0" align=absMiddle></A></TD>
    <TD>&nbsp;<a href="mydingdan">订单管理</a></TD>
    <TD><A href="mylink"><IMG src="<%=ossurl%>images/66.gif" width=30 height=35 border="0" align=absMiddle></A></TD>
    <TD>&nbsp;<a href="mylink">店铺链接</a></TD>
    <TD><A href="goodlist"><IMG src="<%=ossurl%>images/77.gif" width=30 height=35 border="0" align=absMiddle></A></TD>
    <TD>&nbsp;<a href="goodlist">商品列表</a></TD>
    <TD><A href="kaadd"><IMG src="<%=ossurl%>images/55.gif" width=30  height=35 border="0" align=absMiddle></A></TD>
    <TD>&nbsp;<a href="kaadd">添加卡密</a></TD>
  </TR>

  </TBODY></TABLE>
<%
rs.close
%>

<div id="protect">
<p><span style="font-size: 14px"><strong>郑重警告！！！</strong></span></p>
<p style="font-size: 14px"><%=zidingyi1%></p>
<p style="font-size: 14px"><%=zidingyi2%></p>
</div>

<H2><SPAN>站内通知</SPAN></H2>
<TABLE width="99%" align="center" style="width:100%;border-left:1px solid #ccc;border-right:1px solid #ccc;border-BOTTOM:1px solid #ccc">
  <TBODY>
  				<%
				sql="select * from aytongzhi where t6=1 and aytongzhikejian=0 order by aytongzhisx,aytongzhiid desc" 
				rs.open sql,conn,1,1
				if rs.bof and rs.eof then
				rs.close
				response.Write("暂无最新信息")
				else
				rs.pagesize=10
				pagecount=rs.pagecount 
				if request("page")="" then 
				page=1
				else
				page=int(request("page")) 
				end if
				if page<=0 then page=1 
				if request("page")="" then page=1
				rs.absolutepage=page
				do while not rs.eof%>
  <TR>
    <TD style="TEXT-ALIGN: center; COLOR: #666" height=25 width=10%><%=DateValue(rs("aytongzhidate"))%></TD>
    <TD width="90%"><SPAN style="COLOR: #333; FONT-SIZE: 18px">·</SPAN>	<A href="/notice/<%=trim(rs("suijiid"))%>" target="_blank" style="<%=rs("aytongzhibtys")%>">
	<%
				if len(trim(rs("aytongzhibiao")))>55 then
				response.Write left(rs("aytongzhibiao"),55)&"……"
				else
				response.Write rs("aytongzhibiao")
				end if
	
	
	%>
	
	</A>	</TD>
  </TR>
				<%n=n+1
				rs.movenext 
				if n>=rs.pagesize then exit do 
				loop
				zongshu=rs.RecordCount
				rs.close
				end if%> 
 
  <TR>
    <TD height=30 colSpan=2 align="center">
	<%
link="index?cact="
call pageye()%></TD>
  </TR></TBODY></TABLE>

</DIV>
</DIV>
<DIV class=clear></DIV></DIV>
</DIV>

<%'今日收入  今4号-aa3号 1
jinjin=0 '今日收入
jindd=0 '今日笔数
jinkami=0 '今日卖出卡量
jincb=0 '今日卖出成本
jlirun=0 '今日卖出利润
jfei=0   '今日手续费
chengben=0
jlir=0

zjindd=0 '昨日订单笔数
zlirun=0 '昨日利润
zlirunsum=0  '昨日成本
zfei=0
sql="select aydingdanin,aydingdansj,aydingdanuser,aydingdanzt,aydingdanzj,ayddquantity,aydingdancb from "&request.Cookies("ddku")&" where aydingdanuser="&clng(request.Cookies("aynameid"))&" and datediff(day,aydingdansj,'"&now()&"')<=1 and aydingdanzt=1" 
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
	do while not rs.eof
		fei=0
		if datediff("d",rs("aydingdansj"),now())=0 then '今日
		jindd=jindd+1
		jinjin=ccur(jinjin)+ccur(rs("aydingdanzj"))
		jinkami=ccur(jinkami)+ccur(rs("ayddquantity"))
		chengben=ccur(rs("ayddquantity"))*ccur(rs("aydingdancb")) '今日卖出成本价
		jincb=ccur(jincb)+ccur(chengben)  '今日累计成本
		jlir=ccur(rs("aydingdanzj"))-ccur(chengben)  '今日利润
		jfei=ccur(jfei)+ccur(rs("aydingdanzj"))-ccur(rs("aydingdanin")) '今日手续费

		fei=ccur(rs("aydingdanzj"))-ccur(rs("aydingdanin"))
		jlirun=ccur(jlirun)+ccur(jlir)-ccur(fei)        '今日累计利润
		
		
		elseif datediff("d",rs("aydingdansj"),now())=1 then '昨日
		zjindd=zjindd+1
		zlirunsum=ccur(rs("ayddquantity"))*ccur(rs("aydingdancb")) '成本
		lirun=ccur(rs("aydingdanzj"))-ccur(zlirunsum)      '累计成本
		
		zfei=ccur(zfei)+ccur(rs("aydingdanzj"))-ccur(rs("aydingdanin")) '昨日手续费
		fei=ccur(rs("aydingdanzj"))-ccur(rs("aydingdanin"))
		
		zlirun=ccur(zlirun)+ccur(lirun)-ccur(fei)
		end if
	rs.movenext 
	loop
end if
rs.close
if ccur(zlirun)<0 then zlirun=0
if ccur(jlirun)<0 then jlirun=0
%>	
<script language="javascript">jinjin.innerHTML ="<%=Formatnumber(jinjin,2,true,-1,0)%>";jindd.innerHTML ="<%=jindd%>";</script>
<script language="javascript">zjindd.innerHTML ="<%=zjindd%>";zlirun.innerHTML ="<%=Formatnumber(zlirun,2,true,-1,0)%>";</script>
<script language="javascript">jinkami.innerHTML ="<%=jinkami%>";</script>
<script language="javascript">jincb.innerHTML ="<%=Formatnumber(jincb,2,true,-1,0)%>";jlirun.innerHTML ="<%=Formatnumber(jlirun,2,true,-1,0)%>";</script>


<%'上次结算金额
lastjies=0
lastjiesdate="未结算过"
sql="select top 1 aycaiwujine,aycaiwuleibie,aycaiwuuser,aycaiwudate from "&request.Cookies("cwku")&" where aycaiwuuser="&clng(request.Cookies("aynameid"))&" and aycaiwuzt=1 and (aycaiwuleibie=1 or aycaiwuleibie=9) order by aycaiwuid desc" 
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
lastjies=rs("aycaiwujine")
lastjiesdate=DateValue(rs("aycaiwudate"))
end if
rs.close
%>	
<script language="javascript">lastjiesuan.innerHTML ="<%=Formatnumber(lastjies,2,true,-1,0)%>";lastjiesuandate.innerHTML ="<%=lastjiesdate%>";</script>



<%
rs.open "select ayxiaojin,ayjiesuanzhouqi from ayquanju" ,conn,1,1
ayujbtxje=rs("ayxiaojin")
ayjiesuanzhouqi=rs("ayjiesuanzhouqi")
rs.close

if cint(istelrz)=0 or cint(ismailrz)=0 then ayjiesuanzhouqi=jiesuanzhouqi2
	
if cint(request.Cookies("ayjibie"))=1 or cint(request.Cookies("ayjibie"))=2 or cint(request.Cookies("ayjibie"))=3 or cint(request.Cookies("ayjibie"))=4 or cint(request.Cookies("ayjibie"))=6 then
	rs.open "select ayujbtxje,ayujbjsday,ayujbgid from ayujb where ayujbgid="&request.Cookies("ayjibie")&"" ,conn,1,1
	ayujbtxje=rs("ayujbtxje")		  '允许提现最小金额
	ayjiesuanzhouqi=rs("ayujbjsday")  '结算周期
	rs.close
	
	if cint(istelrz)=0 or cint(ismailrz)=0 then
		if ccur(ayujbjsday)<ccur(jiesuanzhouqi2) then 
		ayjiesuanzhouqi=jiesuanzhouqi2
		end if
	end if
end if


if cint(jiesuanfangshi)<>5 then  '自动结算模式

'本期应结算 未结算金额
sql="select aycaiwuuser,aycaiwudate,aycaiwuisjs,isalipayfz,aycaiwuzt,aycaiwuleibie,aycaiwujine from "&request.Cookies("cwku")&" where aycaiwuuser="&clng(request.Cookies("aynameid"))&" and isalipayfz=0 and aycaiwuzt=1" 
rs.open sql,conn,1,1 
minje=0 '本期应结算
kouchu=0
minje2=0 '本期未结算
kouchu2=0
minje3=0 '本期已结算
if not(rs.bof and rs.eof) then
do while not rs.eof

if cint(rs("aycaiwuisjs"))=0 then
if datediff("d",rs("aycaiwudate"),now())>=cint(ayjiesuanzhouqi) then '应结算

if rs("aycaiwuleibie")=0 or rs("aycaiwuleibie")=3 or rs("aycaiwuleibie")=4 or rs("aycaiwuleibie")=7 or rs("aycaiwuleibie")=8 or rs("aycaiwuleibie")=10 or rs("aycaiwuleibie")=12 or rs("aycaiwuleibie")=17 or rs("aycaiwuleibie")=18 then
minje=ccur(minje)+ccur(rs("aycaiwujine"))
end if

if rs("aycaiwuleibie")=2 or rs("aycaiwuleibie")=5 or rs("aycaiwuleibie")=6 or rs("aycaiwuleibie")=11 or rs("aycaiwuleibie")=13 or rs("aycaiwuleibie")=14 or rs("aycaiwuleibie")=15 or rs("aycaiwuleibie")=16 then
kouchu=ccur(kouchu)+ccur(rs("aycaiwujine"))
end if

else '未结算

if rs("aycaiwuleibie")=0 or rs("aycaiwuleibie")=3 or rs("aycaiwuleibie")=4 or rs("aycaiwuleibie")=7 or rs("aycaiwuleibie")=8 or rs("aycaiwuleibie")=10 or rs("aycaiwuleibie")=12 or rs("aycaiwuleibie")=17 or rs("aycaiwuleibie")=18 then
minje2=ccur(minje2)+ccur(rs("aycaiwujine"))
end if
		
if rs("aycaiwuleibie")=2 or rs("aycaiwuleibie")=5 or rs("aycaiwuleibie")=6 or rs("aycaiwuleibie")=11 or rs("aycaiwuleibie")=13 or rs("aycaiwuleibie")=14 or rs("aycaiwuleibie")=15 or rs("aycaiwuleibie")=16 then
kouchu2=ccur(kouchu2)+ccur(rs("aycaiwujine"))
end if

end if
end if

if cint(rs("aycaiwuleibie"))=1 and datediff("d",rs("aycaiwudate"),now())=0 then '本期已结算
minje3=ccur(minje3)+ccur(rs("aycaiwujine"))
end if

rs.movenext  
loop
end if
rs.close
%>



<%end if%>

<br>
<iframe src="/user/aoto.asp" frameborder="0" scrolling="No" height="0" width="0"></iframe>

	<!--#include virtual="/show/foot.asp"-->


