<!--#Include File="Connection.Asp"-->
<!--#Include File="Function.Asp"-->
<!--#Include File="JaClog.Asp"-->
<%
dim rs,sql,orderID,pram2
set rs=server.CreateObject("adodb.recordset")
sql="select top 1 * from home_items order by id desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then 
	orderID=1
else
	orderid=rs("id")+1
end if
rs.close
session("newname")=orderid
If Request.QueryString("action")="do" Then
Dim SqlA,Na,Sr,vi,piw,ty,pi22,pi33,idno,tmprsrs,sqlB,typ,vip1
Na = JaKillStr(Trim(Request.Form("Na")))
vi = JaKillStr(Trim(Request.Form("vi")))
vip1=Cint(JaKillStr(Trim(Request.Form("vip"))))
piw = JaKillStr(Trim(Request.Form("pi")))
ty = Cint(JaKillStr(Trim(Request.Form("ty"))))
pi22 = Cint(JaKillStr(Trim(Request.Form("pi2"))))
pi33 = Cint(JaKillStr(Trim(Request.Form("pi3"))))
idno=Cint(JaKillStr(Trim(Request.Form("id"))))
set tmprsrs=server.CreateObject("adodb.recordset")
sqlb="select seqno,typeseq from home_subtype where id="&ty
tmprsrs.open sqlb,conn,1,1
typ=tmprsrs("typeseq")+tmprsrs("seqno")*100
if typ=101 then
pram2=101
elseif typ=102 or typ=302 then
pram2=12
elseif typ=202 then
pram2=11
else
pram2=21
end if
SqlA = "INSERT INTO [Home_items](id,name,parm1,parm3,type,price1,price2,period,flag,quantity,vip) VALUES("
sqlA=sqlA&idno&",'"&Na&"',0,"&pram2&","&typ&","&piw&","&vi&","&pi22&",1,"&pi33&","&vip1&")"
Conn.ExeCute(SqlA)
Response.Write "<script language=javascript>alert('添加物品成功!');"
  Response.Write "window.document.location.href='SelAdd.Asp';</script>"
  Response.End()
End If
%>
<HTML><HEAD><TITLE>无标题文档</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">

<LINK href="JaImg/css.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>

<BODY>
<FORM name=form action="?action=do" method=post>
<TABLE class=itemhead height=25 cellSpacing=0 cellPadding=0 width="100%" 
align=center border=0>
  <TBODY>
  <TR>
    <TD class=itemheadtd vAlign=bottom bgColor=#bcdbfe>
      <TABLE height=18 cellSpacing=0 cellPadding=0 width=250 border=0>
            <TBODY>
        <TR>
                <TD class=item>添加家园销售物品</TD>
              </TR></TBODY></TABLE>
        </TD>
      </TR></TBODY></TABLE>
<TABLE height=8 cellSpacing=0 cellPadding=0 width=100 border=0>
  <TBODY>
  <TR>
    <TD></TD></TR></TBODY></TABLE>
  <TABLE cellSpacing=1 cellPadding=3 width="100%" align=center bgColor=#164481 
border=0>
    <TBODY>
      <TR> 
        <TD align=middle width="19%" bgColor=#daebfe height=25><STRONG>物 品 名 称：</STRONG></TD>
        <TD width="81%" bgColor=#ffffff> <INPUT 
      name=Na id="Na" size=15 maxLength=8> </TD>
      </TR>
      <TR> 
        <TD align=middle bgColor=#daebfe height=25><STRONG> 小图 片 上 传：</STRONG></TD>
        <TD bgColor=#e7ebf1> <iframe marginwidth=0 framespacing=0 marginheight=0 frameborder=0 width=100% height=25 scrolling=no src="PhotoUpload.asp"></iframe> 
        </TD>
      </TR>
      <TR>
        <TD align=middle bgColor=#daebfe height=25><STRONG>大图 片 上 传：</STRONG></TD>
        <TD bgColor=#ffffff><iframe marginwidth=0 framespacing=0 marginheight=0 frameborder=0 width=100% height=25 scrolling=no src="PhotoUpload1.asp"></iframe></TD>
      </TR>
      <TR> 
        <TD align=middle bgColor=#daebfe height=25><STRONG>VIP 价 格：</STRONG></TD>
        <TD bgColor=#ffffff><INPUT 
      name=vi id="vi" size=15 maxLength=8> </TD>
      </TR>
      <TR> 
        <TD align=middle bgColor=#daebfe height=25><STRONG>普 通 用 户 价 格：</STRONG></TD>
        <TD bgColor=#e7ebf1> <INPUT 
      name=pi id="pi" size="15" maxLength=50> </TD>
      </TR>
      <TR> 
        <TD align=middle bgColor=#daebfe height=25><STRONG>有 效 期 限 ：</STRONG></TD>
        <TD bgColor=#ffffff><INPUT 
      name=pi2 id="pi2" size="15" maxLength=50></TD>
      </TR>
      <TR> 
        <TD align=middle bgColor=#daebfe height=25><STRONG>库 存：</STRONG></TD>
        <TD bgColor=#e7ebf1> <INPUT 
      name=pi3 id="pi3" size="15" maxLength=50> </TD>
      </TR>
      <TR> 
        <TD align=middle bgColor=#daebfe height=25><STRONG>是否VIP：</STRONG></TD>
        <TD bgColor=#ffffff><input type="radio" name="vip" value="1">
          是 
          <input name="vip" type="radio" value="0" checked>
          否</TD>
      </TR>
      <TR> 
        <TD align=middle bgColor=#daebfe height=25><STRONG>编 号：</STRONG></TD>
        <TD bgColor=#e7ebf1> <INPUT 
      name=ID id="ID" size="15" maxLength=50 value="<%response.Write(orderid)%>"> 
        </TD>
      </TR>
      <TR> 
        <TD align=middle bgColor=#daebfe height=25><STRONG>物 品 所 属 ：</STRONG></TD>
        <TD bgColor=#ffffff><select name=ty id="ty">
            <% sql="select * from home_subtype"
		rs.open sql,conn,1,1
		do while not rs.eof 
			response.Write("<option value="&rs("ID")&">"&rs("SubTypeName")&"</option>")
			rs.movenext
		loop
		%>
          </select> </TD>
      </TR>
      <TR> 
        <TD align=middle bgColor=#daebfe height=35>&nbsp;</TD>
        <TD bgColor=#e7ebf1 colSpan=2> <INPUT class=button1 type=submit value=确认无误，我要添加 name=Submit23> 
        </TD>
      </TR>
    </TBODY>
  </TABLE>
</FORM>
</BODY></HTML>
