2 /****************************************************************/
\r
4 /****************************************************************/
\r
5 /* Copyright (c) 2002-2008 by Greg Gay & Joel Kronenberg */
\r
6 /* Adaptive Technology Resource Centre / University of Toronto */
\r
7 /* http://atutor.ca */
\r
9 /* This program is free software. You can redistribute it and/or*/
\r
10 /* modify it under the terms of the GNU General Public License */
\r
11 /* as published by the Free Software Foundation. */
\r
12 /****************************************************************/
\r
15 define('AT_INCLUDE_PATH', '../../include/');
\r
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
\r
17 admin_authenticate(AT_ADMIN_PRIV_ADMIN);
\r
19 require(AT_INCLUDE_PATH.'header.inc.php');
\r
21 $operations[AT_ADMIN_LOG_UPDATE] = _AT('update_to');
\r
22 $operations[AT_ADMIN_LOG_DELETE] = _AT('delete_from');
\r
23 $operations[AT_ADMIN_LOG_INSERT] = _AT('insert_into');
\r
24 $operations[AT_ADMIN_LOG_REPLACE] = _AT('replace_into');
\r
25 $operations[AT_ADMIN_LOG_OTHER] = _AT('other');
\r
28 if (isset($_GET['login']) && $_GET['login']) {
\r
29 $_GET['login'] = $addslashes($_GET['login']);
\r
31 $login_where = ' WHERE login=\''.$_GET['login'].'\'';
\r
34 $sql = "SELECT COUNT(login) FROM ".TABLE_PREFIX."admin_log $login_where";
\r
35 $result = mysql_query($sql, $db);
\r
37 if (($row = mysql_fetch_assoc($result))==0) {
\r
38 echo '<tr><td colspan="7" class="row1">'._AT('no_log_found_').'</td></tr>';
\r
39 require(AT_INCLUDE_PATH.'footer.inc.php');
\r
43 $num_results = $row[0];
\r
44 $results_per_page = 50;
\r
45 $num_pages = max(ceil($num_results / $results_per_page), 1);
\r
46 $page = intval($_GET['p']);
\r
50 $count = (($page-1) * $results_per_page) + 1;
\r
52 echo '<div class="paging">';
\r
54 for ($i=1; $i<=$num_pages; $i++) {
\r
57 echo '<a class="current" href="'.$_SERVER['PHP_SELF'].'?p='.$i.SEP.'login='.$_GET['login'].'"><em>'.$i.'</em></a>';
\r
59 echo '<a href="'.$_SERVER['PHP_SELF'].'?p='.$i.SEP.'login='.$_GET['login'].'#list">'.$i.'</a>';
\r
66 $offset = ($page-1)*$results_per_page;
\r
68 $sql = "SELECT * FROM ".TABLE_PREFIX."admin_log $login_where ORDER BY `time` DESC LIMIT $offset, $results_per_page";
\r
69 $result = mysql_query($sql, $db);
\r
71 <table summary="" class="data" rules="cols" align="center">
\r
74 <th scope="col"><?php echo _AT('date'); ?></th>
\r
75 <th scope="col"><?php echo _AT('login_name'); ?></th>
\r
76 <th scope="col"><?php echo _AT('action'); ?></th>
\r
77 <th scope="col"><?php echo _AT('database_table'); ?></th>
\r
81 <?php if (mysql_num_rows($result) > 0) : ?>
\r
82 <?php while ($row = mysql_fetch_assoc($result)): ?>
\r
84 <tr onmousedown="document.location='<?php echo AT_BASE_HREF; ?>admin/admins/detail_log.php?offset=<?php echo $offset.SEP.'p='.$page.SEP.'login='.$_GET['login']; ?>'" title="<?php echo _AT('view_details'); ?>">
\r
85 <td><a href="<?php echo AT_BASE_HREF; ?>admin/admins/detail_log.php?offset=<?php echo $offset.SEP.'p='.$page.SEP.'login='.$_GET['login']; ?>"><?php echo $row['time']; ?></a></td>
\r
86 <td><?php echo $row['login']; ?></td>
\r
87 <td><?php echo $operations[$row['operation']]; ?></td>
\r
88 <td><?php echo $row['table']; ?></td>
\r
93 <td colspan="4"><?php echo _AT('none_found'); ?></td>
\r
99 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>