<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("cansetnews")="" Then
	ef=True
	ec="您没有此操作的权限。"
ElseIf RegExpTest("[^A-Za-z0-9]",Request("username")) Then
	ef=True
	ec="用户名中有非法字符！"	
ElseIf RegExpTest("[^A-Za-z0-9]",Replace(Request("forwhat"),".","")) Then
	ef=True
	ec="原因只能输入非中文,如ftp用户名等！"		
ElseIf not IsDate(Request("starttime1")) and Request("starttime1")<>""  Then
	ef=True
	ec="请输入合法的日期！"
ElseIf not IsDate(Request("endtime1")) and Request("endtime1")<>""  Then
	ef=True
	ec="请输入合法的日期！"
ElseIf not IsDate(Request("starttime2")) and Request("starttime2")<>""  Then
	ef=True
	ec="请输入合法的日期！"
ElseIf not IsDate(Request("endtime2")) and Request("endtime2")<>""  Then
	ef=True
	ec="请输入合法的日期！"	
End if

if not ef then%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html8")%>
<%=htmlwrite("html9")%>
<script language="javascript">
//配置 颜色
var TodayColor="#ADD8E6";  //当天背景
var DefaultColor="#FFD700"; //默认背景
<!-- 
document.writeln('<div id=meizzDateLayer style="position: absolute; width: 142; height: 166; z-index: 9998; display: none">'); 
document.writeln('<span id=tmpSelectYearLayer style="z-index: 9999;position: absolute;top: 2; left: 18;display: none"></span>'); 
document.writeln('<span id=tmpSelectMonthLayer style="z-index: 9999;position: absolute;top: 2; left: 75;display: none"></span>'); 
document.writeln('<table id=table1 border=0 cellspacing=1 cellpadding=0 width=142 height=160 onselectstart="return false">'); 
document.writeln(' <tr><td id=td1><table border=0 cellspacing=1 cellpadding=0 width=140 height=23>'); 
document.writeln('   <tr align=center><td id=td2'); 
document.writeln('    onclick="meizzPrevM()" title="向前翻　月" Author=meizz><b Author=meizz><<</b></td>'); 
document.writeln('    <td width=100 align=center style="font-size:12px;cursor:default" Author=meizz>'); 
document.writeln('    <span Author=meizz id=meizzYearHead onclick="tmpSelectYearInnerHTML(this.innerText)"></span> 年 <span'); 
document.writeln('     id=meizzMonthHead Author=meizz onclick="tmpSelectMonthInnerHTML(this.innerText)"></span> 月</td>'); 
document.writeln('    <td id=td3'); 
document.writeln('     onclick="meizzNextM()" title="往后翻　月" Author=meizz><b Author=meizz>>></b></td></tr>'); 
document.writeln('  </table></td></tr>'); 
document.writeln(' <tr><td id=td4 width=142 height=18>'); 
document.writeln('<table border=0 cellspacing=0 cellpadding=0 width=140 height=1 style="cursor:default">'); 
document.writeln('<tr align=center><td id=td5 Author=meizz>日</td>'); 
document.writeln('<td id=td6 Author=meizz>一</td><td id=td7 Author=meizz>二</td>'); 
document.writeln('<td id=td8 Author=meizz>三</td><td id=td9 Author=meizz>四</td>'); 
document.writeln('<td id=td10 Author=meizz>五</td><td id=td11 Author=meizz>六</td></tr>'); 
document.writeln('</table></td></tr>'); 
document.writeln(' <tr><td width=142 height=120>'); 
document.writeln('  <table id=table4 border=0 cellspacing=1 cellpadding=0 width=140 height=120>'); 
var n=0; for (j=0;j<5;j++){ document.writeln (' <tr align=center>'); for (i=0;i<7;i++){ 
document.writeln('<td width=20 height=20 id=meizzDay'+n+' style="font-size:12px" Author=meizz onclick=meizzDayClick(this.innerText)></td>');n++;} 
document.writeln('</tr>');} 
document.writeln('   <tr align=center><td width=20 height=20 style="font-size:12px" id=meizzDay35 Author=meizz '); 
document.writeln('     onclick=meizzDayClick(this.innerText)></td>'); 
document.writeln('    <td width=20 height=20 style="font-size:12px" id=meizzDay36 Author=meizz onclick=meizzDayClick(this.innerText)></td></tr>'); 
document.writeln('  </table></td></tr><tr><td>'); 
document.writeln('    <table id=table2 border=0 cellspacing=1 cellpadding=0 width=100%>'); 
document.writeln('     <tr><td Author=meizz align=left><input Author=meizz type=button value="<<" title="向前翻　年" onclick="meizzPrevY()" '); 
document.writeln('       onfocus="this.blur()" style="font-size: 12px; height: 20px"><input Author=meizz title="向前翻　月" type=button '); 
document.writeln('       value="<" onclick="meizzPrevM()" onfocus="this.blur()" style="font-size: 12px; height: 20px"></td><td '); 
document.writeln('       Author=meizz align=center><input Author=meizz type=button value=今天 onclick="meizzToday()" '); 
document.writeln('       onfocus="this.blur()" title="转到今天的日期" style="font-size: 12px; height: 20px"></td><td '); 
document.writeln('       Author=meizz align=right><input Author=meizz type=button value=">" onclick="meizzNextM()" '); 
document.writeln('       onfocus="this.blur()" title="往后翻　月" style="font-size: 12px; height: 20px"><input '); 
document.writeln('       Author=meizz type=button value=">>" title="往后翻　年" onclick="meizzNextY()"'); 
document.writeln('       onfocus="this.blur()" style="font-size: 12px; height: 20px"></td>'); 
document.writeln('</tr></table></td></tr></table></div>');　

//==================================================== WEB 页面显示部分 ====================================================== 
var outObject; 
function setday(tt,obj) //主调函数 
{ 
  if (arguments.length > 2){alert("对不起！传入本控件的参数太多！");return;} 
  if (arguments.length == 0){alert("对不起！您没有传回本控件任何参数！");return;} 
  var dads = document.all.meizzDateLayer.style;var th = tt; 
  var ttop = tt.offsetTop;   //TT控件的定位点高 
  var thei = tt.clientHeight; //TT控件本身的高 
  var tleft = tt.offsetLeft;  //TT控件的定位点宽 
  var ttyp = tt.type;     //TT控件的类型 
  while (tt = tt.offsetParent){ttop+=tt.offsetTop; tleft+=tt.offsetLeft;} 
  dads.top = (ttyp=="image")? ttop+thei : ttop+thei+6; 
  dads.left = tleft; 
  outObject = (arguments.length == 1) ? th : obj; 
  dads.display = ''; 
  event.returnValue=false; 
}　 

var MonHead = new Array(12);        //定义阳历中每个月的最大天数 
   MonHead[0] = 31; MonHead[1] = 28; MonHead[2] = 31; MonHead[3] = 30; MonHead[4] = 31; MonHead[5] = 30; 
   MonHead[6] = 31; MonHead[7] = 31; MonHead[8] = 30; MonHead[9] = 31; MonHead[10] = 30; MonHead[11] = 31;　 

var meizzTheYear=new Date().getFullYear(); //定义年的变量的初始值 
var meizzTheMonth=new Date().getMonth()+1; //定义月的变量的初始值 
var meizzWDay=new Array(37);        //定义写日期的数组　 

function document.onclick() //任意点击时关闭该控件 
{ 
  with(window.event.srcElement) 
  { if (tagName != "INPUT" && getAttribute("Author")==null) 
   document.all.meizzDateLayer.style.display="none"; 
  } 
}　 

function meizzWriteHead(yy,mm) //往 head 中写入当前的年与月 
  { document.all.meizzYearHead.innerText = yy; 
   document.all.meizzMonthHead.innerText = mm; 
  }　 

function tmpSelectYearInnerHTML(strYear) //年份的下拉框 
{ 
  if (strYear.match(/\D/)!=null){alert("年份输入参数不是数字！");return;} 
  var m = (strYear) ? strYear : new Date().getFullYear(); 
  if (m < 1000 || m > 9999) {alert("年份值不在 1000 到 9999 之间！");return;} 
  var n = m - 10; 
  if (n < 1000) n = 1000; 
  if (n + 26 > 9999) n = 9974; 
  var s = "<select Author=meizz name=tmpSelectYear style='font-size: 12px' " 
   s += "onblur='document.all.tmpSelectYearLayer.style.display=\"none\"' " 
   s += "onchange='document.all.tmpSelectYearLayer.style.display=\"none\";" 
   s += "meizzTheYear = this.value; meizzSetDay(meizzTheYear,meizzTheMonth)'>\r\n"; 
  var selectInnerHTML = s; 
  for (var i = n; i < n + 26; i++) 
  { 
   if (i == m) 
    {selectInnerHTML += "<option value='" + i + "' selected>" + i + "年" + "</option>\r\n";} 
   else {selectInnerHTML += "<option value='" + i + "'>" + i + "年" + "</option>\r\n";} 
  } 
  selectInnerHTML += "</select>"; 
  document.all.tmpSelectYearLayer.style.display=""; 
  document.all.tmpSelectYearLayer.innerHTML = selectInnerHTML; 
  document.all.tmpSelectYear.focus(); 
}　 

function tmpSelectMonthInnerHTML(strMonth) //月份的下拉框 
{ 
  if (strMonth.match(/\D/)!=null){alert("月份输入参数不是数字！");return;} 
  var m = (strMonth) ? strMonth : new Date().getMonth() + 1; 
  var s = "<select Author=meizz name=tmpSelectMonth style='font-size: 12px' " 
   s += "onblur='document.all.tmpSelectMonthLayer.style.display=\"none\"' " 
   s += "onchange='document.all.tmpSelectMonthLayer.style.display=\"none\";" 
   s += "meizzTheMonth = this.value; meizzSetDay(meizzTheYear,meizzTheMonth)'>\r\n"; 
  var selectInnerHTML = s; 
  for (var i = 1; i < 13; i++) 
  { 
   if (i == m) 
    {selectInnerHTML += "<option value='"+i+"' selected>"+i+"月"+"</option>\r\n";} 
   else {selectInnerHTML += "<option value='"+i+"'>"+i+"月"+"</option>\r\n";} 
  } 
  selectInnerHTML += "</select>"; 
  document.all.tmpSelectMonthLayer.style.display=""; 
  document.all.tmpSelectMonthLayer.innerHTML = selectInnerHTML; 
  document.all.tmpSelectMonth.focus(); 
}　 

function closeLayer()        //这个层的关闭 
  { 
   document.all.meizzDateLayer.style.display="none"; 
  }　 

function document.onkeydown() 
  { 
   if (window.event.keyCode==27)document.all.meizzDateLayer.style.display="none"; 
  }　 

function IsPinYear(year)      //判断是否年 
  { 
   if (0==year%4&&((year%100!=0)||(year%400==0))) return true;else return false; 
  }　 

function GetMonthCount(year,month) //闰年二月为29天 
  { 
   var c=MonHead[month-1];if((month==2)&&IsPinYear(year)) c++;return c; 
  }　 

function GetDOW(day,month,year)   //求某天的星期几 
  { 
   var dt=new Date(year,month-1,day).getDay()/7; return dt; 
  }　 

function meizzPrevY() //往前翻 Year 
  { 
   if(meizzTheYear > 999 && meizzTheYear <10000){meizzTheYear--;} 
   else{alert("年份超出范围（1000-9999）！");} 
   meizzSetDay(meizzTheYear,meizzTheMonth); 
  } 
function meizzNextY() //往后翻 Year 
  { 
   if(meizzTheYear > 999 && meizzTheYear <10000){meizzTheYear++;} 
   else{alert("年份超出范围（1000-9999）！");} 
   meizzSetDay(meizzTheYear,meizzTheMonth); 
  } 
function meizzToday() //Today Button 
  { 
   meizzTheYear = new Date().getFullYear(); 
   meizzTheMonth = new Date().getMonth()+1; 
   meizzSetDay(meizzTheYear,meizzTheMonth); 
  } 
function meizzPrevM() //往前翻月份 
  { 
   if(meizzTheMonth>1){meizzTheMonth--}else{meizzTheYear--;meizzTheMonth=12;} 
   meizzSetDay(meizzTheYear,meizzTheMonth); 
  } 
function meizzNextM() //往后翻月份 
  { 
   if(meizzTheMonth==12){meizzTheYear++;meizzTheMonth=1}else{meizzTheMonth++} 
   meizzSetDay(meizzTheYear,meizzTheMonth); 
  }　 

function meizzSetDay(yy,mm)  //主要的写程序********** 
{ 
  meizzWriteHead(yy,mm); 
  for (var i = 0; i < 37; i++){meizzWDay[i]=""}; //将显示框的内容全部清空 
  var day1 = 1,firstday = new Date(yy,mm-1,1).getDay(); //某月第一天的星期几 
  for (var i = firstday; day1 < GetMonthCount(yy,mm)+1; i++){meizzWDay[i]=day1;day1++;} 
  for (var i = 0; i < 37; i++) 
  { var da = eval("document.all.meizzDay"+i)   //书写新的一个月的日期星期排列 
   if (meizzWDay[i]!="") 
    { da.innerHTML = "<b>" + meizzWDay[i] + "</b>"; 
     da.style.backgroundColor = (yy == new Date().getFullYear() && 
     mm == new Date().getMonth()+1 && meizzWDay[i] == new Date().getDate()) ? DefaultColor : TodayColor; 
     da.style.cursor="hand" 
    } 
   else{da.innerHTML="";da.style.backgroundColor="";da.style.cursor="default"} 
  } 
} 
function meizzDayClick(n) //点击显示框选取日期，主输入函数************* 
{ 
  var yy = meizzTheYear; 
  var mm = meizzTheMonth; 
  if (mm < 10){mm = "0" + mm;} 
  if (outObject) 
  { 
   if (!n) {outObject.value=""; return;} 
   if ( n < 10){n = "0" + n;} 
   outObject.value= yy + "-" + mm + "-" + n ; //注：在这里您可以输出改成您想要的格式 
   closeLayer(); 
  } 
  else {closeLayer(); alert("您所要输出的控件对象并不存在！");} 
} 
meizzSetDay(meizzTheYear,meizzTheMonth); 
// --> 
    </script>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0 background="img/midtop4.gif">
  <TBODY>
    <TR>
      <TD width=53 align="left" background="img/midtop1.gif" onClick="ShowDtable(1,6)"><strong> 　 </strong><font color="#FFFFFF">─<strong>&gt;</strong></font> </TD>
      <TD width="83"><table height="59"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="7" background="img/midtop.gif">&nbsp;</td>
            <td width="60" align="center" valign="middle" background="img/r3.jpg" style="FONT-WEIGHT: bolder; Cursor:hand"    id="tableTop1"> <a href="showlog.asp"><font color="#FFFFFF">系统记录</font></a><br></td>
            <td width="5" background="img/midtop2.gif">&nbsp;</td>
          </tr>
      </table></TD>
      <TD width="83">&nbsp;</TD>
      <TD width="83">&nbsp;</TD>
      <TD width="83" align="left">&nbsp;</TD>
      <TD width="83" align="left">&nbsp;</TD>
      <TD align="left">&nbsp;</TD>
      <TD width=23 align="right"><IMG height=59 
                  src="img/rtop4.jpg" 
                  width=19></TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0>
  <TBODY>
    <TR>
      <TD width=19 background="img/midlef.gif"  id=rightid>&nbsp;</TD>
      <TD height="462" align="center" vAlign=top background="contopa.gif" bgcolor="#FFFFFF">
错误信息的说明请参考：
<a href="http://sys.7i24.com/support/freehost/error/" target="_blank">http://sys.7i24.com/support/freehost/error/</a><br>
<br>
<form name="form1" method="get" action="showlog.asp">
  用户名：
  <input name="username" type="text" id="username" size="10" maxlength="14">
  或
  开始时间：
<input name="starttime1" type="text" onfocus="setday(this)" style="WIDTH:80px">
结束时间：
<input name="starttime2" type="text" onfocus="setday(this)" style="WIDTH:80px">


或原因:
<input name="forwhat" type="text" id="forwhat" size="10" maxlength="50">
<input type="submit" name="Submit" value="查找">

<a href="showlog.asp?adm=yes">只显示管理员的操作&gt;&gt;&gt;&gt;</a>
</form>
<br>
<br>
<%
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dslogin = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_oplog where "
	
if Request.QueryString ("username")<>"" then Sql=Sql+"username= '"&trim(Request.QueryString ("username"))&"' and "
if Request.QueryString ("starttime2") <>"" then  Sql=Sql+" logintime>'"&Request.QUERYSTRING ("starttime1")&"' and logintime<'"&Request.QUERYSTRING ("starttime2")&"' and "

if Request.QueryString ("forwhat") <>"" then  Sql=Sql+" forwhat like '%"&Request.QUERYSTRING ("forwhat")&"%' and "

if Request.QueryString ("adm")="yes" then Sql="Select * from FreeHost.FreeHost_oplog WHERE  exists(select 1 from FreeHost.FreeHost_Admuser where FreeHost.FreeHost_oplog.username=FreeHost.FreeHost_Admuser.superuser) order by id desc"  
 
if right(sql,5)=" and " then sql=left(sql,len(sql)-5)&" order by id desc"
if right(SQL,6)="where " then  SQL="Select * from FreeHost.FreeHost_oplog order by id desc"
	
	dslogin.PageSize = 25
	dslogin.Open Sql,conn,1,1
%>
<%
if dslogin.Eof then
%>
<br>
数据库中不存在系统操作的记录。
<%
else
if Request.ServerVariables("QUERY_STRING")<>"" then
ask=Split(Request.ServerVariables("QUERY_STRING"), chr(38)&"pn")
else
ask=Split("freehost=1", "")
ask(0)="freehost=lsoft"
end if
	pn=1
if Request.QueryString ("pn")<>"" then pn=Request.QueryString ("pn")
If dslogin.RecordCount <> 0 Then dslogin.AbsolutePage = CLng(pn)  
    if clng(pn)<=10 then
    begini=1
      if dslogin.PageCount<=10 then
       endini=dslogin.PageCount 
       else
       endini=10
      end if
    end if
%>
<%if clng(pn)<=10 then%>
最新
<%for i=begini to endini
    if clng(pn)=i then%>
<font color=red>[<%=i%>]</font>
<%else%>
<a href="?<%=ask(0)%>&pn=<%=i%>"><font color="#000000">[<%=i%>]</font></a>
<%end if%>
　
<%next%>
<%else%>
　
<a href="?<%=ask(0)%>&pn=1"><font color="#000000">最新[1]--[10]</font></a>　　现在是第<font color=red>[<%=pn%>]</font>页 　共<%=dslogin.PageCount%>页　
        <%end if%>
        <%If Clng(pn)>1 Then%>
        <a href="?<%=ask(0)%>&pn=<%=pn-1%>"><font color="#000000">上一页</font></a>
        <%End If%>
        |
        <%If Clng(pn)<dslogin.PageCount Then%>
        <a href="?<%=ask(0)%>&pn=<%=pn+1%>"><font color="#000000">下一页</font></a>
        <%End If%>
        <table width="98%"  border="0" cellspacing="1" bgcolor="#CCCCCC">
          <tr bgcolor="#C1BFBF">
            <td width="30" align="center">编号</td>
            <td width="8%" align="center" bgcolor="#C1BFBF">用户名</td>
            <td width="30" align="center" bgcolor="#C1BFBF">分类</td>
            <td width="20%" align="center" bgcolor="#C1BFBF">时间</td>
            <td width="16%" align="center" bgcolor="#C1BFBF">IP</td>
            <td align="center" bgcolor="#C1BFBF">原因</td>
          </tr>
          <%
For N=1 To dslogin.PageSize 
					If dslogin.RecordCount=0 Then Exit For
%>
          <tr bgcolor="#FFFFFF">
            <td width="30" align="center"><%=dslogin("id")%></td>
            <td width="8%" align="center" bgcolor="#FFFFFF"><a href="searchuser.asp?username=<%=dslogin("username")%>"><%=dslogin("username")%></a></td>
            <td width="30" align="center" bgcolor="#FFFFFF"><%if dslogin("type1")="失败" then%>
                <font color=black>
                <%end  if%>
                <%=dslogin("type1")%>
                <%if dslogin("type1")="失败" then%>
                </font>
            <%end  if%></td>
            <td width="20%" align="center" bgcolor="#FFFFFF"><%=dslogin("logintime")%><br>
            </td>
            <td width="16%" align="center" bgcolor="#FFFFFF"><%=dslogin("ip")%> </td>
            <td align="center" bgcolor="#FFFFFF"><%if instr(dslogin("forwhat"),"users deleted") then%>删除成功<%else%><%=replace(lcase(dslogin("forwhat")),"script","")%><%end if%></td>
          </tr>
          <%
If clng(pn)=dslogin.PageCount Then
I = dslogin.RecordCount - (dslogin.PageCount-1) * dslogin.PageSize
If N=I Then Exit For
End If
dslogin.movenext
Next%>
        </table>
        <%
end if
dslogin.close
set dslogin=nothing%>
        <br>

	  
</TD>
      <TD width=18 background="img/midri.gif">&nbsp;</TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
    <TR>
      <TD width=30><IMG height=19 
                  src="img/rb1.jpg" 
                  width=30></TD>
      <TD 
                background=img/rb2.jpg>&nbsp;</TD>
      <TD width=30><IMG height=19 
                  src="img/rb3.jpg" 
                  width=30></TD>
    </TR>
  </TBODY>
</TABLE>
<%=htmlwrite("html10")%>
<%
end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
