📄 main.asp
字号:
<%@ Language=VBScript %>
<%
'文件功能:wh_logs--主界面
'编写人员:阿房
'编写时间:2003-05-06 17:08:59
'开发平台:ASP3.0 + MSSQL2000
'版本:1.1.20030908.01
%>
<!-- #include file="../Common/Cls_DbProcess2.1.asp" -->
<!-- #include file="../wh_logs/Cls_wh_logs.asp" -->
<!-- #include file="../pub/fun.asp" -->
<%call checklogin()%>
<%
if session("right")<4 then
dim lr
lr="<font color=red>"&now()&"有"&session("name")&"试图查看日志 IP:"&REQUEST.SERVERVARIABLES("REMOTE_ADDR")&"</font>"
call savelog("error.htm",lr)
call savedatalog(now(),session("name"),"试图查看日志",REQUEST.SERVERVARIABLES("REMOTE_ADDR"),2)
response.redirect("../error.asp?msg=2")
end if
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="WindSoft Programmer3">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=gb2312">
<TITLE>wh_logs--主界面</TITLE>
<%
dim mStr_WINDCallType
mStr_WINDCallType = trim(request.querystring("WINDCallType")) '调用方式
dim mStr_WINDURL '请将需要全局传递的变量链接到本变量上,使用方法参见WINDCallType,多个变量之间采用&链接
mStr_WINDURL = "WINDCallType="+Server.URLEncode(mStr_WINDCallType)
dim mInt_Page '当前页
dim mInt_RecordCount '总记录数
dim mInt_CountPerPage '每页记录数
dim mStr_SortBy '排序方式
dim mStr_AscMark '排列顺序
dim mStr_log_time '时间
dim mStr_log_ip 'IP
dim mStr_log_who '操作人
dim mStr_log_type '类型
call InitData()
%>
</HEAD>
<BODY>
<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD>
<FONT CLASS="locationhead">您的位置:</FONT>
<A CLASS="locationdata" HREF="Main.asp?<% =mStr_WINDURL%>">日志</A>>>
<A CLASS="locationlastdata" HREF="Main.asp?<% =mStr_WINDURL%>">主界面</A>
</TD>
</TR>
</TABLE>
<FORM ID="Frm_Data" NAME="Frm_Data">
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD ALIGN="RIGHT">
<A HREF="javascript:WindowPrint()">打印</A>
<A HREF="Search.asp?<% =mStr_WINDURL%>">查询</A>
</TD>
</TR>
</TABLE>
<TABLE WIDTH=100% <% Response.write GetTableBorder()%>>
<TR CLASS='TABLEHEAD' ALIGN=CENTER>
<TD>序号</TD>
<TD><A HREF='javascript:OrderBy("log_time")'>时间<% call GetOrderBy("log_time")%></A></TD>
<TD><A HREF='javascript:OrderBy("log_ip")'>IP<% call GetOrderBy("log_ip")%></A></TD>
<TD><A HREF='javascript:OrderBy("log_who")'>操作人<% call GetOrderBy("log_who")%></A></TD>
<TD><A HREF='javascript:OrderBy("log_action")'>动作<% call GetOrderBy("log_action")%></A></TD>
<TD><A HREF='javascript:OrderBy("log_type")'>类型<% call GetOrderBy("log_type")%></A></TD>
</TR>
<%
call ShowAllData_wh_logs() '显示查询结果
%>
</TABLE>
<%
'显示页数
call ShowPage(mInt_RecordCount,mInt_CountPerPage,mInt_Page,"WIDTH:100%")
%>
</FORM>
<DIV STYLE="DISPLAY:NONE">
<FORM ACTION="?<% =mStr_WINDURL%>" ID="Frm_Update" METHOD="post">
<INPUT NAME="Page" id=Page VALUE='<% =mInt_Page %>'>
<INPUT NAME="SortBy" id=SortBy VALUE='<% =mStr_SortBy %>'>
<INPUT NAME="AscMark" id=AscMark VALUE='<% =mStr_AscMark %>'>
<INPUT NAME='log_time' VALUE='<% =mStr_log_time %>'>
<INPUT NAME='log_ip' VALUE='<% =mStr_log_ip %>'>
<INPUT NAME='log_who' VALUE='<% =mStr_log_who %>'>
<INPUT NAME='log_type' VALUE='<% =mStr_log_type %>'>
</FORM>
</DIV>
</BODY>
</HTML>
<%
function InitData()
'初始化
dim Str_Mess '错误信息
dim Int_Count '错误记录数
'读取查询条件
mInt_Page = val(trim(request.form("Page")))
if mInt_Page=0 then mInt_Page=Val(session("session_wh_logsPage"))
if mInt_Page=0 then mInt_Page=1
session("session_wh_logsPage")=mInt_Page
mStr_SortBy = trim(request.form("SortBy"))
mStr_AscMark = trim(request.form("AscMark"))
mStr_log_time = trim(request.form("log_time"))
mStr_log_ip = trim(request.form("log_ip"))
mStr_log_who = trim(request.form("log_who"))
mStr_log_type = trim(request.form("log_type"))
Str_Mess = ""
Int_Count = 1
if ((mStr_log_time<>"") and not (IsDate(mStr_log_time))) then
Str_Mess = Str_Mess + "\n" + cstr(Int_Count) + ") [时间] 一栏必须为日期!"
Int_Count = Int_Count+1
end if
if (Str_Mess<>"") then
call ShowMess(16,"对不起,您录入的资料存在以下错误:" _
+"\n"+ Str_Mess _
+"\n"++"\n"+ "请检查资料或联系管理员!")
call WindowBack()
end if
end function
function ShowAllData_wh_logs()
'显示查询结果
dim Str_PK_log_id '主鍵
dim Str_log_id 'log_id
dim Str_log_time '时间
dim Str_log_ip 'IP
dim Str_log_who '操作人
dim Str_log_action '动作
dim Str_log_type '类型
dim Rec_Data '结果集
dim Int_PageCount '总页数
dim Int_Count '记数
mInt_CountPerPage = GetCountPerPage()
'计算页数
set Rec_Data = mCls_wh_logs.SearchData(mStr_SortBy + " "+ mStr_AscMark, mStr_log_time, mStr_log_ip, mStr_log_who, mStr_log_type)
mInt_RecordCount = Rec_Data.RecordCount
if not Rec_Data.eof then
Rec_Data.PageSize = mInt_CountPerPage
Int_PageCount = Rec_Data.PageCount
if mInt_Page > Int_PageCount then mInt_Page=1
Rec_Data.AbsolutePage = mInt_Page
end if
Int_Count = 0
Do while not Rec_Data.eof and Int_Count<mInt_CountPerPage
'读取资料
Int_Count = Int_Count+1
Str_PK_log_id = Server.HTMLEncode(trim(Rec_Data.fields("log_id") & ""))
Str_log_id = Server.HTMLEncode(trim(Rec_Data.fields("log_id") & ""))
Str_log_time = Server.HTMLEncode(trim(Rec_Data.fields("log_time") & ""))
Str_log_ip = Server.HTMLEncode(trim(Rec_Data.fields("log_ip") & ""))
Str_log_who = Server.HTMLEncode(trim(Rec_Data.fields("log_who") & ""))
Str_log_action = Server.HTMLEncode(trim(Rec_Data.fields("log_action") & ""))
Str_log_type = Server.HTMLEncode(trim(Rec_Data.fields("log_type") & ""))
'显示资料
%>
<!-- #include file="../wh_logs/Show_wh_logs.asp" -->
<%
Rec_Data.movenext
loop
Rec_Data.close
end function
function GetOrderBy(pStr_SortBy)
if (mStr_SortBy = pStr_SortBy) then
if (mStr_AscMark = "") then
Response.Write "<img src='../image/btup.gif' ALIGN='ABSMIDDLE' BORDER=0>"
else
Response.Write "<img src='../image/btdown.gif' ALIGN='ABSMIDDLE' BORDER=0>"
end if
end if
end function
%>
<SCRIPT LANGUAGE="javascript">
<!--********************************************************************************-->
function getpage(pStr_Page){
//换页
window.Frm_Update.Page.value=pStr_Page;
window.Frm_Update.submit()
}
<!--********************************************************************************-->
function OrderBy(pStr_Type){
//排序
window.Frm_Update.SortBy.value=pStr_Type;
if (pStr_Type=="<% =mStr_SortBy%>"){
window.Frm_Update.AscMark.value=(window.Frm_Update.AscMark.value==""?"desc":"")
} else {
window.Frm_Update.AscMark.value=""
}
window.Frm_Update.Page.value=1;
window.Frm_Update.submit()
}
<!--********************************************************************************-->
function SelectAll(){
//全选
var Int_Count
var Int_I
Int_Count=window.Frm_Data.length
for(Int_I=0; Int_I<=Int_Count-1; Int_I++){
if (document.Frm_Data.elements[Int_I].name=="ChkID"){
document.Frm_Data.elements[Int_I].checked=true
}
}
}
<!--********************************************************************************-->
function SelectReverse(){
//反选
var Int_Count
var Int_I
var Str_Var
Int_Count=window.Frm_Data.length
for(Int_I=0; Int_I<=Int_Count-1; Int_I++){
if (document.Frm_Data.elements[Int_I].name=="ChkID"){
Str_Var=document.Frm_Data.elements[Int_I].checked
document.Frm_Data.elements[Int_I].checked=! Str_Var
}
}
}
<!--********************************************************************************-->
function CallUpdate(){
//修改资料
var Int_SelectCount
var Str_ChkID
var Int_Len
var Str_Date=new Date()
Int_SelectCount=GetSelectCount()
Str_ChkID=GetSelected()
if (Int_SelectCount<=0){
alert("对不起,请选择要修改的 [wh_logs]!")
return
}
if (Int_SelectCount>1){
alert("对不起,您只能选择一个要修改的 [wh_logs]!")
return
}
Int_Len=Str_ChkID.length
if (Str_ChkID!="") {Str_ChkID=Str_ChkID.substr(1,Int_Len-2)}
window.location="Update.asp?<% =mStr_WINDURL%>&time="+Str_Date.getTime()+"&PK_log_id="+Str_ChkID
}
<!--********************************************************************************-->
function CallDelete(){
//删除资料
var Int_SelectCount
var Str_ChkID
var Str_Date=new Date()
Int_SelectCount=GetSelectCount()
Str_ChkID=GetSelected()
if (Int_SelectCount<=0){
alert("对不起,请选择要删除的 [wh_logs]!")
return
}
if (window.confirm("删除选定的 [wh_logs]吗?")){
window.location="Delete.asp?<% =mStr_WINDURL%>&time="+Str_Date.getTime()+"&PK_log_id="+Str_ChkID
}
}
<!--********************************************************************************-->
function GetSelectCount(){
//读取选定的编码
var Int_Count
var Int_SelectCount
var Str_Chk
var Str_ChkID
var Int_I
var Str_Value
Str_ChkID=""
Int_Count=window.Frm_Data.length
Int_SelectCount=0
for(Int_I=0; Int_I<=Int_Count-1; Int_I++){
if (document.Frm_Data.elements[Int_I].name=="ChkID"){
Str_Value=document.Frm_Data.elements[Int_I].value
if ((Str_Value!="") && (document.Frm_Data.elements[Int_I].checked)){
Int_SelectCount=Int_SelectCount+1
}
}
}
return Int_SelectCount
}
<!--********************************************************************************-->
function GetSelected(){
//读取选定的编码
var Int_Count
var Int_SelectCount
var Str_Chk
var Str_ChkID
var Int_I
var Str_Value
Str_ChkID=""
Int_Count=window.Frm_Data.length
Int_SelectCount=0
for(Int_I=0; Int_I<=Int_Count-1; Int_I++){
if (document.Frm_Data.elements[Int_I].name=="ChkID"){
Str_Value=document.Frm_Data.elements[Int_I].value
if ((Str_Value!="") && (document.Frm_Data.elements[Int_I].checked)){
Int_SelectCount=Int_SelectCount+1;
Str_ChkID=Str_ChkID +",'"+Str_Value+"'";
}
}
}
if (Str_ChkID!="") {Str_ChkID=Str_ChkID.substr(1)}
return Str_ChkID
}
<!--********************************************************************************-->
</SCRIPT>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -