?? admin_user_inc.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> </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> <A HREF="?action=edit&id=<%=Rs(0)%>"><%=Rs(1)%></A></td>
<td> <%=Rs(2)%></td>
<td> <%=Rs(3)%></td>
<td> <%=Rs(4)%></td>
<td> <A HREF="?action=powers&id=<%=Rs(0)%>">權限編輯</A></td>
<td> </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> "
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> </TD><TD> <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> "
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> </TD><TD> <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 + -