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

📄 admin_user_inc.asp

📁 da jia lai kan kan hao dong dong
💻 ASP
字号:
<%
'****************************************************
'名称:nowmenu
'功能:管理快捷菜单
'****************************************************
Sub nowmenu()
res "<h4><b>相关操作:</b>",1
res "<a href=""?action=add"">添加新管理员</a> | ",1
res "<a href=""?action=list"">管理员列表</a> ",1
res "</h4>",1
res "<div style=""height:3px;width:100%;background: #fff;""></div>",1
End Sub


'****************************************************
'名称:jstable
'功能:接收表单提交过来的值
'****************************************************
Sub jstable()
	a_UserId = che(request("a_UserId"))
	a_PassWord = md5(md5(che(request("a_PassWord"))))
	a_UserName = che(request("a_UserName"))

End Sub

'****************************************************
'名称:sqltable
'功能:将值提交入库
'参数:types 为空或 "add" 判断是修改记录还是添加记录
'****************************************************
Sub sqltable(types)
	If types="add" Then
		rs("a_UserId") = a_UserId
		rs("a_PassWord") = a_PassWord
	else
		If a_PassWord<>"" Then rs("a_PassWord") = a_PassWord
	End If
	rs("a_UserName") = a_UserName
End Sub


'****************************************************
'名称:listinfo
'功能:列表
'****************************************************
Sub listinfos()
%>
	<table width="100%" cellspacing="1" cellpadding="0" class="info_tab2">
	<tr align="center"> 
		<th width="5%" style="text-align:center;">选</th>
		<th width="15%">帐号</th>
		<th width="15%">姓名</th>
		<th width="20%">最后登陆时间</th>
		<th width="10%">登陆次数</th>
		<th width="10%">操作</th>
		<th>&nbsp;</th>
	</tr>
	<%
	Sql_Lists="id,a_UserId,a_UserName,a_lastdate,a_loads"
	sql=Sqlinfo(Sql_Lists,"Admin_User",Sql_Condition,"id",1,"")
	strFileName="?action="&action&"&types="&types&"&keyword="&keyword
	colnum="7"
	formaction="?action=del"
	sqllist sql,colnum,strFileName,formaction 
	If outcom=True Then
	showContent
	showdelpages
	End If
	%>
	</TABLE>

<%
end sub 

'****************************************************
'名称:showContent
'功能:翻页列表输出
'****************************************************
sub showContent
	dim i
	i=0
	do while not rs.eof
		%>
		<tr> 
			<td style="text-align:center;">
				<input name='id' type='checkbox' class="chek" onclick="unselectall()" id="ArticleID" value='<%=Rs(0)%>' style=" border: 0px"> 
			</td>
			<td>&nbsp;<A HREF="?action=edit&id=<%=Rs(0)%>"><%=Rs(1)%></A></td>
			<td>&nbsp;<%=Rs(2)%></td>
			<td>&nbsp;<%=Rs(3)%></td>
			<td>&nbsp;<%=Rs(4)%></td>
			<td>&nbsp;<A HREF="?action=powers&id=<%=Rs(0)%>">权限编辑</A></td>
			<td>&nbsp;</td>
		</tr>
	<%
		i=i+1
		if i>=MaxPerPage then exit do
		rs.movenext
	loop
end Sub


'****************************************************
'名称:addinfos
'功能:添加信息
'****************************************************
Sub addinfos()
%>
	<table width="100%" cellspacing="1" cellpadding="0" class="info_tab">
	<FORM METHOD=POST ACTION="?action=save">

	<%For i=0 To UBound(users)
		response.write "<TR><TD class=""zq"" width=""20%"">"&users(i)&"</TD><TD>&nbsp;"
		response.write "<INPUT class=""put"" TYPE="""
		If i=1 Then 
			response.write "a_PassWord"
		Else
			response.write "text"
		End If
		response.write """ NAME="""&userslm(i)&""">"
		response.write "</TD></TR>"
	Next
	%>
	<TR><TD>&nbsp;</TD><TD>&nbsp;<INPUT TYPE="submit" value="确认添加"></TD></TR>
	</FORM>
	</TABLE>
	
<%
end Sub

'****************************************************
'名称:editinfos
'功能:编辑信息
'****************************************************
Sub editinfos()
	If id="" Then id=admin25175(0)
	Sql_Lists="a_UserId,a_UserName,a_PassWord"
	sql=Sqlinfo(Sql_Lists,"Admin_User"," ID = "&id,"","","")
	rs_edit = connopen(sql)
	If isArray(rs_edit)=False Then errormsg "参数错误"
	%>
	<table width="100%" cellspacing="1" cellpadding="0" class="info_tab">
	<FORM METHOD=POST ACTION="?action=mod">

	<%
	For i=0 To UBound(users)
		response.write "<TR><TD class=""zq"" width=""20%"">"&users(i)&"</TD><TD>&nbsp;"
		If i<>0 Then	
				response.write "<INPUT  class=""put"" TYPE="""
				If i=2 Then 
					response.write "PassWord"
					response.write """ NAME="""&userslm(i)&""" value="""">"
				else
					response.write "text"
					response.write """ NAME="""&userslm(i)&""" value="""&rs_edit(i,0)&""">"
				End If
		Else
			response.write rs_edit(i,0)
		End If 
		response.write "</TD></TR>"
	Next
	%>
	<TR><TD>&nbsp;</TD><TD>&nbsp;<INPUT TYPE="submit" value="确认修改"><INPUT TYPE="hidden" NAME="id" value="<%=id%>"></TD></TR>
	</FORM>
	</TABLE>
	
<%
end sub 


Sub powerinfos()

	Sql_Lists="a_UserId,a_UserName,a_Power"
	sql=Sqlinfo(Sql_Lists,"Admin_User"," ID = "&id,"","","")
	rs_edit = connopen(sql)
	%>
	<STYLE TYPE="text/css">
	.power_ul { width:90%;}
	.power_ul li {float:left; width:120px;font-weight: normal;padding-top:3px;padding-bottom:3px;}
	.power_ul fir {clear:left;font-weight: bold;border-bottom:1px dotted #CCCCCC;}
	.power_ul li .button {width:120px;text-align:left;padding-top:3px; text-indent:15px;}
	</STYLE>
<table width="100%" cellspacing="1" cellpadding="0" class="info_tab">
<form name="del" method="Post" action="?action=set">
	<%
	If isArray(rs_edit) Then
		response.write "<TR><TD class=""art_info2 zq"">帐号:"&rs_edit(0,0)&"</TD></TR>" & vbcrlf
		response.write "<TR><TD class=""art_info2 zq"">姓名:"&rs_edit(0,0)&"</TD></TR>" & vbcrlf
	Else
		 errormsg "参数错误"
	End If
	sql=Sqlinfo("id,Description,DescriptionNo","admin_power"," Grading =0 ","","","")
	Dim power_edit
	power_edit = connopen(sql)
	If IsArray(power_edit) Then
		Dim power_top2_i,power_top_i
		response.write "<TR><TD class=""art_info2 zq"">" & vbcrlf
		For power_top_i=0 To UBound(power_edit,2)
			response.write "<ul class=""power_ul"" id=""power_id_"&power_top_i&""">"
			response.write "<li style=""clear:left""><INPUT TYPE=""button"" value="""&power_edit(1,power_top_i) &""" onClick=""power_chkll('power_id_"&power_top_i&"')"" class=""button""></li>" & vbcrlf
			sql=Sqlinfo("id,Description,DescriptionNo","admin_power"," Grading ="&power_edit(2,power_top_i),"","","")
			Dim power2_edit
			power2_edit = connopen(sql)
			If IsArray(power2_edit) Then
				For power_top2_i=0 To UBound(power2_edit,2)
					response.write "<li><input name='pID' type='checkbox' class=""chek"" id=""pID"" "
					response.write "value="""&power2_edit(2,power_top2_i)&""" style=""border: 0px;"" "
					If rs_edit(2,0)<>"" Then
					If Replace(rs_edit(2,0),"*"&power2_edit(2,power_top2_i)&"*","")<>rs_edit(2,0) Then response.write "checked "
					End If
					response.write " >"&power2_edit(1,power_top2_i) &"</li>" & vbcrlf
				Next
			End If	
			response.write "</ul>" & vbcrlf & vbcrlf
		Next 
		response.write "<ul class=""power_ul""><li><INPUT TYPE=""button"" value=""全选/取消"" onClick=""power_chkll('del')"" class=""button""></li></ul></TD></TR>" & vbcrlf
	End If 
%>
<TR><TD class="art_info2"><INPUT TYPE="submit" style="margin-left:20px;" value="确定"><INPUT TYPE="reset"></TD></TR>
<INPUT TYPE="hidden" NAME="id" value="<%=id%>">
</form>
</table>
<%
end sub 
%>

⌨️ 快捷键说明

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