www.gusucode.com > 云枫工作室企业网站源代码第五版 1.0 > docc/admin/cpsadd.asp
<%@LANGUAGE="VBSCRIPT"%> <!--#include file="conn.asp"--> <!--#include file="check.asp"--> <!--#include file="include.asp"--> <% smallstyle = int(request.QueryString("smallstyle")) if smallstyle >= "" then %> <% Dim MM_TableName '表名 Dim MM_DatabaseStr '数据库各项 Dim MM_FormStr '表单各项 Dim MM_SqlQuery '最终执行语句 Dim MM_ReturnPath '执行成功后返回的路径 MM_TableName = "cps" MM_DatabaseStr = "fbeizhu|value|febeizhu|value|fnumber|value|ftitle|value|fetitle|value|ftext|value|fetext|value|fimage|value|fcount|value|fadmin|value|fstyle|value|fshow|value|fdate|value" MM_FormStr = "sqlbeizhu|',none,''|sqlebeizhu|',none,''|sqlnumber|',none,''|sqltitle|',none,''|sqletitle|',none,''|sqltext|',none,''|sqletext|',none,''|sqlimage|',none,''|sqlcount|',none,''|sqladmin|',none,''|sqlstyle|',none,''|sqlshow|',none,''|sqldate|',none,''" MM_ReturnPath = "cps.asp?page=1&smallstyle=" & smallstyle if Request.Form("MM_insert") <> "" then MM_SqlQuery = GetAddSql(MM_TableName,MM_DatabaseStr,MM_FormStr) conn.Execute(MM_SqlQuery) response.redirect(MM_ReturnPath) end if %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>添加产品</title> <link href="style.css" rel="stylesheet" type="text/css"> <script language="javascript"> function check() { if(myform.fnumber.value == "") { alert("排列次序不能为空!") myform.fnumber.focus() return(false) } if(isNaN(myform.fnumber.value)) { alert("排列次序应是一个有效的数字!"); myform.fnumber.focus(); return(false); } if(myform.fstyle.value == "") { alert("类别不能为空!") myform.fstyle.focus() return(false) } if(myform.fetitle.value == "") { alert("中文标题不能为空!") myform.fetitle.focus() return(false) } if(myform.fetitle.value == "") { alert("英文标题不能为空!") myform.fetitle.focus() return(false) } if(myform.fimage.value == "") { alert("缩略图不能为空!") myform.fimage.focus() return(false) } if(myform.fdate.value == "") { alert("请正确填写发布日期!") myform.fdate.focus() return(false) } } </script> </head> <body topmargin="0" bgcolor="#799AE1"> <table width="100%" height="100%" border="0" align="center" bgcolor="#668ED4"> <tr> <td height="103" colspan="2" align="center"> <img src="images/toplogo.gif" height="60"> </td> </tr> <tr> <td colspan="2"> <table width="100%" border="0" cellspacing="0" cellpadding="0" background="images/menu_bk.gif"> <tr> <td height="23" valign="bottom" background="images/menu_bk.gif"><font color="#FFFFFF">产品发布->添加产品</font></td> <td valign="bottom" background="images/menu_bk.gif"><a href="<%=MM_ReturnPath%>">返回</a></td> </tr> </table> </td> </tr> <tr> <td colspan="2"> <form ACTION="#" METHOD="POST" name="myform" id="myform" onsubmit="javascript:return check()"> <table width="100%" height="100%" align="center" cellpadding="1" cellspacing="1" bordercolor="#ADADC9" bgcolor="#666699"> <tr bgcolor="#799AE1"> <td colspan="4">次序:</td> <td><input name="fnumber" type="text" id="fnumber" value="0" size="50"> </td> <td> 这个数值越小,显示越前</td> </tr> <tr bgcolor="#799AE1"> <td colspan="4">类别:</td> <td> <% mysqlstr = "select * from cpsmallstyle where sqlindex=" & smallstyle set myred = conn.execute(mysqlstr) if (not myred.eof) then response.Write(myred.Fields.Item("sqlstyle")) end if %> <input name="fstyle" type="hidden" id="fstyle" value="<%=myred.Fields.Item("sqlindex")%>"> </td> <td>已选定的产品类别</td> </tr> <tr bgcolor="#799AE1"> <td colspan="4">中文标题:</td> <td><input name="ftitle" type="text" id="ftitle2" size="50"> <script language="javascript"> myform.ftitle.focus(); </script> </td> <td> </td> </tr> <tr bgcolor="#799AE1"> <td colspan="4">英文标题:</td> <td><input name="fetitle" type="text" id="fetitle" size="50"></td> <td> </td> </tr> <tr bgcolor="#799AE1"> <td colspan="4">图片:</td> <td><input name="fimage" type="text" id="fimage" size="40"> <input type="button" name="Submit22" value="上传图片" onClick="window.open('upload_image.asp?formname=myform&editname=fimage&uppath=userimages&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')"> </td> <td>(.jpg|.gif格式)</td> </tr> <tr bgcolor="#799AE1"> <td colspan="4">中文简介:</td> <td colspan="2"> <div align="left"> <textarea name="fbeizhu" style="display:none"></textarea> <iframe id="eWebEditor1" src="editor/ewebeditor.asp?id=fbeizhu&style=s_popup" frameborder="0" scrolling="no" width="580" height="400"></iframe> </div> </td> </tr> <tr bgcolor="#799AE1"> <td colspan="4">英文简介:</td> <td colspan="2"> <div align="left"> <textarea name="febeizhu" style="display:none"></textarea> <iframe id="eWebEditor1" src="editor/ewebeditor.asp?id=febeizhu&style=s_popup" frameborder="0" scrolling="no" width="580" height="400"></iframe> </div> </td> </tr> <tr bgcolor="#799AE1"> <td colspan="4">中文内容:</td> <td colspan="2"> <div align="left"> <textarea name="ftext" style="display:none"></textarea> <iframe id="eWebEditor1" src="editor/ewebeditor.asp?id=ftext&style=s_popup" frameborder="0" scrolling="no" width="580" height="400"></iframe> </div></td> </tr> <tr bgcolor="#799AE1"> <td colspan="4">英文内容:</td> <td colspan="2"> <div align="left"> <textarea name="fetext" style="display:none"></textarea> <iframe id="eWebEditor1" src="editor/ewebeditor.asp?id=fetext&style=s_popup" frameborder="0" scrolling="no" width="580" height="400"></iframe> </div></td> </tr> <tr bgcolor="#799AE1"> <td colspan="4">日期:</td> <td width="50%"><input name="fdate" type="text" id="fdate2" size="20" value="<%=now()%>"></td> <td width="42%">格式如:2005-01-01</td> </tr> <tr bgcolor="#799AE1"> <td colspan="4">显示/隐藏:</td> <script language="javascript"> function checkshow() { if (myform.fshow.value != 0) { myform.fshow.value = 0; } else { myform.fshow.value = 1; } } </script> <td><input name="fclick" type="checkbox" id="fshow2" value="checkbox" checked onclick="javascript:checkshow();"></td> <td>确定是否在前台网页显示</td> </tr> <tr bgcolor="#799AE1"> <td colspan="4"><input type="hidden" name="MM_insert" value="myform"> <input name="fshow" type="hidden" id="fshow" value="1"></td> <td colspan="2"><input name="fcount" type="hidden" id="fcount" value="0"> <input name="fadmin" type="hidden" id="fadmin" value="<%=session("lyj_admin")%>"></td> </tr> <tr bgcolor="#648BDD"> <td colspan="4"> </td> <td colspan="2"> <input type="submit" name="Submit2" value=" 添 加 "> <input type="reset" name="Submit3" value=" 清 除 "></td> </tr> </table> </form> </td> </tr> <tr> <td colspan="2"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><div align="left">说明:请输入正确的内容以便顺利地添加记录!</div></td> </tr> </table> </td> </tr> </table> </body> </html> <% else response.redirect("cpbigstyle.asp") end if %>