www.gusucode.com > 随缘网络产品管理系统 2.0码程序 > manage/addnews.asp
<!--#include file="conn.asp"--> <% if not session("check")="checked" then response.Redirect "login.asp" end if %> <% dim rs dim sql dim count set rs=server.createobject("adodb.recordset") sql = "select * from SmallClass order by SmallClassID asc" rs.open sql,conn,1,1 %> <script language = "JavaScript"> var onecount; subcat = new Array(); <% count = 0 do while not rs.eof %> subcat[<%=count%>] = new Array("<%= trim(rs("SmallClassName"))%>","<%= trim(rs("BigClassName"))%>","<%= trim(rs("SmallClassName"))%>"); <% count = count + 1 rs.movenext loop rs.close %> onecount=<%=count%>; function changelocation(locationid) { document.addNEWS.SmallClassName.length = 1; var locationid=locationid; var i; for (i=0;i < onecount; i++) { if (subcat[i][1] == locationid) { document.addNEWS.SmallClassName.options[document.addNEWS.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]); } } } function CheckForm() { if (document.addNEWS.title.value.length == 0) { alert("产品名称没有填写!"); document.addNEWS.title.focus(); return false; } return true; } </script> <SCRIPT> function view1(url){ var url; window.open(url,'_blank','status=no,scrollbars=yes,top=50,left=300,width=460,height=220'); } </SCRIPT> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <link href="images/private.css" rel="stylesheet" type="text/css" /> <script language='javascript' src='images/private.js'></SCRIPT> <title>添加产品</title> </head> <body leftmargin="0" topmargin="0"> <table border=0 cellspacing=1 align=center class=navi> <tr> <th>当前位置:产品管理 >> 添加产品</th> </tr> </table> <br> <table width="65%" border="0" align="center" cellpadding="1" cellspacing="1" class="list" bgcolor="#FF0000"> <form id="AddPro" name="addNEWS" method="post" action="addnews_save.asp" onSubmit="return CheckForm();"> <tr bgcolor="#FFFFFF"> <th height="25" bgcolor="#FF0000" width="99%" colspan="2"><div align="center" class="style1"> 产品添加</div> </th> </tr> <tr bgcolor="#FFFFFF"> <td height="25" width="17%" align="right"> 产品名称:</td> <td height="25" width="162%"> <input name="title" type="text" class="input" size="30"></td> </tr> <tr bgcolor="#FFFFFF"> <td height="25" width="17%" align="right">产品类别:</td> <td height="25" width="162%"><% sql = "select * from BigClass" rs.open sql,conn,1,1 if rs.eof and rs.bof then response.write "请先添加栏目。" else %><select name="BigClassName" onChange="changelocation(document.addNEWS.BigClassName.options[document.addNEWS.BigClassName.selectedIndex].value)" size="1"> <option selected value="<%=trim(rs("BigClassName"))%>"><%=trim(rs("BigClassName"))%></option> <% dim selclass selclass=rs("BigClassName") rs.movenext do while not rs.eof %> <option value="<%=trim(rs("BigClassName"))%>"><%=trim(rs("BigClassName"))%></option> <% rs.movenext loop end if rs.close %> </select> <select name="SmallClassName"> <option selected>不指定小类</option> <% sql="select * from SmallClass where BigClassName='" & selclass & "'" rs.open sql,conn,1,1 if not(rs.eof and rs.bof) then %> <option value="<%=rs("SmallClassName")%>"><%=rs("SmallClassName")%></option> <% rs.movenext do while not rs.eof%> <option value="<%=rs("SmallClassName")%>"><%=rs("SmallClassName")%></option> <% rs.movenext loop end if rs.close %> </select></td> </tr> <tr bgcolor="#FFFFFF"> <td height="25" width="17%" align="right"> 产品规格:</td> <td height="25" width="84%"> <input name="gg" type="text" class="input" size="30"></td> </tr> <tr bgcolor="#FFFFFF"> <td height="25" width="17%" align="right"> 产品图片:</td> <td height="25" width="84%"> <input name="pic1" class="input" size="30"> [<strong><a href="javascript:view1('up1.asp?FD=pic1')"><font color="#0000ff">上传图片</font></a></strong>]</td> </tr> <tr bgcolor="#FFFFFF"> <td height="25" width="17%" align="right"> 推荐产品:</td> <td height="25" valign="top" width="162%"> <input type="radio" value="1" name="tj">是 <input type="radio" name="tj" value="0" checked>否</td> </tr> <tr bgcolor="#FFFFFF"> <td height="25" width="17%" align="right"> 产品内容:</td> <td height="25" valign="top" width="162%"> <input type="hidden" name="content" value=""> <iframe ID="eWebEditor1" src="edit/115cn.asp?id=content&style=s_blue" frameborder="0" scrolling="no" width="550" HEIGHT="350"></iframe></td> </tr> <tr bgcolor="#FFFFFF"> <td height="30" align="center" bgcolor="#FF0000" colspan="2"> <input type="submit" name="Submit" value="提交" class="input"> <input type="reset" name="Submit2" value="重置" class="input"> </td> </tr> </form> </table> </body> </html>