<!--#include file="conn.asp"-->
<!--#include file="inc/cookies_check.asp"-->
<!--
'*****************************************
'* 软件名称 乐彼网上开店软件(56770 EShop)
'* 软件开发 http://www.56770.com    
'* 版权所有 http://www.56770.com   
'* 文件名称 Admin_order_tel.asp  
'* 最后更新 2010-09-19 by 56770.kingdge 
'*****************************************
--->
<%
admintop()
Dim admin_flag
admin_flag=",1.5,"
If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then 
		adminflag()	
Else 
		If OutSubmit = 1 Then CheckOutSubmit()
		Select Case request("action")
				Case "add" :add()
				Case "modi" :modi()
				Case "prolist" :prolist()
				Case "saveA" :saveA()
				Case "saveB" :saveB()
				Case "dela" :dela()
				Case "delb" :delb()
				Case "addpro" :addpro()
				Case "addpro_ok" :addpro_ok()
				Case "updatestate" : updatestate()
				Case Else
						list()
		End Select
End if

Sub saveA
        If OnlyRead = 1 Then OnlyReadMessage()
        Dim Is_error,Msg_error
		Is_error = 0 : Msg_error = ""
        t_name=Safereplace(trim(request("t_name")))
        t_tel=Safereplace(trim(request("t_tel")))
        t_biaozhi=Safereplace(trim(request("t_biaozhi")))
        t_add=Safereplace(trim(request("t_add")))
        rmb=Safereplace(trim(request("rmb")))
		If t_name = "" Then 
		        Is_error = 1
				Msg_error = Msg_error &"·请输入客户名称!<br>"
		End If 
		If t_tel = "" Then 
		        Is_error = 1
				Msg_error = Msg_error &"·请输入联系电话!<br>"
		End If 
		If t_add = "" Then 
		        Is_error = 1
				Msg_error = Msg_error &"·请输入送货地址!<br>"
		End If 
		If rmb = "" Then 
		        Is_error = 1
				Msg_error = Msg_error &"·请输入配送费用!<br>"
		End If 
		If Is_error = 1 Then 
                m_t=" 录入客户信息"
                m_s=Msg_error
                m_u="javascript:history.back()"
                m_time="2"
                Call Up_mes(m_t,m_s,0,m_u,0,0,m_time,0)
		Else 
                conn.execute("Insert into [Lebi_ordertel](t_name,t_tel,t_biaozhi,t_add,rmb,dates)values('"&t_name&"','"&t_tel&"','"&t_biaozhi&"','"&t_add&"',"&rmb&","&sqlnowstring&")")
                set rs2 = conn.execute("select t_id from [Lebi_ordertel] where t_name='"&t_name&"' and t_tel='"&t_tel&"'")
				ManageLog "录入客户信息-电话订单，ID"&rs2("t_id")&""
                m_t=" 录入客户信息"
                m_s=Msg_error
                m_u="?action=addpro&id="&rs2("t_id")&""
                m_time="2"
                Call Up_mes(m_t,m_s,0,m_u,0,0,m_time,1)
		End If 
End Sub

Sub saveB
        If OnlyRead = 1 Then OnlyReadMessage()
        t_name=Safereplace(trim(request("t_name")))
        t_tel=Safereplace(trim(request("t_tel")))
        t_biaozhi=Safereplace(trim(request("t_biaozhi")))
        t_add=Safereplace(trim(request("t_add")))
        rmb=Safereplace(trim(request("rmb")))
		t_id = safereplace(Trim(request("t_id")))
		If t_name = "" Then 
		        Is_error = 1
				Msg_error = Msg_error &"·请输入客户名称!<br>"
		End If 
		If t_tel = "" Then 
		        Is_error = 1
				Msg_error = Msg_error &"·请输入联系电话!<br>"
		End If 
		If t_add = "" Then 
		        Is_error = 1
				Msg_error = Msg_error &"·请输入送货地址!<br>"
		End If 
		If rmb = "" Then 
		        Is_error = 1
				Msg_error = Msg_error &"·请输入配送费用!<br>"
		End If 
		If Is_error = 1 Then 
                m_t=" 编辑客户信息"
                m_s=Msg_error
                m_u="javascript:history.back()"
                m_time="2"
                Call Up_mes(m_t,m_s,0,m_u,0,0,m_time,0)
		Else 
                conn.execute("Update [Lebi_ordertel] set t_name = '"&t_name&"',t_tel = '"&t_tel&"',t_biaozhi='"&t_biaozhi&"',t_add='"&t_add&"',rmb="&rmb&",dates="&sqlnowstring&" where t_id="& t_id &"")
				ManageLog "编辑客户信息-电话订单，ID"& t_id &""
                m_t=" 编辑客户信息"
                m_s=Msg_error
                m_u="?action=addpro&id="& t_id &""
                m_time="2"
                Call Up_mes(m_t,m_s,0,m_u,0,0,m_time,1)
		End If 
End Sub

Sub dela
        If OnlyRead = 1 Then OnlyReadMessage()
        p_id=safereplace(request("p_id"))
        if p_id="" then 
               response.write"<SCRIPT language=JavaScript>alert('"& Lang_sys(41) &"');javascript:history.go(-1)</SCRIPT>"
               response.end
        end if
        conn.execute("Delete from [Lebi_ordertellist] where t_t_id = "& p_id &"")
	    ManageLog "删除电话订单产品，产品ID"& p_id &""
        Response.redirect "?action=addpro&id="& request("id") &""
End Sub

Sub delb
        If OnlyRead = 1 Then OnlyReadMessage()
        id=safereplace(request("id"))
               if id="" then 
                       response.write"<SCRIPT language=JavaScript>alert('"& Lang_sys(41) &"');javascript:history.go(-1)</SCRIPT>"
                       response.end
               end if
        conn.execute("Delete from [Lebi_ordertel] where t_id in ("&id&")")
        conn.execute("Delete from [Lebi_ordertellist] where t_id in ("&id&")")
		ManageLog "删除电话订单，ID"& id &""
        Response.redirect "?page="&Request("page")&""
End Sub

Sub updatestate()
        If OnlyRead = 1 Then OnlyReadMessage()
        id = CheckNum(request("id"),0)
		state = CheckNum(request("state"),0)
        conn.Execute("update [Lebi_ordertel] set istate="& state &" where t_id="& id &"")
		ManageLog "更新电话订单状态，ID"& id &""
        response.redirect "?action=prolist&id="& id &""
		response.End 
End Sub 

Sub addpro_ok()
        If OnlyRead = 1 Then OnlyReadMessage()
        gname1=safereplace(request("gname"))
        sprice=CheckNum(request("sprice"),0)
        price=CheckNum(request("price"),0)
        num=CheckNum(request("num"),1)
		id=CheckNum(request("id"),0)
	    conn.execute("Insert into [Lebi_ordertellist] (gname,sprice,price,num,t_id)values('"&gname1&"','"&sprice&"','"&price&"','"&num&"',"&id&")")	
		ManageLog "录入电话订单产品，ID"& id &""
		response.redirect "?action=addpro&id="& id
End Sub 

%>

<%Sub list%>
<script language="javascript" type="text/javascript" src="inc/js/MyCalendar.js"></script> 
<table width="99%" border="0" cellspacing="0" cellpadding="3" class="classtable">
<thead>
<tr>
<td height="30" align="left" colspan="4" class="classtd">
<form name="form1" method="post" action="admin_order_tel.asp">
	 <select name="state"><option value="">┌ 状态</option><option value="0">├ 未处理</option><option value="1">├ 已发货</option><option value="2">├ 货已到</option></select> <input type="text" name="dateFrom" value="" size="10" class="form_calendar" onclick="setday(this)" /> 至 <input type="text" name="dateTo" value="" size="10" class="form_calendar" onclick="setday(this)" /> <input name="keywords" type="text" class="form_query" size="10"><input name="Submit" type="image" src="images/bt_query.gif" title="<%=Lang_sys(25)%>" align="absmiddle"> 
	 <img src="images/help.gif" alt="可输入单号、客户名称、电话、地址等信息进行查找。" align="absmiddle">
</form>
</td>
<td align="right" colspan="3" class="classtd">
<form name="form1" method="post" action="admin_order_tel.asp?action=delb">
<input type="image" border="0" title=" <%=Lang_sys(5)%> " onclick="location.href='?action=add';return false;" src="lang/<%=LangFilePath%>/images/bt_add.gif" align="absmiddle">
<input type="image" name="Submit" title=" <%=Lang_sys(15)%> " onClick="return confirm('您确定要这样操作吗？')" src="lang/<%=LangFilePath%>/images/bt_delete.gif" align="absmiddle">
<input type="image" border="0" title=" 全选 " onclick="location.href='javascript:selectall();';return false;" src="images/bt_select.gif" align="absmiddle">
</td>
</tr>
<tr>
    <td height="30" width="5%" class="classtop"><%=Lang_sys(50)%></td>
    <td width="15%" class="classtop">订单编号</td>
    <td width="20%" class="classtop">录入时间</td>
    <td width="25%" class="classtop">客户名称</td>
    <td width="15%" class="classtop">联系电话</td>
    <td width="10%" class="classtop">订单状态</td>
    <td width="10%" class="classtop">操作</td>
</tr>
  <% 
   keywords=safeReplace(request("keywords"))
   state=safeReplace(request("state"))
   datefrom=safeReplace(request("datefrom"))
   dateto=safeReplace(request("dateto"))
   Set rs=Server.CreateObject("ADODB.RecordSet")
   sql="select * from [Lebi_ordertel] where t_name<>''"
   if keywords<>"" then sql=sql&" and (t_name like '%"&keywords&"%' or t_add like '%"&keywords&"%' or t_id in(select distinct t_id from [Lebi_ordertellist] where gname like '%"&keywords&"%'))" 
   If state <> "" Then sql = sql &" and istate = "& state &""
   If IsSqlDataBase = 1 And datefrom<>"" And dateto<>"" Then sql=sql + " and DateDiff(d,dates,'"& datefrom &"')<=0 and DateDiff(d,dates,'"& dateto &"')>=0"
   If IsSqlDataBase = 0 And datefrom<>"" And dateto<>"" Then sql=sql + " and DateDiff('d',dates,'"& datefrom &"')<=0 and DateDiff('d',dates,'"& dateto &"')>=0"
   sql=sql&" order by dates desc "
   rs.open sql,conn,1,1
   if rs.eof then 
	       response.write "<tr class=""classtd""><td align=""center"" height=""50"" colspan=""7"" class=""classtd"">空记录集</td></tr>"
   else
           rs.PageSize=20
           if page=0 then page=1
           pages=rs.pagecount
           if page > pages then page=pages
           rs.AbsolutePage=page
           for j=1 to rs.PageSize
%>
  <tr class="classrow">
    <td height="30" class="classrow"><input name="id" type="checkbox" value="<%=rs("t_id")%>"></td>
	<td class="classrow"><a href="?action=prolist&id=<% =rs("t_id")%>"><%=rs("t_id")%></a></td>
    <td class="classrow"><%=rs("dates")%></td>
    <td class="classrow"><%=rs("t_name")%></td>
	<td class="classrow"><%=rs("t_tel")%></td>
    <td class="classrow"><%if rs("istate")="0" then 
		   response.write "<font color=red>未处理</color>"
		   elseif rs("istate")="1" then 
			response.write "已发货"
		   elseif rs("istate")="2" then
			response.write "货已到" 
		end if %>
    </td>
    <td class="classrow"><a href="?action=prolist&id=<% =rs("t_id")%>"><img src="images/icon_view.gif" alt="查看" border="0"></a> <a href="?action=modi&id=<% =rs("t_id")%>"><img src="images/icon_edit.gif" alt="编辑" border="0"></a></td>
  </tr>
<%
        rs.movenext
        if rs.eof then exit for
        next
%>
</form>
<tr>
<form method=Post action="?keywords=<%=server.urlencode(keywords)%>&state=<%=state%>&datefrom=<%=datefrom%>&dateto=<%=dateto%>">
<td height="30" colspan="7" class="classfooter" align="center">
每页<%=rs.pagesize%>条&nbsp;&nbsp;
共<%=rs.recordcount%>条&nbsp;&nbsp;页次：<font color=red><%=page%></font>/<%=rs.pagecount%>
&nbsp;&nbsp;跳转到<input type="text" style="height:16px;width:30px;" name="page" value="<%=pagecount+1%>" class="form"><input type="image" src="images/icon_go.gif" align="absmiddle" name="go" value="跳转">&nbsp;&nbsp;
<a href="?keywords=<%=server.urlencode(keywords)%>&state=<%=state%>&datefrom=<%=datefrom%>&dateto=<%=dateto%>&page=1"><img src="images/icon_pre_02.gif" alt="首页" border="0" align="absmiddle"></a>
<% if page=1 and rs.pagecount<>page and rs.pagecount<>0 then%>
<a href="?keywords=<%=server.urlencode(keywords)%>&state=<%=state%>&datefrom=<%=datefrom%>&dateto=<%=dateto%>&page=<%=cstr(page+1)%>"><img src="images/icon_next.gif" alt="下一页" border="0" align="absmiddle"></a>
<% end if %>
<% if rs.pagecount>1 and rs.pagecount=page then %>
<a href="?keywords=<%=server.urlencode(keywords)%>&state=<%=state%>&datefrom=<%=datefrom%>&dateto=<%=dateto%>&page=<%=cstr(page-1)%>"><img src="images/icon_pre.gif" alt="上一页" border="0" align="absmiddle"></a>
<%end if%>
<% if page<>1 and rs.pagecount<>page then%>
<a href="?keywords=<%=server.urlencode(keywords)%>&state=<%=state%>&datefrom=<%=datefrom%>&dateto=<%=dateto%>&page=<%=cstr(page-1)%>"><img src="images/icon_pre.gif" alt="上一页" border="0" align="absmiddle"></a>
<a href="?keywords=<%=server.urlencode(keywords)%>&state=<%=state%>&datefrom=<%=datefrom%>&dateto=<%=dateto%>&page=<%=cstr(page+1)%>"><img src="images/icon_next.gif" alt="下一页" border="0" align="absmiddle"></a>
<% end if%>
<a href="?keywords=<%=server.urlencode(keywords)%>&state=<%=state%>&datefrom=<%=datefrom%>&dateto=<%=dateto%>&page=<%=rs.pagecount%>"><img src="images/icon_next_02.gif" alt="尾页" border="0" align="absmiddle"></a>
</td>
</tr>
</form>
<%
end if
rs.close
set rs=nothing
%>
</table>
<%End sub%>


<%Sub prolist()%>
<%
   id=CheckNum(request("id"),0)
   set rs = conn.execute("select * from [Lebi_ordertel] where t_id="&id&"")
   t_name=rs("t_name")
   t_add=rs("t_add")
   t_tel=rs("t_tel")
   t_biaozhi=rs("t_biaozhi")
   t_date=rs("dates")
   rmb=rs("rmb")
   istate=rs("istate")
   rs.close:Set rs=nothing
%>
<table width="99%" border="0" cellspacing="0" cellpadding="3" class="classtable">
    <tr> 
      <td colspan="4" height="27" class="classtop">电话订单第 <%=id%> 号详细信息</td>
    </tr>
        <tr class="classtd"> 
          <td width="15%" class="classtd">订单状态：</td>
          <td colspan="3" class="classtd"><%if istate="0" then 
		   response.write "<font color=red>未处理</color>"
		   elseif istate="1" then 
			response.write "已发货"
		   elseif istate="2" then
			response.write "货已到" 
		end if %>
        <%
		if istate="0" then 
		%>
		&nbsp;&nbsp;点此更改状态->
		<input type="button" class="button" value="已发货" onclick="location.href='?action=updatestate&state=1&id=<%=id%>'"> 
		<%
		End If 
		%>
        <%
		if istate="1" then 
		%>
		&nbsp;&nbsp;点此更改状态->
		<input type="button" class="button" value="货已到" onclick="location.href='?action=updatestate&state=2&id=<%=id%>'"> 
		<%
		End If 
		%>
        </td>
        </tr>
        <tr class="classtd"> 
          <td width="15%" class="classtd">客户姓名：</td>
          <td width="35%" class="classtd"><%=t_name%></td>
          <td width="15%" class="classtd">送货地址：</td>
          <td width="35%" class="classtd"><%=t_add%></td>
        </tr>
        <tr class="classtd"> 
          <td width="15%" class="classtd">联系电话：</td>
          <td width="35%" class="classtd"><%=t_tel%></td>
          <td width="15%" class="classtd">订单备注：</td>
          <td width="35%" class="classtd"><%=t_biaozhi%></td>
        </tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" align="center" width="99%">
<tr>
   <td height="5"></td>
</tr>
</table>
<table width="99%" border="0" cellspacing="0" cellpadding="3" class="classtable">
         <tr> 
            <td width="55%" height="30" class="classtop">商品名称</td>
            <td width="15%" class="classtop">市场价格</td>
            <td width="15%" class="classtop">销售价格</td>
            <td width="15%" class="classtop">数量</td>
          </tr>
          <% 
		     Set rs=Server.CreateObject("ADODB.RecordSet")
		     sqlsp="select * from [Lebi_ordertellist] where t_id="&id 
		     rs.open sqlsp,conn,1,1
			 if rs.eof then 
			  		 response.write "<tr><td height='50' align='center' colspan='4'>没有信息</td></tr>"
			         pit=0
			         pit1=0
			         pit2=0
			  Else  
			         Do while not rs.eof 
			         sprice=rs("sprice")
				     price=rs("price")
				     num=rs("num")
				     pit=pit+price*num
				     pit1=pit1+sprice*num
				     pit2=pit2+num
		%>
          <tr class="classtd"> 
            <td height="25"class="classtd"><%=rs("gname")%></td>
            <td class="classtd"><%=sprice%></td>
            <td class="classtd"><%=price%></td>
            <td class="classtd"><%=num%></td>
          </tr>
          <%
		   rs.movenext
		   loop 
		   end if
		   rs.close:Set rs=nothing%>
          <tr class="classtd"> 
            <td class="classtd"><b>小　　计</b></td>
            <td class="classtd"><%=pit1%></td>
            <td class="classtd"><%=pit%></td>
            <td class="classtd"><%=pit2%></td>
          </tr>
          <tr class="classtd"> 
            <td colspan="4" class="classtd"> 
              运费：<%=rmb%> 元  商品价格：<%=pit%> 元    <font color="#FF0000">总计：</font><%totalm=rmb+pit
			  response.write totalm
			  %>
              元（本次购物，您节省了<%=FormatNumber((pit1-pit),2)%> 元） 
			</td>
          </tr>
          <tr> 
            <td colspan="4" height="30" align="right" class="classfooter"> 
               <a onclick="javascript:history.back()" style="cursor:hand;"><img src="lang/<%=LangFilePath%>/images/bt_bak.gif" alt="返回" border="0"></a> 
               <a onClick="javascript:print()" style="cursor:hand;"><img src="lang/<%=LangFilePath%>/images/bt_print.gif" alt="打印" border="0"></a> 
			   <a onclick="window.open('admin_sh.asp?action=save&s_type=1&lx=1&sj=<%= Now() %>&bh=<%= id%>','basket', 'scrollbars=yes,resizable=no,width=1,height=1,menubar=no')" style="cursor:hand;"><img src="images/bt_sendorder.gif" alt="添加到送货清单" border="0"></a>
			</td>
          </tr>
	</table>
<%End sub%>


<%Sub add%>
<table width="99%" border="0" cellspacing="0" cellpadding="3" class="classtable">
  <form method="POST" action="?action=saveA">
            <tr> 
              <td class="classtd" colspan="2" height="30" align="right"> 
                <input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" value=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="images/bt_res.gif" border="0" alt=" 重填 " onclick="reset();return false;" align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_bak.gif" border="0" alt=" 返回 " onclick="location.href='javascript:history.back()';return false;" align="absmiddle">
			</td>
           </tr>
            <tr> 
              <td class="classtop" colspan="2" height="30">录入客户信息</td>
			</td>
           </tr>
            <tr class="classtd"> 
              <td width="15%" class="classtd" height="25">客户名称：</td>
              <td class="classtd" height="25"><input name="t_name" type="text" class="form" value="" size="40"></td>
            </tr>
			<tr class="classtd"> 
              <td width="15%" class="classtd" height="25">联系电话：</td>
              <td class="classtd" height="25"><input name="t_tel" type="text" class="form" value="" size="20"></td>
            </tr>
            <tr class="classtd"> 
              <td width="15%" class="classtd" height="25">送货地址:</td>
              <td class="classtd" height="25"><input name="t_add" type="text" class="form" value="" size="50"></td>
            </tr>
            <tr class="classtd"> 
              <td width="15%" class="classtd" height="25">配送费用：</td>
              <td class="classtd" height="25"><input name="rmb" type="text" class="form" size="10">元</td>
            </tr>
			<tr class="classtd"> 
              <td width="15%" class="classtd" height="25">备注说明：</td>
              <td class="classtd" height="25"><textarea cols="50" rows="3" name="t_biaozhi" type="text" class="text" ></textarea></td>
            </tr>
            <tr> 
              <td class="classfooter" colspan="2" height="30" align="right"> 
                <input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" value=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="images/bt_res.gif" border="0" alt=" 重填 " onclick="reset();return false;" align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_bak.gif" border="0" alt=" 返回 " onclick="location.href='javascript:history.back()';return false;" align="absmiddle">
			</td>
           </tr>
        </form>
        </table>
<%End sub%>

<%
Sub modi
        id=CheckNum(request("id"),0)
        set rs = conn.execute("select * from [Lebi_ordertel] where t_id="&id&"")
%>
         <table width="99%" border="0" cellspacing="0" cellpadding="3" class="classtable">
            <form method="post" action="?">
            <tr> 
              <td class="classtd" colspan="2" height="30" align="right"> 
                <input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" value=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="images/bt_res.gif" border="0" alt=" 重填 " onclick="reset();return false;" align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_bak.gif" border="0" alt=" 返回 " onclick="location.href='javascript:history.back()';return false;" align="absmiddle">
				<input type="hidden" name="t_id" value="<%= id %>">
				<input type="hidden" name="action" value="saveB">
			</td>
           </tr>
            <tr> 
              <td class="classtop" colspan="2" height="30" align="left">编辑客户信息</td>
			</td>
           </tr>
            <tr class="classtd"> 
              <td width="15%" class="classtd" height="25">客户名称：</td>
              <td class="classtd" height="25"><input name=t_name type="text" class="form" value="<%=rs("t_name")%>" size="40"></td>
            </tr>
			<tr class="classtd"> 
              <td width="15%" class="classtd" height="25">联系电话：</td>
              <td class="classtd" height="25"><input name="t_tel" type="text" class="form" value="<%=rs("t_tel")%>" size="20"></td>
            </tr>
            <tr class="classtd"> 
              <td width="15%" class="classtd" height="25">送货地址：</td>
              <td class="classtd" height="25"><input name="t_add" type="text" class="form" value="<%=rs("t_add")%>" size="50"></td>
            </tr>
            <tr class="classtd"> 
              <td width="15%" class="classtd" height="25">配送费用：</td>
              <td class="classtd" height="25"><input name="rmb" type="text" class="form" value="<%=rs("rmb")%>" size="5"> 元</td>
            </tr>
			<tr class="classtd"> 
              <td width="15%" class="classtd" height="25">备注说明：</td>
              <td class="classtd" height="25"><textarea cols="50" rows="3" name="t_biaozhi" type="text" class="text" ><%=rs("t_biaozhi")%></textarea></td>
            </tr>
            <tr> 
              <td class="classfooter" colspan="2" height="30" align="right"> 
                <input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" value=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="images/bt_res.gif" border="0" alt=" 重填 " onclick="reset();return false;" align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_bak.gif" border="0" alt=" 返回 " onclick="location.href='javascript:history.back()';return false;" align="absmiddle">
              </td>
            </tr>
			</form>
        </table>
<%End sub%>

<%Sub addpro%>
<% 
id=Request("id")
%> 
<script language="JavaScript" type="text/JavaScript">
function CheckForm(theform)
{
    if (!isEmpty(theform.gname,'请填写商品名称！')) return false;
	if (!isEmpty(theform.sprice,'请填写市场价！')) return false;
	if (!isEmpty(theform.price,'请填写销售价！')) return false;
	if (!isEmpty(theform.num,'请填写数量！')) return false;
}
</script>
<table width="99%" border="0" cellspacing="0" cellpadding="3" class="classtable">
            <tr> 
              <td class="classtd" colspan="2" height="30" align="left">录入商品信息</td>
              <td class="classtd" colspan="3" height="30" align="right"> 
                <input type="image" src="lang/<%=LangFilePath%>/images/bt_bak.gif" border="0" alt=" 返回 " onclick="location.href='Admin_order_tel.asp';return false;" align="absmiddle">
			</td>
           </tr>
</table>
<table width="99%" border="0" cellspacing="0" cellpadding="3" class="classtable" style="margin-top:5px;">
		<form name="ffm" method="post" action="?" onSubmit="return CheckForm(this);">
			<tr>
			  <td colspan="5" height="30" align="right" class="classtd"><input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" value=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="images/bt_res.gif" border="0" alt=" 重填 " onclick="reset();return false;" align="absmiddle"><input type="hidden" name="action" value="addpro_ok"><input name="id" type="hidden" id="id" value="<%=Request("id")%>"></td>
			 </tr>
            <tr> 
              <td width="40%" height="30" class="classtop">商品名称</td>
              <td width="15%" class="classtop">市场价</td>
              <td width="15%" class="classtop">销售价</td>
              <td width="15%" class="classtop">数量</td>
			  <td width="15%" class="classtop">&nbsp;</td>
            </tr>
            <tr> 
              <td height="20" class="classtd"><input name="gname" type="text" class="form" size="25"></td>
              <td class="classtd"><input name="sprice" type="text" class="form" size="6"></td>
              <td class="classtd"><input name="price" type="text" class="form" size="6"></td>
              <td class="classtd"><input name="num" type="text" class="form" size="6"></td>
			  <td class="classtd">&nbsp;</td>
            </tr>
			</form>
</table>
<table width="99%" border="0" cellspacing="0" cellpadding="3" class="classtable" style="margin-top:5px;">
		<form name="ffm" method="post" action="?" onSubmit="return check_input()">
			<tr>
			  <td colspan="5" height="30" align="left" class="classtd">订购商品列表</td>
			 </tr>
            <tr> 
              <td width="40%" height="30" class="classtop">商品名称</td>
              <td width="15%" class="classtop">市场价</td>
              <td width="15%" class="classtop">销售价</td>
              <td width="15%" class="classtop">数量</td>
			  <td width="15%" class="classtop">操作</td>
            </tr>
<%  
set rs = conn.execute("select * from [Lebi_ordertellist] where t_id="& id &"")
if not rs.eof Then 
Do While NOT rs.EOF 
%>
            <tr class="classtd"> 
              <td class="classtd" height="20"><%=rs("gname")%></td>
              <td class="classtd"><%=rs("sprice")%></td>
              <td class="classtd"><%=rs("price")%></td>
              <td class="classtd"><%=rs("num")%></td>
              <td class="classtd"><a href="?action=dela&p_id=<%=rs("t_t_id")%>&id=<%=Request("id")%>"><img src="images/icon_del.gif" alt="删除" border="0"></a></td>
            </tr>
            <%  
rs.MoveNext
loop
end If
rs.Close
set rs=nothing 
%>
        </table>
<%End sub%>