<!--#include file="fuction.asp"-->
<%
'//////////////////////////订单查询
sub dindan()
if session("username")="" then
response.Redirect "user.asp"
response.End
end if
%>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>

<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <form name="form1" method="post" action="user.asp?action=dindan&zhuangtai=8">
  <tr bgcolor="#f1f1f1">
    <td height="25"><div align="center">Views By Date</div></td>
  </tr>
  <tr>
    <td height="40"> 
      
        From： 
          <select name="year1" class="wenbenkuang">
        <%for i=2008 to 2100%>
        <option value="<%=i%>"  <%if year(now())=i then%>selected<%end if%>><%=i%></option>
        <%next%>
      </select>
      - 
      <select name="month1" class="wenbenkuang">
        <%for i=1 to 12%>
        <option value="<%=i%>"  <%if year(date())=i then %>selected<% end if %>><%=i%></option>
        <%next%>
      </select>
      - 
      <select name="day1" class="wenbenkuang">
        <%for i=1 to 31%>
        <option value="<%=i%>"  ><%=i%></option>
        <%next%>
      </select>
       To： 
        <select name="year2" class="wenbenkuang">
        <%for i=2008 to 2100%>
        <option value="<%=i%>" ><%=i%> </option>
        <%next%>
      </select>
      - 
      <select name="month2" class="wenbenkuang">
        <%for i=1 to 12%>
        <option value=<%=i%>  ><%=i%> </option>
        <%next%>
      </select>
      - 
      <select name="day2" class="wenbenkuang">
        <%for i=1 to 31%>
        <option value=<%=i%>  <%if year(date())=i then%>selected<%end if%>><%=i%>        </option>
        <%next%>
      </select>  
      <input type="submit" class="go-wenbenkuang" name="Submit3" value="Submit to view">      </td>
  </tr>
  </form>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"  class="table-zuoshang">
 <tr bgcolor="f1f1f1"  class="a1"> 
    <td height="23" > <div align="center">Order Number</div></td>
    <td > <div align="center">Payment of The Goods</div></td>
    <td > <div align="center">Fare</div>
    <td > <div align="center">Order State</div></td>
  </tr>
  <%set rs=server.CreateObject("adodb.recordset")
  dim zhuangtai,lx
  zhuangtai=request.QueryString("zhuangtai")
    lx=request.QueryString("lx")
  if zhuangtai=0 or zhuangtai="" then
  select case zhuangtai
  case "0"
  rs.open "select distinct(dingdan),userzhenshiname,actiondate,shouhuoname,songhuofangshi,zhifufangshi,zhuangtai from shop_action where username='"&checkFFSQLStr(session("username"))&"' and zhuangtai<6 order by actiondate desc",conn,1,1
  case ""
  rs.open "select distinct(dingdan),userzhenshiname,actiondate,shouhuoname,songhuofangshi,zhifufangshi,zhuangtai from shop_action where username='"&checkFFSQLStr(session("username"))&"' and zhuangtai<5 order by actiondate desc",conn,1,1
  end select
  elseif zhuangtai=8 then
  day1=trim(Request.Form("year1"))&"-"&trim(Request.Form("month1"))&"-"&trim(Request.Form("day1"))
  day2=trim(Request.Form("year2"))&"-"&trim(Request.Form("month2"))&"-"&trim(Request.Form("day2"))
    rs.open "select distinct(dingdan),userzhenshiname,actiondate,shouhuoname,songhuofangshi,zhifufangshi,zhuangtai from shop_action where username='"&checkFFSQLStr(session("username"))&"'and (datediff(dd,actiondate,'"&day2&"')>=0)  and (datediff(dd,'"&day1&"',actiondate)>=0) and zhuangtai<6 order by actiondate",conn,1,1
  else
    if lx=2 then
    rs.open "select distinct(dingdan),userzhenshiname,actiondate,shouhuoname,songhuofangshi,zhifufangshi,zhuangtai from shop_action where username='"&checkFFSQLStr(session("username"))&"' and zhuangtai="&zhuangtai&" and  zhifufangshi='货到付款' order by actiondate",conn,1,1
else
    rs.open "select distinct(dingdan),userzhenshiname,actiondate,shouhuoname,songhuofangshi,zhifufangshi,zhuangtai from shop_action where username='"&checkFFSQLStr(session("username"))&"' and zhuangtai="&zhuangtai&" and  zhifufangshi<>'货到付款' order by actiondate",conn,1,1
  end if
end if
  do while not rs.eof
   %>
  <tr bgcolor="#FFFFFF"> 
    <td height="23" bgcolor="#FFFFFF" > <div align="center"><a href="javascript:;" onClick="javascript:window.open('dingdan.asp?dan=<%=trim(rs("dingdan"))%>','','width=770,height=420,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"><%=trim(rs("dingdan"))%></a></div></td>
    <td > <div align="center"> 
        <%dim snsn,rs2
	set snsn=server.CreateObject("adodb.recordset")
	snsn.open "select sum(zonger) as zonger from shop_action where dingdan='"&trim(rs("dingdan"))&"' ",conn,1,1
	response.write "<font color=#FF6600>"&formatnumber(round(snsn("zonger"),2),2)&"</font>"
	snsn.close
	set snsn=nothing%>
      </div></td>
    <td > <div align="center"> 
        <%
	set snsn=server.CreateObject("adodb.recordset")
	snsn.open "select feiyong from shop_action where dingdan='"&trim(rs("dingdan"))&"' ",conn,1,1
	response.write "<font color=#FF6600>"&formatnumber(round(snsn("feiyong"),2),2)&"</font>"
	snsn.close
	set snsn=nothing%>
      </div></td>
    <td > <div align="center"> 
        <%
		  select case rs("zhuangtai")
	case "1"
	response.write "Waiting to be processed！"
	case "2"
	if rs("zhifufangshi")="货到付款" then
	response.write "Order confirmed, being processed for shipping！"
	else
	response.write "Order confirmed, awaiting payment！"
    end if
	case "3"
	if rs("zhifufangshi")="货到付款" then
	response.write "Goods have been shipped！"
	else
	response.write "Payment received, being processed for shipping！"
    end if
	case "4"
	if rs("zhifufangshi")="货到付款" then
	response.write "Goods have been shipped, payment confirmed, thank you for your order！"
	else
	response.write "Goods have been shipped "
    end if
	case "5"
	response.write "Goods have been shipped, payment confirmed, thank you for your order！"
	end select%>
      </div></td>
  </tr>
  <%
   rs.movenext
  loop
  rs.close
  set rs=nothing%>
</table>
<%
end sub

sub myinfo()
if session("username")="" then
response.Redirect "user.asp"
response.End
end if
%>
<table width=98% border=0 align=center cellpadding=0 cellspacing=1 bgcolor="#CCCCCC"  class="table-zuoshang">
  <tr align="center" bgcolor="#FFFFFF"  class="a1"> 
    <td height="23" colspan="6" bgcolor="f1f1f1" > <b>My Information </b></td>
  </tr>
  <%
	set snsn=server.CreateObject("adodb.recordset")
	snsn.open "select * from [shop_user] where username='"&checkFFSQLStr(session("username"))&"' ",conn,1,1
	ky_jifen=snsn("jifen")
	%>
  <tr> 
    <td width="34%" height="23" align="center" bgcolor="f1f1f1" >Usertype</td>
    <td width="14%" height="23" align="center" bgcolor="f1f1f1" > 
      Login Times   </td>
    <td width="12%" align="center" bgcolor="f1f1f1" >Score</td>
    <td width="14%" align="center" bgcolor="f1f1f1" >Consumption</td>
    <td width="14%" align="center" bgcolor="f1f1f1" >Account</td>
    <td width="12%" align="center" bgcolor="f1f1f1" >Collection</td>
  </tr>
  <tr> 
    <td height="22" align="center" bgcolor="#FFFFFF" > 
      <%if session("reglx")=2 then%>
VIP
<%else%>
Member
<%end if%>
<%if session("reglx")=2 then%>
Deadline ：<font color="#FF0000"><%=snsn("vipdate")%></font>
<%end if%></td>
    <td height="22" align="center" bgcolor="#FFFFFF" ><%=snsn("logins")%></td>
    <td height="22" align="center" bgcolor="#FFFFFF" ><%=snsn("jifen")%></td>
    <td height="22" align="center" bgcolor="#FFFFFF" ><%
	set snsn1=server.CreateObject("adodb.recordset")
	snsn1.open "select sum(zonger) as sum_jine from shop_action where username='"&checkFFSQLStr(session("username"))&"' and zhuangtai<=5",conn,1,1
	if snsn1("sum_jine")>=0 then
	%><%=formatnumber(round(snsn1("sum_jine"),2),2)%><%
	else
	%>0<%
	end if
	snsn1.close
	set snsn1=nothing%></td>
    <td height="22" align="center" bgcolor="#FFFFFF" ><%=snsn("yucun")%></td>
    <td height="22" align="center" bgcolor="#FFFFFF" ><%
	set snsn1=server.CreateObject("adodb.recordset")
	snsn1.open "select count(*) as rec_count from shop_action where username='"&checkFFSQLStr(session("username"))&"' and zhuangtai=6",conn,1,1
	%><%=snsn1("rec_count")%><%snsn1.close
	set snsn1=nothing%></td>
  </tr>
  <%snsn.close
	set snsn=nothing%>
</table>
<%
end sub

sub jifen()
if session("username")="" then
response.Redirect "user.asp"
response.End
end if
%>
<table width=98% border=0 align=center cellpadding=0 cellspacing=0  class="table-zuoshang">
  <tr>
                        <td height="1" background="images/xian_001.gif"></td>
  </tr>
  <tr> 
    <td height=28 bgcolor=#FFFFFF> <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
      <tr align="center"> 
          <td height="22" bgcolor="f1f1f1">Award in Return</td>
          <td height="22" bgcolor="f1f1f1">Need Score</td>
          <td height="22" bgcolor="f1f1f1">Action</td>
        </tr>
        <%
	set snsn=server.CreateObject("adodb.recordset")
	snsn.open "select * from shop_jiangpin where xianshi=1 and kc>0",conn,1,1
	while not snsn.eof%>
        <tr> 
          <td height="22" bgcolor="#FFFFFF"><div align="center"><a href="listjp.asp?id=<%=snsn("shopid")%>" target=_blank><%=snsn("shopname")%></a></div></td>
          <td height="22" bgcolor="#FFFFFF" align="center"><div align="center"><%=snsn("jifen")%></div></td>
          <td height="22" bgcolor="#FFFFFF" align="center"><div align="center"><a href="jifen.asp?id=<%=snsn("shopid")%>&action=add">Choose It</a></div></td>
        </tr>
        <%
	snsn.movenext
	wend
	snsn.close
	set snsn=nothing%>
      </table></td>
  </tr>
  <%
	set snsn=server.CreateObject("adodb.recordset")
	snsn.open "select * from shop_action_jp where username='"&checkFFSQLStr(session("username"))&"' and zhuangtai=7",conn,1,1
	if snsn.recordcount>0 then%>
  <tr class="a1"> 
    <td height=22 bgcolor=<%=flbgbk%> align=center >&nbsp;</td>
  </tr>
  <tr> 
    <td height=28 bgcolor=<%=flbgbk%>> <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
        <tr align="center"> 
          <td height="22" bgcolor="f1f1f1" >Selected</td>
          <td height="22" bgcolor="f1f1f1" >Score Spened </td>
          <td height="22" bgcolor="f1f1f1" >Action</td>
        </tr>
        <%
	while not snsn.eof%>
        <tr bgcolor="#FFFFFF"> 
          <td height="22" > 
            <div align="center">
              <%
	set snsn1=server.CreateObject("adodb.recordset")
	snsn1.open "select * from shop_jiangpin where shopid="&snsn("shopid"),conn,1,1
	if snsn1.recordcount=1 then
	response.write "<a href='listjp.asp?id="&snsn("shopid")&"' target=_blank>"&snsn1("shopname")&"</a>"
	end if
	snsn1.close
	set snsn1=nothing%>
            </div></td>
          <td height="22" align="center" ><div align="center"><%=snsn("jifen")%></div></td>
          <td height="22" align="center" ><div align="center"><a href="jifen.asp?actionid=<%=snsn("actionid")%>&action=del">Delete It</a></div></td>
        </tr>
        <%
	snsn.movenext
	wend%>
    </table></td>
  </tr>
  <%end if
	snsn.close
	set snsn=nothing%>
</table>
<table width=98% border=0 align=center cellpadding=0 cellspacing=0  class="table-zuoshang">
  <tr class="a1">
    <td height="22" >&nbsp;</td>
  </tr>
  <tr class="a1">
    <td height="22" bgcolor="#CCCCCC" ><div align=center><strong>Introductions</strong></div></td>
  </tr>
  <tr>
    <td height="1" background="images/xian_001.gif"></td>
  </tr>
  <tr>
    <td ><table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
      <tr>
        <td><%set rs=server.createobject("adodb.recordset")
                              rs.open "select jfhj from shop_config ",conn,1,1
                              response.write rs("jfhj")
                              rs.close
                              set rs=nothing
                              %>        </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="1" background="images/xian_001.gif"></td>
  </tr>
  <tr class="a1">
    <td height=22 align="center" >&nbsp;</td>
  </tr>
  <%
	set snsn=server.CreateObject("adodb.recordset")
	snsn.open "select * from shop_action_jp where username='"&checkFFSQLStr(session("username"))&"' and zhuangtai=7",conn,1,1
	if snsn.recordcount>0 then%>
  <%end if
	snsn.close
	set snsn=nothing%>
</table>
<%
end sub

sub sqvip()
if session("username")="" or session("reglx")=2 then
response.Redirect "user.asp"
response.End
end if
%>
<table width=98% border=0 align=center cellpadding=0 cellspacing=0 class="table-zuoshang">
  <tr class="a1"> 
    <td height=22 > 
     <br> <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td>
            <%set rs=server.createobject("adodb.recordset")
                              rs.open "select vipsq from shop_config ",conn,1,1
                              response.write rs("vipsq")
                              rs.close
                              set rs=nothing
                              %>          </td>
        </tr>
      </table>
    <br></td>
  </tr>
  
  <tr> 
    <td height=28 bgcolor=#FFFFFF align=center > 
      <%set rs=server.createobject("adodb.recordset")
	rs.open "select vipid from shop_vipcount ",conn,1,1
	vipid=rs("vipid")
	rs.close
   %>
      <%
	set snsn=server.CreateObject("adodb.recordset")
	snsn.open "select jifen from [shop_user] where username='"&checkFFSQLStr(session("username"))&"' ",conn,1,1
	ky_jifen=snsn("jifen")
	snsn.close
	set snsn=nothing%><table width="95%" border="0" cellspacing="0" cellpadding="0">
  <tr>
          <td>            </td>
  </tr><tr>
                        <td height="1" background="images/xian_001.gif"></td>
                      </tr>
  <tr>
          <td> 
            <div align="center">
              <%if ky_jifen<vipid then%>
            <font color="#FF0000">You Can't be VIP because your score is not enough! </font>
            <%else%>
            <a href="?action=vipsq"><img src="<%=weburl%>images/vip01.gif" width="100" height="20" border="0"></a> 
            <%end if%>
            </div></td>
  </tr><tr>
                        <td height="1" background="images/xian_001.gif"></td>
                      </tr>
  <tr>
          <td>TIPS：
            <%if session("reglx")=2 then%>
            You are VIP now! 
                <%else%>
            Your score：<%=ky_jifen%> ，you need ：<%=vipid%> to be vip</td>
  </tr><tr>
                        <td height="1" background="images/xian_001.gif"></td>
                      </tr>
</table>

      <%					  set rs=nothing end if	%>    </td>
  </tr>
</table>
<%
end sub

sub vipsq()
if session("username")="" or session("reglx")=2 then
response.Redirect "user.asp"
response.End
end if
%>
<table width=98% border=0 align=center cellpadding=0 cellspacing=0 class="table-zuoshang">
  <tr class="a1"> 
    <td > 
      <%set rs=server.createobject("adodb.recordset")
	rs.open "select vipid from shop_vipcount ",conn,1,1
	vipid=rs("vipid")
	rs.close
   %>
      <%           set rssq=server.createobject("adodb.recordset")
                        rssq.open "select * from [shop_user] where username='"&nosql(session("username"))&"'",conn,1,3
						if rssq("reglx")=2 then
						elseif rssq("jifen")>=vipid then
                        rssq("reglx")=2
						rssq("jifen")= rssq("jifen")-vipid
						rssq("vipdate")=date()+365
						else
						response.write "<script language=javascript>alert('您的积分不足！如有疑问请咨询网站客服！');window.history.go(-1);</script>"
						response.end
						end if
                       rssq.update
                        rssq.close
                        set rssq=nothing
                        %>
      <%
	set snsn=server.CreateObject("adodb.recordset")
	snsn.open "select jifen from [shop_user] where username='"&checkFFSQLStr(session("username"))&"' ",conn,1,1
	ky_jifen=snsn("jifen")
	snsn.close
	set snsn=nothing%>
      <table width="95%" border="0" cellspacing="0" cellpadding="0">
        <tr>
                        <td height="1" background="images/xian_001.gif"></td>
        </tr>
        <tr> 
          <td height="22"><div align="center" class="STYLE1"><strong>Congratulate</strong>，You are VIP now! </div></td>
        </tr><tr>
                        <td height="1" background="images/xian_001.gif"></td>
                      </tr>
        <tr> 
          <td>&nbsp;</td>
        </tr>
      </table>
      <%						  set rs=nothing%>
    </td>
  </tr>
</table>
<%
end sub

sub viphd()
if session("username")="" or session("reglx")=1 then
response.Redirect "user.asp"
response.End
end if
%>
<table width=98% border=0 align=center cellpadding=0 cellspacing=0 class="table-1">
  <tr>
    <td bgcolor="#FFFFFF"> 
      <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td>
            <%set rs=server.createobject("adodb.recordset")
                              rs.open "select viphd from shop_config ",conn,1,1
                              response.write rs("viphd")
                              rs.close
                              set rs=nothing
                              %>
          </td>
        </tr>
      </table>
    </td>
</tr>
</table>
<%
end sub

sub shoucang()
if session("username")="" then
response.Redirect "user.asp"
response.End
end if
%>
<script language="JavaScript">
<!--
var newWindow = null
function windowOpener(loadpos)
{	
  newWindow = window.open(loadpos,'newwindow','width=450,height=350,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');
	newWindow.focus();
}

//-->
</script>
<table width=98% border=0 align=center cellpadding=2 cellspacing=2><tr>
    <td width=7% > </td>
    <td width=93% valign=baseline> 
      <div align=right>您最多只能收藏十种商品</div></td></tr></table>
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select shop_action.actionid,shop_action.shopid,wygkcn_shop.shopname,wygkcn_shop.shichangjia,wygkcn_shop.huiyuanjia,wygkcn_shop.vipjia,wygkcn_shop.dazhe from wygkcn_shop inner join  shop_action on wygkcn_shop.shopid=shop_action.shopid where shop_action.username='"&checkFFSQLStr(session("username"))&"' and shop_action.zhuangtai=6",conn,1,1 
%>
<table width=98% border=0 align=center cellpadding=0 cellspacing=1 bgcolor="#CCCCCC" class="table-zuoshang">
  <form action="sctogw.asp" method=post name=form1 >
   <tr bgcolor="f1f1f1"  class="a1"> 
      <td width=8% height="22" > <div align=center>选择</div></td>
      <td width=42% height="22" bgcolor="f1f1f1" >&nbsp;商品名称</td>
      <td width=14% height="22" > <div align=center>市场价</div></td>
      <td width=14% height="22" > <div align=center>Member Price:</div></td>
      <td width=14% height="22" > <div align=center>VIP 价</div></td>
      <td width=8% height="22" > <div align=center>删除</div></td>
    </tr>
    <%do while not rs.eof%>
    <tr bgcolor="#FFFFFF"> 
      <td height="22" > <div align=center> 
          <input name=shopid type=checkbox checked value="<%=rs("shopid")%>" >
        </div></td>
      <td STYLE='PADDING-LEFT: 5px' height="22" > <div align=left>&nbsp;<a href=list.asp?id=<%=rs("shopid")%> target=_blank><%=rs("shopname")%></a></div></td>
      <td height="22" > <div align=center><s><%=rs("shichangjia")%></s></div></td>
      <td height="22" > <div align=center><%=rs("huiyuanjia")%></div></td>
      <td height="22" > <div align=center><%=rs("vipjia")%></div></td>
      <td height="22" > <div align=center><a href=shoucang.asp?action=del&actionid=<%=rs("actionid")%>&ll=1><img src=img/trash.gif width=18 height=18 border=0></a></div></td>
    </tr>
    <%
rs.movenext
loop
rs.close
set rs=nothing
%>
    <tr bgcolor="#FFFFFF"> 
      <td height=25 colspan=6 > <div align="center"> 
          <input name="Submit" type="submit" class="go-wenbenkuang" value="放入购物车">
        </div></td>
    </tr>
  </form>
</table>
<%
end sub

sub myshhr()
if session("username")="" then
response.Redirect "user.asp"
response.End
end if
%>
<table width=98% border=0 align=center cellpadding=0 cellspacing=1>
  <tr bgcolor="#FFFFFF"> 
    <td height="25" colspan="7" bgcolor="#FFFFFF" > 
      <div align="left"><img src="<%=weburl%>images/arrow03.gif" width="4" height="6" /> <a href="myshhr.asp">Add Shipping Information Or Contact Information</a> </div></td>
  </tr>
</table>
<%set rs=server.createobject("adodb.recordset")
		rs.open "select * from shop_myshouhuoren where username='"&checkFFSQLStr(session("username"))&"'order by id asc",conn,1,1
		if rs.recordcount=0 then 
		%>
<table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
  <tr> 
    <td align=center>No Information ! <a href="myshhr.asp" class="STYLE1">Add It</a></td>
  </tr>
</table>
<%
		else
	  		rs.PageSize =30 '每页记录条数
			iCount=rs.RecordCount '记录总数
			iPageSize=rs.PageSize
    		maxpage=rs.PageCount 
    		page=request("page")
    
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
    
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
    
    rs.AbsolutePage=Page

	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
	%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  <tr> 
    <td width="14%" height="22" bgcolor="f1f1f1" > 
      <div align="center">Name</div></td>
    <td width="8%" bgcolor="f1f1f1" > 
      <div align="center">Sex</div></td>
    <td width="40%" bgcolor="f1f1f1" > 
    <div align="center">Address</div></td>
    <td width="11%" bgcolor="f1f1f1" > 
    <div align="center">Code</div></td>
    <td width="14%" bgcolor="f1f1f1" > 
      <div align="center">Created Time</div></td>
    <td colspan="2" bgcolor="f1f1f1" > 
      <div align="center">Action</div></td>
  </tr><%
			For i=1 To x
			%>
  <tr bgcolor="#FFFFFF"> 
    <td width="14%" height=23 align=left bgcolor="#FFFFFF">&nbsp;&nbsp;<img src="images/dot_03.gif" width="9" height="9" border="0"> 
      <%=rs("shhrname")%></td>
    <td width="8%" align=left> 
      <div align="center">
	  <%if rs("shhrsex")=1 then
	  Response.Write ("male")     
	  elseif   rs("shhrsex")=2 then
	  	  Response.Write ("female") 
	 else   
	 	  	  Response.Write ("secret") 
			  end if
	  %></div></td>
    <td width="40%" align=left bgcolor="#FFFFFF"> 
    <div align="center"><%=rs("shhrdz")%></div></td>
    <td width="11%" align=left> 
    <div align="center"><%=rs("shhryb")%></div></td>
    <td width="14%" align=left> 
      <div align="center"><%=year(rs("shhrdate"))&"."&month(rs("shhrdate"))&"."&day(rs("shhrdate"))%></div></td>
    <td width="7%" align=center><a href="myshhr.asp?action=edit&id=<%=rs("id")%>">Edit</a></td>
    <td width="6%" align=left> 
      <div align="center"><a href="myshhr.asp?action=del&id=<%=rs("id")%>">Del</a></div></td>
  </tr>
  <%
			rs.movenext
		    next
			%>
</table>
<br>
<%
		'call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
		end if
		rs.close
		set rs=nothing
'Sub PageControl(iCount,pagecount,page,table_style,font_style)
'生成上一页下一页链接
    Dim query, a, x, temp
    action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")

    query = Split(Request.ServerVariables("QUERY_STRING"), "&")
    For Each x In query
        a = Split(x, "=")
        If StrComp(a(0), "page", vbTextCompare) <> 0 Then
            temp = temp & a(0) & "=" & a(1) & "&"
        End If
    Next

    Response.Write("<table " & Table_style & ">" & vbCrLf )        
    Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )
    Response.Write("<TD align=right>" & vbCrLf )
    Response.Write(font_style & vbCrLf )    
        
    if page<=1 then
        Response.Write ("First " & vbCrLf)        
        Response.Write ("Pre " & vbCrLf)
    else        
        Response.Write("<A HREF=" & action & "?" & temp & "Page=1>First</A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & ">Pre</A> " & vbCrLf)
    end if

    if page>=pagecount then
        Response.Write ("Next " & vbCrLf)
        Response.Write ("Last " & vbCrLf)            
    else
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & ">Next</A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & ">Last</A> " & vbCrLf)            
    end if

    Response.Write(" Total Pages:" & page & "/" & pageCount & "" &  vbCrLf)
    Response.Write(" Total Informations:" & iCount & " " &  vbCrLf)
    Response.Write(" Goto Page: " & "<INPUT TYEP=TEXT class=wenbenkuang NAME=page SIZE=1 Maxlength=5 VALUE=" & page & ">" & " "  & vbCrLf & "<input name=go type=image  src=" &weburl&"img/butn_go.gif alt=GO align=absMiddle  border=0>")
    Response.Write("</TD>" & vbCrLf )                
    Response.Write("</TR></form>" & vbCrLf )        
    Response.Write("</table>" & vbCrLf )        
'End Sub
%>
<%
end sub

sub syh()
if session("username")="" then
response.Redirect "user.asp"
response.End
end if
%>
<%set rs=server.createobject("adodb.recordset")
		rs.open "select * from shop_yh where username='"&checkFFSQLStr(session("username"))&"'order by id asc",conn,1,1
		if rs.recordcount=0 then 
		%>
<table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
  <tr>
    <td align=center>暂无商友会，请添加!</td>
  </tr>
</table>
<%
		else
	  		rs.PageSize =30 '每页记录条数
			iCount=rs.RecordCount '记录总数
			iPageSize=rs.PageSize
    		maxpage=rs.PageCount 
    		page=request("page")
    
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
    
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
    
    rs.AbsolutePage=Page

	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
	%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  <tr>
    <td width="45%" height="22" bgcolor="f1f1f1" >
      <div align="center"> 商友会 </div>
      <div align="center"></div>
      <div align="center"></div></td>
    <td width="10%" bgcolor="f1f1f1" >
      <div align="center">回复</div></td>
    <td width="22%" bgcolor="f1f1f1" >
      <div align="center">建立时间</div></td>
    <td width="23%" bgcolor="f1f1f1" >
      <div align="center"></div>
      <div align="center">操作</div></td>
  </tr><%
			For i=1 To x
			%>
  <tr bgcolor="#FFFFFF">
    <td width="45%" height=23 align=left bgcolor="#FFFFFF">&nbsp;&nbsp;<img src="img/top5.gif" width="12" height="13" border="0"> <strong><a href=list.asp?id=<%=rs("shopid")%>><%=rs("shopname")%></a></strong>
<a href=list_pinglun.asp?id=<%=rs("shopid")%>>查看评论</a>      
<div align="center">    </div>
    <div align="center"></div></td>
    <td width="10%" align=left>
      <div align="center"><%=rs("hot")%></div></td>
    <td width="22%" align=left>
      <div align="center"><%=year(rs("adddate"))&"."&month(rs("adddate"))&"."&day(rs("adddate"))%></div></td>
    <td align=center>
    <div align="center"><a href="delsyh.asp?id=<%=rs("id")%>">退订</a></div></td>
  </tr>
  <%
			rs.movenext
		    next
			%>
</table>
<br>
<%
		'call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
		end if
		rs.close
		set rs=nothing
'Sub PageControl(iCount,pagecount,page,table_style,font_style)
'生成上一页下一页链接
    Dim query, a, x, temp
    action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")

    query = Split(Request.ServerVariables("QUERY_STRING"), "&")
    For Each x In query
        a = Split(x, "=")
        If StrComp(a(0), "page", vbTextCompare) <> 0 Then
            temp = temp & a(0) & "=" & a(1) & "&"
        End If
    Next

    Response.Write("<table " & Table_style & ">" & vbCrLf )        
    Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )
    Response.Write("<TD align=right>" & vbCrLf )
    Response.Write(font_style & vbCrLf )    
        
    if page<=1 then
        Response.Write ("首页 " & vbCrLf)        
        Response.Write ("上页 " & vbCrLf)
    else        
        Response.Write("<A HREF=" & action & "?" & temp & "Page=1>首页</A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & ">上页</A> " & vbCrLf)
    end if

    if page>=pagecount then
        Response.Write ("下页 " & vbCrLf)
        Response.Write ("尾页 " & vbCrLf)            
    else
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & ">下页</A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & ">尾页</A> " & vbCrLf)            
    end if

    Response.Write(" 页次：" & page & "/" & pageCount & "页" &  vbCrLf)
    Response.Write(" 共有" & iCount & "种商品" &  vbCrLf)
    Response.Write(" 转到 " & "<INPUT TYEP=TEXT class=wenbenkuang NAME=page SIZE=1 Maxlength=5 VALUE=" & page & ">" & " 页"  & vbCrLf & "<input name=go type=image  src=" &weburl&"img/butn_go.gif alt=GO align=absMiddle  border=0>")
    Response.Write("</TD>" & vbCrLf )                
    Response.Write("</TR></form>" & vbCrLf )        
    Response.Write("</table>" & vbCrLf )        
'End Sub
%>
<%
end sub

sub savepass()
if session("username")="" then
response.Redirect "user.asp"
response.End
end if
%>
<script language=JavaScript>
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
function passcheck()
{
    if(document.userpass.userpassword.value.length < 6 || document.userpass.userpassword.value.length >20) {
	document.userpass.userpassword.focus();
    alert("密码长度不能不能这空，在6位到20位之间，请重新输入！");
	return false;
  }
   if(document.userpass.userpassword.value!==document.userpass.userpassword2.value) {
	document.userpass.userpassword.focus();
    alert("对不起，两次密码输入不一样！");
	return false;
  }
   if(checkspace(document.userpass.quesion.value)) {
	document.userpass.quesion.focus();
    alert("对不起，请填写密码提问！");
	return false;
  }
}
</script>
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [shop_user] where username='"&nosql(session("username"))&"' ",conn,1,1
%>
<table width=98% border=0 align=center cellpadding=0 cellspacing=1 bgcolor="#CCCCCC" class="table-zuoshang">
  <form name="userpass" method="post" action="saveuserinfo.asp?action=savepass">
   <tr bgcolor="f1f1f1" class="a1"> 
      <td height="23" colspan=2 >If you want to change the password associated with your customer account, you may do so below.</td>
    </tr>
    <tr> 
      <td height=22 bgcolor=#ffffff > <div align="right">Username： </div></td>
      <td height=22 bgcolor=#ffffff >&nbsp;<%=session("username")%></td>
    </tr>
    <tr> 
      <td height=22 bgcolor=#ffffff > <div align="right">New password:： </div></td>
      <td height=22 bgcolor=#ffffff > &nbsp;
        <input name=userpassword class="wenbenkuang" type=password value="" size="20">
      (required to make changes) </td>
    </tr>
    <tr> 
      <td height=22 bgcolor=#ffffff > <div align="right">Re-enter new password： 
        </div></td>
      <td height=22 bgcolor=#ffffff > &nbsp;
      <input name=userpassword2 class="wenbenkuang" type=password value="" size="20">      </td>
    </tr>
    <tr> 
      <td height=22 bgcolor=#ffffff > <div align="right">Question of Password： 
        </div></td>
      <td height=22 bgcolor=#ffffff > &nbsp;
        <input name=quesion class="wenbenkuang" value="<%=trim(rs("quesion"))%>">
      * </td>
    </tr>
    <tr> 
      <td height=22 bgcolor=#ffffff > <div align="right">Answer of Password： 
        </div></td>
      <td height=22 bgcolor=#ffffff > &nbsp;
        <input name=answer class="wenbenkuang" type=text value="">
      (required to make changes) </td>
    </tr>
    <tr align="center"> 
      <td height=25 bgcolor=#ffffff colspan="2" > <div align="center"> 
          <input name="Submit2" type="submit" class="go-wenbenkuang" value="Submit and Save" onclick='return passcheck();'>
        </div></td>
    </tr>
  </form>
</table>
<%rs.close
set rs=nothing
end sub

sub userziliao()
if session("username")="" then
response.Redirect "user.asp"
response.End
end if
%>
<script language=JavaScript>
<%dim sql,i,j
	set rs_s=server.createobject("adodb.recordset")
	sql="select * From shop_szSheng order by shengorder"
	rs_s.open sql,conn,1,1
%>
	var selects=[];
	selects['xxx']=new Array(new Option('请选择城市……','xxx'));
<%
	for i=1 to rs_s.recordcount
%>
	selects['<%=rs_s("ShengNo")%>']=new Array(
<%
	set rs_s1=server.createobject("adodb.recordset")
	sql="select * From shop_szShi where shengid="&rs_s("id")&" order by shiorder"
	rs_s1.open sql,conn,1,1
	if rs_s1.recordcount>0 then 
		for j=1 to rs_s1.recordcount
		if j=rs_s1.recordcount then 
%>
		new Option('<%=trim(rs_s1("shiname"))%>','<%=trim(rs_s1("shiNo"))%>'));
<%		else
%>
		new Option('<%=trim(rs_s1("shiname"))%>','<%=trim(rs_s1("shiNo"))%>'),
<%
		end if
		rs_s1.movenext
		next
	else 
%>
		new Option('','0'));
<%
	end if
	rs_s1.close
	set rs_s1=nothing
	rs_s.movenext
	next
rs_s.close
set rs_s=nothing
%>
	function chsel(){
		with (document.userinfo){
			if(szSheng.value) {
				szShi.options.length=0;
				for(var i=0;i<selects[szSheng.value].length;i++){
					szShi.add(selects[szSheng.value][i]);
				}
			}
		}
	}
function IsDigit()
{
  return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
function checkuserinfo()
{
 if(document.userinfo.useremail.value.length!=0)
  {
    if (document.userinfo.useremail.value.charAt(0)=="." ||        
         document.userinfo.useremail.value.charAt(0)=="@"||       
         document.userinfo.useremail.value.indexOf('@', 0) == -1 || 
         document.userinfo.useremail.value.indexOf('.', 0) == -1 || 
         document.userinfo.useremail.value.lastIndexOf("@")==document.userinfo.useremail.value.length-1 || 
         document.userinfo.useremail.value.lastIndexOf(".")==document.userinfo.useremail.value.length-1)
     {
      alert("Email地址格式不正确！");
      document.userinfo.useremail.focus();
      return false;
      }
   }
 else
  {
   alert("Email不能为空！");
   document.userinfo.useremail.focus();
   return false;
   }
   if(checkspace(document.userinfo.userzhenshiname.value)) {
	document.userinfo.userzhenshiname.focus();
    alert("对不起，请填写您的真实姓名！");
	return false;
  }
   if(checkspace(document.userinfo.sfz.value)) {
	document.userinfo.sfz.focus();
    alert("对不起，请填写您的身份证号码！");
	return false;
  }
  
  
  if((document.userinfo.sfz.value.length!=15)&&(document.userinfo.sfz.value.length!=18)) {
	document.userinfo.sfz.focus();
    alert("对不起，请正确填写身份证号码！");
	return false;
  } 
  if(checkspace(document.userinfo.shouhuodizhi.value)) {
	document.userinfo.shouhuodizhi.focus();
    alert("对不起，请填写您的详细地址！");
	return false;
  }
  if(checkspace(document.userinfo.youbian.value)) {
	document.userinfo.youbian.focus();
    alert("对不起，请填写邮编！");
	return false;
  }
  if(document.userinfo.youbian.value.length!=6) {
	document.userinfo.youbian.focus();
    alert("对不起，请正确填写邮编！");
	return false;
  } 
    if(checkspace(document.userinfo.usertel.value)) {
	document.userinfo.usertel.focus();
    alert("对不起，请留下您的联系电话！");
	return false;
  }
}
</script>

<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [shop_user] where username='"&checkFFSQLStr(session("username"))&"' ",conn,1,1
%>
    
<table width=98% border=0 align=center cellpadding=0 cellspacing=1 bgcolor="#CCCCCC" class="table-zuoshang">
  <form name="userinfo" method="post" action="saveuserinfo.asp?action=userziliao">
  <tr bgcolor="f1f1f1"  class="a1"> 
      <td height="40" colspan=2 bgcolor="f1f1f1" > If you want to change the name, e-mail address……associated with your customer account, you may do so below. Please click the corresponding Edit button to make changes. </td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">Username： </div></td>
      <td height=22 bgcolor="#ffffff" >&nbsp;<%=session("username")%>　( 
        <%if rs("reglx")=2 then %>
        VIP　Deadline：<%=rs("vipdate")%> 
        <%else%>
        Member 
        <%end if%>
      )</td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">E-mail Address： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > &nbsp;
        <input name=useremail type=text  class="wenbenkuang" value="<%=trim(rs("useremail"))%>" size="30">
      * </td>
    </tr>
    <tr > 
      <td height=22 bgcolor="#ffffff"> <div align="right">Choose E-mail Address state： </div></td>
      <td height=22 bgcolor="#ffffff" > &nbsp;<input type="radio" name="ifgongkai" value="1" <%if rs("ifgongkai")=1 then%>checked<%end if%>>
        open　　 
          <input type="radio" name="ifgongkai" value="0" <%if rs("ifgongkai")=0 then%>checked<%end if%>>
          secret</td>
    </tr>
    <tr > 
      <td height=22 bgcolor="#ffffff"> <div align="right">Your Name： </div></td>
      <td height=22 bgcolor="#ffffff" > &nbsp;<input name=userzhenshiname  class="wenbenkuang" type=text value="<%=trim(rs("userzhenshiname"))%>">
        * </td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">Identification Card ： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > &nbsp;<input name=sfz type=text  class="wenbenkuang" value="<%=trim(rs("sfz"))%>" size="30" maxlength="18">
        * </td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">Sex： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > &nbsp;<input type="radio" name="shousex" value="1" <%if rs("sex")=1 then%>checked<%end if%>>
        male 　　 
        <input type="radio" name="shousex" value="0" <%if rs("sex")=0 then%>checked<%end if%>>
        female 
        <input type="radio" name="shousex" value="2" <%if rs("sex")=2 then%>checked<%end if%>>
        secret</td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">Age： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > &nbsp;<input name=nianling type=text   class="wenbenkuang" value="<%=trim(rs("nianling"))%>" size="4" maxlength="2"> 
      </td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">City： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > &nbsp;<select size="1"  class="wenbenkuang" name="szSheng" onChange=chsel()>
          <option value="xxx" selected>请选择省份……</option>
          <%dim tmpShengid
tmpShengid=0
set rs_s=server.createobject("adodb.recordset")
sql="select * From shop_szSheng  order by shengorder"
rs_s.open sql,conn,1,1
while not rs_s.eof
     if rs("szSheng")=rs_s("ShengNo") then
          tmpShengid=rs_s("id")
%>
          <option value="<%=rs_s("ShengNo")%>" selected ><%=trim(rs_s("ShengName"))%></option>
          <%
     else
%>
          <option value="<%=rs_s("ShengNo")%>" ><%=trim(rs_s("ShengName"))%></option>
          <%
     end if
    rs_s.movenext
wend
rs_s.close
set rs_s=nothing
%>
        </select> <select size="1"  class="wenbenkuang" name="szShi">
          <%
set rs_s=server.createobject("adodb.recordset")
sql="select * From shop_szShi where shengid="&tmpShengid&" order by shiorder"
rs_s.open sql,conn,1,1
while not rs_s.eof
%>
          <option value="<%=rs_s("ShiNo")%>" <%if rs("szShi")=rs_s("ShiNo") then%>selected<%end if%>><%=trim(rs_s("ShiName"))%></option>
          <%
    rs_s.movenext
wend
rs_s.close
set rs_s=nothing
%>
        </select>
        * </td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">Address： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > &nbsp;<input name=shouhuodizhi  class="wenbenkuang" value="<%=trim(rs("shouhuodizhi"))%>" size="40">
        * </td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">Tel： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > &nbsp;<input name=usertel class="wenbenkuang" value="<%=trim(rs("usertel"))%>" size="30">
        * </td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">Code： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > &nbsp;<input name=youbian type=text  class="wenbenkuang" value="<%=trim(rs("youbian"))%>" ONKEYPRESS="event.returnValue=IsDigit();" size="30">
        * </td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">QQ： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > &nbsp;<input name=QQ type=text  class="wenbenkuang" value="<%=trim(rs("oicq"))%>" size="30" maxlength="12"> 
      </td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">Web Url： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > &nbsp;<input name=homepage type=text  class="wenbenkuang" value="<%=trim(rs("homepage"))%>" size="30"> 
      </td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">Introduce Myself： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > &nbsp;<textarea name="content" cols="50" rows="6"  class="wenbenkuang"><%=trim(rs("content"))%></textarea> 
      </td>
    </tr>
    <tr align="center"> 
      <td height=25 bgcolor=#ffffff colspan="2" > <div align="center"> 
          <input name="Submit22" type="submit" class="go-wenbenkuang" value="Edit Information" onclick='return checkuserinfo();'>
        </div></td>
    </tr>
  </form>
</table>
<%rs.close
set rs=nothing
end sub
%>