需求:
查询Email的日志文档
1. 没有.net环境
2. 没有IIS环境
3. 没有上网环境
4. 可进行对子查询的处理
那怎么办呢,查询的数据量十分的大.
一般操作如下:
1. 浏览 Mail Log文件.
2. 用一套Javascript算法,分析日志文件.
3. 对查询的数据,进行行着色功能
4. 可以隐藏,查询出的来的,部分记录.
5. 可以隐藏,头数据,尾数据.
<!
DOCTYPE HTML PUBLIC
"
-//W3C//DTD HTML 4.01 Transitional//EN
"
" http://www.w3.org/TR/html4/loose.dtd " >
< html >
< head >
<!--
Author: William Lin
DataTime: 08 / 06 / 2006
Function: For query Mail - log
-->
< meta http - equiv = " Content-Type " content = " text/html; charset=gb2312 " >
< title >=== SSBG -- Log Tracker === </ title >
< script language = " javascript " >
function GetAimInfo(a,b,c,d,selAnd,chkSub)
{
var temp = "" ;
// --------------
if (d == "" ){
alert( " please put in the routine of the file " );
return false ;
}
if (a == "" && b == "" && c == "" ){
alert( " please put the finding character in " );
return false ;
}
if (a == "" ){
a = " ### " ;
}
if (b == "" ){
b = " ### " ;
}
if (c == "" ){
c = " ### " ;
}
// ==============
ShowWaitFun();
// ==============
var query;
var strProcss = a;
var strEmail = b;
var strOther = c;
var theCount = 0 ;
var theOldNumb = 0 ;
var ProcessNumb = 0 ;
var EmailNumb = 0 ;
var OtherNumb = 0 ;
var theShowResult = "" ;
var sLine = "" ;
var fso,f,r
var ForReading = 1 ,ForWriting = 2 ;
// -------------------------
try
{
fso = new ActiveXObject( " Scripting.FileSystemObject " )
f = fso.OpenTextFile(d, ForReading);
}
catch (e)
{
alert( " the file of the routine is not exist,please put in once more! " );
return false ;
}
// ----------------------------------------------
temp = " <html><title>Find the data</title><body> " ;
temp += " <input type='button' name='Submit1' id='Submit1' value='Hide First Field' οnclick='HidenTDF()' class='btn_mouseout'> | " ;
temp += " <input type='button' name='Submit2' id='Submit2' value='Hide Last Field' οnclick='HidenTDL()' class='btn_mouseout'> | " ;
temp += " <input type='button' name='Submit3' id='Submit3' value='Hide Header' οnclick='HideSomeInfo()' class='btn_mouseout'> | " ;
temp += " <input type='button' name='Submit4' id='Submit4' value='Hide Checked Row' οnclick='HidenTR()' class='btn_mouseout' onMouseover="this.className='btn_mouseover'" onMouseout="this.className='btn_mouseout'"> <hr> " ;
temp += " <table width='100%' border='1' cellpadding='0' cellspacing='0' bordercolorlight='#6699ff' bordercolordark='#6699ff' > " ;
temp += " <tr class='th' id='th'><td id='tdF' width='35'>Num</td><td align = 'center' onclick = 'gotoButtom()'> ----------- The content of the finding ----------- </td><td id='tdL' width='35' onclick = 'SetAllChecked()' align='right'>Num/<u>check</u></td></tr> "
while (sLine != null )
{
try
{
sLine = f.ReadLine();
if (sLine != null )
{
theOldNumb = theOldNumb + 1 ;
// 无论大小写,只要有,就为 true
var boolProcess = (sLine.indexOf(strProcss) > 0 || sLine.indexOf(strProcss.toLowerCase()) > 0 || sLine.indexOf(strProcss.toUpperCase()) > 0 );
var boolEmail = (sLine.indexOf(strEmail) > 0 || sLine.indexOf(strEmail.toLowerCase()) > 0 || sLine.indexOf(strEmail.toUpperCase()) > 0 );
var boolOther = (sLine.indexOf(strOther) > 0 || sLine.indexOf(strOther.toLowerCase()) > 0 || sLine.indexOf(strOther.toUpperCase()) > 0 );
/* ************************************************************************************* */
// 单个记录
if (selAnd == " And " )
{
if (strProcss == " ### " )
query = boolEmail && boolOther;
else if (strEmail == " ### " )
query = boolProcess && boolOther;
else if (strOther == " ### " )
query = boolProcess && boolEmail;
else
query = boolProcess && boolEmail && boolOther;
}
else
{
query = boolProcess || boolEmail || boolOther;
}
if (sLine.indexOf(strProcss.toLowerCase()) > 0 )
{ // 在一定的条件下 把[子进程号]包含当作条件
var theLeft = sLine.indexOf( " ( " ) + 1 ;
var theRirgh = sLine.indexOf( " ) " );
var subString = sLine.substring(theLeft,theRirgh);
if (subString.toLowerCase() == strProcss.toLowerCase() || subString == " 00000000 " )
{ }
else
{ subString = sLine.substring(theLeft,theRirgh); }
}
if (chkSub.checked) // 如果子进程复选框选中的话,条件中加入。。。
{
query = query || sLine.indexOf(subString) > 0 ;
}
if (query)
{ // 查看有没有要查找信息
theCount = theCount + 1 ;
if (boolProcess)
ProcessNumb = ProcessNumb + 1 ;
if (boolEmail)
EmailNumb = EmailNumb + 1 ;
if (boolOther)
OtherNumb = OtherNumb + 1 ;
temp += " <tr id='trId " + theCount + " ' οnmοuseοver="this.bgColor='#C4DFF7'" οnmοuseοut="this.bgColor='#ffffff'"> " ;
temp += " <td id='tdF'> " + theCount + " </td> " ;
temp += " <td> " + sLine + " </td> " ;
temp += " <td id='tdL' align='right'> " + theOldNumb + " " ;
temp += " <input type='checkbox' name='chkTr' value='checkbox'> " ;
temp += " </td> "
temp += " </tr> " ;
/* *** ==========For Test
if(theCount == 2)
{
var temp2 = "";
temp2 = "<tr id='trId"+ theCount +"' οnmοuseοver="this.bgColor='#C4DFF7'" οnmοuseοut="this.bgColor='#ffffff'">" ;
temp2 += "<td id='tdF"+ theCount +"'>" + theCount + "</td>";
temp2 += "<td>" + sLine + "</td>";
temp2 += "<td id='tdL"+ theCount +"'>" + theOldNumb +" ";
temp2 += "<input type='checkbox' name='chk"+ theCount + "' value='checkbox'" + "onChange = " HidenTR('trId" + theCount +"') ">"
temp2 += "</td>"
temp2 += "</tr>";
alert(temp2)
}
*****========== End */
}
}
}
catch (e)
{
break ;
}
}
theShowResult += " <strong><font color = '#FF0000'> " + ProcessNumb + " </font></strong> / " ;
theShowResult += " <strong><font color = '#0000FF'> " + EmailNumb + " </font></strong> / " ;
theShowResult += " <strong><font color = '#007744'> " + OtherNumb + " </font></strong> " ;
temp += " <tr id='thTail'><td id='tdF'>End</td><td id='tdTotal' align='left'><a name='#Buttom'>Total</a> <strong> " + theCount + " </strong> records " + theShowResult + " </td><td id='tdL'> </td></tr> " ;
temp += " </table> " ;
temp += " </body></html> " ;
if (theCount == 0 ) // theCount == 1 || theCount == 0
{
alert( " no record " );
return ;
}
temp = ReplaceStr2(temp, " TO: < " , " TO: " );
temp = ReplaceStr2(temp, " TO:< " , " TO: " );
temp = ReplaceStr2(temp, " to: < " , " TO: " );
temp = ReplaceStr2(temp, " to:< " , " TO: " );
temp = ReplaceStr2(temp, " To:< " , " TO: " );
temp = ReplaceStr2(temp, " FROM: < " , " FROM: " );
temp = ReplaceStr2(temp, " FROM:< " , " FROM: " );
temp = ReplaceStr2(temp, " from:< " , " from: " );
temp = ReplaceStr2(temp, " from: < " , " from: " );
temp = ReplaceStr(temp,strProcss, " #ff0000 " );
temp = ReplaceStr(temp,strProcss.toLowerCase(), " #ff0000 " );
temp = ReplaceStr(temp,strProcss.toUpperCase(), " #ff0000 " );
// email
temp = ReplaceStr(temp,strEmail, " #0000ff " );
temp = ReplaceStr(temp,strEmail.toLowerCase(), " #0000ff " );
temp = ReplaceStr(temp,strEmail.toUpperCase(), " #0000ff " );
// other
temp = ReplaceStr(temp,strOther, " #007744 " );
temp = ReplaceStr(temp,strOther.toLowerCase(), " #007744 " );
temp = ReplaceStr(temp,strOther.toUpperCase(), " #007744 " );
// ---------------------------------------------
document.all.show.innerHTML = temp;
// ---------------------------------------------
}
function ShowWaitFun()
{
var theWait = document.getElementById( " DivWait " );
if (theWait.style.display != " block " )
{
theWait.style.display = " block " ;
}
setTimeout( " HideWaiting() " , 5000 );
}
function HideWaiting()
{
var theWait = document.getElementById( " DivWait " );
if (theWait.style.display == " block " )
theWait.style.display = " none " ;
}
/*
输入的原来字符串
要替换的
目标字符
*/
function ReplaceStr(inputStr,oldStr,colorStr)
{
var strReturn;
if (oldStr == "" )
return ;
re = new RegExp(oldStr, " g " );
var newStr = " <strong><font color = ' " + colorStr + " '><u> " + oldStr + " </u></font></strong> " ;
strReturn = inputStr.replace(re,newStr);
return strReturn;
}
function ReplaceStr2(inputStr,oldStr,newStr)
{
var strReturn;
if (oldStr == "" )
return ;
re = new RegExp(oldStr, " g " );
strReturn = inputStr.replace(re,newStr);
return strReturn;
}
function chkAddFun(a,b)
{
if (a.checked)
{
b.style.background = " #CCCCCC " ;
b.disabled = 1 ;
}
else
{
b.style.background = " #FFFFFF " ;
b.disabled = 0 ;
}
}
// 显示和不显示
function showAndInfo()
{
var temp = document.getElementById( " AndId " );
if (temp.style.display == " none " )
{
temp.style.display = " block " ;
}
else
{
temp.style.display = " none "
}
return ;
}
function setState()
{
var theSelValue = document.getElementById( " selAnd " ).value;
var temp = document.getElementById( " AndId " );
if (theSelValue == " And " )
{
temp.style.display = " block " ;
}
else
{
temp.style.display = " none " ;
}
}
// ================
function gotoButtom()
{
location.href = " #buttom " ;
return ;
}
// ===========
function HidenTR()
{
var temp;
var theTr
var objs = document.getElementsByName( " chkTr " )
for ( var i = 0 ;i < objs.length;i ++ )
{
if (objs[i].checked)
{
theTr = " trId " + (i + 1 );
temp = document.getElementById(theTr);
temp.style.display = " none " ;
}
}
}
function HidenTDF()
{
var temp;
var theTd
var objs = document.getElementsByName( " tdF " );
var theButton = document.getElementById( " Submit1 " );
if (theButton.value == " Hide First Field " )
theButton.value = " Show First Field " ;
else
theButton.value = " Hide First Field " ;
// alert(objs.length);
for ( var i = 0 ;i < objs.length;i ++ )
{
if (objs[i].style.display == " none " )
{
objs[i].style.display = " block " ;
// theButton.value = "Hide First Field";
}
else
{
objs[i].style.display = " none " ;
// theButton.value = "Show First Field";
}
}
}
function HidenTDL()
{
var temp;
var theTd
var objs = document.getElementsByName( " tdL " )
var theButton = document.getElementById( " Submit2 " );
if (theButton.value == " Hide Last Field " )
theButton.value = " Show Last Field " ;
else
theButton.value = " Hide Last Field " ;
// alert(objs.length);
for ( var i = 0 ;i < objs.length;i ++ )
{
if (objs[i].style.display == " none " )
{
objs[i].style.display = " block " ;
}
else
{
objs[i].style.display = " none " ;
}
}
}
function HideSomeInfo()
{
var objTh = document.getElementById( " th " );
var objTail = document.getElementById( " tdTotal " ); // tdTotal|thTail
var theButton = document.getElementById( " Submit3 " );
if (theButton.value == " Hide Header " )
theButton.value = " Show Header " ;
else
theButton.value = " Hide Header " ;
if (objTh.style.display == " none " )
{
objTh.style.display = " block " ;
objTail.style.display = " block " ;
}
else
{
objTh.style.display = " none " ;
objTail.style.display = " none " ;
}
}
function SetAllChecked()
{
var temp;
var theTr
var objs = document.getElementsByName( " chkTr " )
for ( var i = 0 ;i < objs.length;i ++ )
{
if (objs[i].checked)
objs[i].checked = false ;
else
objs[i].checked = true ;
}
}
</ script >
<!--
< link href = " CSS/styles.css " rel = " stylesheet " type = " text/css " >
< link href = " CSS/color.css " rel = " stylesheet " type = " text/css " >
-->
</ head >
< body id = " bodyNode " class = " bodyTop " onload = " setState() " >
< form name = " form1 " method = " post " action = " showInfo.asp " >
< table width = " 100% " border = " 1 " bordercolorlight = " #6699ff " bordercolordark = " #6699ff " cellpadding = " 0 " cellspacing = " 0 " class = " BlueBoldfont " >
< tr >
< td >
< div align = " left " >
< table border = " 0 " align = " left " cellpadding = " 0 " cellspacing = " 0 " >
< tr >
< td >& nbsp; </ td >
< td valign = " bottom " >==== SSBG Log Tracker ===== </ td >
</ tr >
</ table >
</ div ></ td >
</ tr >
< tr >
< td valign = " bottom " >
< div align = " center " > File path: < input type = " file " name = " txtPath " ></ div > </ td >
</ tr >
< tr >
< td >
< table width = " 100% " border = " 0 " cellpadding = " 0 " cellspacing = " 0 " >
< tr >
< td width = " 8% " >< div align = " right " > Course: </ div ></ td >
< td width = " 21% " >
< input name = " txtProcess " type = " text " id = " txtProcess " size = " 18 " >
< input name = " chkSub " id = " chkSub " type = " checkbox " value = "" > sub
</ td >
< td width = " 8% " >< div align = " right " > Email: </ div ></ td >
< td width = " 21% " >< input name = " txtEmail " type = " text " id = " txtEmail2 " size = " 18 " ></ td >
< td width = " 6% " >< div align = " right " > Other: </ div ></ td >
< td >< input name = " txtOther " type = " text " id = " txtOther2 " size = " 18 " ></ td >
< td >
< div align = " left " >
Mode:
< select name = " selAnd " id = " selAnd " onChange = " showAndInfo(this.value) " >
< option value = " Or " selected > Or </ option >
< option value = " And " > And </ option >
</ select >
</ div >
</ td >
< td >& nbsp; </ td >
< td width = " 8% " >< input type = " button " name = " Submit " class = " btn_mouseout " value = " Query " onClick = " GetAimInfo(this.form.txtProcess.value,this.form.txtEmail.value,this.form.txtOther.value,this.form.txtPath.value,this.form.selAnd.options[selAnd.selectedIndex].text,this.form.chkSub) " ></ td >
</ tr >
</ table >
</ td >
</ tr >
</ tr >
</ table >
< br >
< table width = " 100% " border = " 0 " cellspacing = " 0 " cellpadding = " 0 " >
< tr class = " BlueBoldfont " >
< td colspan = " 2 " >< div align = " left " >< strong > [Note]: </ strong > If the date is big,it might take around 30 secords. Best uses the IE browser. </ div >
</ td >
</ tr >
< tr class = " BlueBoldfont " >
< td width = " 77% " > < div id = " DivWait " style = " display:none; " >& nbsp; & nbsp; & nbsp; & nbsp; Please waiting...... </ div ></ td >
< td width = " 23% " >< div id = " AndId " >
< div align = " right " >< font color = " #007744 " > " And " needs 2 conditions. </ font ></ div >
</ div ></ td >
</ tr >
</ table >
< br >
< div id = " show " style = " display:block; " ></ div >
</ form >
</ body >
< style >
body {
background - image: url( " IMAGES/images_content/01.gif " );
background - repeat:no - repeat;
FONT - FAMILY: Arial, Helvetica, sans - serif;
FONT - SIZE: 12px;
text - decoration: none;
color:# 000000 ;
BACKGROUND - COLOR:#FFFFFF;
line - height: 20px;
SCROLLBAR - ARROW - COLOR: black;
SCROLLBAR - FACE - COLOR: #ffffff;
SCROLLBAR - HIGHLIGHT - COLOR: #acacac;
SCROLLBAR - SHADOW - COLOR: #acacac;
SCROLLBAR - 3DLIGHT - COLOR: #ffffff;
SCROLLBAR - TRACK - COLOR: #f8f8f8;
SCROLLBAR - DARKSHADOW - COLOR: #ffffff;
border - top - style: none;
border - bottom - style: none;
background - attachment: fixed;
border - right - style: none;
border - left - style: none;
margin - right: 5px;
margin - left: 5px;
margin - bottom: 5px;
margin - top: 5px;
overflow:auto;
}
input{
height:18px
}
.BlueBoldfont{
font - size: 12px;
color: # 003366 ;
font - weight:bold;
}
.BrownBoldfont{
font - size: 12px;
color:# 993300 ;
font - weight:bold;
}
.BlackBoldfont{
font - size: 12px;
color:# 000000 ;
font - weight:bold;
}
p {
font - size: 12px;
text - align: left;
}
table{
border - collapse: collapse;
margin: 0px;
padding: 0px;
border: 0 ;
}
.tbShow{
border - collapse: collapse;
padding: 0px;
cellpadding:0px;
cellspacing:1px;
border - collapse:collapse;
border: #6699ff;
width: 100 % ;
}
.th {
FILTER:progid:DXImageTransform.Microsoft.Gradient(GradientType = 0 , StartColorStr = #FFFFFF, EndColorStr = #4898DB);
font - size: 12px;
text - align: center;
white - space: pre;
font - weight: normal;
color:
line - height: 200 % ;
}
.td {
border - color:#6699ff;
white - space: pre;
}
.total {
white - space: pre;
background - color: bccbe0;
}
.tdHigh {
border - color:#6699ff;
white - space: pre;
padding - top: 5px;
padding - bottom: 5px;
}
td {
font - size: 12px;
padding - left: 2px;
}
.myInput{
BACKGROUND - COLOR: #fffff1;
color:# 000000 ;
background - image: 01 .gif;
BORDER - BOTTOM: #006cb5 1px solid;
BORDER - LEFT: #006cb5 1px solid;
BORDER - RIGHT: #006cb5 1px solid;
BORDER - TOP:#006cb5 1px solid;
HEIGHT: 18px;
font - size: 12px;
cursor: hand;
}
select{
BACKGROUND - COLOR: #ffffff;
color:# 000000 ;
background - image: none;
BORDER - BOTTOM: #006cb5 1px solid;
BORDER - LEFT: #006cb5 1px solid;
BORDER - RIGHT: #006cb5 1px solid;
BORDER - TOP:#006cb5 1px solid;
HEIGHT: 18px;
font - size: 12px;
cursor: hand;
}
Input{
BACKGROUND - COLOR: #ffffff;
color:# 000000 ;
background - image: none;
BORDER - BOTTOM: #006cb5 1px solid;
BORDER - LEFT: #006cb5 1px solid;
BORDER - RIGHT: #006cb5 1px solid;
BORDER - TOP:#006cb5 1px solid;
HEIGHT: 18px;
font - size: 12px;
cursor: hand;
}
.tbInput {
white - space: pre;
border - collapse: collapse;
padding: 0px;
cellpadding:0px;
cellspacing:1px;
}
hr {
height: 1px;
width: 98 % ;
color:#6699ff;
}
table {
text - align: left;
}
.btn {
BORDER - RIGHT: #7b9ebd 1px solid; PADDING - RIGHT: 2px; BORDER - TOP: #7b9ebd 1px solid;
PADDING - LEFT: 2px; FONT - SIZE: 12px; FILTER: progid:DXImageTransform.Microsoft.Gradient
(GradientType = 0 , StartColorStr = #ffffff, EndColorStr = #cecfde); BORDER - LEFT: #7b9ebd 1px
solid; CURSOR: hand; COLOR: black; PADDING - TOP: 2px; BORDER - BOTTOM: #7b9ebd 1px solid;
}
.btn_mouseout {
BORDER - RIGHT: #3399FF 1px solid; PADDING - RIGHT: 2px; BORDER - TOP: #3399FF 1px solid;
PADDING - LEFT: 2px; FONT - SIZE: 12px; FILTER: progid:DXImageTransform.Microsoft.Gradient
(GradientType = 0 , StartColorStr = #ffffff, EndColorStr = #9EBFEA); BORDER - LEFT: #3399FF 1px
solid; CURSOR: hand; COLOR: black; PADDING - TOP: 2px; BORDER - BOTTOM: #3399FF 1px solid
}
.btn_mouseover {
BORDER - RIGHT: # 000000 1px solid; PADDING - RIGHT: 2px; BORDER - TOP: # 000000 1px solid;
PADDING - LEFT: 2px; FONT - SIZE: 12px; FILTER: progid:DXImageTransform.Microsoft.Gradient
(GradientType = 0 , StartColorStr = #ffffff, EndColorStr = #CCDDF4); BORDER - LEFT: # 000000 1px
solid; CURSOR: hand; COLOR: black; PADDING - TOP: 2px; BORDER - BOTTOM: # 000000 1px solid
}
</ style >
</ html >
" http://www.w3.org/TR/html4/loose.dtd " >
< html >
< head >
<!--
Author: William Lin
DataTime: 08 / 06 / 2006
Function: For query Mail - log
-->
< meta http - equiv = " Content-Type " content = " text/html; charset=gb2312 " >
< title >=== SSBG -- Log Tracker === </ title >
< script language = " javascript " >
function GetAimInfo(a,b,c,d,selAnd,chkSub)
{
var temp = "" ;
// --------------
if (d == "" ){
alert( " please put in the routine of the file " );
return false ;
}
if (a == "" && b == "" && c == "" ){
alert( " please put the finding character in " );
return false ;
}
if (a == "" ){
a = " ### " ;
}
if (b == "" ){
b = " ### " ;
}
if (c == "" ){
c = " ### " ;
}
// ==============
ShowWaitFun();
// ==============
var query;
var strProcss = a;
var strEmail = b;
var strOther = c;
var theCount = 0 ;
var theOldNumb = 0 ;
var ProcessNumb = 0 ;
var EmailNumb = 0 ;
var OtherNumb = 0 ;
var theShowResult = "" ;
var sLine = "" ;
var fso,f,r
var ForReading = 1 ,ForWriting = 2 ;
// -------------------------
try
{
fso = new ActiveXObject( " Scripting.FileSystemObject " )
f = fso.OpenTextFile(d, ForReading);
}
catch (e)
{
alert( " the file of the routine is not exist,please put in once more! " );
return false ;
}
// ----------------------------------------------
temp = " <html><title>Find the data</title><body> " ;
temp += " <input type='button' name='Submit1' id='Submit1' value='Hide First Field' οnclick='HidenTDF()' class='btn_mouseout'> | " ;
temp += " <input type='button' name='Submit2' id='Submit2' value='Hide Last Field' οnclick='HidenTDL()' class='btn_mouseout'> | " ;
temp += " <input type='button' name='Submit3' id='Submit3' value='Hide Header' οnclick='HideSomeInfo()' class='btn_mouseout'> | " ;
temp += " <input type='button' name='Submit4' id='Submit4' value='Hide Checked Row' οnclick='HidenTR()' class='btn_mouseout' onMouseover="this.className='btn_mouseover'" onMouseout="this.className='btn_mouseout'"> <hr> " ;
temp += " <table width='100%' border='1' cellpadding='0' cellspacing='0' bordercolorlight='#6699ff' bordercolordark='#6699ff' > " ;
temp += " <tr class='th' id='th'><td id='tdF' width='35'>Num</td><td align = 'center' onclick = 'gotoButtom()'> ----------- The content of the finding ----------- </td><td id='tdL' width='35' onclick = 'SetAllChecked()' align='right'>Num/<u>check</u></td></tr> "
while (sLine != null )
{
try
{
sLine = f.ReadLine();
if (sLine != null )
{
theOldNumb = theOldNumb + 1 ;
// 无论大小写,只要有,就为 true
var boolProcess = (sLine.indexOf(strProcss) > 0 || sLine.indexOf(strProcss.toLowerCase()) > 0 || sLine.indexOf(strProcss.toUpperCase()) > 0 );
var boolEmail = (sLine.indexOf(strEmail) > 0 || sLine.indexOf(strEmail.toLowerCase()) > 0 || sLine.indexOf(strEmail.toUpperCase()) > 0 );
var boolOther = (sLine.indexOf(strOther) > 0 || sLine.indexOf(strOther.toLowerCase()) > 0 || sLine.indexOf(strOther.toUpperCase()) > 0 );
/* ************************************************************************************* */
// 单个记录
if (selAnd == " And " )
{
if (strProcss == " ### " )
query = boolEmail && boolOther;
else if (strEmail == " ### " )
query = boolProcess && boolOther;
else if (strOther == " ### " )
query = boolProcess && boolEmail;
else
query = boolProcess && boolEmail && boolOther;
}
else
{
query = boolProcess || boolEmail || boolOther;
}
if (sLine.indexOf(strProcss.toLowerCase()) > 0 )
{ // 在一定的条件下 把[子进程号]包含当作条件
var theLeft = sLine.indexOf( " ( " ) + 1 ;
var theRirgh = sLine.indexOf( " ) " );
var subString = sLine.substring(theLeft,theRirgh);
if (subString.toLowerCase() == strProcss.toLowerCase() || subString == " 00000000 " )
{ }
else
{ subString = sLine.substring(theLeft,theRirgh); }
}
if (chkSub.checked) // 如果子进程复选框选中的话,条件中加入。。。
{
query = query || sLine.indexOf(subString) > 0 ;
}
if (query)
{ // 查看有没有要查找信息
theCount = theCount + 1 ;
if (boolProcess)
ProcessNumb = ProcessNumb + 1 ;
if (boolEmail)
EmailNumb = EmailNumb + 1 ;
if (boolOther)
OtherNumb = OtherNumb + 1 ;
temp += " <tr id='trId " + theCount + " ' οnmοuseοver="this.bgColor='#C4DFF7'" οnmοuseοut="this.bgColor='#ffffff'"> " ;
temp += " <td id='tdF'> " + theCount + " </td> " ;
temp += " <td> " + sLine + " </td> " ;
temp += " <td id='tdL' align='right'> " + theOldNumb + " " ;
temp += " <input type='checkbox' name='chkTr' value='checkbox'> " ;
temp += " </td> "
temp += " </tr> " ;
/* *** ==========For Test
if(theCount == 2)
{
var temp2 = "";
temp2 = "<tr id='trId"+ theCount +"' οnmοuseοver="this.bgColor='#C4DFF7'" οnmοuseοut="this.bgColor='#ffffff'">" ;
temp2 += "<td id='tdF"+ theCount +"'>" + theCount + "</td>";
temp2 += "<td>" + sLine + "</td>";
temp2 += "<td id='tdL"+ theCount +"'>" + theOldNumb +" ";
temp2 += "<input type='checkbox' name='chk"+ theCount + "' value='checkbox'" + "onChange = " HidenTR('trId" + theCount +"') ">"
temp2 += "</td>"
temp2 += "</tr>";
alert(temp2)
}
*****========== End */
}
}
}
catch (e)
{
break ;
}
}
theShowResult += " <strong><font color = '#FF0000'> " + ProcessNumb + " </font></strong> / " ;
theShowResult += " <strong><font color = '#0000FF'> " + EmailNumb + " </font></strong> / " ;
theShowResult += " <strong><font color = '#007744'> " + OtherNumb + " </font></strong> " ;
temp += " <tr id='thTail'><td id='tdF'>End</td><td id='tdTotal' align='left'><a name='#Buttom'>Total</a> <strong> " + theCount + " </strong> records " + theShowResult + " </td><td id='tdL'> </td></tr> " ;
temp += " </table> " ;
temp += " </body></html> " ;
if (theCount == 0 ) // theCount == 1 || theCount == 0
{
alert( " no record " );
return ;
}
temp = ReplaceStr2(temp, " TO: < " , " TO: " );
temp = ReplaceStr2(temp, " TO:< " , " TO: " );
temp = ReplaceStr2(temp, " to: < " , " TO: " );
temp = ReplaceStr2(temp, " to:< " , " TO: " );
temp = ReplaceStr2(temp, " To:< " , " TO: " );
temp = ReplaceStr2(temp, " FROM: < " , " FROM: " );
temp = ReplaceStr2(temp, " FROM:< " , " FROM: " );
temp = ReplaceStr2(temp, " from:< " , " from: " );
temp = ReplaceStr2(temp, " from: < " , " from: " );
temp = ReplaceStr(temp,strProcss, " #ff0000 " );
temp = ReplaceStr(temp,strProcss.toLowerCase(), " #ff0000 " );
temp = ReplaceStr(temp,strProcss.toUpperCase(), " #ff0000 " );
temp = ReplaceStr(temp,strEmail, " #0000ff " );
temp = ReplaceStr(temp,strEmail.toLowerCase(), " #0000ff " );
temp = ReplaceStr(temp,strEmail.toUpperCase(), " #0000ff " );
// other
temp = ReplaceStr(temp,strOther, " #007744 " );
temp = ReplaceStr(temp,strOther.toLowerCase(), " #007744 " );
temp = ReplaceStr(temp,strOther.toUpperCase(), " #007744 " );
// ---------------------------------------------
document.all.show.innerHTML = temp;
// ---------------------------------------------
}
function ShowWaitFun()
{
var theWait = document.getElementById( " DivWait " );
if (theWait.style.display != " block " )
{
theWait.style.display = " block " ;
}
setTimeout( " HideWaiting() " , 5000 );
}
function HideWaiting()
{
var theWait = document.getElementById( " DivWait " );
if (theWait.style.display == " block " )
theWait.style.display = " none " ;
}
/*
输入的原来字符串
要替换的
目标字符
*/
function ReplaceStr(inputStr,oldStr,colorStr)
{
var strReturn;
if (oldStr == "" )
return ;
re = new RegExp(oldStr, " g " );
var newStr = " <strong><font color = ' " + colorStr + " '><u> " + oldStr + " </u></font></strong> " ;
strReturn = inputStr.replace(re,newStr);
return strReturn;
}
function ReplaceStr2(inputStr,oldStr,newStr)
{
var strReturn;
if (oldStr == "" )
return ;
re = new RegExp(oldStr, " g " );
strReturn = inputStr.replace(re,newStr);
return strReturn;
}
function chkAddFun(a,b)
{
if (a.checked)
{
b.style.background = " #CCCCCC " ;
b.disabled = 1 ;
}
else
{
b.style.background = " #FFFFFF " ;
b.disabled = 0 ;
}
}
// 显示和不显示
function showAndInfo()
{
var temp = document.getElementById( " AndId " );
if (temp.style.display == " none " )
{
temp.style.display = " block " ;
}
else
{
temp.style.display = " none "
}
return ;
}
function setState()
{
var theSelValue = document.getElementById( " selAnd " ).value;
var temp = document.getElementById( " AndId " );
if (theSelValue == " And " )
{
temp.style.display = " block " ;
}
else
{
temp.style.display = " none " ;
}
}
// ================
function gotoButtom()
{
location.href = " #buttom " ;
return ;
}
// ===========
function HidenTR()
{
var temp;
var theTr
var objs = document.getElementsByName( " chkTr " )
for ( var i = 0 ;i < objs.length;i ++ )
{
if (objs[i].checked)
{
theTr = " trId " + (i + 1 );
temp = document.getElementById(theTr);
temp.style.display = " none " ;
}
}
}
function HidenTDF()
{
var temp;
var theTd
var objs = document.getElementsByName( " tdF " );
var theButton = document.getElementById( " Submit1 " );
if (theButton.value == " Hide First Field " )
theButton.value = " Show First Field " ;
else
theButton.value = " Hide First Field " ;
// alert(objs.length);
for ( var i = 0 ;i < objs.length;i ++ )
{
if (objs[i].style.display == " none " )
{
objs[i].style.display = " block " ;
// theButton.value = "Hide First Field";
}
else
{
objs[i].style.display = " none " ;
// theButton.value = "Show First Field";
}
}
}
function HidenTDL()
{
var temp;
var theTd
var objs = document.getElementsByName( " tdL " )
var theButton = document.getElementById( " Submit2 " );
if (theButton.value == " Hide Last Field " )
theButton.value = " Show Last Field " ;
else
theButton.value = " Hide Last Field " ;
// alert(objs.length);
for ( var i = 0 ;i < objs.length;i ++ )
{
if (objs[i].style.display == " none " )
{
objs[i].style.display = " block " ;
}
else
{
objs[i].style.display = " none " ;
}
}
}
function HideSomeInfo()
{
var objTh = document.getElementById( " th " );
var objTail = document.getElementById( " tdTotal " ); // tdTotal|thTail
var theButton = document.getElementById( " Submit3 " );
if (theButton.value == " Hide Header " )
theButton.value = " Show Header " ;
else
theButton.value = " Hide Header " ;
if (objTh.style.display == " none " )
{
objTh.style.display = " block " ;
objTail.style.display = " block " ;
}
else
{
objTh.style.display = " none " ;
objTail.style.display = " none " ;
}
}
function SetAllChecked()
{
var temp;
var theTr
var objs = document.getElementsByName( " chkTr " )
for ( var i = 0 ;i < objs.length;i ++ )
{
if (objs[i].checked)
objs[i].checked = false ;
else
objs[i].checked = true ;
}
}
</ script >
<!--
< link href = " CSS/styles.css " rel = " stylesheet " type = " text/css " >
< link href = " CSS/color.css " rel = " stylesheet " type = " text/css " >
-->
</ head >
< body id = " bodyNode " class = " bodyTop " onload = " setState() " >
< form name = " form1 " method = " post " action = " showInfo.asp " >
< table width = " 100% " border = " 1 " bordercolorlight = " #6699ff " bordercolordark = " #6699ff " cellpadding = " 0 " cellspacing = " 0 " class = " BlueBoldfont " >
< tr >
< td >
< div align = " left " >
< table border = " 0 " align = " left " cellpadding = " 0 " cellspacing = " 0 " >
< tr >
< td >& nbsp; </ td >
< td valign = " bottom " >==== SSBG Log Tracker ===== </ td >
</ tr >
</ table >
</ div ></ td >
</ tr >
< tr >
< td valign = " bottom " >
< div align = " center " > File path: < input type = " file " name = " txtPath " ></ div > </ td >
</ tr >
< tr >
< td >
< table width = " 100% " border = " 0 " cellpadding = " 0 " cellspacing = " 0 " >
< tr >
< td width = " 8% " >< div align = " right " > Course: </ div ></ td >
< td width = " 21% " >
< input name = " txtProcess " type = " text " id = " txtProcess " size = " 18 " >
< input name = " chkSub " id = " chkSub " type = " checkbox " value = "" > sub
</ td >
< td width = " 8% " >< div align = " right " > Email: </ div ></ td >
< td width = " 21% " >< input name = " txtEmail " type = " text " id = " txtEmail2 " size = " 18 " ></ td >
< td width = " 6% " >< div align = " right " > Other: </ div ></ td >
< td >< input name = " txtOther " type = " text " id = " txtOther2 " size = " 18 " ></ td >
< td >
< div align = " left " >
Mode:
< select name = " selAnd " id = " selAnd " onChange = " showAndInfo(this.value) " >
< option value = " Or " selected > Or </ option >
< option value = " And " > And </ option >
</ select >
</ div >
</ td >
< td >& nbsp; </ td >
< td width = " 8% " >< input type = " button " name = " Submit " class = " btn_mouseout " value = " Query " onClick = " GetAimInfo(this.form.txtProcess.value,this.form.txtEmail.value,this.form.txtOther.value,this.form.txtPath.value,this.form.selAnd.options[selAnd.selectedIndex].text,this.form.chkSub) " ></ td >
</ tr >
</ table >
</ td >
</ tr >
</ tr >
</ table >
< br >
< table width = " 100% " border = " 0 " cellspacing = " 0 " cellpadding = " 0 " >
< tr class = " BlueBoldfont " >
< td colspan = " 2 " >< div align = " left " >< strong > [Note]: </ strong > If the date is big,it might take around 30 secords. Best uses the IE browser. </ div >
</ td >
</ tr >
< tr class = " BlueBoldfont " >
< td width = " 77% " > < div id = " DivWait " style = " display:none; " >& nbsp; & nbsp; & nbsp; & nbsp; Please waiting...... </ div ></ td >
< td width = " 23% " >< div id = " AndId " >
< div align = " right " >< font color = " #007744 " > " And " needs 2 conditions. </ font ></ div >
</ div ></ td >
</ tr >
</ table >
< br >
< div id = " show " style = " display:block; " ></ div >
</ form >
</ body >
< style >
body {
background - image: url( " IMAGES/images_content/01.gif " );
background - repeat:no - repeat;
FONT - FAMILY: Arial, Helvetica, sans - serif;
FONT - SIZE: 12px;
text - decoration: none;
color:# 000000 ;
BACKGROUND - COLOR:#FFFFFF;
line - height: 20px;
SCROLLBAR - ARROW - COLOR: black;
SCROLLBAR - FACE - COLOR: #ffffff;
SCROLLBAR - HIGHLIGHT - COLOR: #acacac;
SCROLLBAR - SHADOW - COLOR: #acacac;
SCROLLBAR - 3DLIGHT - COLOR: #ffffff;
SCROLLBAR - TRACK - COLOR: #f8f8f8;
SCROLLBAR - DARKSHADOW - COLOR: #ffffff;
border - top - style: none;
border - bottom - style: none;
background - attachment: fixed;
border - right - style: none;
border - left - style: none;
margin - right: 5px;
margin - left: 5px;
margin - bottom: 5px;
margin - top: 5px;
overflow:auto;
}
input{
height:18px
}
.BlueBoldfont{
font - size: 12px;
color: # 003366 ;
font - weight:bold;
}
.BrownBoldfont{
font - size: 12px;
color:# 993300 ;
font - weight:bold;
}
.BlackBoldfont{
font - size: 12px;
color:# 000000 ;
font - weight:bold;
}
p {
font - size: 12px;
text - align: left;
}
table{
border - collapse: collapse;
margin: 0px;
padding: 0px;
border: 0 ;
}
.tbShow{
border - collapse: collapse;
padding: 0px;
cellpadding:0px;
cellspacing:1px;
border - collapse:collapse;
border: #6699ff;
width: 100 % ;
}
.th {
FILTER:progid:DXImageTransform.Microsoft.Gradient(GradientType = 0 , StartColorStr = #FFFFFF, EndColorStr = #4898DB);
font - size: 12px;
text - align: center;
white - space: pre;
font - weight: normal;
color:
line - height: 200 % ;
}
.td {
border - color:#6699ff;
white - space: pre;
}
.total {
white - space: pre;
background - color: bccbe0;
}
.tdHigh {
border - color:#6699ff;
white - space: pre;
padding - top: 5px;
padding - bottom: 5px;
}
td {
font - size: 12px;
padding - left: 2px;
}
.myInput{
BACKGROUND - COLOR: #fffff1;
color:# 000000 ;
background - image: 01 .gif;
BORDER - BOTTOM: #006cb5 1px solid;
BORDER - LEFT: #006cb5 1px solid;
BORDER - RIGHT: #006cb5 1px solid;
BORDER - TOP:#006cb5 1px solid;
HEIGHT: 18px;
font - size: 12px;
cursor: hand;
}
select{
BACKGROUND - COLOR: #ffffff;
color:# 000000 ;
background - image: none;
BORDER - BOTTOM: #006cb5 1px solid;
BORDER - LEFT: #006cb5 1px solid;
BORDER - RIGHT: #006cb5 1px solid;
BORDER - TOP:#006cb5 1px solid;
HEIGHT: 18px;
font - size: 12px;
cursor: hand;
}
Input{
BACKGROUND - COLOR: #ffffff;
color:# 000000 ;
background - image: none;
BORDER - BOTTOM: #006cb5 1px solid;
BORDER - LEFT: #006cb5 1px solid;
BORDER - RIGHT: #006cb5 1px solid;
BORDER - TOP:#006cb5 1px solid;
HEIGHT: 18px;
font - size: 12px;
cursor: hand;
}
.tbInput {
white - space: pre;
border - collapse: collapse;
padding: 0px;
cellpadding:0px;
cellspacing:1px;
}
hr {
height: 1px;
width: 98 % ;
color:#6699ff;
}
table {
text - align: left;
}
.btn {
BORDER - RIGHT: #7b9ebd 1px solid; PADDING - RIGHT: 2px; BORDER - TOP: #7b9ebd 1px solid;
PADDING - LEFT: 2px; FONT - SIZE: 12px; FILTER: progid:DXImageTransform.Microsoft.Gradient
(GradientType = 0 , StartColorStr = #ffffff, EndColorStr = #cecfde); BORDER - LEFT: #7b9ebd 1px
solid; CURSOR: hand; COLOR: black; PADDING - TOP: 2px; BORDER - BOTTOM: #7b9ebd 1px solid;
}
.btn_mouseout {
BORDER - RIGHT: #3399FF 1px solid; PADDING - RIGHT: 2px; BORDER - TOP: #3399FF 1px solid;
PADDING - LEFT: 2px; FONT - SIZE: 12px; FILTER: progid:DXImageTransform.Microsoft.Gradient
(GradientType = 0 , StartColorStr = #ffffff, EndColorStr = #9EBFEA); BORDER - LEFT: #3399FF 1px
solid; CURSOR: hand; COLOR: black; PADDING - TOP: 2px; BORDER - BOTTOM: #3399FF 1px solid
}
.btn_mouseover {
BORDER - RIGHT: # 000000 1px solid; PADDING - RIGHT: 2px; BORDER - TOP: # 000000 1px solid;
PADDING - LEFT: 2px; FONT - SIZE: 12px; FILTER: progid:DXImageTransform.Microsoft.Gradient
(GradientType = 0 , StartColorStr = #ffffff, EndColorStr = #CCDDF4); BORDER - LEFT: # 000000 1px
solid; CURSOR: hand; COLOR: black; PADDING - TOP: 2px; BORDER - BOTTOM: # 000000 1px solid
}
</ style >
</ html >