<!--#include file="fuction.asp"-->
<%
'//////////////////////////订单查讯
sub dindan()
if request.cookies("snsn")("username")="" then
response.Redirect "user.asp"
response.End
end if
%> 
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1">
  <tr> 
                            
    <td width="55%"> 我的订单</td>
                            <td width="49%"> 
                              <div align="right"> 
                                <select name="zhuangtai" class="wenbenkuang" onChange="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}" >
                                  <option value="user.asp?action=dindan&zhuangtai=0" selected>--请选择查讯状态--</option>
                                  <option value="user.asp?action=dindan&zhuangtai=0" >全部订单状态</option>
                                  <option value="user.asp?action=dindan&zhuangtai=1" >未作任何处理</option>
                                  <option value="user.asp?action=dindan&zhuangtai=2" >用户已经划出款</option>
                                  <option value="user.asp?action=dindan&zhuangtai=3" >服务商已经收到款</option>
                                  <option value="user.asp?action=dindan&zhuangtai=4" >服务商已经发货</option>
                                  <option value="user.asp?action=dindan&zhuangtai=5" >用户已经收到货</option>
                                </select>
                              </div>
                            </td>
                          </tr>
                        </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">订单号</div></td>
    <td > <div align="center">货款</div></td>
    <td > <div align="center">费用</div>
    <td > <div align="center">订单状态</div></td>
  </tr>
  <%set rs=server.CreateObject("adodb.recordset")
  dim zhuangtai
  zhuangtai=request.QueryString("zhuangtai")
  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(request.cookies("snsn")("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(request.cookies("snsn")("username"))&"' and zhuangtai<5 order by actiondate desc",conn,1,1
  end select
  else
  rs.open "select distinct(dingdan),userzhenshiname,actiondate,shouhuoname,songhuofangshi,zhifufangshi,zhuangtai from shop_action where username='"&checkFFSQLStr(request.cookies("snsn")("username"))&"' and zhuangtai="&zhuangtai&" order by actiondate",conn,1,1
  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>"&snsn("zonger")&"元</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>"&snsn("feiyong")&"元</font>"
	snsn.close
	set snsn=nothing%>
      </div></td>
    <td > <div align="center"> 
        <%select case rs("zhuangtai")
	case "1"
	response.write "未作任何处理"
	case "2"
	response.write "用户已经划出款"
	case "3"
	response.write "服务商已经收到款"
	case "4"
	response.write "服务商已经发货"
	case "5"
	response.write "用户已经收到货"
	end select%>
      </div></td>
  </tr>
  <%
   rs.movenext
  loop
  rs.close
  set rs=nothing%>
</table>
<%
end sub

sub myinfo()
if request.cookies("snsn")("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="3" > <b>我的统计信息</b></td>
  </tr>
  <%
	set snsn=server.CreateObject("adodb.recordset")
	snsn.open "select * from [shop_user] where username='"&checkFFSQLStr(request.cookies("snsn")("username"))&"' ",conn,1,1
	ky_jifen=snsn("jifen")
	%>
  <tr> 
    <td width="121" height="22" align="center" bgcolor="f1f1f1" >用户类型：</td>
    <td width="106" height="22" align="center" bgcolor="f1f1f1" > 
      <%if request.cookies("snsn")("reglx")=2 then%>
      VIP用户 
      <%else%>
      普通会员 
      <%end if%>
    </td>
    <td width="133" height="22" align="center" bgcolor="f1f1f1" > 
      <%if request.cookies("snsn")("reglx")=2 then%>
      期限：<%=snsn("vipdate")%> 
      <%end if%>
    </td>
  </tr>
  <tr> 
    <td width="121" height="22" align="center" bgcolor="#FFFFFF" > 
      登录次数：</td>
    <td width="106" height="22" align="center" bgcolor="#FFFFFF" ><%=snsn("logins")%></td>
    <td width="133" height="22" bgcolor="#FFFFFF" >　</td>
  </tr>
  <tr> 
    <td width="121" height="22" align="center" bgcolor="#FFFFFF" > 
      累计积分：</td>
    <td width="106" height="22" align="center" bgcolor="#FFFFFF" ><%=snsn("jifen")%></td>
    <td width="133" height="22" bgcolor="#FFFFFF" >　</td>
  </tr>
  <%
	set snsn1=server.CreateObject("adodb.recordset")
	snsn1.open "select sum(zonger) as sum_jine from shop_action where username='"&checkFFSQLStr(request.cookies("snsn")("username"))&"' and zhuangtai<=5",conn,1,1
	%>
  <tr> 
    <td width="121" height="21" align="center" bgcolor="#FFFFFF" > 
      总购物金额：</td>
    <td width="106" height="21" align="center" bgcolor="#FFFFFF" ><%=snsn1("sum_jine")%></td>
    <td width="133" height="21" bgcolor="#FFFFFF" >　</td>
  </tr>
  <%snsn1.close
	set snsn1=nothing%>
  <tr> 
    <td width="121" height="23" align="center" bgcolor="#FFFFFF" > 
      预 存 款：</td>
    <td width="106" height="23" align="center" bgcolor="#FFFFFF" ><%=snsn("yucun")%></td>
    <td width="133" height="23" bgcolor="#FFFFFF" >　</td>
  </tr>
  <%if request.cookies("snsn")("reglx")=2 then%>
  <tr> 
    <td width="121" height="22" align="center" bgcolor="#FFFFFF" > 
      VIP期限：</td>
    <td width="106" height="22" align="center" bgcolor="#FFFFFF" ><%=snsn("vipdate")%></td>
    <td width="133" height="22" bgcolor="#FFFFFF" >　</td>
  </tr>
  <%end if%>
  <%
	set snsn1=server.CreateObject("adodb.recordset")
	snsn1.open "select count(*) as rec_count from shop_action where username='"&checkFFSQLStr(request.cookies("snsn")("username"))&"' and zhuangtai=6",conn,1,1
	%>
  <tr> 
    <td width="121" height="22" align="center" bgcolor="#FFFFFF" > 
      收藏的商品数：</td>
    <td width="106" height="22" align="center" bgcolor="#FFFFFF" ><%=snsn1("rec_count")%></td>
    <td width="133" height="22" bgcolor="#FFFFFF" >　</td>
  </tr>
  <%snsn1.close
	set snsn1=nothing%>
  <%snsn.close
	set snsn=nothing%>
</table>
<%
end sub

sub jifen()
if request.cookies("snsn")("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 class="a1"> 
    <td  height="22"> <div align=center>我的积分情况</div></td>
  </tr>
  <%
	set snsn=server.CreateObject("adodb.recordset")
	snsn.open "select jifen from [shop_user] where username='"&checkFFSQLStr(request.cookies("snsn")("username"))&"' ",conn,1,1
	ky_jifen=snsn("jifen")
	snsn.close
	set snsn=nothing%>
  <tr> 
    <td bgcolor=#FFFFFF height="22" >&nbsp;&nbsp;我的可用积分：<%=ky_jifen%></td>
  </tr>
  <%
	set snsn=server.CreateObject("adodb.recordset")
	snsn.open "select sum(zonger) as sum_jine from shop_action where username='"&checkFFSQLStr(request.cookies("snsn")("username"))&"' and zhuangtai<=5",conn,1,1
	ky_jifen=snsn("sum_jine")
	snsn.close
	set snsn=nothing%>
  <tr> 
    <td bgcolor=#FFFFFF height="22" >&nbsp;&nbsp;累计购物金额(不含费用)：<%=ky_jifen%>元</td>
  </tr>
  <tr> 
    <td bgcolor=#FFFFFF height="22" > <div align=center></div></td>
  </tr>
  <tr class="a1"> 
    <td height="22" > <div align=center>积分兑换奖品说明</div></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 bgcolor=#FFFFFF >　</td>
  </tr>
  <tr class="a1"> 
    <td height=22 bgcolor=<%=flbgbk%> align=center >奖品清单</td>
  </tr>
  <tr> 
    <td height=28 bgcolor=#FFFFFF> <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
        <tr align="center" bgcolor="f1f1f1"> 
          <td height="22" >奖品名称</td>
          <td height="22" >需要积分</td>
          <td height="22" >操作</td>
        </tr>
        <%
	set snsn=server.CreateObject("adodb.recordset")
	snsn.open "select * from shop_jiangpin where xianshi=1",conn,1,1
	while not snsn.eof%>
        <tr bgcolor="#FFFFFF"> 
          <td height="22" ><a href="listjp.asp?id=<%=snsn("shopid")%>" target=_blank><%=snsn("shopname")%></a></td>
          <td height="22" align="center" ><%=snsn("jifen")%></td>
          <td height="22" align="center" ><a href="jifen.asp?id=<%=snsn("shopid")%>&action=add">选择此项</a></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(request.cookies("snsn")("username"))&"' and zhuangtai=7",conn,1,1
	if snsn.recordcount>0 then%>
  <tr class="a1"> 
    <td height=22 bgcolor=<%=flbgbk%> align=center >您已选择的奖品清单</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" >奖品名称</td>
          <td height="22" bgcolor="f1f1f1" >使用积分</td>
          <td height="22" bgcolor="f1f1f1" >操作</td>
        </tr>
        <%
	while not snsn.eof%>
        <tr bgcolor="#FFFFFF"> 
          <td height="22" > 
            <%
	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%>
          </td>
          <td height="22" align="center" ><%=snsn("jifen")%></td>
          <td height="22" align="center" ><a href="jifen.asp?actionid=<%=snsn("actionid")%>&action=del">删除此项</a></td>
        </tr>
        <%
	snsn.movenext
	wend%>
      </table></td>
  </tr>
  <%end if
	snsn.close
	set snsn=nothing%>
</table>
<%
end sub

sub sqvip()
if request.cookies("snsn")("username")="" or request.cookies("snsn")("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=22 bgcolor=#FFFFFF >　</td>
  </tr>
  <tr> 
    <td height=28 bgcolor=#FFFFFF align=center > 
      <%set rs=server.createobject("adodb.recordset")
	rs.open "select vipid from shop_sys ",conn,1,1
	vipid=rs("vipid")
	rs.close
   %>
      <%
	set snsn=server.CreateObject("adodb.recordset")
	snsn.open "select jifen from [shop_user] where username='"&checkFFSQLStr(request.cookies("snsn")("username"))&"' ",conn,1,1
	ky_jifen=snsn("jifen")
	snsn.close
	set snsn=nothing%><table width="95%" border="0" cellspacing="0" cellpadding="0">
  <tr>
          <td>
            <%if Request.Cookies("snsn")("reglx")=2 then%>
            你已经是本站VIP会员 
            <%else%>
            您当前积分为：<%=ky_jifen%> 申请VIP所需要积分为：<%=vipid%> </td>
  </tr>
  <tr>
          <td> 
            <%if ky_jifen<vipid then%>
            您的积分不够，暂时不能申请成为VIP会员 
            <%else%>
            <a href="?action=vipsq">立即申请VIP会员</a> 
            <%end if%>
          </td>
  </tr>
  <tr>
          <td><font color="#FF0000">注意：如时申请了，会从您的积分中减少<%=vipid%>积分</font> 
            <%end if%>
          </td>
  </tr>
</table>

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

sub vipsq()
if request.cookies("snsn")("username")="" or request.cookies("snsn")("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_sys ",conn,1,1
	vipid=rs("vipid")
	rs.close
   %>
      <%           set rssq=server.createobject("adodb.recordset")
                        rssq.open "select * from [shop_user] where username='"&request.cookies("snsn")("username")&"'",conn,1,3
						if rssq("reglx")=2 then
						else
                        rssq("reglx")=2
						rssq("jifen")= rssq("jifen")-vipid
						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(request.cookies("snsn")("username"))&"' ",conn,1,1
	ky_jifen=snsn("jifen")
	snsn.close
	set snsn=nothing%>
      <table width="95%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td>您当前积分为：<%=ky_jifen%></td>
        </tr>
        <tr> 
          <td>您已经成为本站VIP会员了，请不要再申请!</td>
        </tr>
        <tr> 
          <td>　</td>
        </tr>
      </table>
      <%						  set rs=nothing%>
    </td>
  </tr>
</table>
<%
end sub

sub viphd()
if request.cookies("snsn")("username")="" or request.cookies("snsn")("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 request.cookies("snsn")("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,shop_snsn.shopname,shop_snsn.shichangjia,shop_snsn.huiyuanjia,shop_snsn.vipjia,shop_snsn.dazhe from shop_snsn inner join  shop_action on shop_snsn.shopid=shop_action.shopid where shop_action.username='"&checkFFSQLStr(request.cookies("snsn")("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" target="newwindow" method=post name=form1 onsubmit="windowOpener('')">
    <tr bgcolor="f1f1f1"  class="a1"> 
      <td width=8% height="22" > <div align=center>选择</div></td>
      <td width=42% height="22" > <div align=center>商品名称</div></td>
      <td width=14% height="22" > <div align=center>市场价</div></td>
      <td width=14% height="22" > <div align=center>会员价</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><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=images/trash.gif width=15 height=17 border=0></a></div></td>
    </tr>
    <%
rs.movenext
loop
rs.close
set rs=nothing
%>
    <tr bgcolor="#FFFFFF"> 
      <td height=25 colspan=6 > <div align="left"> 
          　　　　　　　　　　　　　　　<input name="Submit" type="submit" class="go-wenbenkuang" value="放入购物车" onFocus="this.blur()">
        </div></td>
    </tr>
  </form>
</table>
<%
end sub

sub savepass()
if request.cookies("snsn")("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='"&request.cookies("snsn")("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 > 尊敬的用户，我们向您承诺：以下信息将被严格保密，绝对不提供给第三方或用作它用。</td>
    </tr>
    <tr> 
      <td height=22 bgcolor=#ffffff > <div align="right">用 
          户 名： </div></td>
      <td height=22 bgcolor=#ffffff ><%=request.cookies("snsn")("username")%></td>
    </tr>
    <tr> 
      <td height=22 bgcolor=#ffffff > <div align="right">新 
          密 码： </div></td>
      <td height=22 bgcolor=#ffffff > <input name=userpassword class="wenbenkuang" type=password value="" size="10">
        (不修改请为空) </td>
    </tr>
    <tr> 
      <td height=22 bgcolor=#ffffff > <div align="right">密码确认： 
        </div></td>
      <td height=22 bgcolor=#ffffff > <input name=userpassword2 class="wenbenkuang" type=password value="" size="10"> 
      </td>
    </tr>
    <tr> 
      <td height=22 bgcolor=#ffffff > <div align="right">密码提问： 
        </div></td>
      <td height=22 bgcolor=#ffffff > <input name=quesion class="wenbenkuang" value="<%=trim(rs("quesion"))%>">
        * </td>
    </tr>
    <tr> 
      <td height=22 bgcolor=#ffffff > <div align="right">密码答案： 
        </div></td>
      <td height=22 bgcolor=#ffffff > <input name=answer class="wenbenkuang" type=text value="" size="18">
        (不修改请为空) </td>
    </tr>
    <tr align="center"> 
      <td height=25 bgcolor=#ffffff colspan="2" > <div align="left"> 
          　　　　　　　　　　　　<input name="Submit2" type="submit" class="go-wenbenkuang" value="确认修改" onclick='return passcheck();'>
        </div></td>
    </tr>
  </form>
</table>
<%rs.close
set rs=nothing
end sub

sub userziliao()
if request.cookies("snsn")("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(request.cookies("snsn")("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="23" colspan=2 > 尊敬的用户，我们向您承诺： 以下信息将被严格保密，绝对不提供给第三方或用作它用。</td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">用 
          户 名： </div></td>
      <td height=22 bgcolor="#ffffff" ><%=request.cookies("snsn")("username")%>　( 
        <%if rs("reglx")=2 then %>
        VIP用户　期限：<%=rs("vipdate")%> 
        <%else%>
        普通会员 
        <%end if%>
        )</td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">电子邮箱： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > <input name=useremail  class="wenbenkuang" type=text value="<%=trim(rs("useremail"))%>">
        * </td>
    </tr>
    <tr > 
      <td height=22 bgcolor="#ffffff"> <div align="right">是否公开邮箱地址： </div></td>
      <td height=22 bgcolor="#ffffff" > <input type="radio" name="ifgongkai" value="1" <%if rs("ifgongkai")=1 then%>checked<%end if%>>
        公开　　 
        <input type="radio" name="ifgongkai" value="0" <%if rs("ifgongkai")=0 then%>checked<%end if%>>
        不公开 </td>
    </tr>
    <tr > 
      <td height=22 bgcolor="#ffffff"> <div align="right">真实姓名： </div></td>
      <td height=22 bgcolor="#ffffff" > <input name=userzhenshiname  class="wenbenkuang" type=text value="<%=trim(rs("userzhenshiname"))%>">
        * </td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">身份证号码： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > <input name=sfz type=text  class="wenbenkuang" value="<%=trim(rs("sfz"))%>" size="20" maxlength="18">
        * </td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">您的性别： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > <input type="radio" name="shousex" value="1" <%if rs("sex")=1 then%>checked<%end if%>>
        男　　 
        <input type="radio" name="shousex" value="0" <%if rs("sex")=0 then%>checked<%end if%>>
        女　　 
        <input type="radio" name="shousex" value="2" <%if rs("sex")=2 then%>checked<%end if%>>
        保密</td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">您的年龄： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > <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">所在城市： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > <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">详细地址： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > <input name=shouhuodizhi  class="wenbenkuang" value="<%=trim(rs("shouhuodizhi"))%>">
        * </td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">联系电话： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > <input name=usertel class="wenbenkuang" value="<%=trim(rs("usertel"))%>" size="12">
        * </td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">邮政编码： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > <input name=youbian type=text  class="wenbenkuang" value="<%=trim(rs("youbian"))%>" ONKEYPRESS="event.returnValue=IsDigit();" size="12">
        * </td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">在线QQ： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > <input name=QQ type=text  class="wenbenkuang" value="<%=trim(rs("oicq"))%>" size="12" maxlength="12"> 
      </td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">个人主页： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > <input name=homepage type=text  class="wenbenkuang" value="<%=trim(rs("homepage"))%>"> 
      </td>
    </tr>
    <tr> 
      <td height=22 bgcolor="#ffffff" > <div align="right">自我介绍： 
        </div></td>
      <td height=22 bgcolor="#ffffff" > 
		<textarea  class="wenbenkuang" name="content" rows="11" cols="52"><%=trim(rs("content"))%></textarea> 
      </td>
    </tr>
    <tr align="center"> 
      <td height=25 bgcolor=#ffffff colspan="2" > <div align="left"> 
          　　　　　　　　　　　　　　　<input name="Submit22" type="submit" class="go-wenbenkuang" value="提交保存" onclick='return checkuserinfo();'>
        </div></td>
    </tr>
  </form>
</table>
<%rs.close
set rs=nothing
end sub
%>