admin_add_class.asp
资源名称:wap.rar [点击查看]
上传用户:sking1122
上传日期:2020-09-24
资源大小:1005k
文件大小:11k
源码类别:
手机WAP编程
开发平台:
ASP/ASPX
- <!--#include file=admin_sb.asp--><%
- '====================================================================
- ' 请你保留这段说明,这并不会影响你的速度. 电脑交流:http://www.cnscu.cn
- ' 程序制作:横云 掌上校园收倾心整理收集于互联网,感谢你的支持!
- ' 升级时间: 2008-2-5 主页地址:HTTP://wap.cnscu.cn
- ' E-Mail: cnscu@126.com 客服QQ:554904632 QQ群:30493504 QQ群2:46659883
- '====================================================================
- %> <%
- IF Request.QueryString("Action")="add" Then
- call BBSSET
- elseIF Request.QueryString("Action")="edit" Then
- call edit
- elseIF Request.QueryString("Action")="del" Then
- call del
- else
- call main
- end if
- Function BBSSET
- %>
- <form name="pollform3sdx" method="post" action="admin_add_class.asp?Action=add">
- <p style="margin-left:15px;">
- <b>添加文件栏目</b></p>
- <input type="hidden" name="SubmitFlag" value=yes>
- <table width="100%" border="0" align="center" cellpadding="8" cellspacing="0">
- <tr>
- <td align="center">
- <%
- If Request("SubmitFlag") <> "" Then
- Addbbsboards
- Exit Function
- Else
- DisplayBBSSet
- End If
- %>
- </td></tr>
- <tr>
- <td align="center">
- <input type=submit name=提交 value=提 交 class=fmbtn>
- <input type=reset name=取消 value=清 除 class=fmbtn>
- </td>
- </tr>
- </table>
- </form>
- <%
- End Function
- Function CheckLinkValue
- GetFormValue
- End Function
- Function DisplayBBSSet
- %>
- <table width="100%" border=0 align="center" cellpadding=5 cellspacing=1 bgcolor="#FF0000" class=TBone>
- <tr bgcolor=#f7f7f7 class=TBBG9>
- <td class="tar">栏目名称:</td>
- <td><input name="name" type="text" class=fminpt id="boardName" size="30" maxlength="50">
- <font color=gray>(栏目名称,50字,必填)</font></td>
- </tr>
- <tr bgcolor=#f7f7f7 class=TBBG9>
- <td class="tar">栏目类型:</td>
- <td><select name="classID">
- <option value="1">图像类</option>
- <option value="2">音像类</option>
- <option value="3">软件类</option>
- </select>
- <font color=gray>(栏目类型,选择要新建的栏目类型)</font></td>
- </tr>
- <tr bgcolor=#f7f7f7 class=TBBG9>
- <td class="tar">栏目换行:</td>
- <td><select name="wh">
- <option value="true">栏目后自动换行</option>
- <option value="false">栏目后不换行</option>
- </select>
- <font color=gray>(栏目换行,栏目后是否换行)</font></td>
- </tr>
- </table>
- <%
- End Function
- Function GetFormValue
- dim thing
- for each thing in Request.Form
- Response.Write thing&"="&Request(thing)&"<br>"
- next
- End Function
- Function Addbbsboards
- dim flag,errmsg,id,name,classID,pid,wh
- flag=1
- errmsg="<ul><font color=red>"
- name=TRim(Request.Form("name"))
- wh=TRim(Request.Form("wh"))
- classID=TRim(Request.Form("classID"))
- if wh="" then errmsg=errmsg&"<li>栏目换行不能为空</li>":flag=0
- if name="" then errmsg=errmsg&"<li>栏目名称不能为空</li>":flag=0
- if classID="" then errmsg=errmsg&"<li>栏目类型不能为空</li>":flag=0
- if flag<>0 then
- Dim sql,rs
- set rs=server.CreateObject("adodb.recordset")
- sql="select * from uclass"
- rs.open sql,conn,1,3
- rs.addnew()
- rs("class")=name
- rs("classID")=classID
- rs.update()
- rs.MoveLast
- id=rs("cid")
- Rs.close
- set rs=nothing
- set rs=server.CreateObject("adodb.recordset")
- sql="select * from main order by pid asc"
- rs.open sql,conn,1,3
- if not (rs.bof and rs.eof) then
- rs.MoveLast
- pid=rs("pid")
- else
- pid=0
- end if
- rs.addnew()
- rs("br")=wh
- rs("title")=name
- rs("url")="upfile.asp?id="&id
- rs("pid")=pid+1
- rs("class")="true"
- rs.update()
- Rs.close
- set rs=nothing
- Response.Write("成功添加名为<font color='red'>"&name&"</font>的栏目!")
- Response.Write("<br/><a href='admin_add_class.asp'>返回文件栏目</a>")
- errmsg=errmsg&"</font></ul>"
- else
- Response.Write("由于以下原因,设置没有成功,请<a href='javascript:history.back()'>返回</a>修改:<br>"&errmsg&"<br><button onclick='javascript:history.back()'>返回修改</button>")
- end if
- End Function
- Function main%>
- <form name="pollform3sdx" method="post" action="admin_add_class.asp">
- <p style="margin-left:15px;">
- <b>文件栏目</b><br/>
- <% if session("flag")="1" or session("flag")="2" then%>
- <a href='admin_add_class.asp?Action=add'>添加文件栏目</a>
- <%end if%>
- </p>
- <table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#FF0000" >
- <tr bgcolor="#799ae1">
- <td class="blu">ID</td>
- <td class="blu">文件栏目名称</td>
- <td class="blu">操作</td>
- </tr>
- <%
- dim sql,h,i
- Set Rs = Server.CreateObject("Adodb.Recordset")
- Sql = "SELECT * FROM uclass order by cid desc"
- Rs.Open Sql,conn,1,1
- if not (rs.bof and rs.eof) then
- For i=1 to rs.RecordCount
- If Rs.Eof Then
- exit For
- End If
- %>
- <tr bgcolor="#eeeeee" class=TBBG9>
- <td width="10%"><%=rs("cid")%></td>
- <td width="35%"><a href="admin_class.asp?cid=<%=rs("cid")%>"><%=rs("class")%></a></td>
- <td width="15%"><a href="admin_add_class.asp?Action=edit&cid=<%=rs("cid")%>">修改</a>
- <% if session("flag")="1" or session("flag")="2" then%>
- <a href="admin_add_class.asp?Action=del&cid=<%=rs("cid")%>">删除栏目</a>
- <%end if%>
- </td>
- </tr>
- <%
- Rs.MoveNext
- Next
- %>
- </table>
- </form>
- <%
- else
- %>
- <tr bgcolor="#eeeeee" class=TBBG9>
- <td colspan="4" > <div align="center">
- 暂无栏目,请添加!<br/><a href='admin_add_class.asp?Action=add'>添加栏目</a>
- </div></td>
- </tr>
- <%
- end if
- Rs.close
- set rs=nothing
- %>
- </table>
- <%
- End Function
- Function edit
- dim cid
- cid=TRim(Request("cid"))
- if not isnumeric(cid) then id=""
- if cid<>"" then
- Dim sql,rs
- set rs=server.CreateObject("adodb.recordset")
- sql="select * from uclass where cid="&cid
- Rs.Open Sql,conn,1,1
- if not (rs.bof and rs.eof) then
- %>
- <form name="pollform3sdx" method="post" action="admin_add_class.asp?Action=edit&cid=<%=cid%>">
- <p style="margin-left:15px;">
- <b>修改栏目</b></p>
- <input type="hidden" name="SubmitFlag" value=yes>
- <table width="100%" border="0" align="center" cellpadding="8" cellspacing="0">
- <tr>
- <td align="center">
- <%
- If Request("SubmitFlag") <> "" Then
- dim flag,errmsg,name,classID
- flag=1
- errmsg="<ul><font color=red>"
- name=TRim(Request.Form("name"))
- classID=TRim(Request.Form("classID"))
- if name="" then errmsg=errmsg&"<li>栏目名称不能为空</li>":flag=0
- if classID="" then errmsg=errmsg&"<li>栏目类型不能为空</li>":flag=0
- if flag<>0 then
- set rs=server.CreateObject("adodb.recordset")
- sql="select * from uclass where cid="&cid
- rs.open sql,conn,1,3
- rs("class")=name
- rs("classID")=classID
- rs.update()
- Response.Write("成功修改名为<font color='red'>"&name&"</font>的栏目!")
- Response.Write("<br/><a href='admin_add_class.asp'>返回文件栏目</a>")
- errmsg=errmsg&"</font></ul>"
- else
- Response.Write("由于以下原因,设置没有成功,请<a href='javascript:history.back()'>返回</a>修改:<br>"&errmsg&"<br><button onclick='javascript:history.back()'>返回修改</button>")
- end if
- Else%>
- <table width="100%" border=0 align="center" cellpadding=5 cellspacing=1 bgcolor="#FF0000" class=TBone>
- <tr bgcolor=#f7f7f7 class=TBBG9>
- <td class="tar">栏目名称:</td>
- <td><input name="name" type="text" class=fminpt value="<%=rs("class")%>" id="boardName" size="30" maxlength="50">
- <font color=gray>(栏目名称,50字,必填)</font></td>
- </tr>
- <tr bgcolor=#f7f7f7 class=TBBG9>
- <td class="tar">栏目类型:</td>
- <td><select name="classID" value="<%=rs("classID")%>" >
- <option value="1"
- <%if rs("classID")="1" then%>
- selected
- <%end if%>
- >图像类</option>
- <option value="2"
- <%if rs("classID")="2" then%>
- selected
- <%end if%>
- >音像类</option>
- <option value="3"
- <%if rs("classID")="3" then%>
- selected
- <%end if%>
- >软件类</option>
- </select>
- <font color=gray>(栏目类型,选择要新建的栏目类型)</font></td>
- </tr>
- <tr bgcolor="#eeeeee">
- <td colspan="4" > <div align="center">
- <input type=submit name=保存 value="保 存" class=fmbtn>
- <input type=button name=取消 value=取 消 onclick="javascript:history.go(-1);">
- </td>
- </tr>
- </table>
- <%End If%>
- </form>
- <%
- else%>
- <table width="100%" border=0 align="center" cellpadding=5 cellspacing=1 bgcolor=#cccccc class=TBone>
- <tr bgcolor=#f7f7f7 class=TBBG9>
- <td colspan="2">没有该栏目!</td>
- </tr>
- </table>
- <%end if
- end if
- End Function
- Function del
- dim cid
- cid=Request.QueryString("cid")
- %>
- <p style="margin-left:15px;">
- <b>删除栏目</b></p>
- <%
- If Request("SubmitFlag") <> "" Then
- dim i,sql,rs
- Set Rs = Server.CreateObject("Adodb.Recordset")
- Sql = "select * FROM uclass WHERE cid=" & cid
- Rs.Open Sql,conn,1,3
- if not (rs.bof and rs.eof) then
- rs.Delete
- end if
- rs.Close
- Set rs = Nothing
- Set Rs = Server.CreateObject("Adodb.Recordset")
- Sql = "select * FROM ufile WHERE cid='" & cid&"'"
- Rs.Open Sql,conn,1,3
- if not (rs.bof and rs.eof) then
- For i=1 to rs.RecordCount
- If Rs.Eof Then
- exit For
- End If
- rs.Delete
- Rs.MoveNext
- Next
- end if
- rs.Close
- Set rs = Nothing
- Set Rs = Server.CreateObject("Adodb.Recordset")
- Sql = "select * FROM ulist WHERE cid='" & cid&"'"
- Rs.Open Sql,conn,1,3
- if not (rs.bof and rs.eof) then
- For i=1 to rs.RecordCount
- If Rs.Eof Then
- exit For
- End If
- rs.Delete
- Rs.MoveNext
- Next
- end if
- rs.Close
- Set rs = Nothing%>
- <table width="100%" border=0 align="center" cellpadding=5 cellspacing=1 bgcolor=#cccccc class=TBone>
- <tr bgcolor=#f7f7f7 class=TBBG9>
- <td colspan="2">删除栏目成功!<br/><a href='admin_add_class.asp'>返回文件栏目</a></td>
- </tr>
- </table>
- <% else%>
- <form name="pollform3sdx" method="post" action="admin_add_class.asp?Action=del&cid=<%=cid%>">
- <input type="hidden" name="SubmitFlag" value=yes>
- <table width="100%" border=0 align="center" cellpadding=5 cellspacing=1 bgcolor=#cccccc class=TBone>
- <tr bgcolor=#f7f7f7 class=TBBG9>
- <td colspan="2">注意:删除栏目将删除一切分类和其它信息!<br>
- 在删除前务必确认此栏目分类已经转移。<br><br><b><font color=ff0000 class=RedFont>
- <strong><font color="#FF0000">确认信息: 真的要删除编号为<%=cid%>栏目吗?</font></strong><br><br>
- <input type=button value="不能删啊" onclick="javascript:history.go(-1);">
- <input type=submit name=删除 value="当然删除" class=fmbtn></td>
- </tr>
- </table>
- </form>
- <%
- end if
- End Function
- %>