<!--#include file="../conn/conn.asp"-->
<!--#include file="../conn/nosql.asp"-->
<!--#include file="../conn/config.asp"-->
<!--#include file="../conn/md5.asp"-->
<%
if session("adminname")="" then
response.Redirect "login.asp"
response.End()
else
session("adminname")=session("adminname")
end if
  classid=request("classid")
  picname=nosql(request("picname"))
  pic=nosql(request("pic"))
  qixian=nosql(trim(request("qixian")))
  sex=request("sex")
  jiage=request("jiage")
  action=request("action")
  isnew=request("isnew")
  if action="save" then
  	if not isChkInteger(classid) then
		response.redirect ("login.asp")
	end if
	if not isChkInteger(jiage) then
		response.redirect ("login.asp")
	end if
	if not isChkInteger(isnew) then
		response.redirect ("login.asp")
	end if
	set rs=server.createObject("adodb.recordset")
   	sql="select * from snsn_zyxx"
   	rs.open sql,conn,1,3
	rs.addnew
	rs("name")=picname
	rs("jiage")=jiage
	rs("pic")=pic
	rs("adddate")=now
	rs("new")=isnew
	rs("classid")=classid
	rs("buynum")=0
	rs("sydate")=qixian
	rs("sex")=sex
	session("sex2")=sex
	rs.update
	response.write("<script>alert('成功添加');location.href='addxx.asp'</script>")
  end if
  %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档11111</title>
</head>
<%
	sql="select * from snsn_zyxxclass"
		set rs_class=conn.execute(sql)
%>
<body>
<form action="addxx.asp?action=save" method="post" name="myform" onSubmit="return formcheck()">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#0066FF">
  <tr>
    <td width="1%">&nbsp;</td>
    <td width="99%"><table width="100%" border="0" cellspacing="0" cellpadding="5">
        <tr>
          <td width="30%" style="font-size:14px;color:#ffffff">&nbsp;<strong><font color="#000000">商品管理</font></strong></td>
          <td width="70%" align="right">&nbsp;</td>
        </tr>
    </table></td>
  </tr>
</table>
<br>
  <table width="90%" border="0" align="center" bgcolor="#999999">
  <tr>
    <td colspan="5">所属于类别
      <select name="classid">
        <%	while not rs_class.eof %>
        <option value="<%=rs_class("id")%>"><%=rs_class("name")%></option>
        <%	rs_class.movenext
			wend%>
      </select>
      <input type="submit" name="Submit" value="提交"></td>
    <td width="45%">&nbsp;</td>
  </tr>
  <tr>
    <td width="7%"><div align="center">商品名称</div></td>
    <td width="22%"><input type="text" name="picname"></td>
    <td width="4%">性别</td>
    <td width="11%">男
      <input name="sex" type="radio" value="1" <%if session("sex2")=1 then%> checked <%end if%>>
      女
      <input type="radio" name="sex" value="0" <%if session("sex2")=0 then%> checked <%end if%>></td>
    <td width="11%"><div align="center">商品图片</div></td>
    <td><input type="text" name="pic">
<a href=# onClick="javascript:upload()">上传图片</a></td>
<script language="javascript">
	function upload(){
		a=myform.classid.value
		window.open('../upload1.asp?formname=myform&editname=pic&infoname='+a,'','status=no,scrollbars=no,top=20,left=110,width=420,height=165')
	}
	function formcheck(){
		a=document.getElementsByTagName("input")
		return
	}
</script>
  </tr>
  <tr>
    <td>
      <div align="center">使用期限        </div></td>
    <td><input type="text" name="qixian" value=30></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><div align="center">价格</div></td>
    <td><input name="jiage" type="text" value="30">
      是
        <input type="radio" name="isnew" value="1">
      否
      <input name="isnew" type="radio" value="0" checked>
      是否新品</td>
  </tr>
</table>
    <div align="center"></div>
</form>
</body>
</html>
