📄 admin_function.asp
字号:
<%
'==============================================================
'程序名称:茂盛网站管理系统(Maoin CSM)
'当前版本:Maosin CMS Version 1.1 Powered by maosin.com
'程序作者:阿茂(李胜茂)
'网站地址:www.maosin.com www.maosin.net
' QQ:57861417
'电子邮箱:maosin@163.com maosin@maosin.com
'--------------------------------------------------------------
'Copyright (C) 2006 maosin.com All Rights Reserved.
'免费版本请在程序首页保留(Powered by:Maosin CMS)版权链接信息;
'您可以对此版本进行修改,美化,但请保留此ASP文件内的版权信息;
'茂盛设计网保留此软件的法律追究权利
'==============================================================
Sub table(height)%>
<table><tr><td height="<%=height%>"></td></tr></table>
<%End Sub
Sub adminClass(datatable,classtable,bigname,bigidfield)
sql="select * from "&datatable
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open sql,connstr,1,1
%>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="text table_border mainTable">
<tr>
<td width="100%" height="36" valign="middle" class="td_titleT"><%=catname%>分类管理<span> <a href="?action=maosin_appbigclass">新增大分类</a></span></td>
</tr>
<% do while Not rs.Eof%>
<tr class="td_bgcolor">
<td valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="text">
<tr align="left" valign="middle" class="td_topT">
<td width="110" valign="middle">大分类</td>
<td width="382" height="30" valign="middle" align="lerf">【<%=rs(bigname)%>】 <button onClick="window.location.href='?action=maosin_appchildclass&id=<%=rs(bigidfield)%>';">新建子分类</button></td>
<td width="219" align="right" valign="middle">
<button onClick="window.location.href='?action=maosin_mdfbigclass&id=<%=rs(bigidfield)%>&menu=<%=rs(bigname)%>';">修改大分类</button>
<button onClick="{if (confirm('是真的要册除吗?')){window.location.href='?action=maosin_delbigclass&id=<%=rs(bigidfield)%>';}else{return false;}}">删除大分类</button></td>
</tr>
<%childsql="select * from "&classtable&" where "&bigidfield&"="&rs(bigidfield)
Set childrs=Server.CreateObject("ADODB.RecordSet")
childrs.open childsql,connstr,1,1%>
<tr>
<td height="27" align="center" valign="middle">共有<font color=#ff0000><%=childrs.RecordCount%></font>个子分类</td>
<td colspan="2" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="text">
<%Do While Not childrs.Eof%>
<tr onMouseOver="mouseOver(this)" onMouseOut="mouseOut(this)">
<td width="522" height="27" valign="middle"> ├ <%=childrs("class")%></td>
<td width="272" align="center" valign="middle">
<a href=?action=maosin_mdfChild&classID=<%=childrs("classID")%>&class=<%=childrs("class")%>&<%=bigidfield%>=<%=childrs(bigidfield)%>>修改</a> |
<a href="#" onClick="javascript:{if(confirm('您确定要删除此项目吗?')){window.location.href='?action=maosin_delchild&classID=<%=childrs("classID")%>';}return false;}">删除</a></td>
</tr>
<%childrs.MoveNext
loop
childrs.close
Set childrs=Nothing%>
</table></td>
</tr>
</table></td>
</tr>
<%rs.MoveNext
loop%>
</table>
</body>
</html>
<%rs.Close
Set rs=Nothing
End Sub
Sub addchildClass(bigdatatable,classtable,bigname,bigidname)
if Request.form("addchild")<>"" Then
sql="insert into "&classtable&"("&bigidname&",class) values("&Request.form("stair")&",'"&Request.form("className")&"')"
conn.Execute(sql)
adminShowMsg "操作成功信息","<li>恭喜您,子分类添加加成功了!</li><br>要继续添加请单击 [<a herf=?addchildchass>继续添加分类</a>]<br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回分类管理页......</b><meta http-equiv=refresh content=3;url=?action=maosin_adminclasslist><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>"
end if
sql="select * from "&bigdatatable&" order by "&bigidname&" asc"
Set rs=conn.Execute(sql)
%>
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="text table_border mainTable">
<tr>
<td width="583" height="26" align="center" valign="middle" class="td_titleT">新增子分类</td>
</tr><form action="?action=maosin_appchildclass" method="post">
<tr class="td_bgcolor">
<td height="33" align="center" valign="middle">子分类名称:
<input name="className" type="text" id="className">
所属大分类:
<select name="stair" id="stair">
<%Do While Not rs.Eof
If rs(bigidname)=Cint(Request.QueryString("id")) Then%>
<option value=<%=rs(bigidname)%> selected><%=rs(bigname)%></option>
<%Else%>
<option value=<%=rs(bigidname)%>><%=rs(bigname)%></option>
<%End IF
rs.MoveNext
Loop
rs.close
Set rs=Nothing%>
</select>
</td>
</tr>
<tr class="td_titleB">
<td height="25" align="center" valign="middle"><input type="Submit" name="addchild" value="确认增加">
<input type="reset" name="Submit2" value="清除重填"></td>
</tr></form>
</table>
<%End Sub
Sub modifyChildClass(bigdatatable,dataclass,bigname,bigidname)
If Request.form("modifychild")<>"" Then
sql="update "&dataclass&" set class='"&Request.form("classname")&"',"&bigidname&"="&Request.form("stair")&" where classID="&Request.form("classID")
conn.Execute(sql)
adminShowMsg "操作成功信息","<li>恭喜您,子分类修改成功了!</li><br><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回分类管理页......</b><meta http-equiv=refresh content=3;url=?action=maosin_adminclasslist><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>"
End If
%>
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="text table_border mainTable">
<tr>
<td width="583" height="26" align="center" valign="middle" class="td_titleT">修改子分类</td>
</tr><form action="?action=maosin_mdfChild" method="post">
<tr class="td_bgcolor">
<td height="33" align="center" valign="middle">子分类名称:
<input name="classID" type="hidden" value="<%=Request.QueryString("classID")%>">
<input name="className" type="text" id="className" value='<%=Request.QueryString("class")%>'>
所属大分类:
<select name="stair" id="stair">
<%sql="select * from "&bigdatatable&" order by "&bigidname&" asc"
Set bigrs=conn.Execute(sql)
Do While Not bigrs.Eof
If bigrs(bigidname)=CInt(Request.QueryString(bigidname)) Then%>
<option value=<%=bigrs(bigidname)%> selected><%=bigrs(bigname)%></option>
<%Else%>
<option value=<%=bigrs(bigidname)%>><%=bigrs(bigname)%></option>
<%End IF
bigrs.MoveNext
Loop
if bigrs.eof and bigrs.bof then
response.Write("暂无大分类,请添加!")
end if
bigrs.close
Set bigrs=Nothing%>
</select>
</td>
</tr>
<tr class="td_titleB">
<td height="25" align="center" valign="middle"><input type="Submit" name="modifychild" value="确认增加">
<input type="reset" name="Submit2" value="清除重填"></td>
</tr></form>
</table>
<%
End Sub
Sub deleteChild(dataclass,datalist)
sql="select count(*) as articledata from "&datalist&" where classID="&Request.QueryString("classID")
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,connstr,1,1
if rs("articledata")<>0 then
adminShowMsg "操作错误信息","<font color=""#ff0000"">系统返回如下信息:</font><br><br><li>此分类下有 <font color=""#ff0000"">"&rs("articledata")&"</font> 条数据,如需要删除,请先将分类下的数据转移后,才能删除!</li><br><br>"
rs.close
set rs=nothing
Response.End
end if
sql="delete from "&dataclass&" where classID="&Request.QueryString("classID")
adminShowMsg "操作成功信息","<li>恭喜您,子分类删除成功了!</li><br><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回分类管理页......</b><meta http-equiv=refresh content=3;url=?action=maosin_adminclasslist><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>"
conn.Execute(sql)
set rs=nothing
exit sub
End Sub
Sub modifyBigClass(bigdatatable,bigname,bigidname)
If Request.form("modifybigClass")<>"" Then
sql="update "&bigdatatable&" set "&bigname&"='"&Request.form("bigclass")&"' where "&bigidname&"="&Request.form("id")
conn.Execute(sql)
adminShowMsg "操作成功信息","<li>恭喜您,分类修改成功!</li><br><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回分类管理页......</b><meta http-equiv=refresh content=3;url=?action=maosin_adminclasslist><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>"
exit sub
End If
%>
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="text table_border mainTable">
<form action="?action=maosin_mdfbigclass" Method="post" name="modifyBigform">
<tr>
<td height="26" align="center" valign="middle" class="td_titleT">修改大分类</td>
</tr>
<tr class="td_bgcolor">
<td height="30" align="center" valign="middle">分类名:
<input type="hidden" name="id" value="<%=Request.QueryString("id")%>">
<input type="text" name="bigclass" value="<%=Request.QueryString("menu")%>"></td>
</tr>
<tr class="td_titleB">
<td height="30" align="center" valign="middle"><input type="submit" name="modifybigClass" value="确定增加">
<input type="submit" name="Submit2" value="清除重填">
</td>
</tr>
</form>
</table>
<%End Sub
Sub deleteBigClass(bigdatatable,datalist,bigidname)
sql="select count(*) as datars from "&datalist&" where "&bigidname&"="&CInt(Request.QueryString("id"))
Set rs=conn.Execute(sql)
if rs("datars")<>0 then
adminShowMsg "操作错误信息","<li>此分类下有"&rs("datars")&"条数据,如需要删除,请先将分类下的数据转移后,才能删除!</li><br><br>"
rs.close
Response.End
end if
rs.close
sql="delete from "&bigdatatable&" where "&bigidname&"="&CInt(Request.QueryString("id"))
conn.Execute(sql)
adminShowMsg "操作成功信息","<li>恭喜您,分类分类删除成功了!</li><br><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回分类管理页......</b><meta http-equiv=refresh content=3;url=?action=maosin_adminclasslist><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>"
exit sub
End Sub
Sub addBigClass(bigdatatable,bigname)
if Request.form("addbigClass")<>"" then
sql="insert into "&bigdatatable&"("&bigname&") values('"&Request.form("bigclass")&"')"
conn.Execute(sql)
adminShowMsg "成功信息","<li>恭喜您,分类操作删除成功!</li><li>继续添加请单击 [<a href=?action=maosin_appbigclass>继续增加分类]</a></li><br><br><span id=seNum>8</span><a href=javascript:showtime></a>秒钟后系统将自动返回分类管理页......</b><meta http-equiv=refresh content=8;url=?action=maosin_adminclasslist><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(8);</script>"
exit sub
end if%>
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="text table_border mainTable">
<form action="?action=maosin_appbigclass" Method="post" name="addBigform">
<tr>
<td height="26" align="center" valign="middle" class="td_titleT">新增大分类</td>
</tr>
<tr class="td_bgcolor">
<td height="30" align="center" valign="middle">分类名:
<input type="text" name="bigclass"></td>
</tr>
<tr class="td_titleB">
<td height="30" align="center" valign="middle"><input type="submit" name="addbigClass" value="确定增加">
<input type="submit" name="Submit2" value="清除重填">
</td>
</tr>
</form>
</table>
<%
End Sub
Sub adminpl(pltable,all)
if all=true then
sql="select * from "&pltable&" order by pl_id desc"
else
url=url&"id="&Request.QueryString("id")&"&title="&Request.QueryString("title")&"&"
sql="select * from "&pltable&" where id="&CInt(Request.QueryString("id"))&" order by pl_id desc"
end if
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open sql,connstr,1,1
%>
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="text table_border mainTable">
<tr valign="middle">
<td height="23" colspan="5" class="td_titleT">评论管理 <%if all=false then%> | 相关标题:<font color="#ff0000"> <%=Request.QueryString("title")%></font><%end if%></td>
</tr>
<tr class="td_topT">
<td width="60" height="24" align="center" valign="middle">ID</td>
<td width="*" align="center" valign="middle">评 论 内 容</td>
<td width="100" align="center" valig="middle">打 分</td>
<td width="120" align="center" valign="middle">评 论 人</td>
<td width="100" align="center" valign="middle">操 作 选 项</td>
</tr>
<form name="fileform" action="?action=maosin_delpl" method="post">
<%
if not rs.bof and not rs.eof then
nextpage=pagetitle(rs,20,url,"条评论")
lineNo=1
Do While Not rs.Eof And lineNo<=rs.pagesize%>
<tr class="td_bgcolor" onmouseover="mouseOver(this)" onmouseout="mouseOut(this)">
<td height="22" align="center" valign="middle"><%=rs("pl_id")%></td>
<td valign="middle"><%=rs("pl_content")%></td>
<td align="center" valign="middle"><%=rs("pl_fen")%></td>
<td align="center" valign="middle"><%=rs("pl_name")%></td>
<td align="center" valign="middle"><input type="checkbox" name="pl_id" id="pl<%=rs("pl_id")%>" value="<%=rs("pl_id")%>"><label for="pl<%=rs("pl_id")%>">选定</label> <a href="#" onClick="javascript:{if(confirm('您确定要删除此项目吗?')){window.location.href='?action=maosin_delpl&pl_id=<%=rs("pl_id")%>';}return false;}">删除</a></td>
</tr>
<%rs.MoveNext
lineNo=lineNo+1
Loop%>
<tr><td colspan="5" class="td_topT">
<%=(nextpage)%>
</td></tr>
<%else%>
<tr class="td_bgcolor"><td colspan="5" height="30" valign="middle" align="center">没有相关评论!</td></tr>
<%end if%>
<tr class="td_titleB"><td colspan=5 valign="middle" align="center">
<input type="checkbox" name="checkall" id="checkall" onclick="checkalldele(this.form)"><label for="checkall">选择所有</label> <input type="submit" name="deletepl" value="删除所选">
</td></tr>
</form>
</table>
<script type="text/javascript">
function checkalldele(obj){
var len=obj.elements.length;
for(var i=0;i<len-3;i++){
obj.elements(i).checked=obj.checkall.checked;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -