<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../conn/nosql.asp"-->
<!--#include file="../../conn/config.asp"-->
<!--#include file="../../conn/count.asp"-->
<!--#include file="../page.asp"-->
<!--#include file="../count.asp"-->
<%
if isChkInteger(request("web_id")) then
web_id=request("web_id")
else
Response.Redirect ("../../index.asp")
end if
sql="select * from snsn_user where id="&web_id
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1
if rs.eof or rs.bof then
response.write "<script language='javascript'>"
response.write "alert('没有此用户，请确认后或联系管理员再访问本页！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
else
%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<link rel="stylesheet" href="css.css" type="text/css">
<style type="text/css">
<!--
.tmpstr {word-break:break-all}

-->
</style>
<script language="Javascript" src="/minishow/js/ps_only.js"></script>
</head>
<body>
<%action=request("action")
if action="gm" then
			if session("id")="" then
			   response.write "<script language='javascript'>"
                    response.write "alert('对不起，请登录后再访问本页！');"
                    response.write"javascript:history.go(-1)</SCRIPT>"
			        response.End()
end if
				if isChkInteger(request("goodid")) then
goodid=request("goodid")
else
response.write "<script language='javascript'>"
response.write "alert('非法操作，正在返回！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
end if
			sql="select * from mini_goods where goodid="&goodid&" and userid="&nosql(session("id"))
			set rs=conn.execute(sql)
		    if not rs.eof then
				response.write "<script language='javascript'>"
                response.write "alert('您已经购买过本商品了，请返回！');"
                response.write"javascript:history.go(-1)</SCRIPT>"
				response.End()
		    else
		      
		sql="select * from mini_minilist where id="&goodid
         Set mini= Server.CreateObject("ADODB.Recordset") 
         mini.open sql,conn,1,3
		 if not mini.eof then
		 sql="select * from snsn_user where id="&nosql(session("id"))
                  Set rsjf= Server.CreateObject("ADODB.Recordset") 
                 rsjf.open sql,conn,1,3

                    if rsjf("jifen")<(clng(mini("minijg"))*session("youhui")) then
			        response.write "<script language='javascript'>"
                    response.write "alert('您的积分不够了，请返回！');"
                    response.write"javascript:history.go(-1)</SCRIPT>"
			        response.End()
			        else
			        rsjf("jifen")=rsjf("jifen")-(clng(mini("minijg"))*session("youhui"))
			        rsjf("mini_sl")=rsjf("mini_sl")+1
			        rsjf("mini_jg")=rsjf("mini_jg")+clng(mini("minijg"))
			        rsjf.update
		            end if
					session("jifen")=rsjf("jifen")
					session("mini_sl")=rsjf("mini_sl")
                    session("mini_jg")=rsjf("mini_jg")
				  rsjf.close
                  set rsjf=nothing
		 mini("buynum")=mini("buynum")+1
		 mini.update

		 conn.execute="insert into mini_goods (goodpath,cate,bigclassid,userid,goodname,goodid,goodjg,sydate,minilx) values('"&mini("minipic")&"',"&mini("smllclassid")&","&mini("bigclassid")&","&nosql(session("id"))&",'"&mini("mininame")&"',"&goodid&","&mini("minijg")&","&mini("sydate")&","&mini("minilx")&")"
					response.write "<script language='javascript'>"
                    response.write "alert('购买成功:\n\n    物品已经放入到你的物品栏里，点击家园管理可以进行装饰房间！');"
	                response.write"javascript:history.go(-1)</SCRIPT>"
			        response.End()
					
					else
								   response.write "<script language='javascript'>"
                    response.write "alert('未找到该产品，请返回！');"
                    response.write"javascript:history.go(-1)</SCRIPT>"
			        response.End()
		    end if
					  mini.close
          set mini=nothing
			end if
			
			
			
			elseif action="shc" then
			if session("id")="" then
			   response.write "<script language='javascript'>"
                    response.write "alert('对不起，请登录后再访问本页！');"
                    response.write"javascript:history.go(-1)</SCRIPT>"
			        response.End()
end if
			if isChkInteger(request("miniid")) then
miniid=request("miniid")
else
response.write "<script language='javascript'>"
response.write "alert('非法操作，正在返回！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
end if
			sql="select * from mini_shc where miniid="&miniid&" and userid="&nosql(session("id"))
			set rs=conn.execute(sql)
		    if not rs.eof then
				response.write "<script language='javascript'>"
                response.write "alert('您已经收藏过本商品了，请返回！');"
                response.write"javascript:history.go(-1)</SCRIPT>"
				response.End()
		    else
					sql="select * from mini_minilist where id="&miniid
         Set mini= Server.CreateObject("ADODB.Recordset") 
         mini.open sql,conn,1,3
		 if not mini.eof then

		      sql="insert into mini_shc (minipic,smllclassid,bigclassid,userid,mininame,miniid,minijg,sydate,minilx) values('"&mini("minipic")&"',"&mini("smllclassid")&","&mini("bigclassid")&","&nosql(session("id"))&",'"&mini("mininame")&"',"&miniid&","&mini("minijg")&","&mini("sydate")&","&mini("minilx")&")"
			   conn.execute(sql)
			   response.write "<script language='javascript'>"
                    response.write "alert('收藏成功，请返回！');"
                    response.write"javascript:history.go(-1)</SCRIPT>"
			        response.End()
					else
								   response.write "<script language='javascript'>"
                    response.write "alert('未找到该商品，请返回！');"
                    response.write"javascript:history.go(-1)</SCRIPT>"
			        response.End()
					end if
		    end if
end if
%>
<table width="420"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="22">
      <table width="420"  border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="1" height="1"></td>
          <td height="1" colspan="2" bgcolor="#CCCCCC"></td>
          <td width="1" height="1"></td>
        </tr>
        <tr>
          <td width="1" bgcolor="#CCCCCC"></td>
          <td width="30" bgcolor="#F1F1F1"><div align="center"><span class="M"><IMG 
                              src="img/icon_04.gif" 
                              name=image1754891 width="16" height="13" border=0></span></div></td>
          <td height="25" bgcolor="#F1F1F1"><span class="M"><FONT 
                              color=#000000><a href="web.asp?web_id=<%=web_id%>"><U><%=home%></U></a></FONT> -&gt; <FONT 
                              color=#000000><a href="yw.asp?web_id=<%=web_id%>"><u>愿望</u></a> </FONT></span></td>
          <td width="1" bgcolor="#CCCCCC"></td>
        </tr>
        <tr>
          <td width="1" height="1"></td>
          <td height="1" colspan="2" bgcolor="#CCCCCC"></td>
          <td width="1" height="1"></td>
        </tr>
      </table></td>
  </tr><tr>
    <td height="6"></td>
  </tr>
  <tr>
    <td valign="top"><div align="center">
      <table width="90%" height="10"  border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td></td>
        </tr>
      </table>
      <%
sql="select * from mini_yw where userid="&web_id&" and zt=0"
sql=""&sql&" order by id desc"
set rs=conn.execute(sql)

i=0
x=-1
if rs.recordcount=0 then 
                        response.write "<p align='center'>对不起，没有您要查询的信息</p>" 
else
			hang=3			'显示的行数
			l=3			'显示的列数
	  		rs.PageSize =hang*l '每页记录条数,必须是3的倍数
			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
			response.write "<table align=center>"
		for ii=1 to hang
			response.write "<tr>"
			for jj=1 to l
				response.write "<td width=""120"">"
				if not rs.eof then
	i=i+1
	x=x+1

%>
      <table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height="100"><div align="center"><img src="<%=rs("minipic")%>" border="0"  name=img<%=x%> id=img<%=x%> onLoad="javascript:ImageResize(this.name);"></div></td>
        </tr>
        <tr>
          <td height="22" colspan="3"><%=rs("mininame")%></td>
        </tr>
        <tr>
          <td height="22" colspan="3"><img src="/minishow/images/money.gif" width="13" height="12"> <%=rs("minijg")%>两(<font color="ff9900"><%=rs("sydate")%></font>天)</td>
        </tr>
        <tr>
          <td height="22" colspan="3"><a href="yw.asp?action=gm&goodid=<%=rs("miniid")%>&web_id=<%=web_id%>"><img src="/minishow/images/xgm.gif" width="30" height="16" border="0"></a> <a href="javascript:;" onClick="window.open('/minishow/yulan.asp?action=yw&goodid=<%=rs("miniid")%>&ywid=<%=rs("id")%>&minijg=<%=rs("minijg")%>&web_id=<%=web_id%>','new','scrollbars=no,resizable=no,width=200,height=200,menubar=no,top=100,left=100')" class=over><img src="/minishow/images/xsy.gif" width="30" height="16" border="0"></a> <a href="yw.asp?action=shc&miniid=<%=rs("miniid")%>&web_id=<%=web_id%>"><img src="/minishow/images/xsc.gif" width="30" height="16" border="0"></a></td>
        </tr>
      </table>
      <%rs.movenext
				else
					response.write "&nbsp;"
				end if
				response.write "</td>"
			next
			response.write "</tr>"
		next
			response.write "</table>"
		end if
		rs.close
		set rs=nothing
%>
      <table width="100%" align="center" background="images/shopbj.gif">
        <tr>
          <td height="30" style="word-break:break-all;"><%call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>",per_page)%>
              <div align="center"> </div></td>
        </tr>
      </table>
</div></td>
  </tr>
</table>
</body>
</html>
<%
end if%>