2 /****************************************************************/
\r
4 /****************************************************************/
\r
5 /* Copyright (c) 2002-2010 */
\r
6 /* Inclusive Design Institute */
\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 require(AT_INCLUDE_PATH.'header.inc.php');
\r
19 <table class="data static" rules="cols" summary="">
\r
22 <th scope="col"><?php echo _AT('page'); ?></th>
\r
23 <th scope="col"><?php echo _AT('visits'); ?></th>
\r
24 <th scope="col"><?php echo _AT('duration'); ?></th>
\r
25 <th scope="col"><?php echo _AT('last_accessed'); ?></th>
\r
30 $sql = "SELECT content_id, COUNT(*) AS unique_hits, SUM(counter) AS total_hits, SEC_TO_TIME(SUM(duration)/SUM(counter)) AS average_duration, SEC_TO_TIME(SUM(duration)) AS total_duration, last_accessed FROM ".TABLE_PREFIX."member_track WHERE course_id=$_SESSION[course_id] AND member_id=$_SESSION[member_id] GROUP BY content_id ORDER BY total_hits DESC";
\r
32 $result = mysql_query($sql, $db);
\r
34 if (mysql_num_rows($result) > 0) {
\r
35 while ($row = mysql_fetch_assoc($result)) {
\r
36 if ($row['total'] == '') {
\r
37 $row['total'] = _AT('na');
\r
41 echo '<td><a href='.AT_BASE_HREF.url_rewrite('content.php?cid='.$row['content_id']). '>' . $contentManager->_menu_info[$row['content_id']]['title'] . '</a></td>';
\r
42 echo '<td>' . $row['total_hits'] . '</td>';
\r
43 echo '<td>' . $row['total_duration'] . '</td>';
\r
44 if ($row['last_accessed'] == '') {
\r
45 echo '<td>' . _AT('na') . '</td>';
\r
47 echo '<td>' . AT_date(_AT('forum_date_format'), $row['last_accessed'], AT_DATE_MYSQL_DATETIME) . '</td>';
\r
55 echo '<tr><td colspan="4">' . _AT('none_found') . '</td></tr>';
\r
61 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>