<%case "uzlsave"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [user] where username='"&session("username")&"' ",conn,2,3
rs("useremail")=request("useremail")'用户邮箱
rs("ifgongkai")=request("ifgongkai")'是否公开
rs("userzhenshiname")=request("userzhenshiname")'真实姓名
rs("sfz")=request("sfz")'身份证
rs("sex")=request("sex")'性别
rs("nianling")=request("nianling")'年龄
rs("shouhuodizhi")=request("shouhuodizhi")'用户地址
rs("usertel")=request("usertel")'用户联系电话
rs("youbian")=request("youbian")'用户邮编
rs("oicq")=request("oicq")'联系QQ
rs("homepage")=request("homepage")'用户主页
rs("content")=request("content")'用户自简
rs.update
response.write "<span style='height:500px;font-size:12px;padding-top:200px;padding-left:150px;color:red'>修改成功，2秒后自动返回</span><script>window.setTimeout(""location.href='?action=uzl'"",1000);</script>"

case "uzl"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [user] where username='"&session("username")&"' ",conn,1,1
username=request.cookies("rs")("username")
reglx=rs("reglx")
vipdate=rs("vipdate")'用户VIP期限
useremail=rs("useremail")
ifgongkai=rs("ifgongkai")
userzhenshiname=rs("userzhenshiname")
sfz=rs("sfz")
sex=rs("sex")
nianling=rs("nianling")
shouhuodizhi=rs("shouhuodizhi")
usertel=rs("usertel")
youbian=rs("youbian")
oicq=rs("oicq")
homepage=rs("homepage")
content=rs("content")
rs.close
set rs=nothing
%>
<script language=JavaScript>
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>
<table border="0" class="bgcolor" cellpadding="5" cellspacing="1">
<form name="userinfo" method="post" action="?action=uzlsave">
<tr class="tdcolor"> 
<td>用户类型：</td>
<td>
<font color=#FF6600><%=username%>(<%if reglx=2 then %>VIP用户　期限：<%=vipdate%><%else%>普通会员<%end if%>)</font></td>
</tr>
<tr class="tdcolor"> 
<td>电子邮件：</td>
<td> 
<input name=useremail class="wenbenkuang" type=text value="<%=useremail%>">
<font color="#FF0000">**</font></td>
</tr>
<tr class="tdcolor"> 
<td>是否公开邮箱地址：</td>
<td><input type="radio" name="ifgongkai" value="1" <%if ifgongkai=1 then%>checked<%end if%>>公开<input type="radio" name="ifgongkai" value="0" <%if ifgongkai=0 then%>checked<%end if%>>不公开</td>
</tr>
<tr class="tdcolor"> 
<td>真实姓名：</td>
<td> 
<input name=userzhenshiname class="wenbenkuang" type=text value="<%=userzhenshiname%>" size="10">
<font color="#FF0000">**</font></td>
</tr>
<tr class="tdcolor"> 
<td>身份证号码：</td>
<td> 
<input name=sfz type=text class="wenbenkuang" value="<%=sfz%>" size="30" maxlength="18">
<font color="#FF0000">**</font></td>
</tr>
<tr class="tdcolor"> 
<td>性别： </td>
<td><select name="sex" id="sex" class="selectmenu">
<option value="<%=sex%>" selected><%=sex%></option>
<option value="先生">先生</option>
<option value="女士">女士</option></select></td>
</tr>
<tr class="tdcolor"> 
<td>年龄：</td>
<td> 
<input name=nianling type=text class="wenbenkuang" value="<%=nianling%>" size="4" maxlength="2"></td>
</tr>
<tr class="tdcolor"> 
<td>详细地址：</td>
<td> 
<input name=shouhuodizhi type=text class="wenbenkuang" value="<%=shouhuodizhi%>" size="30">
<font color="#FF0000">**</font></td>
</tr>
<tr class="tdcolor"> 
<td>联系电话：</td>
<td> 
<input name=usertel type=text class="wenbenkuang" value="<%=usertel%>" size="12">
<font color="#FF0000">**</font></td>
</tr>
<tr class="tdcolor"> 
<td>邮编：</td>
<td> 
<input name=youbian type=text class="wenbenkuang" value="<%=youbian%>" onkeypress="event.returnValue=IsDigit();" size="12">
<font color="#FF0000">**</font></td>
</tr>
<tr class="tdcolor"> 
<td>QQ：</td>
<td> 
<input name=QQ type=text class="wenbenkuang" value="<%=oicq%>" size="12" maxlength="12"></td>
</tr>
<tr class="tdcolor"> 
<td>个人主页：</td>
<td> 
<input name=homepage type=text class="wenbenkuang" value="<%=homepage%>" size="30"></td>
</tr>
<tr class="tdcolor"> 
<td>自我介绍：</td>
<td> 
<textarea name="content" cols="30" rows="5" class="wenbenkuang"><%=content%></textarea></td>
</tr>
<tr class="tdcolor"> 
<td height=25>&nbsp;</td>
<td height=25><input class="go-wenbenkuang" onclick="return checkuserinfo();" type="submit" name="submit" value=" 提交保存 "></td>
</tr>
</form>
</table>

<%case "savepass"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [user] where username='"&session("username")&"' ",conn,2,3
if trim(request("userpassword"))<>"" then
rs("userpassword")=md5(trim(request("userpassword")))
end if
rs.update
response.write "<span style='height:500px;font-size:12px;padding-top:200px;padding-left:150px;color:red'>修改成功，2秒后自动返回</span><script>window.setTimeout(""location.href='?action=password'"",1000);</script>"

case "password"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [user] where username='"&session("username")&"' ",conn,1,1
username=session("username")
%>
<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.userpassword1.value) {
	document.userpass.userpassword.focus();
alert("对不起，两次密码输入不一样！");
	return false;
}
}
</script>
<table border="0" class="bgcolor" cellpadding="5" cellspacing="1">
<form name="userpass" method="post" action="?action=savepass">
<tr class="tdcolor"> 
<td>用 户 名：</td>
<td><font color=#FF6600><%=username%></font></td>
</tr>
<tr class="tdcolor"> 
<td>新 密 码：</td>
<td><input name="userpassword" class="wenbenkuang"; type="password" value="" size="18">
<font color="#FF0000">**</font> 不修改请为空</td>
</tr>
<tr class="tdcolor"> 
<td>密码确认：</td>
<td><input name="userpassword1" class="wenbenkuang" type="password" value="" size="18">
<font color="#FF0000">**</font></td>
</tr>
<tr class="tdcolor">
<td></td>
<td height=25>
<input class="go-wenbenkuang" onclick="return passcheck();" type="submit" name="submit" value=" 提交保存 ">
</td>
</tr>
</form>
</table>

<%case "myxinxi"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if%>
<table border="0" class="bgcolor" cellpadding="5" cellspacing="1">
<tr> 
<td colspan="2" class="managetop">我的统计信息</td>
</tr>
<%set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [user] where username='"&session("username")&"' ",conn,1,1
jifen=rs("jifen")
reglx=rs("reglx")
vipdate=rs("vipdate")
logins=rs("logins")
jifen=rs("jifen")
yucun=rs("yucun")
jiaoyijine=rs("jiaoyijine")
rs.close
set rs=nothing%>
<tr class="tdcolor"> 
<td width="50%">用户类型：</td>
<td width="50%"><font color=red><%if reglx=2 then%>VIP用户-期限<%=vipdate%><%else%>普通会员</font><%end if%></td>
</tr>
<tr class="tdcolor">
<td>登录次数：</td>
<td><%=logins%></td>
</tr>
<tr class="tdcolor"> 
<td>累计积分：</td>
<td><%=jifen%>商币</td>
</tr>
<tr class="tdcolor"> 
<td>总购物金额：</td>
<td><%=jiaoyijine%>元</td>
</tr>
<tr class="tdcolor"> 
<td>预存款：</td>
<td><%=yucun%>元</td>
</tr><%if reglx=2 then%>
<tr class="tdcolor"> 
<td>VIP期限：</td>
<td><%=vipdate%></td>
</tr><%end if%>
<tr class="tdcolor"> 
<td>收藏的商品数：</td>
<td></td>
</tr>
</table>

<%case "jifen"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if%>
<table border="0" class="bgcolor" cellpadding="5" cellspacing="1">
<tr class="tdcolor"> 
<td>积分兑换奖品说明</td>
</tr>
<tr class="tdcolor"> 
<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>
<tr> 
<td class="tdcolor">我的积分情况</td>
</tr>
<tr class="tdcolor"> 
<td> 
<table width="95%" height="24" border="0" cellspacing="0" cellpadding="0" class="tdcolor">
<tr>
<%set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [user] where username='"&session("username")&"' ",conn,1,1
jifen=rs("jifen")
jiaoyijine=rs("jiaoyijine")
rs.close
set rs=nothing%>
<td width="50%">我的可用积分：<font color=#FF0000><%=jifen%>商币</font></td>
<td width="50%">累计购物金额(不含费用)：<%=jiaoyijine%>元</td>
</tr>
</table></td>
</tr>
</table>

<%case "sqvip"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if%>
<table border="0" class="bgcolor" cellpadding="5" cellspacing="1">
<tr>
<td class="managetop">申请VIP说明</td>
</tr>
<tr class="tdcolor"> 
<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>

<%case "viphd"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if%>
<table border="0" class="bgcolor" cellpadding="5" cellspacing="1">
<tr>
<td class="managetop">VIP活动说明</td>
</tr>
<tr class="tdcolor"> 
<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>

<%case "goumai"
if session("username")="" then
response.write "<span style='height:500px;font-size:12px;padding-top:200px;padding-left:150px;color:red'>您还没有登录</span><script>window.setTimeout(""history.go(-1)"",1000);</script>"
response.End
end if%>
<table border="0" cellspacing="1" cellpadding="5" class="bgcolor">
<tr class="tdcolor"><td colspan="7">请选择购买的商品数量及送货、支付方式再进行下一步操作</td></tr>
<tr class="tdcolor">
<td>商品名称</td>
<td>商品价格</td>
<td>购买数量</td>
<td>商品单位</td>
<td>选择送货方式</td>
<td>选择支付方式</td>
<td>商品状态</td>
</tr>
<%set rs=server.createobject("adodb.recordset")
rs.open"select * from price where bookid="&request("id")&"",conn,1,1
bookname=rs("bookname")
bookid=rs("bookid")
money=split(rs("money"),"|")
att=rs("att")
anclassid=rs("anclassid")
nclassid=rs("nclassid")
ppid=rs("ppid")
kucun=rs("kucun")
rs.close
set rs=nothing%>
<form action="?action=goumainext&id=<%=bookid%>" method="post" name="myform">
<tr class="tdcolor">
<td><%=bookname%><input name="from" id="from" value="<%=request("from")%>" type="hidden"></td>
<td><%=money(1)%>元</td>
<td><input name="goumaicount" id="goumaicount" class="wenbenkuang" size="3" value="1"></td>
<td>&nbsp;</td>
<td><select name="songhuo" id="songhuo" class="select">
<%set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_songhuo where fangshi=0 order by songidorder",conn,1,1
while not rs.eof
subject=split(rs("subject"),"|")%>
<option value="<%=subject(0)%>"><%=replace(rs("subject"),"|","-")%>元</option>
<%rs.movenext
wend
rs.close%>
</select></td>
<td><select name="zhifu" id="zhifu" class="select">
<%set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_songhuo where fangshi=1 order by songidorder",conn,1,1
while not rs.eof%>
<option value="<%=trim(rs("subject"))%>"><%=trim(rs("subject"))%></option>
<%rs.movenext
wend
rs.close%>
</select></td>
<td><%=att%></td>
</tr>
<tr class="tdcolor"><td colspan=7 align="center"><input type="submit" name="submit" value="下一步" class="wenbenkuang"></td>
</tr></form>
</table>

<%case "goumainext"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if%>
<table border="0" cellspacing="1" cellpadding="5" class="bgcolor">
<tr class="tdcolor"><td colspan="9">请确认上一步的操作，核实费用进入下一步</td></tr>
<tr class="tdcolor">
<td>商品名称</td>
<td>商品价格</td>
<td>购买数量</td>
<td>商品单位</td>
<td>送货方式</td>
<td>支付方式</td>
<td>商品状态</td>
<td>费用</td>
<td><font color="red">总额</font></td>
</tr>
<%set rs=server.createobject("adodb.recordset")
rs.open"select * from price where bookid="&request("id")&"",conn,1,1
bookname=rs("bookname")
bookid=rs("bookid")
money=split(rs("money"),"|")
att=rs("att")
anclassid=rs("anclassid")
nclassid=rs("nclassid")
ppid=rs("ppid")
kucun=rs("kucun")
rs.close
rs.open "select * from shop_songhuo where fangshi=0 and subject like '%"&request("songhuo")&"%' order by songidorder",conn,1,1
subject=split(rs("subject"),"|")
rs.close
set rs=nothing
goumaicount=request("goumaicount")
zonge=money(1)*goumaicount+subject(1)%>
<form action="?action=next&id=<%=bookid%>" method="post" name="myform">
<tr class="tdcolor">
<td><%=bookname%><input name="from" id="from" value="<%=request("from")%>" type="hidden"></td>
<td><%=money(1)%>元</td>
<td><%=goumaicount%><input name="goumaicount" id="goumaicount" value="<%=goumaicount%>" type="hidden"></td>
<td>&nbsp;</td>
<td><%=request("songhuo")%><input name="songhuo" id="songhuo" value="<%=request("songhuo")%>" type="hidden"></td>
<td><%=request("zhifu")%><input name="zhifu" id="zhifu" value="<%=request("zhifu")%>" type="hidden"></td>
<td><%=att%></td>
<td><%=subject(1)%>元</td>
<td><font color="red"><%=zonge%>元</font><input name="zonge" id="zonge" value="<%=zonge%>" type="hidden"></td>
</tr>
<tr class="tdcolor"><td colspan=9 align="center"><input type="reset" name="submit" onclick="history.go(-1)" value="上一步" class="wenbenkuang">&nbsp;<input type="submit" name="submit" value="下一步" class="wenbenkuang"></td>
</tr></form>
</table>

<%case "next"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if
set rs=server.createobject("adodb.recordset")
rs.open"select * from price where bookid="&request("id")&"",conn,1,1
bookname=rs("bookname")
bookid=rs("bookid")
money=split(rs("money"),"|")
att=rs("att")
anclassid=rs("anclassid")
nclassid=rs("nclassid")
ppid=rs("ppid")
kucun=rs("kucun")
rs.close
rs.open "select * from shop_songhuo where fangshi=0 and subject like '%"&request("songhuo")&"%' order by songidorder",conn,1,1
subject=split(rs("subject"),"|")
rs.close
set rs=nothing%>
<table border="0" cellpadding="5" cellspacing="1" class="bgcolor">
<form name="myform" method="post" action="?action=ok">
<tr class="tdcolor">
<td height="25" colspan="2"><b>进一步填写会员收货资料，以便我们能及时地发货。</b>
<input name="username" type="hidden" value="<%=session("username")%>">
<input name="userid" type="hidden" value="<%=session("userid")%>">
<input name="bookname" type="hidden" value="<%=bookname%>">
<input name="bookid" type="hidden" value="<%=bookid%>">
<input name="anclassid" type="hidden" value="<%=anclassid%>">
<input name="nclassid" type="hidden" value="<%=nclassid%>">
<input name="ppid" type="hidden" value="<%=ppid%>">
<input name="goumaijia" type="hidden" value="<%=money(1)%>">
<input name="goumaicount" id="goumaicount" value="<%=request("goumaicount")%>" type="hidden">
<input name="songhuo" id="songhuo" type="hidden" value="<%=request("songhuo")%>">
<input name="zhifu" id="zhifu" type="hidden" value="<%=request("zhifu")%>">
<input name="att" type="hidden" value="<%=att%>">
<input name="feiyong" id="feiyong" type="hidden" value="<%=subject(1)%>">
<input name="zonge" id="zonge" type="hidden" value="<%=request("zonge")%>">
<input name="from" id="from" value="<%=request("from")%>" type="hidden">
</td>
</tr>
<tr class="tdcolor">
<td width="20%" height="25">收货人真实姓名：</td>
<td><input name="shouhuoname" id="shouhuoname" class="wenbenkuang">性别：<select name="sex" id="sex" class="select">
<option value="先生">先生</option>
<option value="女士">女士</option>
</select></td>
</tr>
<tr class="tdcolor">
<td height="25">收货人的联系电话：</td>
<td><input name="tel" id="tel" class="wenbenkuang"></td>
</tr>
<tr class="tdcolor">
<td height="25">具体的收货地址：</td>
<td><input name="address" id="address" size="35" class="wenbenkuang"></td>
</tr>
<tr class="tdcolor">
<td height="25">邮政编码：</td>
<td><input name="post" id="post" class="wenbenkuang"></td>
</tr>
<tr class="tdcolor">
<td height="25">Email：</td>
<td><input name="Email" id="Email" class="wenbenkuang"></td>
</tr>
<tr class="tdcolor">
<td height="25">简单留言：</td>
<td><input name="reply" id="reply" size="35" class="wenbenkuang"></td>
</tr>
<tr class="tdcolor">
<td height="25"></td>
<td><input type="reset" name="submit" onclick="history.go(-1)" value="上一步" class="wenbenkuang">&nbsp;<input name="submit" type="submit" value="确定提交订单" class="wenbenkuang"></td>
</tr>
</form>
</table>

<%case "ok"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if
set rs=server.createobject("adodb.recordset")
rs.open"select * from price_action",conn,2,3
rs.addnew
rs("dingdanno")=replace(year(now)&month(now)&day(now)&minute(now),":","")
rs("username")=trim(request("username"))
rs("userid")=trim(request("userid"))
rs("bookid")=trim(request("bookid"))
rs("bookname")=trim(request("bookname"))
rs("anclassid")=trim(request("anclassid"))
rs("nclassid")=trim(request("nclassid"))
rs("ppid")=trim(request("ppid"))
rs("goumaijia")=trim(request("goumaijia"))
rs("goumaicount")=trim(request("goumaicount"))
rs("songhuo")=trim(request("songhuo"))
rs("zhifu")=trim(request("zhifu"))
rs("att")=trim(request("att"))
rs("zonge")=trim(request("zonge"))
rs("feiyong")=trim(request("feiyong"))
rs("shouhuoname")=trim(request("shouhuoname"))
rs("sex")=trim(request("sex"))
rs("tel")=trim(request("tel"))
rs("address")=trim(request("address"))
rs("post")=trim(request("post"))
rs("Email")=trim(request("Email"))
rs("reply")=trim(request("reply"))
rs("updatetime")=now()
rs("overdatetime")=now()
rs("from")=trim(request("from"))&"|平台"
rs("act")="等待审核"
rs.update
bookid=rs("bookid")
goumaicount=rs("goumaicount")
userid=rs("userid")
goumaijia=rs("goumaijia")
rs.close
rs.open"select * from price where bookid="&bookid,conn,1,3
rs("kucun")=rs("kucun")-goumaicount
rs("chengjiaocount")=rs("chengjiaocount")+1
rs.update
rs.close
rs.open"select * from [user] where userid="&userid,conn,1,3
rs("jifen")=rs("jifen")+100
rs("jiaoyijine")=rs("jiaoyijine")+goumaijia
rs.update
rs.close
set rs=nothing
response.write "<span style='height:500px;font-size:12px;padding-top:200px;padding-left:150px;color:red'>提交成功！我们会尽快安排发货</span><script>window.setTimeout(""location.href='?action=dingdan'"",1000);</script>"%>

<%case "dingdan"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if%>
<table border="0" cellspacing="1" cellpadding="5" class="bgcolor">
<tr><td colspan="9" class="managetop">订单明细</td></tr>
<tr class="tdcolor">
<td>订单号</td>
<td>订购商品</td>
<td>订购数量</td>
<td>订购价格</td>
<td>费用</td>
<td>总额</td>
<td>处理状态</td>
<td>处理日期</td>
<td>管理</td>
</tr><%set rs=server.createobject("adodb.recordset")
rs.open"select * from price_action where userid="&session("userid")&" order by updatetime desc",conn,1,1
if not rs.eof then
rs.PageSize =15 '每页记录条数
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
end if
For i=1 To x%>
<tr class="tdcolor">
<td><%=rs("dingdanno")%></td>
<td><%=rs("bookname")%></td>
<td><%=rs("goumaicount")%></td>
<td><%=rs("goumaijia")%>元</td>
<td><%=rs("feiyong")%>元</td>
<td><font color="red"><%=rs("zonge")%>元</font></td>
<td><%=rs("act")%></td>
<td><%=rs("overdatetime")%></td>
<td><a href="?action=del&id=<%=rs("id")%>">删除</a></td>
</tr>
<%rs.movenext
next
rs.close
set rs=nothing%>
<tr class="tdcolor"><td colspan="9" align="center">
<%Dim query, a, x, temp
if instr(Request.ServerVariables("QUERY_STRING"), "&")>=0 then
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
end if
if page<=1 then%>首页 上页
<%else%>
<a href="<%=request.ServerVariables("url")%>?<%=temp%>page=1">首页</a>&nbsp;
<a href="<%=request.ServerVariables("url")%>?<%=temp%>page=<%=(page-1)%>">上页</a>
<%end if%>
<%if page>=maxpage then%> 下页 尾页
<%else%>
<a href="<%=request.ServerVariables("url")%>?<%=temp%>page=<%=page+1%>">下页</a>&nbsp;
<a href="<%=request.ServerVariables("url")%>?<%=temp%>page=<%=maxpage%>">尾页</a> 
<%end if%>
页次：<%= page %>/<%=maxpage%>页&nbsp;
共有<%= icount %>条&nbsp;
转到<input tyep="text" name=page size=2 maxlength=5 value="<%=page%>" class="wendbenkuang">页<input type=submit value=go class="go-wenbenkuang"></form>
</td></tr>
</table>

<%'删除订单
case "del"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if
conn.execute"delete from price_action where userid="&session("userid")&" and id="&request("id")&" "
response.write "<span style='height:500px;font-size:12px;padding-top:200px;padding-left:150px;color:red'>删除成功</span><script>window.setTimeout(""location.href='?action=dingdan'"",1000);</script>"
'开通商频协议
case "xieyi"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if
set rs=server.createobject("adodb.recordset")
rs.open"select * from shop_config where id=3",conn,1,1
content=rs("vipsq")
rs.close%>
<table>
<tr><td><%=content%></td></tr>
</table>

<%'判断开启商频系统的名称是否有重复
case "paimaiyes"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if
set rs=server.createobject("adodb.recordset")
rs.open"select * from [user] where UserSetting like '%"&request("UserSetting")&"%' ",conn,1,1
if rs.recordcount>0 then
response.write "<span style='height:500px;font-size:12px;padding-top:200px;padding-left:150px;color:red'>您创建的名称已经被占用！</span><script>window.setTimeout(""location.href='?action=paimai'"",1000);</script>"
else
set rs=server.CreateObject("adodb.recordset")
rs.open"select * from [user] where username='"&session("username")&"'",conn,1,3
rs("lockuser")=1
rs("UserSetting")=request("UserSetting")
rs("useremail")=request("useremail")
rs("userzhenshiname")=request("userzhenshiname")
rs("shouhuodizhi")=request("shouhuodizhi")
rs("youbian")=request("youbian")
rs("usertel")=request("usertel")
rs("birthday")=now()
rs.update
rs.close
response.write "<span style='height:500px;font-size:12px;padding-top:200px;padding-left:150px;color:red'>个人商频开启成功，开始添加您的商品吧！</span><script>window.setTimeout(""location.href='?action=paimai'"",1000);</script>"
end if
'删除商品
case "paimaidel"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if
set rs=server.createobject("adodb.recordset")
rs.open"select * from price_user where id="&request("id"),conn,1,1
if rs("pic")<>"" Then
image="../"+rs("pic")     '//后期要加上多张图片特殊字符删除程序
Set fso = Server.CreateObject("Scripting.FileSystemObject")
If fso.FileExists(server.mappath(image)) Then
fso.DeleteFile(server.mappath(image)),true
end if
end if
conn.execute "delete from price_user where id in ("&request("id")&")"
response.write "<span style='height:500px;font-size:12px;padding-top:200px;padding-left:150px;color:red'>删除成功</span><script>window.setTimeout(""location.href='index.asp?action=paimai'"",1000);</script>"

'进入商频系统
case "paimai"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if
set rs=server.CreateObject("adodb.recordset")
rs.open"select * from [user] where username='"&session("username")&"' ",conn,1,1
if not rs.eof then
lockuser=rs("lockuser")
useremail=rs("useremail")
userzhenshiname=rs("userzhenshiname")
shouhuodizhi=rs("shouhuodizhi")
youbian=rs("youbian")
usertel=rs("usertel")
rs.close
'没有开通商频的用户
if lockuser=0 then%>
<%'已经开通商频的用户直接显示商品库
else%>
<%end if
end if%>

<%case "addpro"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if
dim count
set rs=server.createobject("adodb.recordset")
rs.open "select * from shop_Nclass order by Nclassidorder ",conn,1,1%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof 
%>
subcat[<%=count%>] = new Array("<%= trim(rs("Nclass"))%>","<%= rs("anclassid")%>","<%= rs("Nclassid")%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myformone.Nclassid.length = 0; 
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{ 
document.myformone.Nclassid.options[document.myformone.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
}        
}    
}    
</script>
<script language="javascript">
<!--
function checkmyformone()
{
 if(checkspace(document.myformone.bookname.value)) {
	document.myformone.bookname.focus();
alert("对不起，请添加产品名称！");
	return false;
}
 if(checkspace(document.myformone.money.value)) {
	document.myformone.money.focus();
alert("对不起，请添加出售价格！");
	return false;
}
 if(checkspace(document.myformone.kucun.value)) {
	document.myformone.kucun.focus();
alert("对不起，请添加出售数量！");
	return false;
}
 if(checkspace(document.myformone.pic.value)) {
	document.myformone.pic.focus();
alert("对不起，请为产品加上图片或打电话0532-82924086联系我们帮您制作产品图片！");
	return false;
}
 if(checkspace(document.myformone.hid.value)) {
	document.myformone.hid.focus();
alert("对不起，请写明产品介绍！");
	return false;
}
}
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
-->
</script>
<%case "editpro"
set rs=server.createobject("adodb.recordset")
rs.open"select * from price_user where id="&request("id"),conn,1,1
Rbookname=rs("bookname")
Ranclassid=rs("anclassid")
Rnclassid=rs("nclassid")
Ratt=rs("att")
Rmoney=rs("money")
Rkucun=rs("kucun")
Rppid=rs("ppid")
Rpic=rs("pic")
Rhid=rs("hid")
Rupdatetime=rs("updatetime")
rs.close
set rs=nothing

set rs=server.createobject("adodb.recordset")
rs.open "select * from shop_Nclass order by Nclassidorder ",conn,1,1%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof 
%>
subcat[<%=count%>] = new Array("<%= trim(rs("Nclass"))%>","<%= rs("anclassid")%>","<%= rs("Nclassid")%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.Nclassid.length = 0; 
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{ 
document.myform.Nclassid.options[document.myform.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
}        
}    
}    
</script>
<%case "savepro"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if
if request("id")<>"" then
set rs=server.createobject("adodb.recordset")
rs.open"select * from price_user where id="&request("id"),conn,1,3
'修改图片将原图片删除
picup=request("pic")
if rs("pic")<>picup then
image="../"+rs("pic")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
If fso.FileExists(server.mappath(image)) Then
fso.DeleteFile(server.mappath(image)),true
else
Response.Write " 原图不存在 "
end if
end if

else
set rs=server.createobject("adodb.recordset")
rs.open"select * from price_user",conn,1,3
rs.addnew
rs("bookid")=request("bookid")
rs("datetime")=now()
rs("count")=1
end if
rs("bookname")=trim(request("bookname"))
rs("pic")=trim(request("pic"))
rs("money")=trim(request("money"))
rs("hid")=trim(request("hid"))'产品介绍
rs("userid")=session("userid")
rs("username")=session("username")
rs("att")=trim(request("att"))'品牌
rs("anclassid")=request("anclassid")'大类
rs("nclassid")=request("nclassid")'小类
'rs("ppid")=request("ppid")'拍卖期限
rs("kucun")=request("kucun")'拍卖商品的数量
rs("updatetime")=request("updatetime")

rs.update
rs.close
set rs=nothing
response.write "<span style='height:500px;font-size:12px;padding-top:200px;padding-left:150px;color:red'>提交成功</span><script>window.setTimeout(""location.href='index.asp?action=paimai'"",1000);</script>"
%>

<%case "view"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if
set rs=server.createobject("adodb.recordset")
rs.open"select * from [user] where userid="&session("userid"),conn,1,1
if not rs.eof then
useremail=rs("useremail")
userzhenshiname=rs("userzhenshiname")
shouhuodizhi=rs("shouhuodizhi")
youbian=rs("youbian")
usertel=rs("usertel")
UserSetting=rs("UserSetting")
rs.close
end if
%>
<%case "paimaiyesII"
if session("username")="" then
response.Redirect "index.asp"
response.End
end if

set rs=server.CreateObject("adodb.recordset")
rs.open"select * from [user] where username='"&session("username")&"'",conn,1,3
rs("UserSetting")=request("UserSetting")
rs("useremail")=request("useremail")
rs("userzhenshiname")=request("userzhenshiname")
rs("shouhuodizhi")=request("shouhuodizhi")
rs("youbian")=request("youbian")
rs("usertel")=request("usertel")
rs.update
rs.close
response.write "<span style='height:500px;font-size:12px;padding-top:200px;padding-left:150px;color:red'>个人商频修改成功</span><script>window.setTimeout(""location.href='?action=paimai'"",1000);</script>"


case "bb"
%>
