<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<!--#include file="../Conn.asp"-->
<!--#include file="../HSK_Cls/HSK.MemberCls.asp"-->
<!--#include file="../HSK_Cls/HSK.Label.CommonCls.asp"-->
<%
Dim KSCls
Set KSCls = New User_Express
KSCls.HSK_Run()
Set KSCls = Nothing

Class User_Express
        Private KS,KSUser
		Private CurrentPage,totalPut,TotalPages,SQL
		Private RS,MaxPerPage
		Private Para,SqlStr
		Private Sub Class_Initialize()
			MaxPerPage =20
		  Set KS=New PublicCls
		  Set KSUser = New UserCls
		End Sub
        Private Sub Class_Terminate()
		 Set KS=Nothing
		 Set KSUser=Nothing
		End Sub
		%>
		<!--#include file="../HSK_Cls/UserFunction.asp"-->
		<%
       Public Sub loadMain()
		
		IF Cbool(KSUser.UserLoginChecked)=false Then
		  Response.Write "<script>top.location.href='Login';</script>"
		  Exit Sub
		End If
		Call KSUser.Head()
		Call KSUser.InnerLocation("快递单中心")
		IF KS.ChkClng(KSUser.GetUserInfo("KS_IDAuthentication")) <> 1 Then
			KS.Alert "抱歉！\n\n您的账号尚未通过手机认证，暂时不能领取快递，请点击确定按钮跳转到认证页面。","User_IDAuthentication.asp"
		End IF
	   If KS.S("page") <> "" Then
			  CurrentPage = CInt(KS.S("page"))
		Else
			  CurrentPage = 1
		End If
%>
<script type="text/javascript" src="/style/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/HSK_JS/HSK.box.js"></script>
<script type="text/javascript">
function View(ID,N)
{
  new KesionPopup("#fff",4,true,"font-size:12px;background:url(/style/images/w_b_2.gif) #1B76B7 0 -4px;color:#20537A;height:22px;").popupIframe('&nbsp; 领取真实快递单','User_ExpressDetail.asp?ID=' + ID +'&N='+ N ,660,330,'auto')
}
</script>
<div class="tabs">
    <ul>
        <li<%If KS.S("View")<>"MyOrder" Then KS.Echo " class=""select"""%>><a href="User_Express.asp">快递单号中心</a></li>
        <li<%If KS.S("View")="MyOrder" Then KS.Echo " class=""select"""%>><a href="?View=MyOrder">我领取的单号</a></li>
        <li><a href="User_Express_Buy.asp">订购真实快递</a></li>
        <li><a href="User_Express_Buy.asp?Action=MyOrder">我订购的单号</a></li>
    </ul>
</div>

<table width="100%" height="50" border="0" cellspacing="0" cellpadding="0" >
    <form name="myform" action="?Action=Search" method="post">
      <tr>
        <td width="200" align="left">扫描时间：
         <input type="text" readonly  name="ScanDate" value="<%If Not KS.IsNul(KS.S("ScanDate")) Then KS.Echo KS.S("ScanDate") Else KS.Echo KS.DateFormat(Now,1)%>" size="13" onClick="WdatePicker()" /></td>
        <td width="150" align="left">发货地：
          <input type="text" name="CFCity" size="10" value="<%=KS.S("CFCity")%>" /></td>
        <td width="150" align="left">收货地：
          <input type="text" name="MDCity" size="10" value="<%=KS.S("MDCity")%>" /></td>
        <td width="180" align="left">快递类型：
         <select name="ComName">
         <option value="">不限</option>
        <option value="顺丰快递"<%If KS.S("ComName")="顺丰快递" Then KS.Echo " selected=""selected"""%>>顺丰快递</option>
        <option value="韵达快递"<%If KS.S("ComName")="韵达快递" Then KS.Echo " selected=""selected"""%>>韵达快递</option>
        <option value="圆通快递"<%If KS.S("ComName")="圆通快递" Then KS.Echo " selected=""selected"""%>>圆通快递</option>
        <option value="EMS快递"<%If KS.S("ComName")="EMS快递" Then KS.Echo " selected=""selected"""%>>EMS快递</option>
        <option value="中通快递"<%If KS.S("ComName")="中通快递" Then KS.Echo " selected=""selected"""%>>中通快递</option>
        <option value="天天快递"<%If KS.S("ComName")="天天快递" Then KS.Echo " selected=""selected"""%>>天天快递</option>
        <option value="汇通快递"<%If KS.S("ComName")="汇通快递" Then KS.Echo " selected=""selected"""%>>汇通快递</option>
        <option value="申通快递"<%If KS.S("ComName")="申通快递" Then KS.Echo " selected=""selected"""%>>申通快递</option>
        <option value="宅急送快递"<%If KS.S("ComName")="宅急送快递" Then KS.Echo " selected=""selected"""%>>宅急送快递</option>
        </select>
		</td>
        <td align="left"><button class="pn" id="submit1" type="submit"><strong> 筛 选</strong></button></td>
        <td></td>
      </tr>
    </form>
</table>			
            
				<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="border">
					<tr class="titlename">
					<td nowrap width="10%" height="25" align="center"><strong>快递公司</strong></td>
					<td nowrap width="16%" height="25" align="center"><strong>快递单号</strong></td>
					<td nowrap width="18%" height="25" align="center"><strong>发货地</strong></td>
					<td nowrap width="18%" height="25" align="center"><strong>收货地</strong></td>
					<td nowrap width="15%" align="center"><strong>预计扫描时间</strong></td>
					<td nowrap width="9%" align="center"><strong>是否扫描</strong></td>
					<td nowrap align="center"><strong>操作</strong></td>
				  </tr>
					<%  If KS.S("Action")="Search" Then
							If Not KS.IsNul(KS.S("ScanDate")) Then	Para = " And DATEDIFF(d,'" & KS.CheckXSS(KS.S("ScanDate")) & "',ScanDate) >= 0" 
							If Not KS.IsNul(KS.S("CFCity")) Then Para = Para &" And CFCity Like '%" & KS.CheckXSS(KS.S("CFCity")) & "%'"
							If Not KS.IsNul(KS.S("MDCity")) Then Para = Para &" And MDCity Like '%" & KS.CheckXSS(KS.S("MDCity")) & "%'"
							If Not KS.IsNul(KS.S("ComName")) Then Para = Para &" And ComName Like '%" & KS.CheckXSS(KS.S("ComName")) & "%'"
						End If
						If KS.S("View") = "MyOrder" Then Para = Para &" And BuyUserName ='" & KSUser.UserName & "'"
						 SqlStr="Select * From Express Where Status<2 " & Para & " Order By Status,ID Asc"
						 Set RS=Server.createobject("adodb.recordset")
						 RS.open SqlStr,conn,1,1

						 If RS.EOF And RS.BOF Then
								  Response.Write "<tr class='tdbg'><td align=center height=25 colspan=7 valign=top>暂时还没有快递单号!</td></tr>"
						 Else
							TotalPut=rs.recordcount
							if (TotalPut mod MaxPerPage)=0 then
								TotalPages = TotalPut \ MaxPerPage
							else
								TotalPages = TotalPut \ MaxPerPage + 1
							end if
							if CurrentPage > TotalPages then CurrentPage=TotalPages
							if CurrentPage < 1 then CurrentPage=1
							rs.move (CurrentPage-1)*MaxPerPage
							SQL = rs.GetRows(MaxPerPage)
							rs.Close:set rs=Nothing
							ShowContent
				End If

						
						 %>
          </table>
		  </td>
		  </tr>
</table>
		  <%Call KS.ShowPage(totalput, MaxPerPage, "", CurrentPage,false,true)%>
		  <%
  End Sub
    
Sub ShowContent
Dim i
For i=0 To Ubound(SQL,2)
	%>
  <tr height="25" class='tdbg' onMouseOver="this.className='tdbgmouseover'" onMouseOut="this.className='tdbg'">
    <td class="splittd" align="center"><%=SQL(4,I)%></td>
    <td class="splittd" align="center"><%=Left(SQL(5,I),4) & "********"%></td>
    <td class="splittd" align="center"><%=SQL(6,I)%></td>
    <td class="splittd" align="center"><%=SQL(7,I)%></td>
    <td class="splittd" align="center"><%=SQL(10,I)%></td>
	<td class="splittd" align="center"><%=KS.IIF(DateDiff("s", Now, SQL(10,I)) < 0,"<span style='color:blue'>已扫描</span>","<span style='color:red'>未扫描</span>")%></td>
    <td class="splittd" align="center"><%
	If KS.S("View") = "MyOrder" Then
		KS.Echo "<a href=""javascript:;"" onclick=""View(" & SQL(0,I) & ",1)""><img src=""/style/images/view_bt.gif"" border=0 width=""90"" height=""28"" align=""absmiddle""></a>"
	Else
		If KS.ChkClng(SQL(11,I))=0 Then
			KS.Echo "<a href=""javascript:;"" onclick=""View(" & SQL(0,I) & ",0)""><img src=""/style/images/get_bt.gif"" border=0 width=""90"" height=""32"" align=""absmiddle""></a>"
		Else
			KS.Echo "<span style=""color:green"">已被领取</span>"
		End If
	End If
	%></td>
  </tr>
  <%Next%>

  <%  
End Sub
  
End Class
%> 
