www.gusucode.com > 学校共青团组织网站源代码 > 学校共青团组织网站源代码/626/admin/admin_ztAdd.asp
<% if Request.Cookies("admindj")<>"1" then Response.Write "<BR><BR><BR><BR><center>权限不足,你没有此功能的管理权限" Response.end end if %> <!--#include file = admin_chk.asp --> <!--#include file = admin_conn.asp --> <!--#include file = language.asp --> <html> <head> <meta http-equiv="Content-Language" content="zh-cn"> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <STYLE type="text/css"> <!-- a:link {text-decoration: none; font-family: AdobeSm; color: #000000 } a:visited {text-decoration: none; color: #000000 } A:hover {COLOR: green; FONT-FAMILY: "宋体,MingLiU"; TEXT-DECORATION: underline} body {font-size: 9pt; font-family: 宋体,MingLiU, Arial;color: #000000} TD {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000;table-layout:fixed;word-break:break-all} p {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000} input {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000} body {margin-top: 0; margin-bottom: 0;margin-left:0;margin-right:0; color: #000000} select {FONT-SIZE: 9PT;font-family: 宋体} option {FONT-SIZE: 9pt;font-family: 宋体} textarea {FONT-SIZE: 9pt;font-family: 宋体} --> </STYLE> <script language="JavaScript"> <!-- //显示图层 function show_icon_cho(i) { var xx=document.FrontPage_Form1.select_icon.options[document.FrontPage_Form1.select_icon.selectedIndex].value; // if(xx.indexOf("images")!=1) if(xx.length>5) { i.style.display = "" document.show_icon.src=xx; document.FrontPage_Form1.icon.value="<img src="+xx+" border=0>"; } else { i.style.display = "none"; document.FrontPage_Form1.icon.value=xx; } } // --> </script> </head> <% editid=trim(Request("editid")) saveid=trim(Request("saveid")) title=trim(Request("title")) mb=trim(Request("mb")) icon=trim(Request("icon")) if editid="" and saveid="" and title<>"" and mb<>"" then set rs = Server.CreateObject("ADODB.RecordSet") rs.Open "select top 1 * from [Newszt] order by id desc",conn,1,3 rs.addnew rs("title")=title rs("mb")=mb rs("icon")=icon rs.update rs.close:set rs=nothing Response.Write "<script>alert('新增专题成功');</script> <META http-equiv='refresh' content='0;url=admin_zt.asp'>" elseif editid<>"" and saveid="" and title="" and mb="" then set rs = Server.CreateObject("ADODB.RecordSet") rs.Open "select * from [NewsZT] where ID="&editid&" order by id desc",conn,1,1 if rs.recordcount<>0 then etitle=rs("title") emb=rs("mb") eIcon=rs("icon") end if rs.close:set rs=nothing elseif editid="" and saveid<>"" and title<>"" and mb<>"" then set rs = Server.CreateObject("ADODB.RecordSet") rs.Open "select * from [NewsZT] where ID="&saveid&" order by id desc",conn,1,3 if rs.recordcount<>0 then rs("title")=title rs("mb")=mb rs("icon")=icon rs.update end if rs.close:set rs=nothing Response.Write "<script>alert('修改专题成功');</script> <META http-equiv='refresh' content='0;url=admin_zt.asp'>" end if %><body> <br> <!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="JavaScript" Type="text/javascript"><!-- function FrontPage_Form1_Validator(theForm) { if (theForm.title.value == "") { alert("请在 专题名称 域中输入值。"); theForm.title.focus(); return (false); } if (theForm.title.value.length < 1) { alert("在 专题名称 域中,请至少输入 1 个字符。"); theForm.title.focus(); return (false); } if (theForm.title.value.length > 200) { alert("在 专题名称 域中,请最多输入 200 个字符。"); theForm.title.focus(); return (false); } if (theForm.mb.value == "") { alert("请在 专题模版 域中输入值。"); theForm.mb.focus(); return (false); } if (theForm.mb.value.length < 1) { alert("在 专题模版 域中,请至少输入 1 个字符。"); theForm.mb.focus(); return (false); } return (true); } //--></script><!--webbot BOT="GeneratedScript" endspan --><form method="POST" action="?saveid=<%=editid%>" name="FrontPage_Form1" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript"> <div align="center"> <table border="0" cellpadding="3" cellspacing="0" width="800" id="table1"> <tr> <td width="80" align="center">专题名称</td> <td width="708"> <!--webbot bot="Validation" s-display-name="专题名称" b-value-required="TRUE" i-minimum-length="1" i-maximum-length="200" --><input type="text" name="title" size="60" value="<%=eTitle%>" maxlength="200"></td> </tr> <tr> <td width="80" align="center">专题模版<br> <br> <font color="#808080">可以使用<br> HTML代码<br> <br> $$列表$$<br> $$专题名$$<br> $$ZTID$$</font></td> <td width="708"> <!--webbot bot="Validation" s-display-name="专题模版" b-value-required="TRUE" i-minimum-length="1" --><textarea rows="19" name="mb" cols="110"><%=emb%></textarea></td> </tr> <tr> <td width="118" height="25" style="font-size: 9pt; color: #000000; table-layout: fixed; word-break: break-all"> <p align="center">标题图标</td> <td height="25" style="font-size: 9pt; color: #000000; table-layout: fixed; word-break: break-all"> <!-- 小图标 --> <select size="1" name="select_icon" id="select_icon" onchange="show_icon_cho(pic_div)"> <option value="" <%if icon="" then response.write "selected"%>> (无图标)</option> <option value="·" <%if icon="·" then response.write "selected"%>>· </option> <option value="★" <%if icon="★" then response.write "selected"%>> ★</option> <option value="☆" <%if icon="☆" then response.write "selected"%>>☆</option> <option value="○" <%if icon="○" then response.write "selected"%>>○</option> <option value="●" <%if icon="●" then response.write "selected"%>>●</option> <option value="◎" <%if icon="◎" then response.write "selected"%>>◎</option> <option value="◇" <%if icon="◇" then response.write "selected"%>>◇</option> <option value="◆" <%if icon="◆" then response.write "selected"%>>◆</option> <option value="□" <%if icon="□" then response.write "selected"%>>□</option> <option value="■" <%if icon="■" then response.write "selected"%>>■</option> <option value="△" <%if icon="△" then response.write "selected"%>>△</option> <option value="▲" <%if icon="▲" then response.write "selected"%>>▲</option> <% '取出目录中的图标 icon_path=Server.MapPath("../images/icon") 'on error resume next set fso=server.CreateObject("scripting.filesystemobject") set objFolder=fso.GetFolder(icon_path) set objFiles=objFolder.Files for each objFile in objFiles if right(objFile.name,3)="gif" or right(objFile.name,3)="jpg" or right(objFile.name,3)="bmp" then response.write "<option value=../images/icon/"&trim(objFile.name)&" " if eicon="<img src=../images/icon/"&trim(objFile.name)&" border=0>" then response.write " selected " response.write ">"&trim(objFile.name)&"</option>"&vbcrlf end if next set objFolder=nothing set fso=nothing '结束取出目录中的图标 %> </select><span id="pic_div" style="DISPLAY:none"> <img name="show_icon" src="" border="0"> (小图标存放在目录:../images/icon/)</span><br> <!-- 图形图标 --> <input type="text" name="icon" size="40" value="<%=Server.HtmLEncode(icon)%>"> 原图标:<%=icon%> 支持HTML语句。显示在更多新闻时的标题前面。 </td> </tr> </table> </div> <p align="center"><input type="submit" value="提交" name="B1"> <input type="reset" value="重置" name="B2"></p> </form> </body> </html> <% conn.close set conn=nothing %>