<!--#include virtual="/incs/config.asp"-->
<% chk_log()%>
<%
Chk_newpwr 4,15,1
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
perpage=SafeRequest("perpage")
if chk_int(perpage)=false then
perpage=20
end if 
perpage=clng(perpage)
if perpage>=100 then
perpage=100
end if
ThePage=0
page=0
rcount=0
thepage=0
''''''''''''''''''''''''''''''''''
k_wrds=trim(SafeRequest("k_wrds"))
k_tpe=trim(SafeRequest("k_tpe"))
k_mod=trim(SafeRequest("k_mod"))
if  k_wrds<>"" and instr(k_wrds,"'")<=0 then
if k_mod="moda" then
keywords=" and l_"&k_tpe&"='"&k_wrds&"'"
else
keywords=" and l_"&k_tpe&" like '%"&k_wrds&"%'"
end if

end if
''''''''''''''''''''''''''''''''''
t_str1=trim(SafeRequest("t_str1"))
t_str2=trim(SafeRequest("t_str2"))
if t_str1<>"" and t_str2<>"" then
if ((not chk_tme(t_str1)) and (not chk_tme(t_str2))) or instr(t_str1,"-")<=0 or instr(t_str2,"-")<=0 then
call errorpage(-2,"对不起，时间格式不正确!")
end if
timestrings=" and (l_addtme>='"&t_str1&"' and l_addtme<='"&t_str2&"')"
end if
''''''''''''''''''''''''''''''''''''''
odr1=trim(SafeRequest("odr1"))
odr2=trim(SafeRequest("odr2"))
if odr1="" or odr2="" then
odr1="a_ifok_a"
odr2="b_addtme_d"
end if
order1="l_"&right(odr1,len(odr1)-2)
aff_a=left(order1,len(order1)-2)
if right(order1,1)="a" then
order1=left(order1,len(order1)-2)
else
order1=left(order1,len(order1)-2)&" desc"
end if
order2="l_"&right(odr2,len(odr2)-2)
aff_b=left(order2,len(order2)-2)
if right(order2,1)="a" then
order2=left(order2,len(order2)-2)
else
order2=left(order2,len(order2)-2)&" desc"
end if


if aff_a=aff_b then
orderstring=order1
else
orderstring=order1&","&order2
end if

''''''''''''''''''''''
query="select * from lgnlst where 1=1 "&keywords&timestrings&" order by "&orderstring
conn.open constr
rs.open query,conn,1,1
if rs.RecordCount<=0 then
          ErrMsg="<font color=#ff0000>对不起</font>，没有搜索到符合条件的记录！..."
		
	   else
	      rcount=rs.recordcount
	      rs.pagesize=perpage
		  ThePage=rs.pagecount
		  if Chk_Int(SafeRequest("page"))=false then
		  page=1
		  else
		   page=cint(SafeRequest("page"))
		    if page<=0  then
		       page=1
		    elseif page>ThePage then
		       page=ThePage
		    end if	  
		  end if
		    rs.absolutepage=page
       end if   

%>
<!--#include virtual="/incs/top.asp"-->
<script language="javascript">
<!--

function tofirst()
{searchform.page.value=1;
searchform.submit();
 }
  function toprev()
{searchform.page.value-=1;
searchform.submit();
 }
  function tonext()
{
searchform.page.value=<%=page%>-1+2;
searchform.submit();
 }
  function tolast()
{searchform.page.value=<%=ThePage%>;
searchform.submit();
 }
 function toorder(ordn)
{searchform.odr1.value=ordn;
searchform.page.value=1;
searchform.submit();
 }
function ifdel(lid)
{
if(confirm("是否确认删除该登录记录?"))
location.href="log_mng.asp?module=log_del&perpage=<%=SafeRequest("perpage")%>&page=<%=SafeRequest("page")%>&k_wrds=<%=SafeRequest("k_wrds")%>&k_tpe=<%=SafeRequest("k_tpe")%>&k_mod=<%=SafeRequest("k_mod")%>&odr1=<%=SafeRequest("odr1")%>&odr2=<%=SafeRequest("odr2")%>&t_str1=<%SafeRequest("t_str1")%>&t_str2=<%SafeRequest("t_str2")%>&lid="+lid;
}
function delall()
{
if(confirm("是否确认删除?"))
document.log_frm.submit();
}

function checkAll()
  {
    for (var i=0;i<document.log_frm.elements.length;i++)
    {
      var e = document.log_frm.elements[i];
      var boolValue = document.log_frm.selectAll.checked;
      if (e.name != 'selectAll')
	  {
        e.checked = boolValue;
	  }
    }
  }
 //-->
 </script>
<table cellspacing=2 cellpadding=0 width="100%" border=0>
  <tbody> 
  <tr> 
    <td  colspan=2 valign="middle"> 
      <table class=line cellspacing=0 cellpadding=0 width="100%" 
                  border=0 align="center">
        <tbody> 
        <tr> 
          <td valign=bottom width="25%" height=20><font color="#000000" class=ddropshadow><b><span class=enbold><strong>登录日志</strong></span></b></font></td>
          <td valign=bottom noWrap align=right 
                        width="75%">&nbsp;</td>
        </tr>
        <tr> 
          <td align=middle width="100%" colspan=2 height=5></td>
        </tr>
        <tr> 
          <td align=middle width="100%" colspan=2 height=2 class=menuline></td>
        </tr>
        </tbody> 
      </table>
      <br>
    </td>
  </tr>
  <tr> 
    <td  colspan=2 valign="middle" height="28"> 
      <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tbody> 
        <form action=log_lst.asp method=post name=searchform2>
          <tr> 
            <td height=20 width="119">&nbsp;共计 <b> <%=rcount%> </b>条记录 </td>
            <td height=20> 
              <div align="center"> 
                <input type=hidden name=k_tpe value="<%=k_tpe%>">
                <input type=hidden name=k_mod value="<%=k_mod%>">
                <input type=hidden name=k_wrds value="<%=k_wrds%>">
                <input type=hidden name=t_str1 value="<%=t_str1%>">
                <input type=hidden name=t_str2 value="<%=t_str2%>">
                <input type=hidden name=odr1 value="<%=odr1%>">
                <input type=hidden name=odr2 value="<%=odr2%>">
                <input type=hidden name=perpage value="<%=perpage%>"><%=page_turn%><input type=button name=deldall value="删 除" class=btxx onclick="javascript: delall();">
              </div>
            </td>
            <td height=20 width="120"> 
              <div align="right">转第 
                <select name="page" onChange="javascript:document.searchform2.submit();">
                  <option selected value=<%=page%>><%=page%></option>
                  <%
				   for i=1 to thepage
				   response.write "<option value="&i&">"&i&"</option>"
				   next
				   %>
                </select>
                页</div>
            </td>
          </tr>
        </form>
        </tbody> 
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height=8></td>
        </tr>
      </table>
      <%
				  if right(odr1,2)="_d" then
				  odr1_1="a_unme_a"
				  odr1_2="a_agt_a"
				  odr1_3="a_addtme_a"
				  odr1_4="a_prv_a"
				  odr1_5="a_ip_a"
				  odr1_6="a_vs_a"
				  odr1_7="a_dot_a"
				  odr1_8="a_ifok_a"
				  else
				  odr1_1="a_unme_d"
				  odr1_2="a_agt_d"
				  odr1_3="a_addtme_d"
				  odr1_4="a_prv_d"
				  odr1_5="a_ip_d"
				  odr1_6="a_vs_d"
				  odr1_7="a_dot_d"
				  odr1_8="a_ifok_d"
				  end if
				  %>
      <table border=0 cellpadding=0 
                        cellspacing=0  align="center" width="100%" bgcolor="#666666" class=datalist>
        <tbody> 
        <form action=log_mng.asp method=post name=log_frm>
          <tr > 
            <th height="20" width="6%" align=center class=datalistheader> 序号 </th>
            <th width="5%" align=center class=datalistheader> 
              <input type="checkbox" NAME="selectAll" onClick="return checkAll();" value="ON">
            </th>
            <th width="9%" align=center class=datalistheader><a class=commonface  href="javascript:toorder('<%=odr1_1%>');" title="登录名称"><b>用户名</b></a> 
              <input type="hidden" NAME="module"  value="log_delall">
            </th>
            <th align=center width="9%" class=datalistheader><a class=commonface href="javascript:toorder('<%=odr1_2%>');" title="是否为管理人员切换登录"><b>代理</b></a></th>
            <th width="15%"  align=center class=datalistheader><a class=commonface  href="javascript:toorder('<%=odr1_3%>');" title="登录时间"><b>发生时间</b></a></th>
            <th width="9%" align=center  class=datalistheader><a class=commonface  href="javascript:toorder('<%=odr1_4%>');" title="所属省份"><b>地区</b></a></th>
            <th width="12%" align=center class=datalistheader><a class=commonface  href="javascript:toorder('<%=odr1_5%>');" title="IP地址"><b>IP地址</b></a></th>
            <th width="12%" align=center class=datalistheader><a class=commonface  href="javascript:toorder('<%=odr1_6%>');" title="浏览器类型"><b>浏览器</b></a></th>
            <th width="9%" align=center class=datalistheader><a class=commonface  href="javascript:toorder('<%=odr1_7%>');" title="浏览器分辨率"><b>分辨率</b></a></th>
            <th width="6%"  align=center class=datalistheader><a  class=commonface href="javascript:toorder('<%=odr1_8%>');" title="是否登录成功"><b>状态</b></a></th>
          </tr>
          <%
		  i=1
	Do While Not rs.eof 
if i mod 2=1 then
classstl="datalistgrida"
else
classstl="datalistgridb"
end if
	%>
          <tr > 
            <td height="20"  align=center class=<%=classstl%> ><%=i+perpage*(page-1)%></td>
            <td   align=center  class=<%=classstl%>> 
              <input type="checkbox" name="delid" value="<%=rs("l_id")%>">
            </td>
            <td   align=center  class=<%=classstl%>><a class=commonface href="javascript:showurl('/master/memmng/mem_dtl.asp?unme=<%=rs("l_unme")%>');" ><b><%=trim(rs("l_unme"))%></b></a></td>
            <td   align=center  class=<%=classstl%>><a class=commonface href="javascript:showurl('/master/memmng/mem_dtl.asp?unme=<%=rs("l_agt")%>');" ><%=rs("l_agt")%></a>&nbsp; 
            </td>
            <td   align=center  class=<%=classstl%>> <%=trim(rs("l_addtme"))%> 
            <td   align=center  class=<%=classstl%>><%=trim(rs("l_prv"))%></td>
            <td  align=center  class=<%=classstl%>><%=trim(rs("l_ip"))%> </td>
            <td  align=center  class=<%=classstl%>> <%=trim(rs("l_vs"))%> </td>
            <td  align=center  class=<%=classstl%>> <%=trim(rs("l_dot"))%> </td>
            <td   align=center  class=<%=classstl%>> 
              <%
			if rs("l_ifok")=1 then
			response.write "<font class=wordline>成功</a>"
			else
			response.write "<font color=#ff0000><u>失败</u></font>"
			end if 
			 %>
            </td>
          </tr>
          <%
  rs.movenext
i=i+1
if i>perpage then
exit do
end if

  loop 
  	rs.close
	conn.close
  %>
        </form>
        </tbody> 
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height=8></td>
        </tr>
      </table>
      <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tbody> 
        <form action=log_lst.asp method=post name=searchform>
          <tr> 
            <td height=20 width="120">&nbsp;共计 <b> <%=rcount%> </b>条记录 </td>
            <td height=20> 
              <div align="center"> 
                <input type=hidden name=k_tpe value="<%=k_tpe%>">
                <input type=hidden name=k_mod value="<%=k_mod%>">
                <input type=hidden name=k_wrds value="<%=k_wrds%>">
                <input type=hidden name=t_str1 value="<%=t_str1%>">
                <input type=hidden name=t_str2 value="<%=t_str2%>">
                <input type=hidden name=odr1 value="<%=odr1%>">
                <input type=hidden name=odr2 value="<%=odr2%>">
                <input type=hidden name=perpage value="<%=perpage%>"><%=page_turn%><input type=button name=delall2 value="删除" class=btxx  onclick="javascript: delall();">
              </div>
            </td>
            <td height=20 width="120"> 
              <div align="right">转第 
                <select class=normalform name="page" onChange="javascript:document.searchform.submit();">
                  <option selected value=<%=page%>><%=page%></option>
                  <%
				   for i=1 to thepage
				   response.write "<option value="&i&">"&i&"</option>"
				   next
				   %>
                </select>
                页</div>
            </td>
          </tr>
        </form>
        </tbody> 
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height=8></td>
        </tr>
      </table>
      <div align="center"><br>
        <b>搜索功能</b> <br>
        <br>
      </div>
      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class=datalist>
        <form action="log_lst.asp" method=post name="frm_qry">
          <tr align="center"> 
            <th height="20" class=datalistheader width="30%">关键字</th>
            <th class=datalistheader width="25%">时间(yyyy-mm-dd)</th>
            <th class=datalistheader width="20%">排序</th>
            <th class=datalistheader width="10%">条/页</th>
            <th class=datalistheader>查询</th>
          </tr>
          <tr align="center"> 
            <td height="20" class=datalistgridb> 
              <select name="k_tpe"  class=normalform>
                <option value="unme">用户</option>
                <option value="prv">地区</option>
                <option value="ip">IP地址</option>
                <option value="agt">代理</option>
              </select>
              <select name="k_mod" class=normalform>
                <option value="moda" <% if k_mod="moda" then
						  response.write " selected"
						  end if %>>等于</option>
                <option value="modb"  <% if k_mod="modb" then
						  response.write " selected"
						  end if %>>类似</option>
              </select>
              <input name="k_wrds" type="text" size="12" maxlength="50" value="<%=k_wrds%>" class=normalform>
            </td>
            <td  class=datalistgridb> 
              <input name="t_str1" type="text" size="10" maxlength="10" value="<%=t_str1%>" class=normalform>
              到 
              <input name="t_str2" type="text" size="10" maxlength="10" value="<%=t_str2%>" class=normalform>
            </td>
            <td  class=datalistgridb> 
              <select name="odr1"  class=normalform>
                <option value="a_unme_a" <%if odr1="a_unme_a" then
				response.write " selected "
				end if %>>用户名顺</option>
                <option value="a_unme_d" <%if odr1="a_unme_d" then
				response.write " selected "
				end if %>>用户名倒</option>
                <option value="a_agt_a" <%if odr1="a_agt_a" then
				response.write " selected "
				end if %>>代理顺</option>
                <option value="a_agt_d" <%if odr1="a_agt_d" then
				response.write " selected "
				end if %>>代理倒</option>
                <option value="a_addtme_a" <%if odr1="a_addtme_a" then
				response.write " selected "
				end if %>>时间顺</option>
                <option value="a_addtme_d" <%if odr1="a_addtme_d" then
				response.write " selected "
				end if %>>时间倒</option>
                <option value="a_prv_a" <%if odr1="a_prv_a" then
				response.write " selected "
				end if %>>地区顺</option>
                <option value="a_prv_d" <%if odr1="a_prv_d" then
				response.write " selected "
				end if %>>地区倒</option>
                <option value="a_ip_a" <%if odr1="a_ip_a" then
				response.write " selected "
				end if %>>IP顺</option>
                <option value="a_ip_d" <%if odr1="a_ip_d" then
				response.write " selected "
				end if %>>IP倒</option>
                <option value="a_vs_a" <%if odr1="a_vs_a" then
				response.write " selected "
				end if %>>浏览器顺</option>
                <option value="a_vs_d" <%if odr1="a_vs_d" then
				response.write " selected "
				end if %>>浏览器倒</option>
                <option value="a_dot_a" <%if odr1="a_dot_a" then
				response.write " selected "
				end if %>>分辨率顺</option>
                <option value="a_dot_d" <%if odr1="a_dot_d" then
				response.write " selected "
				end if %>>分辨率倒</option>
                <option value="a_ifok_a" <%if odr1="a_ifok_a" then
				response.write " selected "
				end if %>>状态顺</option>
                <option value="a_ifok_d" <%if odr1="a_ifok_d" then
				response.write " selected "
				end if %>>状态倒</option>
              </select>
              <select name="odr2"  class=normalform>
                <option value="b_unme_a" <%if odr2="b_unme_a" then
				response.write " selected "
				end if %>>用户名顺</option>
                <option value="b_unme_d" <%if odr2="b_unme_d" then
				response.write " selected "
				end if %>>用户名倒</option>
                 <option value="b_agt_a" <%if odr2="b_agt_a" then
				response.write " selected "
				end if %>>代理顺</option>
                <option value="b_agt_d" <%if odr2="b_agt_d" then
				response.write " selected "
				end if %>>代理倒</option>
               <option value="b_addtme_a" <%if odr2="b_addtme_a" then
				response.write " selected "
				end if %>>时间顺</option>
                <option value="b_addtme_d" <%if odr2="b_addtme_d" then
				response.write " selected "
				end if %>>时间倒</option>
                <option value="b_prv_a" <%if odr2="b_prv_a" then
				response.write " selected "
				end if %>>地区顺</option>
                <option value="b_prv_d" <%if odr2="b_prv_d" then
				response.write " selected "
				end if %>>地区倒</option>
                <option value="b_ip_a" <%if odr2="b_ip_a" then
				response.write " selected "
				end if %>>IP顺</option>
                <option value="b_ip_d" <%if odr2="b_ip_d" then
				response.write " selected "
				end if %>>IP倒</option>
                <option value="b_vs_a" <%if odr2="b_vs_a" then
				response.write " selected "
				end if %>>浏览器顺</option>
                <option value="b_vs_d" <%if odr2="b_vs_d" then
				response.write " selected "
				end if %>>浏览器倒</option>
                <option value="b_dot_a" <%if odr2="b_dot_a" then
				response.write " selected "
				end if %>>分辨率顺</option>
                <option value="b_dot_d" <%if odr2="b_dot_d" then
				response.write " selected "
				end if %>>分辨率倒</option>
                <option value="b_ifok_a" <%if odr2="b_ifok_a" then
				response.write " selected "
				end if %>>状态顺</option>
                <option value="b_ifok_d" <%if odr2="b_ifok_d" then
				response.write " selected "
				end if %>>状态倒</option>
              </select>
            </td>
            <td  class=datalistgridb> 
              <input name="perpage" type="text" size="4" maxlength="4" value="<%=perpage%>"  class=normalform>
            </td>
            <td  class=datalistgridb> 
              <input type="submit" name="Submit" value="查 询" class=btxx>
            </td>
          </tr>
        </form>
      </table>
      <br>
      注：您仅能删除3天前的登录日志！ </td>
  </tr>
  </tbody> 
</table>
<br>
<br>
<br>
<br>
<!--#include virtual="/incs/bottom.asp"-->

