?? login_log.php
字號:
<?php
session_start();
include "middle.php";
include "../datasource.inc.php";
$date = Date("Y-m-j");
include "../MessageBox.php";
$Message = new MessageBox;
$page = $_REQUEST['page'];
if ($_SESSION["userjs"]=='0' and $_REQUEST['page']=='delete') {
$query = "delete from logs where id='$_REQUEST[id]';";
mysql_query($query);
$Message->setMessage("刪除成功!","login_log.php");
$Message->showMessage();
}
if ($_SESSION["userjs"]=='0' and $_REQUEST['page']=='deleteall') {
$query = "delete from logs;";
$result = mysql_query($query);
$num = mysql_num_rows($result);
$Message->setMessage("刪除成功!","login_log.php");
$Message->showMessage();
}
if ( !empty($_SESSION["userid"]) ) {
?>
<link href="../css/a1.css" rel="stylesheet" type="text/css">
<body leftmargin="0" topmargin="0">
<table width="789" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><img src="../images/home_12.jpg" width="789" height="12"></td>
</tr>
<tr>
<td width="776" valign="top">
<table width="560" border="0" cellspacing="0" cellpadding="0">
<tr>
<TD vAlign=top><FONT color=#565656> <IMG height=14
src="../images/closedfold.gif" width=14> 您當前的位置<BR> <IMG
height=15 src="../images/bar.gif" width=15> <IMG height=14
src="../images/openfold.gif" width=14> 查看登錄日記文件</FONT></TD>
</tr>
</table>
<table widtd=766 border=0 cellspacing=0 cellpadding=0 align="right">
<tr>
<td width=766 height=1 bgcolor=#3494d4></td>
</tr>
</table><br>
<div align="right"><a href=login_log.php?page=deleteall onclick="return confirm('是否確定刪除此記錄')">清空全部登陸日記文件</a></div>
<?php
$sql= "select * from logs order by id desc";
$result=mysql_query($sql);
$num = mysql_num_rows($result);
if ( $num > 0 ) {
$last = intval(($num-1)/20)+1; //A
if ( $page < 1 ) $page=1;
if ( $page > $last ) $page=$last;
mysql_data_seek($result,($page-1)*20); //A
echo "<center><br>";
echo "<table border=0 cellpadding=0 cellspacing=0 width=766>";
echo "<tr><td width=10> </td>";
echo "<td><table border=0 cellpadding=0 cellspacing=1 bgcolor=#3494d4 width=766>";
echo "<tr height=24 bgColor=#3494d4>";
echo "<td width=60 align=center><font color=#ffffff><b>序號</b></font></td>";
echo "<td width=220 align=center><font color=#ffffff><b>登錄人<b></font></td>";
echo "<td width=226 align=center><font color=#ffffff><b>登錄時間</b></font></td>";
echo "<td width=220 align=center><font color=#ffffff><b>IP地址</b></font></td>";
echo "<td width=40 align=center><font color=#ffffff><b>刪除</b></font></td>";
echo "</tr>";
for ($i=1;$i<=20;$i++) {
$row=mysql_fetch_array($result);
if ($row['id']) {
echo "<tr height=22 bgColor=#ffffff>";
echo "<td width=60 align=center>$row[id]</td>";
echo "<td width=220 align=center>$row[username]</td>";
echo "<td width=226 align=center>$row[logintime]</td>";
echo "<td width=220 align=center>$row[ipaddress]</td>";
echo "<td width=40 align=center><a title=點擊刪除內容 href=login_log.php?page=delete&id=$row[id] onclick=\"return confirm('是否確定刪除此記錄')\"><img src=../images/clearicon.gif border=0></a></td>";
echo "</tr>";
}
}
echo "</table></td></table><br>";
echo "總共找到<font color=red>$num</font>條記錄共,第<font color=red>$page</font>頁,共<font color=red>$last</font>頁。";
echo "<table width=776 border=0 cellspacing=0 cellpadding=0 height=24 >";
echo "<tbody>";
echo "<tr>";
if ( $page <> 1 ) {
echo "<td align=center> <a href=login_log.php?page=1>第一頁</a></td>";
echo "<td align=center><a href=login_log.php?page=".($page-1).">上一頁</a></td>";
}
if ( $page <> $last ) {
echo "<td align=center><a href=login_log.php?page=".($page+1).">下一頁</a></td>";
echo "<td align=center><a href=login_log.php?page=$last>最后一頁</a></td>";
}
echo "</tbody>";
echo "</tr>";
echo "</table><br>";
echo "</center>";
} else {
echo "<br><center>對不起,目前沒有登錄日記!</center>";
}
} else {
header("Location:../index.php");
exit();
}
?>
</td>
<td width="13" align="right" background="../images/home_16.jpg" height=457> </td>
</tr>
<tr>
<td height="8" colspan="2" valign="top" width=789><img src="../images/home_24.jpg" width="789"></td>
</tr>
</table>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -