query("delete from {$dbtbpre}enewslog where loginid='$loginid'"); if($sql) { //操作日志 insert_dolog("loginid=".$loginid); printerror("DelLogSuccess","ListLog.php".hReturnEcmsHashStrHref2(1)); } else { printerror("DbError","history.go(-1)"); } } //批量删除日志 function DelLog_all($loginid,$userid,$username){ global $empire,$dbtbpre; //验证权限 CheckLevel($userid,$username,$classid,"log"); $count=count($loginid); if(!$count) { printerror("NotDelLogid","history.go(-1)"); } for($i=0;$i<$count;$i++) { $add.=" loginid='".intval($loginid[$i])."' or"; } $add=substr($add,0,strlen($add)-3); $sql=$empire->query("delete from {$dbtbpre}enewslog where".$add); if($sql) { //操作日志 insert_dolog(""); printerror("DelLogSuccess","ListLog.php".hReturnEcmsHashStrHref2(1)); } else { printerror("DbError","history.go(-1)"); } } //日期删除日志 function DelLog_date($add,$userid,$username){ global $empire,$dbtbpre; //验证权限 CheckLevel($userid,$username,$classid,"log"); $start=RepPostVar($add['startday']); $end=RepPostVar($add['endday']); if(!$start||!$end) { printerror('EmptyDelLogTime',''); } $startday=$start.' 00:00:00'; $endday=$end.' 23:59:59'; $sql=$empire->query("delete from {$dbtbpre}enewslog where logintime<='$endday' and logintime>='$startday'"); if($sql) { //操作日志 insert_dolog("time=".$start."~".$end); printerror("DelLogSuccess","ListLog.php".hReturnEcmsHashStrHref2(1)); } else { printerror("DbError","history.go(-1)"); } } //补零 function ToAddDateZero($n){ if($n<10) { $n='0'.$n; } return $n; } //返回日期 function ReturnLogSelectDate($y,$m,$d){ //年 if(empty($y)) { $y=date("Y"); } for($i=2003;$i<=$thisyear+1;$i++) { $selected=''; if($i==$y) { $selected=' selected'; } $r['year'].=""; } //月 if(empty($m)) { $m=date("m"); } for($i=1;$i<=12;$i++) { $selected=''; $mi=ToAddDateZero($i); if($mi==$m) { $selected=' selected'; } $r['month'].=""; } //日 if(empty($d)) { $d=date("d"); } for($i=1;$i<=31;$i++) { $selected=''; $di=ToAddDateZero($i); if($di==$d) { $selected=' selected'; } $r['day'].=""; } return $r; } $enews=$_POST['enews']; if(empty($enews)) {$enews=$_GET['enews'];} if($enews) { hCheckEcmsRHash(); } //删除日志 if($enews=="DelLog") { $loginid=$_GET['loginid']; DelLog($loginid,$logininid,$loginin); } //批量删除日志 elseif($enews=="DelLog_all") { $loginid=$_POST['loginid']; DelLog_all($loginid,$logininid,$loginin); } elseif($enews=="DelLog_date") { DelLog_date($_POST,$logininid,$loginin); } $line=20;//每页显示条数 $page_line=18;//每页显示链接数 $page=(int)$_GET['page']; $page=RepPIntvar($page); $start=0; $offset=$page*$line;//总偏移量 $query="select loginid,username,loginip,logintime,status,password,loginauth,ipport from {$dbtbpre}enewslog"; $totalquery="select count(*) as total from {$dbtbpre}enewslog"; //搜索 $search=''; $search.=$ecms_hashur['ehref']; $where=''; if($_GET['sear']==1) { $search.="&sear=1"; $a=''; $and=''; //状态 $status=(int)$_GET['status']; if($status) { if($status==1) { $a.="status=1"; } else { $a.="status=0"; } $search.="&status=$status"; } //时间 $startday=RepPostVar($_GET['startday']); $endday=RepPostVar($_GET['endday']); if($startday&&$endday) { $and=$a?' and ':''; $search.="&startday=$startday&endday=$endday"; $a.=$and."logintime<='".$endday." 23:59:59' and logintime>='".$startday." 00:00:00'"; } //搜索 $keyboard=RepPostVar($_GET['keyboard']); if($keyboard) { $and=$a?' and ':''; $show=RepPostStr($_GET['show'],1); if($show==1) { $a.=$and."username like '%$keyboard%'"; } elseif($show==2) { $a.=$and."loginip like '%$keyboard%'"; } else { $a.=$and."(username like '%$keyboard%' or loginip like '%$keyboard%')"; } $search.="&keyboard=$keyboard&show=$show"; } if($a) { $where.=" where ".$a; } $query.=$where; $totalquery.=$where; } $search2=$search; //排序 $mydesc=(int)$_GET['mydesc']; $desc=$mydesc?'asc':'desc'; $orderby=(int)$_GET['orderby']; if($orderby==1)//登陆用户 { $order="username ".$desc.",loginid desc"; $usernamedesc=$mydesc?0:1; } elseif($orderby==2)//状态 { $order="status ".$desc.",loginid desc"; $statusdesc=$mydesc?0:1; } elseif($orderby==3)//登陆IP { $order="loginip ".$desc.",loginid desc"; $loginipdesc=$mydesc?0:1; } elseif($orderby==4)//登陆时间 { $order="logintime ".$desc.",loginid desc"; $logintimedesc=$mydesc?0:1; } else//ID { $order="loginid ".$desc; $loginiddesc=$mydesc?0:1; } $search.="&orderby=$orderby&mydesc=$mydesc"; $num=$empire->gettotal($totalquery);//取得总条数 $query=$query." order by ".$order." limit $offset,$line"; $sql=$empire->query($query); $returnpage=page2($num,$line,$page_line,$start,$page,$search); ?> 管理登陆日志
位置:日志管理 > 管理登陆日志

时间从 ,关键字:
fetch($sql)) { if($r['status']) { $status='登陆成功'; } else { $status=$r['loginauth']?'认证码错':'密码错'; } ?> >
删除
:
     选中全部
删除从 之间的日志