admin_pset.asp
资源名称:txl.zip [点击查看]
上传用户:comthink
上传日期:2021-05-06
资源大小:1280k
文件大小:7k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
HTML/CSS
- <!--#include file="conn.asp"-->
- <!-- #include file="inc/const.asp" -->
- <title><%=txl_info(0)%>--管理页面</title>
- <!--#include file="inc/admin_css.asp"-->
- <meta NAME=GENERATOR Content="Microsoft FrontPage 3.0" CHARSET=GB2312>
- <BODY leftmargin="0" bottommargin="0" rightmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="#DDEEFF">
- <%
- if not supermaster or session("flag")="" then
- Errmsg=Errmsg+"<br>"+"<li>本页面为管理员专用,请<a href=admin_index.asp target=_top>登陆</a>后进入。<br><li>您没有管理本页面的权限。"
- call txl_error()
- response.end
- end if
- %>
- <table cellpadding="2" cellspacing="1" border="0" width="95%" class="tableBorder" align=center>
- <tr>
- <th colspan=4 height=23>照片类别管理</th>
- </tr>
- <tr>
- <td width=15% class=txlrow>注意事项</td>
- <td width=85% class=txlrow colspan=3 style="line-height: 150%">①点击类别或编辑可以修改照片类别名和类别简介;<br>②类别简介不要超过50个字符;<br>③点击删除,将删除该类别下的所有照片,请谨慎操作。</td>
- </tr>
- <%
- if request("action")="edit" then
- call edit()
- elseif request("action")="save" then
- call save()
- elseif request("action")="add" then
- call addnew()
- elseif request("action")="del" then
- call delete()
- else
- call main()
- end if
- conn.close
- set conn=nothing
- sub main()
- %>
- <tr>
- <th colspan=4 align=left height=23>类别列表</th>
- </tr>
- <tr align=center>
- <td class=txlHeaderBackgroundAlternate><B>ID</B></td>
- <td class=txlHeaderBackgroundAlternate><B>类别名</B></td>
- <td class=txlHeaderBackgroundAlternate><B>编辑</B></td>
- <td class=txlHeaderBackgroundAlternate><B>删除</B></td>
- </tr>
- <%
- Set rs= Server.CreateObject("ADODB.Recordset")
- select case request("userSearch")
- case 1
- sql="select * from imgclass where classid="&request("classid")
- case else
- sql="select * from imgclass order by classid"
- end select
- rs.open sql,conn,1,1
- if rs.eof and rs.bof then
- response.write "<tr><td colspan=4 class=txlrow>没有找到相关记录。</td></tr>"
- else
- do while (not rs.eof)
- %>
- <tr>
- <td height=25 width=15% class=txlrow align=center><%=rs("classid")%></td>
- <td width=55% class=txlrow align=center><a href=?action=edit&id=<%=rs("classid")%>><%=rs("classname")%></a></td>
- <td width=15% class=txlrow align=center><a href=?action=edit&id=<%=rs("classid")%>><u>编辑</u></a></td>
- <td width=15% class=txlrow align=center><a href=?action=del&id=<%=rs("classid")%> onclick="{if(confirm('确定要删除该类别吗?')){return true;}return false;}"><u>删除</u></a></td>
- </tr>
- <%
- rs.movenext
- loop
- end if
- rs.close
- set rs=nothing
- %>
- <FORM METHOD=POST ACTION="?action=add">
- <tr>
- <th colspan=4 align=left height=23>添加类别</th>
- </tr>
- <TR>
- <td width=15% class=txlrow>类别名称:</td>
- <td width=85% class=txlrow colspan=3><input type=text name="classname" size=30 value=""></td>
- </TR>
- <TR>
- <td width=15% class=txlrow>类别简介:<br></td>
- <td width=85% class=txlrow colspan=3><textarea cols=50 rows=4 name="classinfo"></textarea> 请不要超过50个字符</td>
- </TR>
- <tr>
- <td width=15% class=txlrow> </td>
- <td width=85% class=txlrow colspan=3><input name="submit" type=submit value="添 加"></td>
- </tr>
- </form>
- </table>
- <%
- end sub
- sub edit()
- if not isnumeric(request("id")) then
- response.write "<p>错误的用户参数。</p>"
- response.end
- end if
- if not founderr then
- Set rs= Server.CreateObject("ADODB.Recordset")
- sql="select * from imgclass where classid="&request("id")
- rs.open sql,conn,1,1
- if rs.eof and rs.bof then
- response.write "<tr><td colspan=4 class=txlrow>没有找到相关类别。</td></tr>"
- response.end
- end if
- end if
- %>
- <FORM METHOD=POST ACTION="?action=save">
- <input type=hidden name="classid" value="<%=rs("classid")%>">
- <tr>
- <th colspan=4 align=left height=23>修改类别</th>
- </tr>
- <TR>
- <td width=15% class=txlrow>类别名称:</td>
- <td width=85% class=txlrow colspan=3><input type=text name="classname" size=30 value="<%=rs("classname")%>"></td>
- </TR>
- <TR>
- <td width=15% class=txlrow>类别简介:<br></td>
- <td width=85% class=txlrow colspan=3><textarea cols=50 rows=4 name="classinfo"><%=rs("classinfo")%></textarea> 请不要超过50个字符</td>
- </TR>
- <tr>
- <td width=15% class=txlrow> </td>
- <td width=85% class=txlrow colspan=3><input name="submit" type=submit value="修 改"></td>
- </tr>
- </form>
- </table>
- <%
- end sub
- sub addnew()
- response.write "<tr><th colspan=4 height=23 align=left>执行结果</th></tr>"
- if request("classname")="" then
- response.write "<tr><td colspan=4 class=txlrow>请输入类别名。</td></tr>"
- response.end
- end if
- if request("classinfo")="" then
- response.write "<tr><td colspan=4 class=txlrow>请输入类别简介。</td></tr>"
- response.end
- elseif Len(request("classinfo"))>50 then
- response.write "<tr><td colspan=4 class=txlrow>类别简介只能在50个字符以内。</td></tr>"
- response.end
- end if
- set rs=server.createobject("adodb.recordset")
- sql="Select * from imgclass"
- rs.open sql,conn,1,3
- if rs.eof and rs.bof then
- errmsg=errmsg+"<br>"+"<li>该用类别不存在。"
- founderr=true
- else
- rs.addnew
- rs("classname")=request("classname")
- rs("classinfo")=request("classinfo")
- rs.update
- end if
- rs.close
- set rs=nothing
- response.write "<tr><td colspan=4 class=txlrow>添加类别成功。</td></tr>"
- end sub
- sub save()
- response.write "<tr><th colspan=4 height=23 align=left>执行结果</th></tr>"
- if not isnumeric(request("classid")) then
- response.write "<tr><td colspan=4 class=txlrow>错误的类别参数。</td></tr>"
- response.end
- end if
- if request("classname")="" then
- response.write "<tr><td colspan=4 class=txlrow>请输入类别名。</td></tr>"
- response.end
- end if
- if request("classinfo")="" then
- response.write "<tr><td colspan=4 class=txlrow>请输入类别简介。</td></tr>"
- response.end
- elseif Len(request("classinfo"))>50 then
- response.write "<tr><td colspan=4 class=txlrow>类别简介只能在50个字符以内。</td></tr>"
- response.end
- end if
- set rs=server.createobject("adodb.recordset")
- sql="Select * from imgclass where classid="&request("classid")
- rs.open sql,conn,1,3
- if rs.eof and rs.bof then
- errmsg=errmsg+"<br>"+"<li>该用类别不存在。"
- founderr=true
- else
- rs("classname")=request("classname")
- rs("classinfo")=request("classinfo")
- rs.update
- end if
- rs.close
- set rs=nothing
- response.write "<tr><td colspan=4 class=txlrow>操作成功。</td></tr>"
- end sub
- sub delete()
- response.write "<tr><th colspan=4 height=23 align=left>执行结果</th></tr>"
- if not isnumeric(request("id")) then
- response.write "请指定相关参数。"
- response.end
- else
- conn.execute("update imgclass set picset=2 where classid="&request("id"))
- conn.execute("delete from imgclass where classid="&request("id"))
- end if
- response.write "<tr><td colspan=4 class=txlrow>删除成功。</td></tr>"
- end sub
- %>
English
