📄 admin_classsave.asp
字号:
<!--#include file = include.asp-->
<!--#include file = admin_CheckMana.asp-->
<%
'=========================================================
'产品目录:风讯产品N系列
'软件名称:风讯站点管理系统
'当前版本:2004.I.0225
'最新更新:2004.2.10
'=========================================================
'Copyright (C) 2002-2004 cooin.com. All rights reserved.
'网站: http://www.cooin.com Foosun.net
'程序制作:轻风云(QQ:655071)
'Email:skeen@cooin.com,skeen@Foosun.net
'论坛支持:风讯在线论坛(http://BBS.COOIN.COM)
'=========================================================
if EnoughPopedom("class")=1 then
Response.write"<script>alert(""[操作失败]\n\n你的权限不足!\n\n请与系统管理员联系获得足够的权限!"");location.href=""javascript:history.back()"";</script>"
Response.end
end if
%>
<%
Copyright="\n\n Copyrights Cooin Computer System studios"
Sub ModifyBig()
session("errormsg")=""
classcn=replace(request.form("classcn"),"'","''")
classen=replace(request.form("classen"),"'","''")
Sclassen=replace(request.form("Sclassen"),"'","''")
Sclasscn=replace(request.form("Sclasscn"),"'","''")
oldClassCN=replace(request.form("oldClassCN"),"'","''")
Ttitle=replace(request.form("Ttitle"),"'","''")
Datesize=replace(request.form("datesize"),"'","''")
Tdate=request.form("Tdate")
GDate=request.form("GDate")
DhangPic=replace(request.form("DhangPic"),"'","''")
OutURL=replace(request.form("OutURL"),"'","''")
Datecolor=replace(request.form("datecolor"),"#","")
iiNews=replace(request.form("iiNews"),"'","''")
ID=request.form("ID")
if Ttitle="" then
response.Write("<script>alert(""新闻标题数必须填写! "&Copyright&" "");location.href=""javascript:history.back()"";</script>")
response.End
end if
if classcn = "" or classen = "" then
Response.write"<script>alert(""栏目的中文名与英文必须填写! "&Copyright&" "");location.href=""admin_ClassManage.asp"";</script>"
Response.end
end if
if Sclasscn<>classcn then
set rs = server.createobject("adodb.recordset")
rs.source = "select * from newsclass where classcn = '"&classcn&"' "
rs.open rs.source,conn,1,1
if not rs.eof then
Response.write"<script>alert(""栏目的中文名称已经存在! "&Copyright&" "");location.href=""admin_ClassManage.asp"";</script>"
Response.end
end if
rs.close
end if
if Sclassen<>classen then
set rso = server.createobject("adodb.recordset")
rso = "select * from newsclass where classen = '"&classen&"' "
rso.open rso,conn,1,1
if not rso.eof then
Response.write"<script>alert(""栏目的英文名称已经存在! "&Copyright&" "");location.href=""admin_ClassManage.asp"";</script>"
Response.end
end if
rso.close
end if
session("errormsg")=errormsg
if errormsg="" then
conn.execute("update Review set classcn='"&classcn&"' where classcn='"&Sclasscn&"'")
conn.execute("update newsClass set iNews="&request.form("iNews")&" where ID="&ID)
conn.execute("update newsClass set iiNews="&request.form("iiNews")&" where ID="&ID)
conn.execute("update news set classcn='"&classcn&"' where classcn='"&Sclasscn&"'")
conn.execute("update newsClass set classcn='"&classcn&"' where ID="&ID)
conn.execute("update newsClass set Ttitle='"&Ttitle&"' where ID="&ID)
conn.execute("update newsClass set GDate='"&GDate&"' where ID="&ID)
conn.execute("update newsClass set NewsBg='"&request.form("NewsBg")&"' where ID="&ID)
conn.execute("update newsClass set NewsBg1='"&request.form("NewsBg1")&"' where ID="&ID)
conn.execute("update newsClass set TitlePic='"&request.form("TitlePic")&"' where ID="&ID)
conn.execute("update newsClass set DirPic='"&request.form("DirPic")&"' where ID="&ID)
conn.execute("update newsClass set Tdate='"&Tdate&"' where ID="&ID)
conn.execute("update newsClass set datesize='"&datesize&"' where ID="&ID)
conn.execute("update newsClass set Dshow="&request.form("Dshow")&" where ID="&ID)
conn.execute("update newsClass set ClassNum="&request.form("ClassNum")&" where ID="&ID)
conn.execute("update newsClass set DhangPic='"&DhangPic&"' where ID="&ID)
conn.execute("update newsClass set TopNum="&request.form("TopNum")&" where ID="&ID)
conn.execute("update newsClass set TopwordsNum="&request.form("TopwordsNum")&" where ID="&ID)
conn.execute("update newsClass set PicNumsite="&request.form("PicNumsite")&" where ID="&ID)
conn.execute("update newsClass set OutURL='"&OutURL&"' where ID="&ID)
conn.execute("update newsClass set datecolor='"&datecolor&"' where ID="&ID)
Response.Redirect("admin_ClassManage.asp")
Response.end
end if
End Sub
Sub DelBig()
session("result")=""
classen=replace(request.form("classen"),"'","''")
Set MyFile=Server.CreateObject("Scripting.FileSystemObject")
if classen="" then
Response.write"<script>alert(""请选择栏目类别 "&Copyright&" "");location.href=""javascript:history.back()"";</script>"
Response.end
end if
set rs=Server.CreateObject("adodb.recordset")
rs.source="select * from newsClass where classen='"&classen&"'"
rs.open rs.source,conn,1,1
if not (rs.eof and rs.bof) then
if rs("child")>0 then
rs.close
set rs=nothing
response.write"<script>alert(""该栏目含有下属栏目,请删除其下属栏目后再进行删除本栏目的操作 "&Copyright&" "");location.href=""javascript:history.back()"";</script>"
Response.end
end if
'如果有上级栏目,则更新数据
if MyFile.FileExists(Server.MapPath("..")&"\Class\"&Classen&"\index.htm") then
MyFile.Deletefolder(Server.MapPath("..")&"\Class\"&Classen&"")
end if
if MyFile.FileExists(Server.MapPath("..")&"\ClassJS\"&Classen&"01.js") then
MyFile.DeleteFile(Server.MapPath("..")&"\ClassJS\"&Classen&"0*.js")
end if
set rs5=Server.CreateObject("adodb.recordset")
rs5.source="select * from news where classen='"&classen&"'"
rs5.open rs5.source,conn,1,1
while not rs5.eof
if MyFile.FileExists(Server.MapPath("..")&"\"&rs5("lpath")&"\"&rs5("FileName")&".html") then
MyFile.Deletefile(Server.MapPath("..")&"\"&rs5("lpath")&"\"&rs5("FileName")&".html")
end if
if MyFile.FileExists(Server.MapPath("..")&"\"&rs5("lpath")&"\"&rs5("FileName")&".asp") then
MyFile.Deletefile(Server.MapPath("..")&"\"&rs5("lpath")&"\"&rs5("FileName")&".asp")
end if
rs5.movenext
wend
if rs("depth")>0 then
conn.execute("update newsclass set child=child-1 where id in ("&rs("parentstr")&")")
end if
conn.execute("Delete from newsClass where classen='"&Classen&"'")
conn.execute("Delete from News where classen='"&Classen&"'")
conn.execute("Delete from Review where classen='"&Classen&"'")
conn.execute("Delete from JSFile where classen='"&Classen&"'")
end if
set MyFile=nothing
rs.close
set rs=nothing
Response.Redirect("admin_ClassManage.asp")
Response.end
End Sub
Sub ModifySmall()
session("errormsg")=""
session("result")=""
DhangPic=replace(request.form("DhangPic"),"'","''")
ID=request.form("ID")
if errormsg="" then
conn.execute("Update newsClass Set MNCount="&request.form("MNCount")&" where ID="&ID)
conn.execute("Update newsClass Set IndexJSCount="&request.form("IndexJSCount")&" where ID="&ID)
conn.execute("Update NewsClass Set DhangPic='"&DhangPic&"' where ID="&ID)
conn.execute("Update newsClass Set Dshow="&request.form("Dshow")&" where ID="&ID)
conn.execute("Update newsClass Set HtmlJSCount="&request.form("HtmlJSCount")&" where ID="&ID)
conn.execute("Update newsClass Set MNTitle='"&replace(request.form("MNTitle"),"'","''")&"' where ID="&ID)
conn.execute("Update newsClass Set OrderRule='"&request.form("OrderRule")&"' where ID="&ID)
conn.execute("Update newsClass Set TitlePic='"&replace(request.form("TitlePic"),"'"," ")&"' where ID="&ID)
conn.execute("Update newsClass Set MorePic='"&replace(request.form("MorePic"),"'"," ")&"' where ID="&ID)
conn.execute("Update newsClass Set ReviewCSS='"&replace(request.form("ReviewCSS"),"'"," ")&"' where ID="&ID)
conn.execute("Update newsClass Set DateColor='"&request.form("DateColor")&"' where ID="&ID)
conn.execute("Update newsClass Set DateSize='"&request.form("DateSize")&"' where ID="&ID)
conn.execute("Update newsClass Set TopNum='"&request.form("TopNum")&"' where ID="&ID)
conn.execute("Update newsClass Set PicNumsite='"&request.form("PicNumsite")&"' where ID="&ID)
conn.execute("Update newsClass Set NewsBg='"&request.form("NewsBg")&"' where ID="&ID)
conn.execute("Update newsClass Set NewsBg1='"&request.form("NewsBg1")&"' where ID="&ID)
conn.execute("Update newsClass Set TopwordsNum='"&request.form("TopwordsNum")&"' where ID="&ID)
conn.execute("Update newsClass Set TitleDate="&request.form("TitleDate")&" where ID="&ID)
conn.execute("Update newsClass Set iNews="&request.form("iNews")&" where ID="&ID)
conn.execute("Update newsClass Set GDate="&request.form("GDate")&" where ID="&ID)
conn.execute("Update newsClass Set DirPic='"&request.form("DirPic")&"' where ID="&ID)
conn.execute("Update newsClass Set CBution="&request.form("CBution")&" where ID="&ID)
TitleNumber=request.form("TitleNumber")
if TitleNumber="" then TitleNumber=20
conn.execute("Update newsClass Set TitleNumber="&TitleNumber&" where ID="&ID)
Response.Redirect("admin_ClassManage.asp")
Response.end
end if
End Sub
Sub Wran()
response.write result
%>
<p> </p>
<p> </p>
<p> </p>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<body onLoad="MM_preloadImages('pic/err_close2.gif')">
<form method=post action=admin_ClassManage.asp>
<TABLE class=body cellSpacing=0 cellPadding=0 width=400 align=center background=pic/err_bg1.gif border=0>
<TBODY>
<TR>
<TD width=10 height=23><IMG height=23 src="pic/err1.gif" width=24 border=0></TD>
<TD width=348 height=23> <b>
<%
if session("errormsg")<>"" then
response.write("操作错误")
else
response.write session("result")
end if
%>
</b></TD>
<TD vAlign=baseline width=37 height=23 align=right><A onmouseover="MM_swapImage('close','','pic/err_close2.gif',1)" onmouseout=MM_swapImgRestore() href="javascript:window.close()"><IMG height=18 src="pic/err_close2.gif" width=15 border=0 name=close></A></TD>
<TD width=5 height=23><IMG height=23 src="pic/err2.gif" width=5 border=0 name=errr1_c4></TD>
</TR>
</TBODY>
</TABLE>
<TABLE class=body cellSpacing=0 cellPadding=0 width=400 align=center border=0>
<TBODY>
<TR vAlign=bottom>
<TD background=pic/err_bg.gif height=120> <BLOCKQUOTE>
<DIV id=base> <br>
<font color=red><%=session("errormsg")%></font>
<% if session("errormsg")<>"" then %>
<br>
<br>
<br>
<input name="button2" type="button" onclick="javascript:history.back()" value=" 返 回 ">
<% else %>
<br>
按确定键返回"模板管理"<br>
<br>
<br>
<br>
<A onmouseover="MM_swapImage('back','','pic/err_but2.gif',1)" onmouseout=MM_swapImgRestore() href="javascript:history.go(-1)">
<input name="imageField" type="image" src="pic/err_but2.gif" width="73" height="20" border="0">
</A>
<% end if %>
</DIV>
</BLOCKQUOTE>
<P align=center><A onmouseover="MM_swapImage('back','','pic/err_but2.gif',1)" onmouseout=MM_swapImgRestore() href="javascript:history.go(-1)">
</A> </TD>
</TR>
<TR>
<TD height=2><IMG height=5 src="pic/err_bot.gif" width=400></TD>
</TR>
</TBODY>
</TABLE>
</form>
</body>
<% End Sub %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -