<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<!--#include file="fuction.asp" -->
<style type="text/css">
<!--
.style1 {	color: #FF6600;
	font-weight: bold;
}
-->
</style>
<!--#include file="webtop.asp"-->
<%dim action
action=request.QueryString("action")%>
<table width="1000" align="center" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="6" colspan="3"></td>
  </tr>
  <tr>
    <td width="20"></td>
    <td valign="bottom"><img src="<%=weburl%>images/arrow01.gif" width="11" height="11" />Your present position:<a href="<%=weburl%>"><%=webname%></a> ->
    <span class="table-shangxia"><span class="b14">All Gift </span></span></td>
    <td valign="bottom"> 
       
    </td>
  </tr>
  <tr>
    <td height="6" colspan="3"></td>
  </tr>
</table>
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0" class="sm_debrown">
  <tr>
    <td height="4" colspan="2" bgcolor="ffffff"></td>
  </tr>
  
  <tr>
    <td width="205" valign="top"><!--#include file="index_login.asp"-->
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="5"><img src="images/ge.gif" width="1" height="5"></td>
      </tr>
      </table>
      <!--#include file="rexiao.asp"-->
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="5"><img src="images/ge.gif" width="1" height="5"></td>
      </tr>
      </table>
      <%if session("username")<>"" then%>
      <table width="200" border="0" align="center" cellpadding="1" cellspacing="1" background="<%=weburl%>images/skin<%=cssid%>/z02.jpg">
              <tr>
                <td width="200" bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td height="30" background="<%=weburl%>images/skin<%=cssid%>/z01.jpg"><div align="center"><span style="font-weight: bold; color: #000000">Your Recent History</span></div></td>
                    </tr>
       
          <td valign="top"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <%set rsl=server.createobject("adodb.recordset")
		    rsl.open "select * from shop_his where username='"&session("username")&"' and lx=1 order by ltime desc",conn,1,1
			while not rsl.eof%>
                  <tr>
                    <td height="22"><img src="<%=weburl%>images/arrow03.gif" width="4" height="6" /> <a href='list.asp?id=<%=rsl("shopid")%>' target=_blank>
                      <%if len(trim(rsl("shopname")))>14 then
	response.write left(trim(rsl("shopname")),14)&".."
	else
	response.write trim(rsl("shopname"))
	end if%>
                      </a></td>
              </tr>
                       <tr>
                <td><img src="<%=weburl%>images/xuxian.gif" width="163" height="1" /></td>
              </tr>
                    
                  <%rsl.movenext
		    wend
		    rsl.close
		  %>
                  </table></td>
       
                </table></td>
              </tr>
          </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="5"><img src="images/ge.gif" width="1" height="5"></td>
      </tr>
        </table>
      <table width="200" border="0" align="center" cellpadding="1" cellspacing="1" background="<%=weburl%>images/skin<%=cssid%>/z02.jpg">
              <tr>
                <td width="200" bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td height="30" background="<%=weburl%>images/skin<%=cssid%>/z01.jpg"><div align="center"><span style="font-weight: bold; color: #000000">Search History</span></div></td>
                    </tr>
   <td valign="top"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <%set rss=server.createobject("adodb.recordset")
		    rss.open "select * from shop_his where username='"&nosql(session("username"))&"' and lx=2 order by ltime desc",conn,1,1
			while not rss.eof%>
                  <tr>
                    <td height="22"><img src="<%=weburl%>images/arrow03.gif" width="4" height="6" /> <%if len(trim(rss("shopname")))>14 then
	response.write left(trim(rss("shopname")),14)&".."
	else
	response.write trim(rss("shopname"))
	end if%>
                      </a></td>
              </tr>
                       <tr>
                <td><img src="<%=weburl%>images/xuxian.gif" width="163" height="1" /></td>
              </tr>
                    
                  <%rss.movenext
		    wend
		    rss.close
			set rss=nothing%>
                  </table></td>
        </tr>
                </table></td>
              </tr>
          </table>
      <%end if%></td>
    <td width="795" valign="top"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="30" background="<%=weburl%>images/skin<%=cssid%>/newsbj.gif"><div align="center" style="color: #333333">
            <div align="left"><strong>CHOOSE SECTION </strong>:<a href="gift.asp?selectm=1">Section A</a>&nbsp;&nbsp;<a href="gift.asp?selectm=2">Section B</a>&nbsp;&nbsp;<a href="gift.asp?selectm=3">Section C</a></div>
        </div></td>
      </tr>
      <tr>
        <td height="53"><p align="left">Free gift is our new promotion from 2008; we have  many small beauty products made in China,  Japan and South Korea,  which no value buying these products from other side of the sea. So we add as <strong>free</strong>. Starts pick your favorable free  gift now for <u>join our member</u>! Enjoy!</p></td>
      </tr>
    </table>
      <%dim selectm,selectkey,selectshopid,anid
selectkey=trim(request(trim("selectkey")))
anid=trim(request("anid"))
selectm=trim(request("selectm"))
if selectkey="" then
selectkey=request.QueryString("selectkey")
end if
if selectkey="请输入关键字" then
selectkey=""
end if
%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30">&gt;&gt;&gt;
      <%select case selectm
	      case ""
		  Response.Write "ALL GIFT"
		  case "1"
		  Response.Write "SECTION:A"
		  case "2"
		  Response.Write "SECTION:B"
		  case "3"
		  Response.Write "SECTION:C"
		  end select
		  %></td>
  </tr>
</table>
<%'开始分页
				Const MaxPerPage=15
   				dim totalPut   
   				dim CurrentPage
   				dim TotalPages
   				dim j
   				dim sql
    				if Not isempty(request("page")) then
      				currentPage=Cint(request("page"))
   				else
      				currentPage=1
   				end if 
			set rs=server.CreateObject("adodb.recordset")
			if anid<>"" then
			            rs.open "select * from shop_jiangpin",conn,1,1
else
			select case selectm
			case ""
            rs.open "select * from shop_jiangpin",conn,1,1
		    case "0"
			rs.open "select * from shop_jiangpin",conn,1,1
			case "1"
			rs.open "select * from shop_jiangpin where sn=1",conn,1,1
			case "2"
			rs.open "select * from shop_jiangpin where sn=2",conn,1,1
			case "3"
			rs.open "select * from shop_jiangpin where sn=3",conn,1,1
			end select
		  end if
		   	if err.number<>0 then
				response.write "NO GIFT"
				end if
				
  				if rs.eof And rs.bof then
       				Response.Write "<p align='center' class='contents'>NO GIFT</p>"
   				else
	  				totalPut=rs.recordcount

      				if currentpage<1 then
          				currentpage=1
      				end if

      				if (currentpage-1)*MaxPerPage>totalput then
	   					if (totalPut mod MaxPerPage)=0 then
	     					currentpage= totalPut \ MaxPerPage
	   					else
	      					currentpage= totalPut \ MaxPerPage + 1
	   					end if
      				end if

       				if currentPage=1 then
            			showContent
            			showpage totalput,MaxPerPage,"gift.asp"
       				else
          				if (currentPage-1)*MaxPerPage<totalPut then
            				rs.move  (currentPage-1)*MaxPerPage
            				dim shopmark
            				shopmark=rs.bookmark
            				showContent
             				showpage totalput,MaxPerPage,"gift.asp"
        				else
	        				currentPage=1
           					showContent
           					showpage totalput,MaxPerPage,"gift.asp"
	      				end if
	   				end if
   				   				end if

   				sub showContent
       			dim i
	   			i=0%> 
  <%
		  do while not rs.eof%>

<table width="98%" border="0" align="center" cellpadding="2" cellspacing="0" onMouseOver='JavaScript:this.style.backgroundColor="#f1f1f1"' onMouseOut='JavaScript:this.style.backgroundColor=""'>
  <tr> 
    <td width="147" rowspan="6" valign="middle" class="table-xia"> 
      <%if rs("shoppic")="" then %>      <table width="98" height="98" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td colspan="3"><img src="img/img_01.gif" width="98" height="4" alt=""></td>
        </tr>
        <tr>
          <td rowspan="2"><img src="img/img_02.gif" width="4" height="94" alt=""></td>
          <td width="85" height="85" background="img/img_03.gif"><a href=listjp.asp?id=<%=rs("shopid")%>>NO IMG </a></td>
          <td rowspan="2"><img src="img/img_04.gif" width="8" height="94" alt=""></td>
        </tr>
        <tr>
          <td height="9"><img src="img/img_05.gif" alt="" width="86" height="9"></td>
        </tr>
      </table>
	  <%else%>
      <div align="center">
        <a href=listjp.asp?id=<%=rs("shopid")%>><img src="<%=weburl%><%=trim(rs("shoppic"))%>" alt=<%=trim(rs("shopname"))%>   width=120 height=80 border=0></a>
        <%end if%>
      </div>    </td>
    <td width="624" height="23"><strong><a href=listjp.asp?id=<%=rs("shopid")%>><%=trim(rs("shopname"))%></a></strong> (Section：<font color="<%=flzhzt%>">
      <%if rs("section")=1  then%>
      A
      <%end if%>
      <%if rs("section")=2  then%>
      B
      <%end if%>
      <%if rs("section")=3  then%>
      C
      <%end if%>
    </font>)</td>
  </tr>
  <tr>
    <td><font color="<%=flzhzt%>">【</font>Market price<font color="<%=flzhzt%>">】：￥<%=formatnumber(rs("shichangjia"),2)%> </font>&nbsp;【Score】：<font color="<%=flzhzt%>"><%=rs("jifen")%></font></td> 
    </tr>
  <tr>
    <td></td>
    </tr>
  <tr>
    <td></td>
    </tr>
  
  <tr>
    <td><a href="jifen.asp?id=<%=rs("shopid")%>&action=add" target="_blank" style="color: #0033CC">&gt;&gt;Choose It</a> </td> 
    </tr>
</table>

<%i=i+1
			if i>=MaxPerPage then Exit Do
			rs.movenext
		  loop
		  rs.close
		  set rs=nothing%>
<%  
				End Sub   
  
				Function showpage(totalnumber,maxperpage,filename)  
  				Dim n
  				
				If totalnumber Mod maxperpage=0 Then  
					n= totalnumber \ maxperpage  
				Else
					n= totalnumber \ maxperpage+1  
				End If
				
				Response.Write "<form method=Post action="&filename&"?selectm="&selectm&"&selectkey="&selectkey&" >"  
				Response.Write "<p align='center' class='contents'> "  
				If CurrentPage<2 Then  
					Response.Write "<font class='contents'>First Pre</font> "  
				Else  
					Response.Write "<a href="&filename&"?page=1&anid="&anid&"&selectm="&selectm&"&selectkey="&selectkey&" class='contents'>First</a> "  
					Response.Write "<a href="&filename&"?page="&CurrentPage-1&"&anid="&anid&"&selectm="&selectm&"&selectkey="&selectkey&" class='contents'>Pre</a> "  
				End If
				
				If n-currentpage<1 Then  
					Response.Write "<font class='contents'>Next Last</font>"  
				Else  
					Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&"&anid="&anid&"&selectm="&selectm&"&selectkey="&selectkey&" class='contents'>"  
					Response.Write "Next</a> <a href="&filename&"?page="&n&"&anid="&anid&"&selectm="&selectm&"&selectkey="&selectkey&" class='contents'>Last</a>"  
				End If  
					Response.Write "<font class='contents'> Total Page：</font><font class='contents'>"&CurrentPage&"</font><font class='contents'>/"&n&"</font> "  
					Response.Write "<font class='contents'> Total Gift："&totalnumber&" " 
					Response.Write "<font class='contents'>Go to：</font><input type='text' name='page' size=4 maxlength=10 class=wenbenkuang value="&currentpage&">"  
					Response.Write "&nbsp;<input type='submit'  class='go-wenbenkuang' value='GO' name='cndok' ></form>"  
				End Function  
			%></td>
  </tr>
</table>
<!--#include file="copyright.asp"-->
</body>
</html>