www.gusucode.com > 运动用品商城网站系统源代码程序 > feyok/ad_submore.asp
<!--#include file="conn.asp"--> <!--#include file="ad_chk.asp"--> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <link href=inc/css.css rel=STYLESHEET type=text/css> <body topmargin="5" leftmargin="5" rightmargin="5" bottommargin="5"> <% if Request.Cookies("venshop")("admin_class")<>0 and Request.Cookies("venshop")("admin_class")<>2 then response.write "你没有这个权限!" response.end end if %> <% errmeg="定购数量不能大于库存!" errmes1="没有此订单信息!" errmes2="订单状态修改成功!" errmes3="此订单信息已经删除!" host=lcase(request.servervariables("HTTP_HOST")) if request("action")="change" then if request("count")="" or Not(isNumeric(request("count"))) then count=1 else count=Cint(request("count")) end if hw_price=Cint(request("hw_price")) basket_id=request("basket_id") set rs=server.createobject("adodb.recordset") sql="select * from venshop_basket where basket_id="&basket_id&" and basket_check=1" rs.open sql,conn,1,3 if not rs.eof then rs("basket_count")=count rs("hw_price")=hw_price rs.update end if rs.close set rs=nothing call editok(editt,"ad_submore.asp?sub_id="&request("sub_id"),"ad_submore.asp?sub_id="&request("sub_id")) elseif request("action")="delb" then basket_id=request("basket_id") set rs=server.createobject("adodb.recordset") sql="select * from venshop_basket where basket_id="&basket_id&" and basket_check=1" rs.open sql,conn,1,3 if rs.eof then response.redirect "ad_submore.asp?sub_id="&request("sub_id") response.End else rs.delete rs.update end if rs.close set rs=nothing call deleok(delet,"ad_submore.asp?sub_id="&request("sub_id")) end if if request("action")="zt" then i=request("sub_zt") if Not(isNumeric(i)) or i>5 then response.write "Error!!!!" response.end end if set rs=server.createobject("adodb.recordset") sql="select * from venshop_sub where sub_id="&request("sub_id")&"" rs.open sql,conn,1,3 if rs.eof then response.write errmes1 response.end end if sub_name=rs("sub_name") sub_number=rs("sub_number") if request("sub_zt")>=3 and rs("sub_k")=0 then set rs1=server.createobject("adodb.recordset") sql1="select * from venshop_user where username='"&sub_name&"'" rs1.open sql1,conn,1,3 if not rs1.eof then set rs2=server.createobject("adodb.recordset") sql2="select * from venshop_basket where sub_number='"&sub_number&"'" rs2.open sql2,conn,1,1 do while not rs2.eof rs1("savemoney")=rs1("savemoney")+rs2("hw_jifen")*rs2("basket_count") rs2.movenext loop rs2.close set rs2=nothing tcheck=0 set rs2=server.createobject("adodb.recordset") rs2.open "select * from venshop_usertype order by usertype_up desc",conn,1,1 do while not rs2.eof if tcheck=0 then if rs2("usertype_up")<=rs1("savemoney") then tcheck=1 usertype_id=rs2("usertype_id") end if end if rs2.movenext loop rs2.close set rs2=nothing rs1("user_type")=usertype_id rs1.update end if rs1.close set rs1=nothing rs("sub_k")=1 end if if request("sub_zt")>=4 and rs("sub_h")=0 then set rs2=server.createobject("adodb.recordset") sql2="select * from venshop_basket where sub_number='"&sub_number&"'" rs2.open sql2,conn,1,1 do while not rs2.eof hw_id=rs2("hw_id") set rs1=server.createobject("adodb.recordset") sql1="select * from venshop_hw where hw_id="&hw_id&"" rs1.open sql1,conn,1,3 if not rs1.eof then rs1("hw_kucun")=rs1("hw_kucun")-rs2("basket_count") rs1.update rs1.close set rs1=nothing end if rs2.movenext loop rs2.close set rs2=nothing rs("sub_h")=1 end if rs("sub_zt")=i if i=-1 or i="-1" then i=1 if i<>0 then rs("sub_zt"&i)=request("sub_zti") rs("sub_yunfei")=request("sub_yunfei") rs("sub_date"&i)=now() end if rs.update rs.close set rs=nothing call editok(editt,"ad_submore.asp?sub_id="&request("sub_id"),"ad_submore.asp?sub_id="&request("sub_id")) elseif request("action")="del" then set rs=server.createobject("adodb.recordset") sql="select * from venshop_sub where sub_id="&request("sub_id")&"" rs.open sql,conn,1,3 sub_number=rs("sub_number") rs.delete rs.update rs.close set rs=nothing set rs=server.createobject("adodb.recordset") sql="select * from venshop_basket where sub_number='"&sub_number&"'" rs.open sql,conn,1,3 do while not rs.eof rs.delete rs.movenext loop rs.close set rs=nothing call deleok(delet,"ad_sub.asp") end if set rs=server.createobject("adodb.recordset") sql="select * from venshop_sub where sub_id="&request("sub_id")&"" rs.open sql,conn,1,1 if rs.eof then response.write errmes1 response.end end if user_name=rs("sub_name") sub_psname=rs("sub_psname") sub_yunfei=rs("sub_yunfei") sub_fapiao=rs("sub_fapiao") zp_id=rs("zp_id") zp_name=rs("zp_name") zp_price=rs("zp_price") zp_full=rs("zp_full") %> <table border="0" cellpadding="5" cellspacing="0" class="st"> <tr><td colspan="6" align="center" class="sa">定单号:<font color="#FF0000"><%=rs("sub_number")%><%sub_number=rs("sub_number")%></font> 日期:<font color="#808080"><%=rs("sub_date")%></font> 用户名:<%=rs("sub_name")%></td></tr> <tr><td bgcolor="#FFFFFF" colspan="6" class="s1"> <table border="0" cellpadding="5" cellspacing="0"> <tr><td height="23">订单状态:</td> <td width="150" height="23"><%if rs("sub_zt")=0 then response.write "无效订单"%> <%if rs("sub_zt")=1 then response.write "未处理"%> <%if rs("sub_zt")=-1 then response.write "已处理等待客户付款"%> <%if rs("sub_zt")=2 then response.write "已付款等待发货"%> <%if rs("sub_zt")=3 then response.write "已收款发货中"%> <%if rs("sub_zt")=4 then response.write "已发货注意收货"%> <%if rs("sub_zt")=5 then response.write "已收货(归档)"%> <%i=rs("sub_zt")%></td> <td height="23">下单时间:</td> <td height="23" width="200"><%=rs("sub_date")%></td></tr> <%if rs("sub_date1")<>"" then%> <tr><td height="23">处理时间:</td> <td width="150" height="23"><%=rs("sub_date1")%></td> <td height="23">处理说明:</td> <td height="23" width="200"><%=rs("sub_zt1")%></td></tr> <%end if%> <%if rs("sub_date2")<>"" then%> <tr><td height="23">付款时间:</td> <td width="150" height="23"><%=rs("sub_date2")%></td> <td height="23">付款说明:</td> <td height="23" width="200"><%=rs("sub_zt2")%></td></tr> <%end if%> <%if rs("sub_date3")<>"" then%> <tr><td height="23">收款时间:</td> <td width="150" height="23"><%=rs("sub_date3")%></td> <td height="23">收款说明:</td> <td height="23" width="200"><%=rs("sub_zt3")%></td></tr> <%end if%> <%if rs("sub_date4")<>"" then%> <tr><td height="23">发货时间:</td> <td width="150" height="23"><%=rs("sub_date4")%></td> <td height="23">发货说明:</td> <td height="23" width="200"><%=rs("sub_zt4")%></td></tr> <%end if%> <%if rs("sub_date5")<>"" then%> <tr><td height="23">到货时间:</td> <td width="150" height="23"><%=rs("sub_date5")%></td> <td height="23">到货说明:</td> <td height="23" width="200"><%=rs("sub_zt5")%></td></tr> <%end if%> </table> <table border="0" cellspacing="0" cellpadding="5"> <form method="POST" action="ad_submore.asp?sub_id=<%=rs("sub_id")%>&action=zt"><tr><td width="0">修改状态:</td> <td><select size="1" name="sub_zt"> <option value="0"<%if rs("sub_zt")=0 then response.write " selected"%>>无效订单</option> <option value="1"<%if rs("sub_zt")=1 then response.write " selected"%>>未处理</option> <option value="-1"<%if rs("sub_zt")=-1 then response.write " selected"%>>已处理等待客户付款</option> <option value="2"<%if rs("sub_zt")=2 then response.write " selected"%>>已付款等待发货</option> <option value="3"<%if rs("sub_zt")=3 then response.write " selected"%>>已收款发货中</option> <option value="4"<%if rs("sub_zt")=4 then response.write " selected"%>>已发货注意收货</option> <option value="5"<%if rs("sub_zt")=5 then response.write " selected"%>>已收货(归档)</option> </select> <img border="0" src="Img/ad_help.gif" class="helpimg" alt="确认到款后客户积分会自动增加 / 缺货发货后库存会自动减少"></td> <td rowspan="3" valign="bottom"><input type="submit" value="处理订单" name="submit1" style="width: 75; height: 36"></td></tr> <tr><td width="0">处理说明:</td> <td><%zti=rs("sub_zt") if zti<0 then zti=-zti%> <textarea rows="2" name="sub_zti" cols="38"><%=rs("sub_zt"&zti)%></textarea> <img border="0" src="Img/ad_help.gif" class="helpimg" alt="例如:货源充足,请即时付款 / 货款收到,我们会及时发货 / 货已发,单号:*** / 感谢您的支持,欢迎再次光临!"></td> </tr> <tr><td width="0">更改运费:</td> <td><%=fuhao%> <input type="text" name="sub_yunfei" size="5" value="<%=trim(rs("sub_yunfei"))%>"> <%=danwei%></td> </tr></form></table></td></tr> <tr><td bgcolor="#F0F0F0" colspan="6" class="sa">订 货 人:<b><%=rs("sub_from")%></b></td></tr> <tr><td bgcolor="#FFFFFF" colspan="6"><table border="0" width="600" cellspacing="0" cellpadding="0" id="table1"> <tr><td bgcolor="#FFFFFF" height="23" width="50%">地 址:<%=rs("sub_fromadds")%> </td><td bgcolor="#FFFFFF" height="23">邮编:<%=rs("sub_frompost")%></td></tr> <tr><td bgcolor="#FFFFFF" height="23" width="50%">邮 箱:<%=rs("sub_frommail")%></td><td bgcolor="#FFFFFF" height="23">电话:<%=rs("sub_fromtel")%></td></tr> </table> </td></tr> <tr><td bgcolor="#F0F0F0" colspan="6" class="sa">收 货 人:<b><%=rs("sub_to")%></b></td></tr> <tr><td bgcolor="#FFFFFF" colspan="6"><table border="0" width="600" cellspacing="0" cellpadding="0" id="table1"> <tr><td bgcolor="#FFFFFF" height="23" width="50%">收货地址:<%=rs("sub_adds")%> </td><td bgcolor="#FFFFFF" height="23">邮编:<%=rs("sub_post")%></td></tr> <tr><td bgcolor="#FFFFFF" height="23" width="50%">邮 箱:<%=rs("sub_mail")%></td><td bgcolor="#FFFFFF" height="23">电话:<%=rs("sub_tel")%></td></tr> </table></td></tr> <tr><td bgcolor="#F0F0F0" colspan="6" class="sa">到货时间:<%=rs("sub_totime")%></td></tr> <tr><td bgcolor="#FFFFFF" colspan="6"><table border="0" width="600" cellspacing="0" cellpadding="0" id="table1"> <tr><td height="20" bgcolor="#FFFFFF" width="50%">付款方式:<%=rs("sub_payname")%></td> <td height="20" bgcolor="#FFFFFF" width="50%">送货方式:<%=rs("sub_psname")%></td></tr> <tr><td height="20" bgcolor="#FFFFFF" width="50%">需要发票:<%if fapiao=1 then%> <%if rs("sub_fapiao")=1 then%>需要(抬头:<%=rs("sub_taitou")%>)<%else%>不需要<%end if%><%else%>不提供<%end if%></td> <td height="20" bgcolor="#FFFFFF" width="50%">缺货处理:<%if rs("sub_quehuo")=1 then%>等待到货<%else%>从订单取消<%end if%></td></tr> <tr><td height="20" bgcolor="#FFFFFF" colspan="2">其它说明:<%=rs("sub_other")%></td></tr> </table></td></tr> <%rs.close set rs=nothing%> <tr bgcolor="#f0f0f0"> <td colspan="6" bgcolor="#F0F0F0" align="center" class="sa">订购货物列表</td></tr> <tr bgcolor="#f7f7f7"><td align="center" class="s0">货物名称</td> <td align="center" class="s0">单价</td><td align="center" class="s0">数量</td> <td align="center" class="s0">备注</td><td align="center" class="s0">合计</td> <td align="center" class="s0"></td></tr> <%set rs=server.CreateObject("adodb.recordset") sql="select * from venshop_basket where sub_number='"&sub_number&"' and user_name='"&user_name&"' and basket_check=1" rs.open sql,conn,1,1 if rs.eof then response.write "" else i=0 do while not rs.eof i=i+1 %> <form name="form1" method="POST" action="ad_submore.asp?action=change&basket_id=<%=rs("basket_id")%>&sub_id=<%=request("sub_id")%>"> <tr><td align="center" class="s<%=i mod 2%>"><a href=../views.asp?hw_id=<%=rs("hw_id")%> target=_blank><%=rs("hw_name")%></a></td> <td align="center" class="s<%=i mod 2%>"><%=fuhao%> <input type="text" name="hw_price" size="5" value="<%=trim(rs("hw_price"))%>"> <%=danwei%></td> <td align="center" class="s<%=i mod 2%>"><input type="text" name="count" size="2" value="<%=rs("basket_count")%>"></td> <td align="center" class="s<%=i mod 2%>"><%=rs("kxa")%> <%=rs("kxb")%></td> <td align="center" class="s<%=i mod 2%>"><%=fuhao%> <%=trim(rs("hw_price"))*rs("basket_count")%> <%=danwei%></td> <%totalcash=totalcash+trim(rs("hw_price"))*rs("basket_count") totaljifen=totaljifen+rs("hw_jifen")*rs("basket_count") totalw=totalw+(rs("basket_count")*trim(rs("hw_weight"))) totaly=totaly+(rs("basket_count")*trim(rs("hw_yunfei"))) totalc=totalc+rs("basket_count") %> <td align="center" class="s<%=i mod 2%>"> <input type="submit" value="更改" name="B1"> <input onclick="javascript:window.open('ad_submore.asp?action=delb&basket_id=<%=rs("basket_id")%>&sub_id=<%=request("sub_id")%>','_self','')" type="button" value="删除"></td> </tr></form> <%rs.movenext loop rs.close set rs=nothing%> <%set rs=server.CreateObject("adodb.recordset") sql="select user_type from venshop_user where username='"&user_name&"'" rs.open sql,conn,1,1 if rs.eof then zhekou=100 usertype_name="一般用户" zhekouyu="不享受折扣价" rs.close set rs=nothing else usertype=rs("user_type") rs.close set rs=nothing set rs=server.CreateObject("adodb.recordset") sql="select * from venshop_usertype where usertype_id="&usertype&"" rs.open sql,conn,1,1 if rs.eof then zhekou=100 usertype_name="一般用户" zhekouyu="不享受折扣价" else zhekou=rs("usertype_zhekou") usertype_name=rs("usertype_name") zhekouyu="享受原价"&zhekou&"%的折扣价" end if rs.close set rs=nothing end if%> <%if totalcash*zhekou/100>=zp_full and zp_id>0 then i=i+1%> <tr><td class="s<%=i mod 2%>" align="center"><a href=../viewzp.asp?zp_id=<%=zp_id%> target=_blank><%=zp_name%></a></td> <td class="s<%=i mod 2%>" align="center"><%=fuhao%> 0 <%=danwei%></td> <td class="s<%=i mod 2%>" align="center">1</td> <td class="s<%=i mod 2%>" align="center">赠品</td> <td class="s<%=i mod 2%>" align="center"><%=fuhao%> 0 <%=danwei%></td> <td class="s<%=i mod 2%>" align="center"></td> </tr> <%end if i=i+1%> <tr><td class="s<%=i mod 2%>" colspan="6" align="right"> <p style="line-height: 200%; margin-left:5px; margin-right:15px; margin-top:5px; margin-bottom:5px"> 共 <span class="price"><%=totalc%></span> 件商品 价格总计:<span class="price"><%=fuhao%> <%=totalcash%> <%=danwei%></span> <font color="#0000FF"><%=usertype_name%></font>(<%=zhekouyu%>)<br> 收货方式:<%=sub_psname%> 附加费用:<%=sub_yunfei%><br> 折后总计:<%totalcash=checkshui(totalcash*zhekou/100+sub_yunfei,shuidian,sub_fapiao)%><span class="price"><%=fuhao%> <%=FormatNum(totalcash)%> <%=danwei%></span><%if sub_fapiao=1 then%>(索要发票需要加收<%=shuidian%>%的税点)<%end if%> 获得积分:<%=totaljifen%> </td> </tr><%end if i=i+1%> <tr><td class="s<%=i mod 2%>" colspan="6" align="center"> <a href="ad_submore.asp?sub_id=<%=request("sub_id")%>&action=del" onClick="return confirm('您确定进行删除操作吗?')"> <font color="#FF0000">删除此订单</font></a><font color="#FF0000"> </font> <a href="ad_create.asp?sub_id=<%=request("sub_id")%>"><font color="#FF0000">订单打印</font></a></td></tr></table> <!--#include file="ad_bottom.asp"-->