<!--#include file="../0.asp"--><!--#include file="../../../conn/zkconn.asp"-->
<% 
session("id")=Request("id")
t_id1=session("id")
%> 
<html>
<head>
<link href="../../../css/css.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
<div align="center"> 
  <p><br>
    <a href="index.asp">&gt;&gt;返回送货清单主页面</a>&nbsp;&nbsp;<br>
  </p>
</div>
<table width="96%" border="0" cellpadding="0" cellspacing="0" align="center">
  <tr> 
    <td height="207" valign="top" width="10%"> <form name="ffm" method="POST" action=add2.asp>
        <table bgcolor=#CCCCCC border=0 cellpadding=3 cellspacing=1 
        width="350" align="center" class="9bang">
          <tbody>
            <tr bgcolor="#f1f1f1"> 
              <td class="008c5e">&gt;&gt;新增送货信息(如果是电话订单请选中<font color="#FF3333">电话</font>后的选框)</td>
            </tr>
            <tr> 
              <td height="18" bgcolor=#FFFFFF class="008c5e"> <div align="center"> 
                  订单号<font color="#FF0000"><b> 
                  <input name="id" type="hidden" id="id" value="<%=Request("id")%>">
                  </b></font> 
                  <input name="bh" type="text" class="wenbenkuang" id="bh" size="8" maxlength="10">
                  <font color="#FF3333">电话</font> 
                  <input name="lx" type="checkbox" id="lx" value="1">
                  <input name="Submit" type="submit" class="go-wenbenkuang" value="提交">
                </div>
                </td>
            </tr>
          </tbody>
        </table>
        <br>
<%if request("bh")<>"" then
	  if request("lx")<>"" then
	  lx=1
	  set rs = conn.execute("select * from telorder where t_id="&request("bh")&"")
	  conn.execute("Insert into sh(bh,lx,dz,name,tel,bz,sjid)values("&rs("t_id")&","&lx&",'"&rs("t_add")&"','"&rs("t_name")&"','"&rs("t_tel")&"','"&rs("t_biaozhi")&"',"&t_id1&")")
      rs.close
	set rs=nothing
	  else
	  set rs = conn.execute("select * from cart where id="&request("bh")&"")
	  conn.execute("Insert into sh(bh,dz,name,tel,bz,sjid)values("&rs("id")&",'"&rs("dz")&"','"&rs("name")&"','"&rs("tel")&"','"&rs("bz")&"',"&t_id1&")")
      rs.close
	set rs=nothing
	  end if
end if
'添加完成,开始显示数据 
set rs = conn.execute("select * from sh where sjid="&t_id1&"")
%>
        <table bgcolor=#CCCCCC border=0 cellpadding=3 cellspacing=1 
        width="850" align="center" class="9bang">
          <%set rs = conn.execute("select * from sh where sjid="&t_id1&" order by id desc")
if not rs.eof then %>
          <tr bgcolor="#FFFFFF"> 
            <td colspan="6" class="008c5e"> <div align="center">本次送货清单列表&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                <a href="ok.asp?id=<%=rs("sjid")%>">&gt;&gt;打印本次送货清单</a></div></td>
          </tr>
          <tbody>
            <tr bgcolor="#f1f1f1"> 
              <td width=125 class="008c5e"> <div align="center">订单号</div></td>
              <td width=225 class="008c5e"> <div align="center">送货地址</div></td>
              <td width=75 class="008c5e"> <div align="center">收货人姓名</div></td>
              <td width=125 class="008c5e"> <div align="center">联系电话</div></td>
              <td width=200 align="center" class="008c5e">备注</td>
              <td width=50 align="center" class="008c5e">删除</td>
            </tr>
            <% 
While NOT rs.EOF 
%>
            <tr> 
              <td bgcolor=#FFFFFF width=125 height="18"> <div align="center">
                  <%if rs("lx")=1 then Response.Write ("电话")%>
                  <%=rs("bh")%></div></td>
              <td bgcolor=#ffffff width=225 height="18"> <div align="center"><%=rs("dz")%></div></td>
              <td bgcolor=#ffffff width=75 height="18"> <div align="center"><%=rs("name")%></div></td>
              <td bgcolor=#FFFFFF width="125" height="18"> <div align="center"><%=rs("tel")%></div></td>
              <td bgcolor=#FFFFFF  width="200"><%=rs("bz")%></td>
              <td bgcolor=#ffffff width="50" height="18"> <div align="center"><a href=del.asp?x=a&id=<%=rs("id")%>>删除</a></div></td>
            </tr>
            <%  
    rs.MoveNext()
Wend
rs.Close
set rs=nothing
end if %>
          </tbody>
        </table>
        <input type="hidden" name="MM_insert" value="true">
      </form></td>
  </tr>
</table>
</body>
</html>