<%@language=vbscript codepage=936 %>
<!--#include file="Conn.asp"-->
<!--#include file ="Check_Manager.asp"-->
<%
Sub Delorder
Set del=Conn.Execute("Delete * From [ShopList] Where ShopForm_Id="&Request("Id"))
Set del=Conn.Execute("Delete * From [ShopOrder] Where Form_Id="&Request("Id"))
JaSys("管理员" & session("ManagerUser") & "<font color=red>订单删除ID"&Request("id")&"</font>成功")
Response.Redirect "Shop_Manage.asp"
End Sub
If Request.QueryString("action")="del" Then
Call Delorder
End if
If Request.Form("cndok") Then Response.Redirect "Shop_Manage.asp?page="&Trim(Request.Form("pp"))
Set rs=Server.CreateObject("Adodb.Recordset")
Sql="Select * From [ShopOrder] Order By RegTime desc"
rs.Open Sql,Conn,1,1

dim MaxPerPage
MaxPerPage=20
Dim text,checkpage
text="0123456789"
Rs.PageSize=MaxPerPage
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next

If checkpage<>0 then
If NOT IsEmpty(request("page")) Then
CurrentPage=Cint(request("page"))
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
Else
CurrentPage= 1
End If
If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
CurrentPage=1
End if
%>
<script language=javascript>
function ConfirmDel()
{
   if(confirm("确定要删除此订单吗？"))
     return true;
   else
     return false;
}
</script>
<html>
<head>
<titel></titel>
<LINK href="admin/admin.css" type=text/css rel=stylesheet>
</head>
<body>
<table width="500" border="0" align="center" cellpadding="10" cellspacing="10">
  <tr>
    <td><div align="center"><strong>订单管理</strong></div></td>
  </tr>
</table>
<table width="750" border="0" align="center" cellpadding="2" cellspacing="0" class=tableBorder>
  <tr> 
    <td width="65" height="25" align="center" background="admin/admin_bg_1.gif"><font color="#FFFFFF"><strong>订单编号</strong></font></td>
    <td width="111" height="25" align="center" background="admin/admin_bg_1.gif"><strong> 
      <font color="#FFFFFF">用户名</font></strong></td>
    <td width="254" height="25" align="center" background="admin/admin_bg_1.gif"><strong><font color="#FFFFFF">公司名称</font></strong></td>
    <td width="122" height="25" align="center" background="admin/admin_bg_1.gif"><strong><font color="#FFFFFF">联系电话 
      </font> </strong></td>
    <td width="74" align="center" background="admin/admin_bg_1.gif"><strong><font color="#FFFFFF">订单详情</font></strong></td>
    <td width="98" height="25" align="center" background="admin/admin_bg_1.gif"><strong> 
      <font color="#FFFFFF">操作</font></strong></td>
  </tr>
  <%If rs.Eof or rs.Bof Then
Response.Write "<center>没有注册会员</center>"
Else
i=0
Do While Not rs.Eof
%>
  <tr> 
    <td height="22" align="center"><%=rs("Form_Id")%></td>
    <td align="center"><%=rs("UserName")%></td>
    <td> 
      <div><%=rs("Compname")%></div>
      </td>
    <td align="center"> <%=rs("Phone")%> 
      <div align="center"></div></td>
    <td><div align="center"><%=rs("Flag")%></div></td>
    <td align="center">&nbsp;<a href="Shop_View.asp?id=<%=rs("Form_Id")%>">详细资料</a> 
      | <a href="Shop_Manage.asp?action=del&id=<%=rs("Form_Id")%>" onClick="return ConfirmDel();">删除</a></td>
  </tr>
  <%
i=i+1 
If i >= MaxPerpage Then Exit do 
rs.MoveNext
 Loop
 End if
 %>
</table>
    </td>
  </tr>
</table>
 
<table width="750" border="0" align="center" cellpadding="2" cellspacing="2">
  <tr>
                  <td> 
                    <form name="form1" method="post" action="">
<%
Response.write "全部"
Response.write "共 </font>" & "<font color=#FF0000>" & Cstr(Rs.RecordCount) & "</font>" & "<font color='#000000'> 个订单</font></strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
Response.write "第</font>" & "<font color=#FF0000>" & Cstr(CurrentPage) &  "</font>" & "<font color='#000000'>/" & Cstr(rs.pagecount) & "</font></strong>&nbsp;"
If currentpage > 1 Then
response.write "<a href='Shop_Manage.asp?&page="+cstr(1)+"'>首页 </a>"
Response.write "<a href='Shop_Manage.asp?page="+Cstr(currentpage-1)+"'> 上一页 </a>"
Else
Response.write " 上一页 "
End if
If currentpage < Rs.PageCount Then
Response.write "<a href='Shop_Manage.asp?page="+Cstr(currentPage+1)+"'> 下一页 "
Response.write "<a href='Shop_Manage.asp?page="+Cstr(Rs.PageCount)+"'> 尾页</a>&nbsp;&nbsp;"
Else
Response.write "下一页&nbsp;&nbsp;"
End if
response.write "</td><td align='right'>"
response.write "转到：<input type='text' name='pp' size=4 maxlength=4 class=smallInput value="&Currentpage&">&nbsp;"
response.write "<input type='submit'  value='Go'  name='cndok'>&nbsp;&nbsp;"
%>
                    </form> </td>
                </tr>
              </table>
</body>
</html>
<%rs.Close
Conn.Close
%>