www.gusucode.com > 漂亮的地方旅游景点景观介绍网站源代码 > admin/back/guestbook.asp
<!--#include file="../config.asp" --> <!--#include file="../../inc/page.asp" --> <link href="../inc/mm.css" rel="stylesheet" type="text/css" /> <% call chkqx(3,9) mytit=mytit&"<a href=?>留言管理</a> > " function ymdh() if fid=0 then ymdh="" end if dim fpath,path,i fpath=getmc("jw_guestbookclass","id",fid,"fpath") path=split(fpath,",") for i=1 to (ubound(path)-1) ymdh=ymdh&"<a href=""?fid="&path(i)&""">"&getmc("jw_guestbookclass","id",path(i),"mc")&"</a> > " next end function select case action case "del" call del() case "show","" if fid=0 then mytit=mytit&"所有留言" else mytit=mytit&ymdh()&"留言列表" end if call show() case "ups" mytit=mytit&ymdh()&"留言详情" call ups() case "doup" call doup() case "qy" call qy() case "jy" call jy() end select '显示 sub show() sql="select * from jw_guestbook order by id desc" call record(rs,sql,1) call head() %><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#116BAE"> <tr> <td bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td id="tit"><%= mytit %></td> </tr> <tr> <td> <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF"> <form name="form1" id="form1" method="post" action=""> <tr> <td width="4%" align="center" bgcolor="#C5E0F3"><strong>ID</strong></td> <td width="27%" bgcolor="#C5E0F3"><strong>主题</strong></td> <td width="13%" align="center" bgcolor="#C5E0F3"><strong>称呼</strong></td> <td width="17%" align="center" bgcolor="#C5E0F3"><strong>时间</strong></td> <td width="16%" align="center" bgcolor="#C5E0F3"><strong>所属分类</strong></td> <td width="13%" align="center" bgcolor="#C5E0F3"><strong>查看</strong></td> <td width="6%" align="center" bgcolor="#C5E0F3"><strong>操作</strong></td> <td width="4%" align="center" bgcolor="#C5E0F3"><input type="checkbox" name="selectall" onClick="selectit()"/></td> </tr> <% dim i,sz sz=20 i=sz dim bgc %> <div style="display:none"><% call fenpage(sz,rs,10) %></div> <% do while not rs.eof and i>0 if i mod 2=0 then bgc="#D2E9FF" else bgc="#D2E1EE" end if %> <tr id="r<%=rs("id")%>" bgcolor=<%= bgc %> onMouseOver="museing(r<%=rs("id")%>,0,'<%= bgc %>')" onMouseOut="museing(r<%=rs("id")%>,1,'<%= bgc %>')"> <td align="center"><%= rs("id") %></td> <td><%= rs("title") %></td> <td align="center"><%= rs("gname") %></td> <td align="center"><%= rs("ctim") %></td> <td align="center"> <% If rs("fid")=0 Then Response.Write("根目录") else Response.Write("<a href=""guestbookclass.asp?action=ups&id="&rs("fid")&""">"&getmc("Jw_newsclass","id",rs("fid"),"mc")&"</a>") end if %> </td> <td align="center"> <% If rs("ck")=1 Then Response.Write("已查看") else Response.Write("未查看") end if %></td> <td align="center"><table border="0" cellpadding="2" cellspacing="0"> <tr> <td valign="bottom"><a href="?action=ups&fid=<%= fid %>&id=<%= rs("id") %>"><img src="../../images/admin/20050703091537508.gif" alt="编辑信息" width="14" height="15" border="0" align="absbottom" /></a></td> <td valign="bottom"><% If rs("show")=0 Then %> <a href="?action=jy&fid=<%= fid %>&id=<%= rs("id") %>"><img src="../../images/admin/20050703091539318.gif" alt="锁定" width="13" height="13" border="0" align="absbottom" /></a> <% Else %> <a href="?action=qy&fid=<%= fid %>&id=<%= rs("id") %>"><img src="../../images/admin/20050703091613193.gif" alt="解锁" width="12" height="13" border="0" align="absbottom" /></a> <% End If %></td> </tr> </table></td> <td align="center"><input name="idstr" type="checkbox" value="<%= rs("id") %>" onclick="td_bgcolor(r<%=rs("id")%>,1);"></td> </tr> <% i=i-1 rs.movenext loop %> <tr> <td colspan="8" bgcolor="#C5E0F3"> <table width="100%" border="0" cellpadding="2" cellspacing="0"> <tr> <td width="11%"><input name="del" type="button" class="button_1" id="del" value="删除所选" onmouseup="tjqr('您确定要删除?此操作无法逆转!','?action=del')" onmouseover="this.className='button_2'" onmouseout="this.className='button_1'"/></td> <td width="89%"><% call fenpage(sz,rs,10) %></td> </tr> </table></td> </tr> </form> </table></td> </tr> </table></td> </tr> </table> <% call recordend(rs) call connend() call foot() end sub '修改 sub ups() call record(rs,"select * from jw_guestbook where id="&id,3) if rs.eof then call cc("记录不存在!") end if rs("ck")=1 rs.update call head() %> <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#116BAE"> <tr> <td bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td id="tit"> <%= mytit %></td> </tr> <tr> <td> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF"> <form action="?action=doup&id=<%= id %>" name="form1" id="form1" method="post"> <tr> <td bgcolor="#D9ECF7">所属分类:</td> <td bgcolor="#D9ECF7"><% If rs("fid")=0 Then Response.Write("根目录") else Response.Write("<a href=""guestbookclass.asp?action=ups&id="&rs("fid")&""">"&getmc("Jw_newsclass","id",rs("fid"),"mc")&"</a>") end if %></td> </tr> <tr> <td bgcolor="#D9ECF7">时 间:</td> <td bgcolor="#D9ECF7"><%=rs("ctim") %></td> </tr> <tr> <td width="10%" bgcolor="#D9ECF7">称 呼:</td> <td width="90%" bgcolor="#D9ECF7"><%=rs("gname") %></td> </tr> <tr> <td bgcolor="#D9ECF7">性 别:</td> <td bgcolor="#D9ECF7"> <% if rs("sex")=0 then Response.Write("男") else Response.Write("女") end if %></td> </tr> <tr> <td bgcolor="#D9ECF7">QICQ:</td> <td bgcolor="#D9ECF7"><%= rs("qq") %> </td> </tr> <tr> <td bgcolor="#D9ECF7">E-MAIL:</td> <td bgcolor="#D9ECF7"><%=rs("email") %></td> </tr> <tr> <td bgcolor="#D9ECF7">电 话:</td> <td bgcolor="#D9ECF7"><%=rs("tel") %></td> </tr> <tr> <td bgcolor="#D9ECF7">地 址:</td> <td bgcolor="#D9ECF7"><%=rs("address") %></td> </tr> <tr> <td bgcolor="#D9ECF7">主 题:</td> <td bgcolor="#D9ECF7"><%=rs("title") %></td> </tr> <tr> <td bgcolor="#D9ECF7">内 容:</td> <td bgcolor="#D9ECF7"><%=rs("content") %></td> </tr> <tr> <td bgcolor="#D9ECF7">回 复:</td> <td bgcolor="#D9ECF7"> <textarea name="hf" cols="60" rows="6" class="inp" id="hf"><%=rs("hf") %></textarea></td> </tr> <tr> <td colspan="2" bgcolor="#D9ECF7"><input name="del2" type="submit" id="del2" value="提交" onmouseover="this.className='button_2'" onmouseout="this.className='button_1'" class="button_1"></td> </tr> </form> </table> </td> </tr> </table> </td> </tr> </table> <% call connend() call foot() end sub '执行修改 sub doup() dim con con=getForm("hf",1,0) conn.execute("update jw_guestbook set hf='"&con&"' where id="&id) call connend() response.Redirect("?") end sub '删除 sub del() '删除单条记录 if id<>"" then conn.execute("delete * from jw_guestbook where id="&id) end if '批量删除 dim idstr,iid,i idstr=replace(Trim(Request.Form("idstr"))," ","") iid=split(idstr,",") for i=0 to ubound(iid) conn.execute("delete * from jw_guestbook where id="&iid(i)) next call connend() response.Redirect(request.ServerVariables("HTTP_REFERER")) end sub '禁用////////////////////////////////////////////////////////////////////////////////////// sub jy() dim val val=1 if id<>"" then call uptab("jw_guestbook","show",val,"id",id) end if call connend() response.Redirect(request.ServerVariables("HTTP_REFERER")) end sub '起用////////////////////////////////////////////////////////////////////////////////////// sub qy() dim val val=0 if id<>"" then call uptab("jw_guestbook","show",val,"id",id) end if call connend() response.Redirect(request.ServerVariables("HTTP_REFERER")) end sub %>