<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../Include/conn.asp" -->
<!--#include file="../Include/ConnDatabase.asp" -->
<!--#include file="../Include/NoHackSql.Asp" -->
<%
'=====================================
'天天企业网站管理系统  TianTianCMS
'天天网络科技工作室版权所有
'官方网站http://www.ip126.com
'技术支持论坛 http://bbs.ip126.com/
'QQ:530051328 mail:bbfhq@163.com
'=====================================
%>
<%call SiteInfo
headid=7
Seotitle="View Order"
%>
<!--#include file="Head.Asp" -->
<%
if not (session("MemName")<>"" and session("MemLogin")="Succeed") then
  response.Write "<script language=javascript>alert('Please Login First！');location.href='Index.asp';</script>"
  response.end
end if
%>
<!---弹出面板开始--->
<script>
function loadThreadFollow(t_id,b_id){
	var targetImg =eval("document.all.followImg" + t_id);
	var targetDiv =eval("document.all.follow" + t_id);
	
	if ("object"==typeof(targetImg)){
		if (targetDiv.style.display!='block'){
			targetDiv.style.display="block";
			
		}else{
			targetDiv.style.display="none";
		}
	}
}
</script>
<!---弹出面板结束--->
<TABLE width="960" border=0 align="center" cellPadding=0 cellSpacing=0 bgcolor="#FFFFFF">
  <TR>
    <TD height="5"></TD>
  </TR>
  <TR> 
    <TD height="172" ><table width="960" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td class="tdbg_left"  width="190" height="179" valign="top" > <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td height="34" class="title_left">&nbsp;&nbsp;&nbsp;<img src="../images/smallbook.jpg" width="10" height="10">&nbsp;&nbsp;User Login 
                </td>
              </tr>
              <tr> 
                <td height="5"></td>
              </tr>
              <tr> 
                <td height="10"><table width="88%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td> 
                       
	<iframe src="login.asp"  frameborder="0" border="0px" scrolling="no" class="frame" height="120px" width="160px"></iframe>
                      </td>
                    </tr>
                  </table></td>
              </tr>
              <tr> 
                <td height="5"></td>
              </tr>
            </table>
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr> 
                <td height="34" colspan="2" class="title_left">&nbsp;&nbsp;&nbsp;<img src="../images/smallbook.jpg" width="10" height="10">&nbsp;&nbsp;Member Center</td>
              </tr>
     
 	<%=WebMenu()%>

            </table></td>
          <td width="6"></td>
          <td valign="top"><table Class=border width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
              <tr> 
                <td height="206" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td class="
title_right" height="32">&nbsp;&nbsp;&nbsp;<img src="../images/smallbook.jpg" width="10" height="10">&nbsp;Member Center</td>
                    </tr>
			<TR> 
              <TD    
                  height=1> 
 <table width="100%" height="19" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr> 
                            <td width="80%" height="18" bgcolor="#eeeeee"><%=WebLocation()%>My Orders</td>
                        <td width="79%" bgcolor="#eeeeee">&nbsp; </td>
                  </tr>
                  <tr> 
                    <td height="1" colspan="2" bgcolor="#999999"></td>
                  </tr>
                </table>
                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="3" bgcolor="#FBFEFF">
                  <tr> 
                    <td height="8"></td>
                  </tr>
                 
                  <tr> 
                        <td>
		<table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
          <td><%=WebContent()%></td>
        </tr>
        <tr>
          <td height="20">&nbsp;</td>
        </tr>
      </table>
			</td>
                  </tr>             
                  <tr> 
                    <td height="8"><div align="right"></div></td>
                  </tr>
                </table> 
                      </TD>
            </TR>
                  </table>
                  
                </td>
              </tr>
			  
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
<!--#include file="Foot.Asp"-->
<%

function WebContent()
  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="TianTianCMS_Order "
  dim datawhere
	  datawhere="where MemID="&conn.execute("select * from TianTianCMS_Members where MemName='"&session("MemName")&"'")("ID")&" "
  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
	k=0
    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=""background:url(images/bg1.gif) repeat-x left bottom""><HR><strong style=""color:red""><b>Order number</b>:"&rs("ddhm")&"</strong><br><b>Order name</b>:"&rs("OrderName")&" &nbsp;&nbsp;&nbsp;<b>SEND</b>:"&rs("Addtime")&"&nbsp;&nbsp;&nbsp;<b>The latest operation time</b>:"&rs("ddshsj")&""&VbCrLf		
		if rs("ReplyTime")<>"" then response.write "&nbsp;&nbsp;&nbsp;<b>webmaster RE</b>:"&rs("ReplyTime")&""

        Response.Write "<br />"
		admincl=rs("admincl")%>
		<form name="orderstate" method="post" action="Confirm_order.asp?id=<%=rs("id")%>">
		<%grade(admincl)
		If rs("admincl")=3 Then
		Response.Write "<input type=""submit"" name=""Submit"" value=""Confirm the goods"">(Attention:In the first place, in your alipay account to confirm and hereby confirm.)"&VbCrLf
		Else
		Response.Write "Successful deal"
		End if        
		If rs("admincl")<1 Then Response.Write " <a href='Pay.asp?Action_pay=yes&ddhm="&rs("ddhm")&"&total="&rs("cash")&"&userid="&rs("MemID")&"' target=""_blank""><b>【To the cashier to pay】</b></a>"&VbCrLf
		Response.Write "</form>"

		Response.Write "<br><font color=""#0000FF""><span id=""followImg"&k&""" style=""CURSOR: hand"" onClick=""loadThreadFollow("&k&",5)"">detailed>>></span></font>"&VbCrLf
		Response.Write "    </td>"&VbCrLf
		Response.Write "  </tr>"&VbCrLf
		Response.Write "  <tr style=""display:none"" id=""follow"&k&""">"&VbCrLf
		Response.Write "    <td style=""line-height:200%"">"	
		Response.Write "      <b>Name </b>: "&rs("Linkman")&"<br />"&VbCrLf		
		Response.Write "      <b>Company</b>:"&rs("Company")&"<br />"&VbCrLf
		Response.Write "      <b>Address</b>:"&rs("Address")&"<br />"&VbCrLf
		Response.Write "      <b>Post Code</b>:"&rs("ZipCode")&"<br />"&VbCrLf
		Response.Write "      <b>Tel</b>:"&rs("Telephone")&"<br />"&VbCrLf
		Response.Write "      <b>Fax</b>:"&rs("Fax")&"<br />"&VbCrLf
		Response.Write "      <b>Mobile</b>:"&rs("Mobile")&"<br />"&VbCrLf
        Response.Write "      <b>QQ</b>:"&rs("userqq")&"<br />"&VbCrLf
		Response.Write "      <b>Email</b>:"&rs("Email")&"<br />"&VbCrLf
		Response.Write "      <b>I leave a message</b>:"&HtmlStrReplace(rs("Remark"))&"<br />"&VbCrLf	
		Response.Write "      <b>goods</b>:<br>"&HtmlStrReplace(rs("goods"))&""&VbCrLf
		Response.Write "      The freight:"&rs("freight")&" yuan&nbsp;&nbsp;&nbsp;Tax invoice:"&rs("tax")&" yuan&nbsp;&nbsp;&nbsp;The total amount of payables:"&rs("cash")&" yuan<br>"&VbCrLf		
		if rs("ReplyContent")<>"" then response.write "<strong style=""color:red""><b>webmaster Reply</b>:</strong><br />"&HtmlStrReplace(rs("ReplyContent"))
		Response.Write "      </td>"&VbCrLf
		Response.Write "  </tr>"&VbCrLf
		Response.Write "</table>"&VbCrLf
	  rs.movenext
	  k=k+1
    wend
  else
    response.write "<center>No Information</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 "Total:<strong style=""color:red"">"&idcount&"</strong>Records&nbsp;&nbsp;Page:<strong style=""color:red"">"&page&"</strong>/"&pagec&" PageSize:<strong style=""color:red"">"&pages&"</strong>Records" & 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=""Return to page 1""><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=""page"& 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=""Go to page"&pagenext&"""><font face=""webdings"" color=""#999999"">:</font></a> ")
  if(page<pagec) then response.write (" <a href="""& myself &"Page="& pagec &""" title=""Go to page"&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

sub grade(admincl)
select case admincl
case "0"%> 
<input type="checkbox" name="checkbox0" value="0" DISABLED checked>not make any processing<span style='font-family:Wingdings;'>à</span>
<input type="checkbox" name="checkbox1" value="1" DISABLED >the remittance<span style='font-family:Wingdings;'>à</span>  
<input type="checkbox" name="admincl" value="2" DISABLED>Businessmen money<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox3" value="3" DISABLED>Has been shipped<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox4" value="4" DISABLED> 
<%case "1"%> 
<input type="checkbox" name="checkbox0" value="0" DISABLED checked>not make any processing<span style='font-family:Wingdings;'>à</span>
<input type="checkbox" name="checkbox1" value="1" DISABLED checked>the remittance<span style='font-family:Wingdings;'>à</span>   
<input type="checkbox" name="admincl" value="2" DISABLED checked>Businessmen money<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox3" value="3" DISABLED>Has been shipped<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox4" value="4" DISABLED> 
<%case "2"%> 
<input type="checkbox" name="checkbox0" value="0" DISABLED checked>not make any processing<span style='font-family:Wingdings;'>à</span>
<input type="checkbox" name="checkbox1" value="1" DISABLED checked>the remittance<span style='font-family:Wingdings;'>à</span>  
<input type="checkbox" name="checkbox2" value="2" checked DISABLED>Businessmen money<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="admincl" value="3" DISABLED>Has been shipped<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox4" value="4" DISABLED> 
<%case "3"%> 
<input type="checkbox" name="checkbox0" value="0" DISABLED checked>not make any processing<span style='font-family:Wingdings;'>à</span>
<input type="checkbox" name="checkbox1" value="1" DISABLED checked>the remittance<span style='font-family:Wingdings;'>à</span>  
<input type="checkbox" name="checkbox2" value="2" DISABLED checked>Businessmen money<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox3" value="3" DISABLED checked>Has been shipped<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="admincl" value="4" > 
<%case "4"%> 
<input type="checkbox" name="checkbox0" value="0" checked DISABLED>not make any processing<span style='font-family:Wingdings;'>à</span>
<input type="checkbox" name="checkbox1" value="1" DISABLED checked>the remittance<span style='font-family:Wingdings;'>à</span>  
<input type="checkbox" name="checkbox2" value="2" checked DISABLED>Businessmen money<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox3" value="3" checked DISABLED>Has been shipped<span style='font-family:Wingdings;'>à</span> 
<input type="checkbox" name="checkbox4" value="4" checked DISABLED> 
<%end select
end Sub
Call CloseDB(conn)%>