[ Index ] |
|
Code source de CMS made simple 1.0.5 |
1 <?php 2 #CMS - CMS Made Simple 3 #(c)2004 by Ted Kulp (wishy@users.sf.net) 4 #This project's homepage is: http://cmsmadesimple.sf.net 5 # 6 #This program is free software; you can redistribute it and/or modify 7 #it under the terms of the GNU General Public License as published by 8 #the Free Software Foundation; either version 2 of the License, or 9 #(at your option) any later version. 10 # 11 #This program is distributed in the hope that it will be useful, 12 #but WITHOUT ANY WARRANTY; without even the implied warranty of 13 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 #GNU General Public License for more details. 15 #You should have received a copy of the GNU General Public License 16 #along with this program; if not, write to the Free Software 17 #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 # 19 #$Id: adminlog.php 3602 2006-12-20 21:44:04Z silmarillion $ 20 21 $CMS_ADMIN_PAGE=1; 22 23 require_once ("../include.php"); 24 25 check_login(); 26 27 include_once ("header.php"); 28 29 global $gCms; 30 $db =& $gCms->GetDb(); 31 32 $userid = get_userid(); 33 $access = check_permission($userid, 'Clear Admin Log'); 34 35 if (isset($_GET['clear']) && $access) { 36 $query = "DELETE FROM ".cms_db_prefix()."adminlog"; 37 $db->Execute($query); 38 echo $themeObject->ShowMessage(lang('adminlogcleared')); 39 } 40 41 $page = 1; 42 if (isset($_GET['page']))$page = $_GET['page']; 43 44 $result = $db->Execute("SELECT * FROM ".cms_db_prefix()."adminlog ORDER BY timestamp DESC"); 45 $totalrows = $result->RecordCount(); 46 47 $limit = 20; 48 $page_string = ""; 49 $from = ($page * $limit) - $limit; 50 51 $result = $db->SelectLimit('SELECT * from '.cms_db_prefix().'adminlog ORDER BY timestamp DESC', $limit, $from); 52 53 echo '<div class="pagecontainer">'; 54 echo '<div class="pageoverflow">'; 55 56 if ($result && $result->RecordCount() > 0) { 57 $page_string = pagination($page, $totalrows, $limit); 58 echo "<p class=\"pageshowrows\">".$page_string."</p>"; 59 echo $themeObject->ShowHeader('adminlog').'</div>'; 60 61 echo "<table cellspacing=\"0\" class=\"pagetable\">\n"; 62 echo '<thead>'; 63 echo "<tr>\n"; 64 echo "<th>".lang('user')."</th>\n"; 65 echo "<th>".lang('itemid')."</th>\n"; 66 echo "<th>".lang('itemname')."</th>\n"; 67 echo "<th>".lang('action')."</th>\n"; 68 echo "<th>".lang('date')."</th>\n"; 69 echo "</tr>\n"; 70 echo '</thead>'; 71 echo '<tbody>'; 72 73 $currow = "row1"; 74 75 while ($row = $result->FetchRow()) { 76 77 echo "<tr class=\"$currow\" onmouseover=\"this.className='".$currow.'hover'."';\" onmouseout=\"this.className='".$currow."';\">\n"; 78 echo "<td>".$row["username"]."</td>\n"; 79 echo "<td>".($row["item_id"]!=-1?$row["item_id"]:" ")."</td>\n"; 80 echo "<td>".$row["item_name"]."</td>\n"; 81 echo "<td>".$row["action"]."</td>\n"; 82 echo "<td>".date("D M j, Y G:i:s", $row["timestamp"])."</td>\n"; 83 echo "</tr>\n"; 84 85 ($currow == "row1"?$currow="row2":$currow="row1"); 86 87 } 88 89 echo '</tbody>'; 90 echo '</table>'; 91 92 } 93 else { 94 echo '<p class="pageheader">'.lang('adminlog').'</p></div>'; 95 echo '<p>'.lang('adminlogempty').'</p>'; 96 } 97 98 if ($access && $result && $result->RecordCount() > 0) { 99 echo '<div class="pageoptions">'; 100 echo '<p class="pageoptions">'; 101 echo '<a href="adminlog.php?clear=true">'; 102 echo $themeObject->DisplayImage('icons/system/delete.gif', lang('delete'),'','','systemicon').'</a>'; 103 echo '<a class="pageoptions" href="adminlog.php?clear=true">'.lang('clearadminlog').'</a>'; 104 echo '</p>'; 105 echo '</div>'; 106 } 107 108 echo '</div>'; 109 110 echo '<p class="pageback"><a class="pageback" href="'.$themeObject->BackUrl().'">« '.lang('back').'</a></p>'; 111 112 113 include_once ("footer.php"); 114 115 # vim:ts=4 sw=4 noet 116 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Tue Apr 3 18:50:37 2007 | par Balluche grâce à PHPXref 0.7 |