<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%

'If Request.ServerVariables("HTTP_X_FORWARDED_FOR")  <> "" Then
 '  Response.write "禁止代理访问"
  ' Response.end
'End If


If session("username")="" Then
Response.Redirect "default.asp"
end if

'验证会员资格
If not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
 Set dsreg = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_USER where username='"&session("username")&"'"
		dsreg.Open Sql,conn,1,1
session("usermoney")=dsreg("usermoney")
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html2")%>
欢迎您光临用户专区！
<%=htmlwrite("html3")%>
<br>
<br>
<table width="100%" height="100"  border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  <tr>
    <td align="center" bgcolor="#FFFFFF">　<img src="img/tip.gif" width="34" height="34" align="absmiddle">欢迎您： <strong><font face="Courier New, Courier, mono"><%=session("username")%></font></strong>　
<%If session("AgnRunasUser")=false then%>
可用金额：<font face="Arial, Helvetica, sans-serif">
<%=FormatNumber(dsreg("usermoney"),2,-1)%> </font>元 　等待入帐金额：<font face="Arial, Helvetica, sans-serif">
<%=FormatNumber(dsreg("waitmoney"),2,-1)%> </font>元<%Else'代理进入用户区

  Set dsagent = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_AGENT where username='"&session("username")&"'"
		dsagent.Open Sql,conn,1,1

%>
<%if session("agenttype")<>"子代理" then%><%=session("agenttype")%><%end if%>，您的代理角色的可用金额：<font face="Arial, Helvetica, sans-serif" color=red><%=FormatNumber(dsagent("usermoney"),2,-1)%> </font>元，等待入帐金额：<font face="Arial, Helvetica, sans-serif" color=red><%=FormatNumber(dsagent("waitmoney"),2,-1)%> </font>元，用户角色可用金额：<font face="Arial, Helvetica, sans-serif"><%=FormatNumber(dsreg("usermoney"),2,-1)%> </font>元，等待入帐金额：<font face="Arial, Helvetica, sans-serif"><%=FormatNumber(dsreg("waitmoney"),2,-1)%> </font>元，您在用户区所有的消费价格为代理成本价。


<%
dsagent.close
Set dsagent=nothing
end If
%>	登陆时间：<%=now%> IP：<%=Request.ServerVariables("REMOTE_ADDR")%>
<%if not isnull(dsreg("usernotice")) then%>
<br><%=dsreg("usernotice")%><br>　<a href="clearnotice.asp">我知道了>>></a>
<%end if
dsreg.close
set dsreg=nothing
%>

</td>
  </tr>
</table>
<br>
<table width="100%" height="120"  border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  <tr>
    <td align="center" bgcolor="#FFFFFF">
      <table width="98%"  border="0" cellspacing="0" cellpadding="0">
        <tr align="center">
          <td width="25%"><a href="/style/info/host.asp"><img src="img/1.jpg" alt="购买虚拟主机" width="110" height="86" border="0"></a><br>          </td>
          <td width="25%"><a href="/user/hostadm.asp"><img src="img/2.jpg" alt="虚拟主机管理" width="110" height="86" border="0"></a></td>
          <td width="25%"><a href="/user/aws.asp"><img src="img/5.jpg" alt="客服答疑" width="110" height="86" border="0"></a></td>
          <td width="25%"><a href="/user/moneylist.asp"><img src="img/3.jpg" alt="财务信息" width="110" height="86" border="0"></a></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<br>
<table width="100%"  border="0" cellspacing="0" cellpadding="0" id="table1">
    <tr>
      <td width="10" height="23" background="img/contopa.gif">&nbsp;</td>
      <td height="23" align="left" valign="top" background="img/contopb.gif"><table width="100%"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td height="8" colspan="3"></td>
          </tr>
          <tr>
            <td width="25">&nbsp;</td>
            <td align="left" valign="top"><font color="#FFFFFF"><strong><span class="tablebody2">内部通知</span></strong></font></td>
            <td width="10">&nbsp;</td>
          </tr>
      </table></td>
      <td width="10" height="23" background="img/contopc.gif">&nbsp;</td>
    </tr>
    <tr>
      <td background="img/conmid1.gif">&nbsp;</td>
      <td><%


	Set dslogin = Server.CreateObject("ADODB.Recordset")	
	Sql="Select top 10 * from FreeHost.FreeHost_News where type2=100 order by id desc"
if session("agentname")="n" then 	Sql="Select top 10 * from FreeHost.FreeHost_News where (username='freehost' and (type2=100 or type2=101)) or (username='"&session("agentname")&"' and (type2=100 or type2=101)) order by id desc" '直接用户
if session("agentname")<>"n" then 	Sql="Select top 10 * from FreeHost.FreeHost_News where (username='freehost' and  (type2=100 or type2=102)) or (username='"&session("agentname")&"' and (type2=102)) order by id desc" '代理名下用户

if session("agentname")=session("username") Then Sql="Select top 10 * from FreeHost.FreeHost_News where (username='freehost' and  (type2=100 or type2=102)) or (username='freehost' and (type2=103 or type2=104)) or (username='"&session("agentname")&"' and (type2=102)) order by id desc" '代理名下用户
if session("agentname")=session("username") and session("agenttype")<>"子代理" then ql="Select top 10 * from FreeHost.FreeHost_News where (username='freehost' and (type2=103 or type2=104))  order by id desc" '直接代理
'response.write sql
'	dslogin.PageSize = 10
	dslogin.Open Sql,conn,1,1
if dslogin.Eof then
%>
        <br><br>
数据库中不存在内部通知。
<%else%>
　

        <table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC">
          <tr bgcolor="#EEEEEE">
            <td width="19%" height="29" align="center" bgcolor="#EEEEEE">编号</td>
            <td width="38%" align="center">标题</td>
            <td width="20%" align="center">时间</td>
          </tr>
          <%
while not dslogin.eof
%>
          <tr bgcolor="#FFFFFF">
            <td width="19%" height="20" align="center" bgcolor="#FFFFFF"><%=dslogin("id")%></td>
            <td width="38%" align="center"><a href="/style/info/shownews.asp?id=<%=dslogin("id")%>" target=_blank><font color="#000000"><%=dslogin("title")%></font></a></td>
            <td width="20%" align="center"><%=dslogin("posttime")%><br>
            </td>
          </tr>
          <%

dslogin.movenext
wend%>
        </table>
      <%end if
dslogin.close
set dslogin=nothing%></td>
      <td width="10" background="img/conmid2.gif">&nbsp;</td>
    </tr>
    <tr>
      <td width="10" height="10"><img src="img/conend1.gif" width="10" height="10"></td>
      <td height="10" background="img/conend2.gif"></td>
      <td width="10" height="10"><img src="img/conend3.gif" width="10" height="10"></td>
    </tr>
</table>
  <br>
<table width="100%"  border="0" cellspacing="0" cellpadding="0" id="table1">
    <tr>
      <td width="10" height="23" background="img/contopa.gif">&nbsp;</td>
      <td height="23" align="left" valign="top" background="img/contopb.gif"><table width="100%"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td height="8" colspan="3"></td>
          </tr>
          <tr>
            <td width="25">&nbsp;</td>
            <td align="left" valign="top"><font color="#FFFFFF"><strong>登陆历史</strong></font></td>
            <td width="10">&nbsp;</td>
          </tr>
      </table></td>
      <td width="10" height="23" background="img/contopc.gif">&nbsp;</td>
    </tr>
    <tr>
      <td background="img/conmid1.gif">&nbsp;</td>
      <td><%


	Set dslogin = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Loginlog where username='"&session("username")&"'  order by logintime desc"
	dslogin.PageSize = 15
	dslogin.Open Sql,conn,1,1
%>
        <%
if dslogin.Eof then
%>
        <br><br>
数据库中不存在登陆的记录。
<%
else
if Request.ServerVariables("QUERY_STRING")<>"" then
ask=Split(Request.ServerVariables("QUERY_STRING"), chr(38)&"pn")
else
ask=Split("freehost=1", "")
ask(0)="freehost=lsoft"
end if
	pn=1
if Request.QueryString ("pn")<>"" then pn=Request.QueryString ("pn")
If dslogin.RecordCount <> 0 Then dslogin.AbsolutePage = CLng(pn)  
    if clng(pn)<=10 then
    begini=1
      if dslogin.PageCount<=10 then
       endini=dslogin.PageCount 
       else
       endini=10
      end if
    end if
%><br>
<%if clng(pn)<=10 then%>
最新
<%for i=begini to endini
    if clng(pn)=i then%>
<font color=red>[<%=i%>]</font>
<%else%>
<a href="?<%=ask(0)%>&pn=<%=i%>"><font color="#000000">[<%=i%>]</font></a>
<%end if%>
　
<%next%>
<%else%>
　
<a href="?<%=ask(0)%>&pn=1"><font color="#000000">最新[1]--[10]</font></a>　　现在是第<font color=red>[<%=pn%>]</font>页 　共<%=dslogin.PageCount%>页　
        <%end if%>
        <%If Clng(pn)>1 Then%>
        <a href="?<%=ask(0)%>&pn=<%=pn-1%>"><font color="#000000">上一页</font></a>
        <%End If%>
        |
        <%If Clng(pn)<dslogin.PageCount Then%>
        <a href="?<%=ask(0)%>&pn=<%=pn+1%>"><font color="#000000">下一页</font></a>
        <%End If%><br><br>
        <table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC">
          <tr bgcolor="#EEEEEE">
            <td width="6%" height="29" align="center" bgcolor="#EEEEEE">编号</td>
            <td width="11%" align="center">用户名</td>
            <td width="20%" align="center">时间</td>
            <td width="10%" align="center">登陆IP</td>
          </tr>
          <%
For N=1 To dslogin.PageSize 
					If dslogin.RecordCount=0 Then Exit For
%>
          <tr bgcolor="#FFFFFF">
            <td width="6%" height="20" align="center" bgcolor="#FFFFFF"><%=dslogin("id")%></td>
            <td width="11%" align="center"><%=dslogin("username")%></td>
            <td width="20%" align="center"><%=dslogin("logintime")%><br>
            </td>
            <td width="10%" align="center"><%=dslogin("ip")%> </td>
          </tr>
          <%
If clng(pn)=dslogin.PageCount Then
I = dslogin.RecordCount - (dslogin.PageCount-1) * dslogin.PageSize
If N=I Then Exit For
End If
dslogin.movenext
Next%>
        </table>
      <%end if
dslogin.close
set dslogin=nothing%></td>
      <td width="10" background="img/conmid2.gif">&nbsp;</td>
    </tr>
    <tr>
      <td width="10" height="10"><img src="img/conend1.gif" width="10" height="10"></td>
      <td height="10" background="img/conend2.gif"></td>
      <td width="10" height="10"><img src="img/conend3.gif" width="10" height="10"></td>
    </tr>
</table>
  <br>  
  <%=htmlwrite("html4")%>
<%
conn.Close
set conn=nothing
end if

if ef then
Response.Redirect "e.asp?e="&ec
end if%>
