<!--#include file="Include/Const.asp" -->
<!--#include file="Include/NoHackSql.Asp" -->
<!--#include file="Include/ConnSiteData.asp" -->
<%call SiteInfo
headid=7
%>
<!--#include file="Head.Asp" -->
<%
if not (session("ShopName")<>"" and session("ShopLogin")="Succeed") then
  response.Write "<script language=javascript>alert('请先登录！');location.href='Index.asp';</script>"
  response.end
end If
dim MemID
Call MemInfo()
%>
<div id='index_wrapper'>
<div id=best-r class="best" style="width:586px;float:left">
<div id=best-sc>
<div class=best-tb>
<a>查询订单:</a>
</div>
</div>
<div id=bests>
<table border="0" cellpadding="0" width="60%" cellspacing="0" align="center">
  <form name="Search" action="ShopOrder.asp">
    <tr>
	<td width="60">产品编号: </td>
      <td height="36"> 
<input type="text" name="ProdcutNo"  size="12" value="<%=ProdcutNoS(MemID)%>" maxlength="42"> 
      </td>
	  </tr>
<tr>
	<td width="60" align="right">订单号: </td>
<td   width="330" height="28" align="left"> 
<input type="text" name="OrderNo"  size="12" value="" maxlength="42" ><font style="color:red">注意:在填写号码是不要加入其他字符</font>
        </td>
		</tr>

		<tr>
		<td width="60"></td>
		<td align="left" width="100px"> <input type="image" src="images/btn_sear.gif"  value="搜索"></td>
    </tr>
  </form>
</table>
<%
if request("ProdcutNo")<>"" And  request("OrderNo")<>""  Then
Call WebContent(Trim(request("ProdcutNo")),Trim(request("OrderNo")))
End If 
%>
<br />
</div>
</div>
<div style="width:200px; float:right;">
<div id=best-r class="best" style="width:200px; float:right;">
<div id=best-sc>
<div class=best-tb>
<a style="width:100px;">我的信息中心</a>       
</div>
</div>
<div id=bests>
<%Call WebMenu()%>
</div>
</div>
<div id=best-r class="best" style="width:200px; float:right;margin-top:10px;">
<div id=best-sc>
<div class=best-tb>
<a style="width:80px;font-size:14px;font-weight:bold;">信息订阅</a>       
</div>
</div>

<div id=bests>
<table cellpadding="0" cellspacing="0" width="100%px" style="padding:6px;">
<tr><td align="center">
<% Call LiangjingCMSEMail() %>
</td></tr>
</table>
</div>
</div>
</div>
<div style="clear:both;;*display:inline;overflow:;hidden;">
</div>
<div style="float:none;height:10px;"></div>
</div></div>
</div></div>
<!--#include file="Foot.Asp"-->
<%
Function WebMenu()
If session("ShopName")="" Or session("ShopLogin")<>"Succeed" Then
  response.write "<Li>  <img src=""image/Tx_Ar3.gif"" style=""margin-left:5px;"" /> <a href=""ShopRegister.asp"">注册商家</a></li>"
Else
  response.write "<Li>  <img src=""image/Tx_Ar3.gif"" style=""margin-left:5px;"" /> <a href=""ShopInfo.asp"">修改资料</a></li>"
  response.write "<Li>  <img src=""image/Tx_Ar3.gif"" style=""margin-left:5px;"" /> <a href=""ShopOrder.asp"">订单查询</a></li>"
  response.write "<Li>  <img src=""image/Tx_Ar3.gif"" style=""margin-left:5px;"" /> <a href=""ShopsLogin.asp?Action=Out"">退出登录</a></li>"
End If
End Function

sub MemInfo()
  dim rs,sql
  set rs = server.createobject("adodb.recordset")
  sql="select * from LiangJing_Shops where MemName='"&session("ShopName")&"'"
  rs.open sql,conn,1,1
  if rs.eof then
    response.write "<center>暂无相关信息</center>"
  else
    MemID=rs("ID")
	mMemName=rs("MemName")
	mRealName=rs("RealName")
	mSex=rs("Sex")
	mQusetion=rs("Question")
	mCompany=rs("Company")
	mAddress=rs("Address")
	mZipCode=rs("ZipCode")
	mTelephone=rs("Telephone")
	mFax=rs("Fax")
	mMobile=rs("Mobile")
	mEmail=rs("Email")
	mHomePage=rs("HomePage")
	mAddTime=rs("AddTime")
	mLoginTimes=rs("LoginTimes")
	mLastLoginTime=rs("LastLoginTime")
	mLastLoginIP=rs("LastLoginIP")
  end if
  rs.close
  set rs=nothing
end sub

function ProdcutNoS(ID)
  dim rs,sql
  set rs = server.createobject("adodb.recordset")
  sql="select * from liangjing_Products where ShopID="&ID&""
  rs.open sql,conn,1,1
  If rs.bof And rs.eof Then 
  ProdcutNoS="你暂时没有团购标识,请联系管理员"
  Else 
  ProdcutNoS=rs("ProductNo")
  End If 
  rs.close
  set rs=nothing
end function

function WebLocation()
  WebLocation="&nbsp;当前位置：<a href=""index.asp"" class=""agray"">首页</a> - <a href=""MemberCenter.asp"" class=""agray"">会员中心</a> - 我的订单"&VbCrLf
end Function

function WebContent(ProductNo,OrderNo)
  dim idCount
  dim pages
      pages=4
  dim pagec
  dim page
      page=clng(request("Page"))
  dim pagenc
      pagenc=5
  dim pagenmax
  dim pagenmin
  dim pageprevious
  dim pagenext
  dim datafrom
      datafrom="LiangJing_Order "
  dim datawhere
	  datawhere="where Instr(ProductNo,'"&ProductNo&"')>0 and OrderNo='"&OrderNo&"'"
  dim sqlid
  dim Myself,PATH_INFO,QUERY_STRING
      PATH_INFO = request.servervariables("PATH_INFO")
	  QUERY_STRING = request.ServerVariables("QUERY_STRING")'
      if QUERY_STRING = "" then
	    Myself = PATH_INFO & "?"
	  elseif Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")=0 then
	    Myself= PATH_INFO & "?" & QUERY_STRING & "&"
	  else
	    Myself = Left(PATH_INFO & "?" & QUERY_STRING,Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")-1)
	  end if
  dim taxis
      taxis="order by id desc "
  dim i
  dim rs,sql
  set rs = server.createobject("adodb.recordset")
  sql="select count(ID) as idCount from ["& datafrom &"]" & datawhere
  set rs=server.createobject("adodb.recordset")
  rs.open sql,conn,0,1
  idCount=rs("idCount")
  if(idcount>0) then
    if(idcount mod pages=0)then
	  pagec=int(idcount/pages)
   	else
      pagec=int(idcount/pages)+1
    end if
    sql="select id from ["& datafrom &"] " & datawhere & taxis
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,1
    rs.pagesize = pages
    if page < 1 then page = 1
    if page > pagec then page = pagec
    if pagec > 0 then rs.absolutepage = page
    for i=1 to rs.pagesize
	  if rs.eof then exit for
	  if(i=1)then
	    sqlid=rs("id")
	  else
	    sqlid=sqlid &","&rs("id")
	  end if
	  rs.movenext
    next
  end if
  if(idcount>0 and sqlid<>"") then
    sql="select * from ["& datafrom &"] where id in("& sqlid &") "&taxis
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,0,1
    while not rs.eof
		Response.Write "<table width=""95%"" border=""0"" align=""center"" cellpadding=""3"" cellspacing=""5"">"&VbCrLf
		Response.Write "  <tr>"&VbCrLf
		Response.Write "    <td style=""line-height:200%"">"&HtmlStrReplace(rs("Remark"))&"<br />"&VbCrLf
		Response.Write "      联 系 人："&rs("Linkman")&"人<br />"&VbCrLf
		Response.Write "      性　　别："&rs("Sex")&"<br />"&VbCrLf
		Response.Write "      手机号码："&rs("Mobile")&"<br />"&VbCrLf
		Response.Write "      电子邮箱："&rs("Email")&"<br />"&VbCrLf
       If rs("IsokMoney") Then 
   		Response.Write "      是否付款：<font style=""color:red"">已经付款</font><br />"&VbCrLf
	    Response.Write "      付款金额：<font style=""color:red"">￥"&Formatnumber(rs("ToalMoney"),2,-1,-1,0)&"</font><br />"&VbCrLf
		if rs("ReplyContent")<>"" then response.write "<strong style=""color:red"">回复内容：</strong><br />"&HtmlStrReplace(rs("ReplyContent"))
		Response.Write "      </td>"&VbCrLf
		Response.Write "  </tr>"&VbCrLf
		Response.Write "</table>"&VbCrLf
        Else 
        Response.Write "      是否付款：<font style=""color:red"">未付款</font><br />"&VbCrLf
		Response.Write "      付款金额：<font style=""color:red"">￥"&Formatnumber(rs("ToalMoney"),2,-1,-1,0)&"</font><br />"&VbCrLf
		if rs("ReplyContent")<>"" then response.write "<strong style=""color:red"">回复内容：</strong><br />"&HtmlStrReplace(rs("ReplyContent"))
		Response.Write "      </td>"&VbCrLf
		Response.Write "</table>"&VbCrLf
        End If 

	  rs.movenext
    wend
  else
    response.write "<center>暂无相关信息</center>"
	exit function
  end if
  Response.Write "<table width=""98%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"&VbCrLf
  Response.Write "  <tr height=""35"">"&VbCrLf
  Response.Write "    <td align=""center"">"&VbCrLf
  Response.Write "共<strong style=""color:red"">"&idcount&"</strong>条记录 页次：<strong style=""color:red"">"&page&"</strong>/"&pagec&" 每页：<strong style=""color:red"">"&pages&"</strong>条记录" & vbCrLf
  pagenmin=page-pagenc
  pagenmax=page+pagenc
  if(pagenmin<1) then pagenmin=1
  if(page>1) then response.write ("<a href="""& myself &"Page=1"" title=""回到第一页""><font face=""webdings"" color=""#000000"">9</font></a> ")
  if page-(pagenc*2+1)<=0 then
	pageprevious=1
  else
	pageprevious=page-(pagenc*2+1)
  end if
  if(pagenmin>1) then response.write ("<a href="""& myself &"Page="& pageprevious &""" title=""第"& pageprevious &"页""><font face=""webdings"" color=""#000000"">3</font></a> ")
  if(pagenmax>pagec) then pagenmax=pagec
  for i = pagenmin to pagenmax
	if(i=page) then
	  response.write ("&nbsp;<strong style=""color:red"">"& i &"</strong>&nbsp;")
	else
	  response.write ("[<a href="""& myself &"Page="& i &""">"& i &"</a>]")
	end if
  next
  if page+(pagenc*2+1)>=pagec then
    pagenext=pagec
  else
    pagenext=page+(pagenc*2+1)
  end if
  if(pagenmax<pagec) then response.write (" <a href="""& myself &"Page="& pagenext &""" title=""跳转到第"&pagenext&"页""><font face=""webdings"" color=""#999999"">:</font></a> ")
  if(page<pagec) then response.write (" <a href="""& myself &"Page="& pagec &""" title=""跳转到第"&pagec&"页""><font face=""webdings"" color=""#000000"">:</font></a>")
  Response.Write "    </td>"&VbCrLf
  Response.Write "  </tr>"&VbCrLf
  Response.Write "</table>"&VbCrLf
  rs.close
  set rs=nothing
end function
%>