⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_pt.asp

📁 蓝色WAP建站系统,WAP源码,更多请登陆http://xywap.cn
💻 ASP
字号:
<%
'==================================
'=文 件 名:admin_pt.asp
'=适用版本:游戏天府WAP网站管理系统(CMS)V1.
'=官方版权:http://www.gotf.cn
'=文件功能:手机平台系统管理
'=文件作者:游戏天府
'=发行时间:2007-02-01
'==================================
%>
<!--#include file="wapls_admin_conn.asp"-->
<!--#include file="wapls_admin_top.asp"-->
<%
if session("wapls_adminlogin")<>wapls_sessionvar then	
	errmsg="您没有登陆或不是管理员。请登陆。"
response.write "<script>window.alert('"&errmsg&"');window.location='admin_login.asp';</script>"
	response.End
elseif cur_adminsuper<>1 then
	errmsg=""&cur_adminname&",您不是超级管理员,没有权限进行此操作!"
response.write "<script>window.alert('"&errmsg&"');window.location='javascript:history.go(-1);';</script>"
	response.End
end if
%>
<table cellspacing="1" cellpadding="4" class="tableborder" align="center">
	<tr align="center" class="tablebody">
		<td width="50%" class="td_title"><a href="?action=admin"><font color="#ffffff">手机平台管理</font></a></td>
		<td  width="50%" class="td_title"><a href="?action=add"><font color="#ffffff">新增手机平台</font></a></td>
	</tr>
</table>
<br>
<%
'==================================
'=功    能:主调代码,相应功能皆有说明
'==================================
Select case request.QueryString("action")
	case "admin"		'手机平台管理
		call admin()
	case "add"	'添加手机平台
		call add()
	case "edit"		'编辑手机平台
		call edit()
	case "del"	'删除手机平台
		call del()
	case else
		call admin()
End Select
'==================================
'=过 程 名:admin()
'=功    能:手机平台管理
'==================================
sub admin() 
dim totalpt,Currentpage,totalpages,k
sql="select * from wapls_pt order by pt_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table cellspacing="1" cellpadding="4" class="tableborder" align="center">
	<tr class="tablebody">
		<td colspan="4" class="td_title">手机平台管理</td>
	</tr>
	<tr class="tablebody" align="center">
		<td width="10%">编号</td>
		<td width="30%">手机平台标题</td>
		<td width="30%">链接地址</td>
		<td width="20%">操作</td>
	</tr>
	<%
	if not rs.eof then
		rs.movefirst
		perpage=cint(perpage)
		rs.pagesize=perpage
		if trim(request("page"))<>"" then
			currentpage=cint(request.querystring("page"))
			if currentpage>rs.pagecount then
				currentpage=rs.pagecount
			end if
		else
			currentpage=1
		end if
		totalpt=rs.recordcount
		if currentpage<>1 then
			if (currentpage-1)*perpage<totalpt then
				rs.move(currentpage-1)*perpage
			end if
		end if
		if (totalpt mod perpage)=0 then
			totalpages=totalpt\perpage
		else
			totalpages=totalpt\perpage+1
		end if
		k=0
		do while not rs.eof and k<perpage
		%>
		<tr class="tablebody">
			<td align="center"><%=rs("pt_id")%></td>
			<td id="menutitle<%=k%>" onclick="showsubmenu(<%=k%>)" style="cursor:hand;"><%=rs("pt_title")%><br>
			<table style="display:none" id='submenu<%=k%>' class="tableborder" cellspacing="1" cellpadding="4" align="center"><tr><td bgcolor="#ffffff">支持机型:<%=rs("pt_content")%></td>
			</table>
			</td>
<td><input size="30" type="text" value="soft.asp?Action=pt&id=<%=rs("pt_id")%>" onmouseover="this.focus()" onfocus="this.select()"></td>
			<td align="center"><button onClick="window.location
='?id=<%=rs("pt_id")%>&action=edit&page=<%=currentpage%>'">编辑</button>&nbsp;<button onClick="window.location
='?id=<%=rs("pt_id")%>&action=del&page=<%=currentpage%>'">删除</button></td>
		</tr>
		<%
		k=k+1
		rs.movenext
		loop
	else
		if rs.eof and rs.bof then
		%>
	<tr align="center" class="tablebody">
		<td colspan="4" height="70" class="disable_font">当前没有手机平台!</td>
	</tr>
		<%
		end if
	end if
	%>
</table>
<%if totalpt>perpage then%>
<table cellspacing="1" cellpadding="4" class="tableborder" align="center">
		<form name="form" method="post" action="">
		<tr class="tablebody">
		<td align="center">
		<%showpage totalpt,perpage,"admin_blog.asp?action=admin&"%>
		</td>
		</tr>
		</form>
	</table>
<%
end if
rs.close
set rs=nothing
end sub
'==================================
'=过 程 名:add()
'=功    能:新增手机平台
'==================================
sub add()
if request.form("addpt")="true" then
	pt_title=checksql("手机平台标题",request.form("pt_title"),1,50)
	pt_content=checksql("手机平台内容",request.form("pt_content"),1,0)
	sql="select * from wapls_pt"
	set rs=server.createobject("adodb.recordset")
	rs.open sql,conn,1,3
	rs.addnew
	rs("pt_content")=pt_content
	rs("pt_title")=pt_title
	rs.update
	rs.close
	set rs=nothing
	response.redirect "admin_pt.asp"
end if
%>
<table cellspacing="1" cellpadding="4" class="tableborder" align="center">
	<form name="form1" method="post" action=""  onsubmit="javascript:submits();">
	<tr class="tablebody">
		<td class="td_title" colspan="2">增加手机平台</td>
	</tr>
	<tr class="tablebody">
		<td align="center" width="13%">平台标题</td>
		<td width="87%"><input type="text" name="pt_title" size="30"  maxlength="50"></td>
	</tr>
	<tr class="tablebody">
	<td align="center" valign="top">支持型号</td>
		<td><textarea name="pt_content" rows="15" cols="100"></textarea></td>
	</tr>
	<tr class="tablebody">
		<td class="tablebody" height="30" align="center" colspan="2"><input type="submit" name="Submit2" value="确定新增" onClick="if (Dvbbs_bTextMode!=1) {Dvbbs_setMode(1);}"><input type="hidden" name="addpt" value="true"></td>
	</tr>
	</form>
</table>
<%
end sub
'==================================
'=过 程 名:edit()
'=功    能:编辑手机平台
'==================================
sub edit()
if request.form("editpt")="true" then
	dim curpage
	if request.querystring("page")<>"" then
		curpage=cint(request.querystring("page"))
	else
		curpage=1
	end if
	pt_title=checksql("手机平台标题",request.form("pt_title"),1,50)
	pt_content=checksql("手机平台内容",request.form("pt_content"),1,0)
	sql="select * from wapls_pt where pt_id="&cint(request.form("id"))
	set rs=server.createobject("adodb.recordset")
	rs.open sql,conn,1,3
	rs("pt_content")=pt_content
	rs("pt_title")=pt_title
	rs.update
	rs.close
	set rs=nothing
	response.redirect "?action=admin&page="&curpage&""
end if
pt_id=checksql("手机平台ID",request.querystring("id"),0,8)
sql="select * from wapls_pt where pt_id="&pt_id
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table cellspacing="1" cellpadding="4" class="tableborder" align="center">
	<form name="form1" method="post" action="" onsubmit="javascript:submits();">
	<tr class="tablebody">
		<td class="td_title" colspan="2">编辑手机平台</td>
	</tr>
	<tr class="tablebody">
		<td align="center" width="13%">平台标题</td>
		<td width="87%"><input type="text" name="pt_title" size="30" maxlength="50" value="<%=rs("pt_title")%>"></td>
	</tr>
	<tr class="tablebody">
		<td align="center" valign="top">支持型号</td>
		<td><textarea name="pt_content" rows="15" cols="100"><%=rs("pt_content")%></textarea></td>
	</tr>
	<tr class="tablebody">
		<td class="tablebody" colspan="2" height="30" align="center">
		<input type="submit" name="Submit" value="确定修改" onClick="if (Dvbbs_bTextMode!=1) {Dvbbs_setMode(1);}">
		<input type="hidden" name="id" value="<%=rs("pt_id")%>">
		<input type="hidden" name="editpt" value="true">
		</td>
	</tr>
	</form>
</table>
<%
rs.close
set rs=nothing
end sub
'==================================
'=过 程 名:del()
'=功    能:删除手机平台
'==================================
sub del()
if request.form("delpt")="true" then
	dim curpage
	if request.querystring("page")<>"" then
		curpage=cint(request.querystring("page"))
	else
		curpage=1
	end if
	pt_id=checksql("手机平台ID",request.Form("id"),0,8)
	sql="select * from wapls_pt where pt_id="&pt_id
	set rs=server.createobject("adodb.recordset")
	rs.open sql,conn,1,3
	rs.delete
	rs.update
	rs.close
	set rs=nothing
	response.redirect "?action=admin&page="&curpage&""
end if
pt_id=checksql("手机平台ID",request.querystring("id"),0,8)
sql="select * from wapls_pt where pt_id="&pt_id
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table cellspacing="1" cellpadding="4" class="tableborder" align="center">
	<form name="form1" method="post" action="">
	<tr class="tablebody">
		<td class="td_title" colspan="2">删除手机平台</td>
	</tr>
	<tr class="tablebody">
		<td align="center" width="13%">标 题</td>
		<td width="87%"><%=rs("pt_title")%></td>
	</tr>
	<tr class="tablebody">
		<td align="center" height="100" valign="top">内 容</td>
		<td><%=rs("pt_content")%></td>
	</tr>
	<tr class="tablebody">
		<td class="tablebody" height="30" align="center" colspan="2">
		<input name="Submit" type="submit" id="Submit" value="确定删除" onclick="{if(confirm('您确定要删除『<%=rs("pt_title")%>』这个手机平台吗?\n\n注意:删除后不可恢复!')){return true;}return false;}">
		<input type="hidden" name="id" value="<%=rs("pt_id")%>">
		<input type="hidden" name="delpt" value="true"></td>
		<input type="hidden" name="cur_page" value="<%=request.querystring("page")%>">
	</tr>
	</form>
</table>
<%
rs.close
set rs=nothing
end sub
%>
<!--#include file="wapls_admin_bottom.asp"-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -