<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<TABLE align="center" cellSpacing=0 cellPadding=0 border=0>
    <TR> 
      <TD width="165" vAlign=top>
	   <% if LngUserID="0" then 
	  		 %>
	   <table width=100% border=0 align=center cellpadding=0 cellspacing=0>
<tr><td width="100" border=0></td></tr>
          <form name=loginfo method=post action="chkuser.asp">
            
            <tr> 
              <td style='padding-left:5px' height="25">用户名：
                <input name=username type=text class="input_sr" size="12">              </td>
            </tr>
            <tr> 
            <td style='padding-left:5px' height="25">密　码：
            <input name=UserPassword type=password class="input_sr" size="12">            </tr>
            <tr> 
              <td style='padding-left:5px' height="25">验证码：
                <input name=passcode type=text class="input_sr" size=4 maxlength="4">
              <img src="code.asp"></td>
		    </tr>
            <tr> <td colspan="2" align="center" height="25">
                <input name=Submit type=submit class="input_bot" onClick="return checkuu();" value="登录">
				<input name="Submit1" type="button" class="input_bot" onClick="location.href='reg.asp';" value="注册"> 
				<input name="Submit2" type="button" class="input_bot" onClick="location.href='repassw.asp?action=repass';" value="忘密">
            </td></tr>
          </form>
        </table>
<%
else 

dim IntOrderNum
set rsvip=server.CreateObject("adodb.recordset")
rsvip.Open "select distinct(goods) from orders where username='"&strUserName&"' and state=2 ",conn,1,1
IntOrderNum = rsvip.recordcount
rsvip.Close

rsvip.open "select [User].grpid,username,GrpID,b2b_userjb.GrpName,bookzt,b2b_userjb.Stars from [User] Inner Join b2b_userjb On [User].GrpID = b2b_userjb.GrpID where username='"&strUserName&"' ",conn,1,1

strTitle = rsVip("GrpName")
bookzt=rsVip("bookzt")
LngDiscount = rsVip("Stars")
rsvip.close
set rsvip=nothing 

if IntOrderNum=0 then %>

<table width="100%" border="0" cellspacing="1" cellpadding="1" align="center">
<tr><td width="100" background=images/bg_04.gif border=0></td></tr>
  
  <tr height=20>
    <td height="26">欢迎<font color=FF6600><% = strUserName %></font>&nbsp;您是<font color=FF6600><% = strTitle %></font></td>
  </tr>

  <tr>
    <td height=26>您目前没有未处理订单</td>
  </tr>
  <tr>
    <td height=26>共计:0.00元</td>
  </tr>
  <tr><td align="center" height=26><a href=profile.asp?action=profile>用户中心</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=logout.asp>注销登录</a></td></tr>
</table>

<%

else
dim shopjiage
shopjiage = 0
set rs=server.CreateObject("adodb.recordset")
rs.open "select product.vipprice,product.amount,product." & LstPrice & ",orders.productnum from product inner join orders on product.id=orders.id where orders.state=2 and orders.username='"&trim(strUserName)&"' ",conn,1,1
do while not rs.eof
shopjiage=shopjiage+(rs("" & LstPrice & "")+rs("vipprice"))*rs("productnum")
rs.movenext
loop 
shopjiage=round(shopjiage,2)
%>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"><%
							  if session("uid")<>"" then
							  	mSql="select Count(*) as Num from welcomemesbuy where UserID='"&Session("uID")&"' and isLook=False"
								set mRs=conn.execute(mSql)
								smsg=mRs("Num")
								if mRs("Num")<>0 then
									response.write "<a href='profile.asp?action=profile'>"
									response.Write "<font color='#ff0000'>"
									response.Write "<b>"
									response.Write "您有新的消息，请查收！"
									response.Write "</b>"
									response.Write "</font>"
									response.Write "<img border='0' src='image/mespic.gif' align='absmiddle'>"
									response.Write "</a>"
									end if
								mRs.close
								set mRs=nothing
							  end if
							  %>
							  	<script language="vbscript">
								<%if smsg<>0 then%>			       						   				
									document.write "<bgsound src='sound/newmsg.mp3' loop='1'>"
								<%end if%>   
								</script></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="1" align="center">
<tr><td width="100" background=images/bg_04.gif border=0></td></tr>
  
  <tr>
    <td height=20>欢迎<font color=FF6600><% = strUserName %></font>&nbsp;您是<font color=FF6600><% = strTitle %></font></td>
  </tr>

  <tr>
    <td height=20>您目前有<font color="#FF6600">
      <% =IntOrderNum %></font>笔<a href="profile.asp?action=goods"><font color="#FF6600">未处理订单</font></a>	</td>
  </tr>
  <tr>
    <td height=20>共计：<font color="#FF6600">
    <% = shopjiage %></font>&nbsp;元(不含邮费)</td>
  </tr>
  <tr><td align="center" height=20><a href=profile.asp?action=profile>用户中心</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=logout.asp>注销登录</a></td></tr>
</table>
<%
end if 
rs.close	
end if %></TD>
    </TR>
</TABLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
  function checkuu()
{
    if(checkspace(document.loginfo.username.value)) {
	document.loginfo.username.focus();
    alert("用户名不能为空！");
	return false;
  }
    if(checkspace(document.loginfo.UserPassword.value)) {
	document.loginfo.UserPassword.focus();
    alert("密码不能为空！");
	return false;
  }
    if(checkspace(document.loginfo.passcode.value)){
	document.loginfo.passcode.focus();
	alert("验证码不能为空");
	return false;
	}
	
  }

//-->
</script> 