?? admin_down.asp
字號:
<!--#include file="Include/xbqq_Setup.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="Include/check.asp"-->
<%CheckAdmin3%>
<%
function cutstr(str,strlen,more,url)
if len(str)>strlen then
str=left(str,strlen) & "......"
end if
if (len(str)>strlen) and more then
str=str+" [url="+url+"]點這里查看詳情[/url]"
end if
cutstr=str
end function
function AutoUrl(str)
on error resume next
Set url=new RegExp
url.IgnoreCase =True
url.Global=True
url.MultiLine = True
url.Pattern = "^(http://[A-Za-z0-9\./=\?%\-&_~`@:+!]+)"
str = url.Replace(str,"[url=$1]$1[/url]")
url.Pattern = "(http://[A-Za-z0-9\./=\?%\-&_~`@:+!]+)$"
str = url.Replace(str,"[url=$1]$1[/url]")
url.Pattern = "^(www.[A-Za-z0-9\./=\?%\-&_~`@:+!]+)"
str = url.Replace(str,"[url=http://$1]$1[/url]")
url.Pattern = "(www.[A-Za-z0-9\./=\?%\-&_~`@:+!]+)$"
str = url.Replace(str,"[url=http://$1]$1[/url]")
set url=Nothing
AutoUrl=str
end function
Rem 判斷數字是否整形
function isInteger(para)
on error resume next
dim str
dim l,i
if isNUll(para) then
isInteger=false
exit function
end if
str=cstr(para)
if trim(str)="" then
isInteger=false
exit function
end if
l=len(str)
for i=1 to l
if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
isInteger=false
exit function
end if
next
isInteger=true
if err.number<>0 then err.clear
end function
Function FormatStr(String)
on Error resume next
String = Replace(String, CHR(13), "")
String = Replace(String, CHR(32), " ")
String = Replace(String, "", " ")
String = Replace(String, "<", "<")
String = Replace(String, ">", ">")
String = Replace(String, CHR(10) & CHR(10), "<BR><BR>")
String = Replace(String, CHR(10), "<BR>")
FormatStr = String
End Function
Function Ubb2Html(str, showemot, showimg)
ON ERROR RESUME NEXT
if not str<>"" then exit function
tmpstr="uNobwab"
str=UbbStr(str,"url")
str=UbbStr(str,"quote")
str=UbbStr(str,"color")
str=UbbStr(str,"size")
str=UbbStr(str,"face")
if showemot then
for i=1 to 16
str=replace(str,":em"&i&":","<img src='emot/em"&i&".gif'>",1,6,1)
str=replace(str,":em"&i&":","",1,-1,1)
next
end if
if showimg then
str=UbbStr(str,"img")
str=UbbStr(str,"swf")
str=UbbStr(str,"dir")
str=UbbStr(str,"rm")
str=UbbStr(str,"mp")
str=UbbStr(str,"qt")
end if
str=UbbStr(str,"frame")
str=replace(str,"[b]","<b>",1,-1,1)
str=replace(str,"[/b]","</b>",1,-1,1)
str=replace(str,"[u]","<u>",1,-1,1)
str=replace(str,"[/u]","</u>",1,-1,1)
str=replace(str,"[br]","<br>",1,-1,1)
str=replace(str,"[center]","<center>",1,-1,1)
str=replace(str,"[/center]","</center>",1,-1,1)
str=replace(str,"[fly]","<marquee>",1,-1,1)
str=replace(str,"[/fly]","</marquee>",1,-1,1)
str=replace(str,"["&tmpstr,"[",1,-1,1)
str=replace(str,tmpstr&"]","]",1,-1,1)
str=replace(str,"/"&tmpstr,"/",1,-1,1)
Ubb2Html=str
End Function
%>
<%
if request.form("MM_insert") then
if request.form("action")="newcat" then
sql="select * from d_cat"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
dim cat_name
cat_name=trim(replace(request.form("cat_name"),"'",""))
if cat_name="" then
founderr=true
Response.Write("<script language=javascript>alert('你必須填寫分類名稱!');history.back(1);</script>")
else
rs("cat_name")=cat_name
end if
if founderr then
call diserror()
response.end
else
rs.update
rs.close
set rs=nothing
response.redirect "admin_down.asp"
end if
elseif request.form("action")="newclass" then
sql="select * from d_class"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
dim class_name,cat_id
cat_id=cint(request.form("cat_id"))
class_name=trim(replace(request.form("class_name"),"'",""))
if cat_id<1 then
founderr=true
Response.Write("<script language=javascript>alert('你必須選擇所屬分類名稱!');history.back(1);</script>")
else
rs("cat_id")=cat_id
end if
if class_name="" then
founderr=true
Response.Write("<script language=javascript>alert('你必須填寫子分類名稱!');history.back(1);</script>")
else
rs("class_name")=class_name
end if
if founderr then
call diserror()
response.end
else
rs.update
rs.close
set rs=nothing
response.redirect "admin_down.asp"
end if
elseif request.form("action")="editcat" then
if cint(request.form("id"))<1 then
founderr=true
Response.Write("<script language=javascript>alert('非法的分類參數!');history.back(1);</script>")
response.end
end if
sql="select * from d_cat where cat_id="&request.form("id")
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
cat_name=trim(replace(request.form("cat_name"),"'",""))
if cat_name="" then
founderr=true
Response.Write("<script language=javascript>alert('你必須填寫分類名稱!');history.back(1);</script>")
else
rs("cat_name")=cat_name
end if
if founderr then
call diserror()
response.end
else
rs.update
rs.close
set rs=nothing
response.redirect "admin_down.asp"
end if
elseif request.form("action")="editclass" then
if cint(request.form("id"))<1 then
founderr=true
Response.Write("<script language=javascript>alert('非法的分類參數!');history.back(1);</script>")
response.end
end if
sql="select * from d_class where class_id="&request.form("id")
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
cat_id=cint(request.form("cat_id"))
class_name=trim(replace(request.form("class_name"),"'",""))
if cat_id<1 then
founderr=true
Response.Write("<script language=javascript>alert('你必須選擇所屬分類名稱!');history.back(1);</script>")
else
rs("cat_id")=cat_id
end if
if class_name="" then
founderr=true
Response.Write("<script language=javascript>alert('你必須填寫子分類名稱!');history.back(1);</script>")
else
rs("class_name")=class_name
end if
if founderr then
call diserror()
response.end
else
rs.update
rs.close
set rs=nothing
response.redirect "admin_down.asp"
end if
elseif request.form("action")="delcat" then
if cint(request.form("id"))<1 then
founderr=true
Response.Write("<script language=javascript>alert('非法的分類參數!');history.back(1);</script>")
response.end
end if
sql="select * from d_cat where cat_id="&request.form("id")
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.delete
rs.close
set rs=nothing
response.redirect "admin_down.asp"
elseif request.form("action")="delclass" then
if cint(request.form("id"))<1 then
founderr=true
Response.Write("<script language=javascript>alert('非法的分類參數!');history.back(1);</script>")
response.end
end if
sql="select * from d_class where class_id="&request.form("id")
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.delete
rs.close
set rs=nothing
response.redirect "admin_down.asp"
end if
end if
sql="select * from d_cat"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<HTML><HEAD><TITLE>西商系統 -- 下載管理</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<link href="other/Admin.css" rel="stylesheet" type="text/css">
</HEAD>
<p align="center"><a href="admin_down.asp?action=newsoft">添加下載</a> | <a href="admin_down.asp?action=list">修改下載</a> | <a href="admin_down.asp">下載管理</a> | <a href="admin_down.asp?action=newcat">添加分類</a></p>
<body onkeydown=return(!(event.keyCode==78&&event.ctrlKey)) >
<%if request.querystring("action")="" then%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" style="border-collapse: collapse">
<tr>
<td colspan="2">下載分類管理</font></td>
</tr>
<%do while not rs.eof%><tr><td width="70%"><%=rs("cat_name")%> [<a href="admin_down.asp?action=newclass">新建子分類</a>]</td><td width="30%">[<a href="admin_down.asp?action=editcat&id=<%=rs("cat_id")%>&name=<%=rs("cat_name")%>">修改</a>] [<a href="admin_down.asp?action=delcat&id=<%=rs("cat_id")%>&name=<%=rs("cat_name")%>">刪除</a>]</td></tr>
<%sql="select * from d_class where cat_id="&rs("cat_id")
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof%>
<tr><td width="70%"> <%=rs2("class_name")%></td><td width="30%">[<a href="admin_down.asp?action=editclass&id=<%=rs2("class_id")%>&cid=<%=rs("cat_id")%>&name=<%=rs2("class_name")%>">修改</a>] [<a href="admin_down.asp?action=delclass&id=<%=rs2("class_id")%>&cid=<%=rs("cat_id")%>&name=<%=rs2("class_name")%>">刪除</a>]</td></tr>
<%
rs2.movenext
loop
response.write "<tr><td>"
if rs2.bof and rs2.eof then
response.write " 當前沒有子分類!"
end if
rs2.close
set rs2=nothing
rs.movenext
loop
if rs.bof and rs.eof then
response.write "<tr><td>當前沒有分類!"
end if
%>
</td></tr></table>
<%
end if
if request.querystring("action")="newcat" then%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" style="border-collapse: collapse">
<form name="form1" method="post" action="admin_down.asp">
<tr>
<td>新建分類</td>
</tr>
<tr>
<td>分類名稱-
<input type="text" name="cat_name" size="40" class="textarea">
</td>
</tr>
<tr>
<td align="center">
<input type="submit" name="Submit" value="確定新增" class="button">
<input type="reset" name="Reset" value="取消重填" class="button">
<input type="button" value="返回" onClick="location.href='admin_down.asp'" class="button"></td>
</tr>
<input type="hidden" name="action" value="newcat">
<input type="hidden" name="MM_insert" value="true">
</form>
</table>
<%end if
if request.querystring("action")="newclass" then%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" style="border-collapse: collapse">
<form name="form2" method="post" action="admin_down.asp">
<tr>
<td>新建子分類</td>
</tr>
<tr>
<td>子分類名稱-
<input type="text" name="class_name" size="50" class="textarea">
<br>
所屬分類-
<select name="cat_id">
<%sql="select * from d_cat"
set rs=conn.execute(sql)
do while not rs.eof
%><option value="<%=rs("cat_id")%>"><%=rs("cat_name")%></option>
<%rs.movenext
loop
if rs.eof and rs.bof then%><option value="0">暫無分類</option>
<%end if%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -