www.gusucode.com > 云枫企业网站源代码第二版 2.0源码程序 > admin/product/add.asp
<!--#include file="../inc/admin.asp"--> <!--#include file="../inc/conn.asp"--> <%if Request.QueryString("no")="eshop" then%> <% title=server.htmlencode(Trim(Request("title"))) titlee=server.htmlencode(Trim(Request("titlee"))) D_type=request("D_type") pic=request("pic") pic2=request("pic2") xh=request("xh") dj=request("dj") aa=request("aa") discount=request("discount") sContent = "" For i = 1 To Request.Form("d_content").Count sContent = sContent & Request.Form("d_content")(i) Next sContente = "" For ie = 1 To Request.Form("d_contente").Count sContente = sContente & Request.Form("d_contente")(ie) Next Set rs = Server.CreateObject("ADODB.Recordset") sql="select * from product " rs.open sql,conn,1,3 rs.addnew rs("title")=title rs("titlee")=titlee rs("D_type")=D_type rs("pic")=pic rs("pic2")=pic2 rs("xh")=xh rs("content")=sContent rs("contente")=sContente rs("counter")=0 rs("dj")=dj rs("aa")=aa rs("discount")=discount rs.update rs.close response.redirect "manage.asp" end if %> <html> <head> <title>产品管理</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <link href="../Admin_Style.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!-- body { margin-top: 10px; } --> </style></head> <script language=JavaScript> // 表单提交客户端检测 function doSubmit(){ if (document.myform.title.value==""){ alert("产品名称不能为空!"); myform.title.focus(); return false; } if (document.myform.D_type.value==""){ alert("产品类别不能为空!"); myform.D_type.focus(); return false; } if (document.myform.pic.value==""){ alert("产品小图不能为空!"); myform.pic.focus(); return false; } if (document.myform.pic2.value==""){ alert("产品大图不能为空!"); myform.pic2.focus(); return false; } if (document.myform.pic2.value==""){ alert("请输入产品单价!"); myform.pic2.focus(); return false; } // getHTML()为eWebEditor自带的接口函数,功能为取编辑区的内容 if (eWebEditor1.getHTML()==""){ alert("请输入产品详细说明!"); return false; } document.myform.submit(); } </script> <style type="text/css"> <!-- .STYLE1 { color: #FFFFFF; font-weight: bold; } --> </style> <form action="Add.asp?no=eshop" method="post" name="myform"> <table width="743" border="0" cellspacing="2" cellpadding="3" class="border"> <tr> <td height="25" colspan="2" align="center" bgcolor="#006666" class="STYLE1" >新增产品</td> </tr> <tr> <td height="25" align="right" bgcolor="#E1F4EE">产品名称(中)</td> <td bgcolor="#E1F4EE"><input type="text" name="title" class="inputtext"></td> </tr> <tr> <td height="25" align="right" bgcolor="#E1F4EE">产品名称(英)</td> <td bgcolor="#E1F4EE"><input type="text" name="titlee" class="inputtext"></td> </tr> <tr> <td height="25" align="right" bgcolor="#E1F4EE">产品型号</td> <td bgcolor="#E1F4EE"><input name="xh" type="text" class="inputtext" id="xh"></td> </tr> <tr> <td width="8%" height="25" align="right" bgcolor="#E1F4EE">类别名称</td> <td width="62%" bgcolor="#E1F4EE"><select name="D_type"> <% Set rs1 = Server.CreateObject("ADODB.Recordset") rs1.Open "Select * From sortname order by id desc", conn, 1,1 if not(rs1.eof or rs1.bof) then do while not rs1.eof %> <option value=<%=rs1("id")%>><%=rs1("sortname")%></option> <%rs1.movenext loop rs1.close set rs1=nothing end if %> </select></td> </tr> <tr> <td height="25" align="right" bgcolor="#E1F4EE">产品小图</td> <td height="25" bgcolor="#E1F4EE"><input name="pic" type="text" class="inputtext" id="pic" size="30"> <input type="button" name="Submit2" value="上传文件" onClick="window.open('../Up_BookPic.asp?formname=myform&editname=pic&uppath=Upimg&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')"> <span class="STYLE2">图片大小为:150px * 110px (宽*高) </span></td> </tr> <tr> <td height="25" align="right" bgcolor="#E1F4EE">产品大图</td> <td height="25" bgcolor="#E1F4EE"><input name="pic2" type="text" class="inputtext" id="pic2" size="30"> <input type="button" name="Submit2" value="上传文件" onClick="window.open('../Up_BookPic.asp?formname=myform&editname=pic2&uppath=Upimg&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')"></td> </tr> <tr> <td height="25" align="right" bgcolor="#E1F4EE">详细内容(中)</td> <td height="25" bgcolor="#E1F4EE"><textarea name="d_content" style="display:none"></textarea> <iframe id="eWebEditor1" src="../ewebeditor/ewebeditor.asp?id=d_content&style=standard" frameborder="0" scrolling="no" width="550" height="350"></iframe></td> </tr> <tr> <td height="25" align="right" bgcolor="#E1F4EE">详细内容(英)</td> <td height="25" bgcolor="#E1F4EE"><textarea name="d_contente" style="display:none"></textarea> <iframe id="eWebEditor2" src="../ewebeditor/ewebeditor.asp?id=d_contente&style=standard" frameborder="0" scrolling="no" width="550" height="350"></iframe></td> </tr> <tr bgcolor="#F7F7F7"> <td height="20" align="right" valign="middle" bgcolor="#E1F4EE">单价:</td> <td align="left" valign="middle" bgcolor="#E1F4EE"><input name="dj" type="text" class="inputtext" id="dj"></td> </tr> <tr bgcolor="#F7F7F7"> <td height="20" align="right" valign="middle" bgcolor="#E1F4EE">序号:</td> <td align="left" valign="middle" bgcolor="#E1F4EE"><input name="S_order" type="text" id="S_order" value="0" size="4"></td> </tr> <tr bgcolor="#F7F7F7"> <td height="20" align="right" valign="middle" bgcolor="#E1F4EE">产品推荐:</td> <td align="left" valign="middle" bgcolor="#E1F4EE"><input name="aa" type="checkbox" id="aa" value="true" <%if rs("aa")="true" then%>checked<%end if%>> 首页滚动显示 </td> </tr> <tr bgcolor="#F7F7F7"> <td height="20" align="right" valign="middle" bgcolor="#E1F4EE">产品折扣:</td> <td align="left" valign="middle" bgcolor="#E1F4EE"><select name="discount"> <option value="100" selected>原价</option> <option value="95">9.5折</option> <option value="90">9.0折</option> <option value="85">8.5折</option> <option value="80">8.0折</option> <option value="70">7.0折</option> <option value="60">6.0折</option> <option value="50">5.0折</option> </select></td> </tr> <tr> <td height="25" colspan="2" align="center" bgcolor="#E1F4EE"> <input type=button name=btnSubmit value=" 提 交 " onClick="doSubmit()"> <input type=reset name=btnReset value=" 重 填 "> </td> </tr> </table> </form>