2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
9 /* This program is free software. You can redistribute it and/or*/
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /****************************************************************/
13 if (!defined('AT_INCLUDE_PATH')) { exit; }
15 // NOTE: this script should not be altered. its use will soon be deprecated.
18 //how many content pages are in this course
19 $sql25 = "SELECT content_id from ".TABLE_PREFIX."content where course_id = $_SESSION[course_id]";
20 $result29 = mysql_query($sql25, $db);
21 $num_rows_total = mysql_num_rows($result29);
22 //get the title for each content_id
28 ".TABLE_PREFIX."content C
30 course_id='$_SESSION[course_id]'";
31 if(!$result7 = mysql_query($sql7, $db)){
32 echo AT_ERRORS_GENERAL;
33 require(AT_INCLUDE_PATH.'footer.inc.php');
36 $title_refs = array();
37 while ($row= mysql_fetch_array($result7)) {
38 $title_refs[$row['content_id']] = $row['title'];
42 $sql2 = "SELECT * from ".TABLE_PREFIX."g_click_data where member_id = $_SESSION[member_id] AND course_id = $_SESSION[course_id]";
43 $result28 = mysql_query($sql2, $db);
45 echo '<br /><h3>'._AT('tracker_summary_read', $this_user[$_SESSION["member_id"]]).'</h3>';
46 echo '<a href="'.$_SERVER['PHP_SELF'].'#not_viewed"><img src="images/clr.gif" border="0" alt="'._AT('tracker_not_viewed').'"/></a>';
48 echo '<table class="data static" rules="cols" summary="">';
52 echo '<th>' . _AT('page') . '</th>';
53 echo '<th>' . _AT('visits') . '</th>';
54 echo '<th>' . _AT('duration_sec') . '</th>';
59 while ($row2= mysql_fetch_array($result28)){
60 $duration[$row2['to_cid']] = ($duration[$row2['to_cid']] + $row2['duration']);
61 $visits[$row2['to_cid']] = ($visits[$row2['to_cid']] +1);
64 $sql= "SELECT DISTINCT to_cid from ".TABLE_PREFIX."g_click_data where member_id = $_SESSION[member_id] AND course_id = $_SESSION[course_id]";
65 $result27 = mysql_query($sql, $db);
66 $viewed_page = array();
70 while ($row = mysql_fetch_array($result27)) {
72 $viewed_pages[$row['to_cid']] = $title_refs[$row['to_cid']];
73 $num_rows_read = ($num_rows_read +1);
75 if ($title_refs[$row['to_cid']] !='') {
78 echo '<a href="./index.php?cid='.$row['to_cid'].'">';
79 echo $title_refs[$row['to_cid']].'</a></td><td align="center" class="row1"> '.$visits[$row['to_cid']].' </td><td align="center" class="row1"> '.number_format($duration[$row['to_cid']]);
86 if(count($viewed_pages) > 0){
87 foreach($viewed_pages as $key1 => $refs1){
88 $viewed_page_keys[$key1] = $key1;
90 foreach($title_refs as $key => $ref){
91 if(!in_array($key, $viewed_page_keys)){
92 $missed_pages .= ' <li><a href="./index.php?cid='.$key.SEP.'g=36">'.$ref.'</a></li>';
96 echo '<tr><td>'._AT('tracker_none_viewed').'</td></tr>';
99 if ($num_rows_read < 1) {
104 echo '<td>'._AT('tracker_pages_total', $num_rows_total, $num_rows_read).'</td>';
107 if ($num_rows_total) {
108 $per_cent = number_format((($num_rows_read/$num_rows_total)*100),1);
111 echo '<td>' . _AT('tracker_percent_read',$per_cent) . '%</td>';
116 echo '<a name="not_viewed"></a>';
118 echo '<br /><hr /><br /><h3>'._AT('unvisited_pages').'</h3>';
119 echo '<div class="results">';
121 // show which pages have not been viewed yet
127 echo _AT('tracking_all_page_viewed');