123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435 |
- <!--#include file="Inc/common.asp"-->
- <!--#include file="Inc/MD5.asp"-->
- <!--#include file="Inc/Function.asp"-->
- <!--#include file="Admin_Common.asp"-->
- <!--#include file="CheckComeUrl.asp"-->
- <%
- Dim uid, rsRole, isAdmin, rsgan
- uid = trim(request("uid"))
- if trim(Lcase(AdminName)) = "admin" then
- isAdmin = true
- else
- isAdmin = false
- end if
- maxperpage = 50
- %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title><%=systemPageTitle%></title>
- <link href="bs2010.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript" src="js/share.js"></script>
- <script type="text/javascript" src="js/prototype.js"></script>
- <script language="javascript" type="text/javascript" src="datepicker/WdatePicker.js"></script>
- <script language="javascript">
- function GetData()
- {
- url="alarm.asp";//调用页面
- var xmlhttp=null;
- if(window.XMLHttpRequest)
- {
- xmlhttp=new XMLHttpRequest();
- }
- if(!xmlhttp&&window.ActiveXObject)
- {
- try
- {
- xmlhttp=new ActiveXObject("Msxml2.XMLHTTP.5.0")
- }
- catch(e)
- {
- try
- {
- xmlhttp=new ActiveXObject("Msxml2.XMLHTTP.4.0")
- }
- catch(e){
- try
- {
- new ActiveXObject("Msxml2.XMLHTTP")
- }
- catch(e)
- {
- try{
- new ActiveXObject("Microsoft.XMLHTTP")
- }catch(e)
- {
- }
- }
- }
- }
- }
- if(!xmlhttp){alert("XMLHTTP不可用,请升级安装。");location="support/msxml.msi"}
-
- xmlhttp.open("GET",url,false);
- xmlhttp.send();
- var str = xmlhttp.responseText;
- document.getElementById("loadcontent").innerHTML=str;
-
- setTimeout("GetData()",<%=refreshRate%>);
- }
- </script>
- <script language=javascript>
- <!--
- function CheckForm() {
- if(document.searchForm.d1.value == '') {
- alert('请选择开始日期!');
- document.searchForm.d1.focus();
- return false;
- }
- if(document.searchForm.d2.value == '') {
- alert('请选择结束日期!');
- document.searchForm.d2.focus();
- return false;
- }
- }
- //-->
- </script>
- </head>
- <body onLoad="javascript:GetData();">
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
-
- <tr>
- <td class="mainbg"><table width="760" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td valign="top">
- <div id="loadcontent">
- <p></p>
- 数据载入中……</div>
- <br />
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="20" height="40"><img src="images/arr1.gif" width="14" height="18" /></td>
- <td class="deviceName">用户日志</td>
- </tr>
- </table>
- <table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>
- <tr class='tdbg'>
- <td width='70' height='30'><strong>管理导航:</strong></td>
- <td height='30'><a href='Admin_userLog.asp'><%=ChannelShortName%>用户日志首页</a> | <a href="admin_userLog.asp?Action=search">查询</a></td>
- </tr>
- </table>
- <br />
- <%
- Action = request("Action")
- select case Action
- case "search"
- call Search
- case "searchResult0"
- call searchResult0
- case "searchResult"
- call searchResult
- case else
- call main
- end select
-
- sub main()
- %>
- <form name='myform' method='Post' action='Admin_userLog.asp'>
- <%
- dim rse, sqle, t_classid, totalPages, totalRecords, i
- strFileName = "admin_userLog.asp?action=main"
- t_classid = trim(request("t_classid"))
- if t_classid = "" then
- sqle = "select id, uid, contents, happentime from t_user_log order by happentime desc"
- else
- sqle = "select id, uid, contents, happentime from t_user_log where uid = '" & t_classid & "' order by happentime desc"
- end if
- set rse = server.CreateObject("adodb.recordset")
- rse.open sqle, conn, 1, 1
-
- rse.pagesize = maxperpage
- totalPages = rse.pagecount
- totalRecords = rse.recordcount
-
- if rse.bof and rse.eof then
- else
- dim pageAction
- pageAction = request("pageAction")
- select case pageAction
- case "goPage" session("page") = CLng(request("pageNum"))
- case "first" session("page") = 1
- case "prev" session("page") = session("page") - 1
- case "next" session("page") = session("page") + 1
- case "last" session("page") = totalPages
- case else session("page") = 1
- end select
-
- if session("page") < 1 then session("page") = 1
- if session("page") > totalPages then session("page") = totalPages
- rse.absolutepage = session("page")
- end if
-
- if totalPages > 1 then
- if session("page")=1 then
- response.write "共有记录<strong>"&TotalRecords&"</strong>条 "&session("Page")&"/"&TotalPages&"页 第一页-上一页 -<a href="&strFileName&"&PageAction=next><strong>下一页</strong></a>-<a href="&strFileName&"&PageAction=last><strong>最后一页</strong></a>"
- elseif session("page")=TotalPages Then
- response.write "共有记录<strong>"&TotalRecords&"</strong>条 "&session("Page")&"/"&TotalPages&"页 <a href="&strFileName&"&PageAction=first><strong>第一页</strong></a>-<a href="&strFileName&"&PageAction=prev><strong>上一页</strong></a>-下一页-最后一页"
- else
- response.write "共有记录<strong>"&TotalRecords&"</strong>条 "&session("Page")&"/"&TotalPages&"页 <a href="&strFileName&"&PageAction=first><strong>第一页</strong></a>-<a href="&strFileName&"&PageAction=prev><strong>上一页</strong></a>-<a href="&strFileName&"&PageAction=next><strong>下一页</strong></a>-<a href="&strFileName&"&PageAction=last><strong>最后一页</strong></a>"
- end if
- else
- response.write "共有记录" & totalRecords & "条 " & session("page") & "/" & totalPages & "页"
- end if
- %>
- <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
- <tr>
- <td width="40" class="deviceTdTitle">ID</td>
- <td width="120" class="deviceTdTitle">用户 - <a href="admin_userLog.asp" style="font-weight:normal">显示全部</a></td>
- <td class="deviceTdTitle">事件</td>
- <td width="240" class="deviceTdTitle">发生时间</td>
- </tr>
- <%
- if rse.bof and rse.eof then
- %>
- <tr class="deviceTd">
- <td colspan="4" align="center">没有日志</td>
- </tr>
- <%
- else
-
- i = 0
- do while not rse.eof and i < maxperpage
- i = i + 1
- %>
- <tr class="deviceTd">
- <td align="center"><%=rse("id")%></td>
- <td align="center"><a href="admin_userLog.asp?t_classid=<%=rse("uid")%>"><%=rse("uid")%></a></td>
- <td align="center"><%=rse("contents")%></td>
- <td align="center"><%=rse("happentime")%></td>
- </tr>
- <%
- rse.movenext
- loop
- end if
- rse.close
- set rse = nothing
- %>
- </table>
- </form>
- <%
- end sub
-
- sub Search()
- %>
- <form action='admin_userLog.asp' method='post' name='searchForm' id="searchForm" onsubmit='return CheckForm();'>
- <p> </p>
- <table width="500" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
- <tr>
- <td colspan="2" class="deviceTdTitle">用户日志查询</td>
- </tr>
- <tr class="deviceTd">
- <td width="18%" align="center"><strong>用户</strong></td>
- <td align="left">
- <select name='uid'>
- <%=GetClass_Option()%>
- </select> </td>
- </tr>
- <tr class="deviceTd">
- <td align="center"><strong>日期</strong></td>
- <td width="82%" align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0">
-
- <tr>
- <td align="left">从
- <input type="text" id="d1" name="d1" style="border:1px solid #CCC;background:url(DatePicker/skin/datePicker.gif) center right no-repeat" onfocus="WdatePicker({el:'d1',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'<%=startdate%>',maxDate:'#F{$dp.$D(\'d2\')||\'%y-%M-%d %H:%m:%s\'}',onpicked:pickedFunc1})"/>
- <script>
- function pickedFunc1(){
- $dp.$('d1_y').value=$dp.cal.getP('y');
- $dp.$('d1_M').value=$dp.cal.getP('M');
- $dp.$('d1_d').value=$dp.cal.getP('d');
- $dp.$('d1_HH').value=$dp.cal.getP('H');
- $dp.$('d1_mm').value=$dp.cal.getP('m');
- $dp.$('d1_ss').value=$dp.cal.getP('s');
- }
- </script></td>
- <td align="left">到
- <input type="text" id="d2" name="d2" style="border:1px solid #CCC;background:url(DatePicker/skin/datePicker.gif) center right no-repeat" onfocus="WdatePicker({el:'d2',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'d1\')||\'<%=startdate%>\'}',maxDate:'%y-%M-%d %H:%m:%s',onpicked:pickedFunc2})"/>
- <script>
- function pickedFunc2(){
- $dp.$('d2_y').value=$dp.cal.getP('y');
- $dp.$('d2_M').value=$dp.cal.getP('M');
- $dp.$('d2_d').value=$dp.cal.getP('d');
- $dp.$('d2_HH').value=$dp.cal.getP('H');
- $dp.$('d2_mm').value=$dp.cal.getP('m');
- $dp.$('d2_ss').value=$dp.cal.getP('s');
- }
- </script></td>
- </tr>
-
- </table>
- </td>
- </tr>
-
- <tr class="deviceTd">
- <td colspan="2" align="center">
- <input type="hidden" id="Action" name="Action" value="searchResult0" />
- <input type="submit" name="submit" id="submit" value="查询" />
- </td>
- </tr>
- </table>
- </form>
- <%
- end sub
-
- sub searchResult0()
- session("uid") = trim(request("uid"))
- session("d1") = request("d1")
- session("d2") = request("d2")
- session("page") = 1
- call searchResult
- end sub
-
- sub searchResult()
-
- dim rse, sqle, t_classid, uid, d1, d2, totalPages, totalRecords, strFileName,i
-
- uid = session("uid")
- d1 = session("d1")
- d2 = session("d2")
-
- strFileName = "admin_userLog.asp?action=searchResult"
- sqle = "select id, uid, contents, happentime from t_user_log where uid = '" & uid & "' and happentime between '"&d1&"' and '"&d2&"' order by happentime desc"
- set rse = server.CreateObject("adodb.recordset")
- rse.open sqle, conn, 1, 1
-
- rse.pagesize = maxperpage
- totalPages = rse.pagecount
- totalRecords = rse.recordcount
-
- if rse.bof and rse.eof then
- else
- dim pageAction
- pageAction = request("pageAction")
- select case pageAction
- case "goPage" session("page") = CLng(request("pageNum"))
- case "first" session("page") = 1
- case "prev" session("page") = session("page") - 1
- case "next" session("page") = session("page") + 1
- case "last" session("page") = totalPages
- case else session("page") = 1
- end select
-
- if session("page") < 1 then session("page") = 1
- if session("page") > totalPages then session("page") = totalPages
- rse.absolutepage = session("page")
- end if
-
- if totalPages > 1 then
- if session("page")=1 then
- response.write "共有记录<strong>"&TotalRecords&"</strong>条 "&session("Page")&"/"&TotalPages&"页 第一页-上一页 -<a href="&strFileName&"&PageAction=next><strong>下一页</strong></a>-<a href="&strFileName&"&PageAction=last><strong>最后一页</strong></a>"
- elseif session("page")=TotalPages Then
- response.write "共有记录<strong>"&TotalRecords&"</strong>条 "&session("Page")&"/"&TotalPages&"页 <a href="&strFileName&"&PageAction=first><strong>第一页</strong></a>-<a href="&strFileName&"&PageAction=prev><strong>上一页</strong></a>-下一页-最后一页"
- else
- response.write "共有记录<strong>"&TotalRecords&"</strong>条 "&session("Page")&"/"&TotalPages&"页 <a href="&strFileName&"&PageAction=first><strong>第一页</strong></a>-<a href="&strFileName&"&PageAction=prev><strong>上一页</strong></a>-<a href="&strFileName&"&PageAction=next><strong>下一页</strong></a>-<a href="&strFileName&"&PageAction=last><strong>最后一页</strong></a>"
- end if
- else
- response.write "共有记录" & totalRecords & "条 " & session("page") & "/" & totalPages & "页"
- end if
-
- %>
- <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
- <tr>
- <td width="40" class="deviceTdTitle">ID</td>
- <td width="120" class="deviceTdTitle">用户</td>
- <td class="deviceTdTitle">事件</td>
- <td width="240" class="deviceTdTitle">发生时间</td>
- </tr>
- <%if rse.bof and rse.eof then%>
- <tr class="deviceTd">
- <td colspan="4" align="center">没有日志</td>
- </tr>
- <%
- else
-
- i = 0
- do while not rse.eof and i < maxperpage
- i = i + 1
- %>
- <tr class="deviceTd">
- <td align="center"><%=rse("id")%></td>
- <td align="center"><%=rse("uid")%></td>
- <td align="center"><%=rse("contents")%></td>
- <td align="center"><%=rse("happentime")%></td>
- </tr>
- <%
- rse.movenext
- loop
- end if
- rse.close
- set rse = nothing
- %>
- </table>
- <%
- end sub
- %> </td>
- </tr>
- </table></td>
- </tr>
- <tr>
- <td> </td>
- </tr>
- </table>
- </body>
- </html>
- <%
- Function GetClass_Option()
- Dim rsClass, sqlClass, strTemp, tmpDepth, i
-
- sqlClass = "Select uid from t_user_info order by id"
- Set rsClass = Conn.Execute(sqlClass)
- If rsClass.BOF And rsClass.EOF Then
- strTemp = "<option value=''>请先添加用户</option>"
- Else
- strTemp = ""
- Do While Not rsClass.EOF
- strTemp = strTemp & "<option value='" & rsClass(0) & "'"
- strTemp = strTemp & ">"
-
- strTemp = strTemp & rsClass(0)
- strTemp = strTemp & "</option>"
- rsClass.MoveNext
- Loop
- End If
- rsClass.Close
- Set rsClass = Nothing
- GetClass_Option = strTemp
- End Function
- Function GetPath(ParentID, ParentPath)
- on error resume next
- Dim strPath, i
- If ParentID <= 0 Then
- GetPath = "无(所属区域已被删除)"
- Exit Function
- End If
- ParentPath = ParentPath & "," & ParentID
- Dim rsParent, sqlParent
- sqlParent = "Select * from t_area where t_classid in (" & ParentPath & ") order by Depth"
- Set rsParent = Conn.Execute(sqlParent)
- Do While Not rsParent.EOF
- For i = 1 To rsParent("Depth")
- strPath = strPath & " "
- Next
- If rsParent("Depth") > 0 Then
- strPath = strPath & "└ "
- End If
- strPath = strPath & rsParent("ClassName") & "<br>"
- rsParent.MoveNext
- Loop
- rsParent.Close
- Set rsParent = Nothing
- GetPath = strPath
- End Function
- Call CloseConn
- %>
|