<%if session("bjxadmin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
else
if session("flag")>1 then
response.Write "<p align=center><font color=red>您没有此项目管理权限！</font></p>"
response.End
end if
end if%>
<!--#include file="conn.asp"-->
<% 
session("id")=Request("id")
t_id1=session("id")
%> 
<html>
<head>
<title>添加新商品</title>
<script language=javascript >

function check_input() 
{  
    if (ffm.gname.value=="")
      { alert("请输入商品名");
        ffm.gname.focus();
	   return false;
       }
	 if (ffm.mprice.value=="")
      { alert("请输入市场价");
        ffm.mprice.focus();
	   return false;
       }
	  if (ffm.leprice.value=="")
      { alert("请输入263商城价");
        ffm.leprice.focus();
	   return false;
       }
	 if (ffm.num.value=="")
      { alert("请输入数量");
        ffm.num.focus();
	   return false;
       }	
       
	  return true;
}


</script> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../../images/css.css" rel="stylesheet" type="text/css">
<style><!--
body,td,th {
	color: #000000;
}
body {
	background-color: #C7D4F7;
}
-->
</style></head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
<div align="center"> 
  <p><br>
    <a href="index.asp">&gt;&gt;返回电话订单主页面</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    <a href="add.asp?add=x&id=<%=Request("id")%>">&gt;&gt;修改客户信息</a> 
    <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=? onSubmit="return check_input()">
        <table bgcolor=#CCCCCC border=0 cellpadding=3 cellspacing=1 
        width="98%" align="center" class="9bang">
          <tr bgcolor="#FFFFFF"> 
            <td colspan="5" class="008c5e"> <div align="center">新增商品 （带<font color="#FF0000"><b>＊</b></font>为必填项） 
              </div></td>
          </tr>
          <tbody>
            <tr bgcolor="#f1f1f1"> 
              <td width=37% class="008c5e"> 
                <div align="center">商品名称</div></td>
              <td width=22% class="008c5e"> 
                <div align="center">市场价格</div></td>
              <td width=20% class="008c5e"> 
                <div align="center">会员价格</div></td>
              <td width=12% class="008c5e"> 
                <div align="center">数量</div></td>
              <td width=9% class="008c5e">&nbsp;</td>
            </tr>
            <tr> 
              <td bgcolor=#FFFFFF width=37% class="008c5e" height="18"> <div align="center"> 
                  <font color="#FF0000"><b>
                  <input name="id" type="hidden" id="id" value="<%=Request("id")%>">
                  ＊</b></font> 
                  <input name="gname" type="text" class="wenbenkuang" size="15">
                </div></td>
              <td bgcolor=#ffffff width=22% class="008c5e" height="18"> <div align="center"> 
                  <font color="#FF0000"><b>＊</b></font> 
                  <input name="mprice" type="text" class="wenbenkuang" size="15">
                </div></td>
              <td bgcolor=#ffffff width=20% class="008c5e" height="18"> <div align="center"> 
                  <font color="#FF0000"><b>＊</b></font> 
                  <input name="leprice" type="text" class="wenbenkuang" size="15">
                </div></td>
              <td bgcolor=#ffffff width=12% class="008c5e" height="18"> <div align="center"> 
                  <font color="#FF0000"><b>＊</b></font> 
                  <input name="num" type="text" class="wenbenkuang" size="6">
                </div></td>
              <td bgcolor=#ffffff width=9% class="008c5e" height="18"> <div align="center"> 
                  <input name="Submit" type="submit" class="go-wenbenkuang" value="提交">
                </div></td>
            </tr>
          </tbody>
        </table>
        <br>
        <%   gname1=request("gname")
   mprice=request("mprice")
   leprice=request("leprice")
   num=request("num")
		  Set rs = Server.CreateObject("ADODB.Recordset")		 
	  sql="select * from telorder_goods where t_id="&t_id1&" and gname='"&gname1&"'"
	  rs.open sql,conn,1,3
	  if rs.eof and gname1<>"" then	 
      rs.addnew  
	  
	  rs("t_id")=t_id1
	  rs("gname")=gname1
	  rs("mprice")=mprice
	  rs("leprice")=leprice
	  rs("num")=num 
	   
	  
	  rs.update 	
	  else
	  rs.close
	  set rs=nothing
	  end if	  
%>
        <table bgcolor=#CCCCCC border=0 cellpadding=3 cellspacing=1 
        width="98%" align="center" class="9bang">
          <%set rs = conn.execute("select * from telorder_goods where t_id="&t_id1&"")
		  if not rs.eof then %>
          <tr bgcolor="#FFFFFF"> 
            <td colspan="5" class="008c5e"> <div align="center">购物车内商品列表</div></td>
          </tr>
          <tbody>
            <tr bgcolor="#f1f1f1"> 
              <td width=37% height="17" class="008c5e"> 
                <div align="center">商品名称</div></td>
              <td width=23% height="17" class="008c5e"> 
                <div align="center">市场价格</div></td>
              <td width=19% height="17" class="008c5e"> 
                <div align="center">会员价格</div></td>
              <td width=12% height="17" class="008c5e"> 
                <div align="center">数量</div></td>
              <td width=9% height="17" class="008c5e"> 
                <div align="center">删除</div></td>
            </tr>
            <% 
While NOT rs.EOF 
%>
            <tr> 
              <td bgcolor=#FFFFFF width=37% class="008c5e" height="18"> <div align="center"><%=rs("gname")%></div></td>
              <td bgcolor=#ffffff width=23% class="008c5e" height="18"> <div align="center"><%=rs("mprice")%></div></td>
              <td bgcolor=#ffffff width=19% class="008c5e" height="18"> <div align="center"><%=rs("leprice")%></div></td>
              <td bgcolor=#FFFFFF class="008c5e" width="12%" height="18"> <div align="center"><%=rs("num")%></div></td>
              <td bgcolor=#ffffff class="008c5e" width="9%" height="18"><div align="center"><a href=del.asp?x=a&id=<%=rs("t_t_id")%>>删除</a></div></td>
            </tr>
            <%  
    rs.MoveNext()
Wend
end if %>
          </tbody>
        </table>
        <input type="hidden" name="MM_insert" value="true">
      </form></td>
  </tr>
</table>
</body>
</html>
<%
rs.Close
set rs=nothing 
%>
