"../auth/profile.php", "name"=> get_lang('ModifyProfile')); $nameTools = get_lang('ToolName'); $htmlHeadXtra[] = " "; /* ----------------------------------------------------------- Constants and variables ----------------------------------------------------------- */ //Remove all characters different than 0 and 1 from $view parameter $view = preg_replace('/[^01]/','',$_REQUEST['view']); $TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER); $TABLETRACK_ACCESS = $_configuration['statistics_database']."`.`track_e_access"; $TABLETRACK_LINKS = $_configuration['statistics_database']."`.`track_e_links"; $TABLETRACK_DOWNLOADS = $_configuration['statistics_database']."`.`track_e_downloads"; $TABLETRACK_LOGIN = $_configuration['statistics_database']."`.`track_e_login"; $TABLETRACK_EXERCICES = $_configuration['statistics_database']."`.`track_e_exercices"; $limitOfDisplayedLogins = 25; // number of logins to display include(api_get_path(LIBRARY_PATH)."statsUtils.lib.inc.php"); ////////////// OUTPUT ////////////////////// Display::display_header($nameTools,"Tracking"); api_display_tool_title($nameTools); /* ============================================================================== MAIN SECTION ============================================================================== */ if ( $_configuration['tracking_enabled'] ) { // show all : view must be equal to the sum of all view values (1024+512+...+64) // show none : 0 echo " "; if(empty($view)) $view ="0000000"; /*************************************************************************** * * Logins * ***************************************************************************/ $tempView = $view; if($tempView[0] == '1') { $tempView[0] = '0'; echo " "; $sql = "SELECT `login_date` FROM `".$TABLETRACK_LOGIN."` WHERE `login_user_id` = '".$_user['user_id']."' ORDER BY `login_date` DESC LIMIT ".$limitOfDisplayedLogins.""; echo ""; } else { $tempView[0] = '1'; echo " "; } /*************************************************************************** * * Exercices * ***************************************************************************/ /* $tempView = $view; if($view[1] == '1') { $tempView[1] = '0'; echo " "; echo " Ceci est amen etre dplac vers la page de garde des exercices "; $sql = "SELECT `ce`.`title`, `te`.`exe_result` , `te`.`exe_weighting`, `te`.`exe_date` FROM `$TABLECOURSE_EXERCICES` AS ce , `$TABLETRACK_EXERCICES` AS te WHERE `te`.`exe_user_id` = '".$_user['user_id']."' AND `te`.`exe_exo_id` = `ce`.`id` ORDER BY `te`.`exe_cours_id` ASC, `ce`.`title` ASC, `te`.`exe_date`ASC"; echo ""; } else { $tempView[1] = '1'; echo " "; } */ echo "\n
-    ".get_lang('Logins')."     [".get_lang('Close')."]
".get_lang('LoginsExplaination')."
"; $results = getManyResults1Col($sql); echo " "; if (is_array($results)) { while ( list($key,$value) = each($results)) { $timestamp = strtotime($value); //$beautifulDate = $langDay_of_weekNames['long'][date("w" , $timestamp)].date(" d " , $timestamp).$langMonthNames['long'][date("n", $timestamp)-1].date(" Y" , $timestamp); //$beautifulHour = date("H : i" , $timestamp); $beautifulDate = format_locale_date($dateTimeFormatLong,$timestamp); echo " "; if(!isset($previousDate)) { $sql = "SELECT NOW()"; $previousDate = getOneResult($sql); } $sql = "SELECT `access_tool`, count(access_tool), `access_cours_code` FROM `".$TABLETRACK_ACCESS."` WHERE `access_user_id` = '".$_user['user_id']."'". //AND access_tool IS NOT NULL "AND access_date > '".$value."' AND access_date < '".$previousDate."' GROUP BY access_tool, access_cours_code ORDER BY access_cours_code ASC"; $results2 = getManyResults3Col($sql); if (is_array($results2)) { echo " "; } $previousDate = $value; } } else { echo ""; echo ""; echo""; } echo "
".$beautifulDate."
"; $previousCourse = "???"; for($j = 0 ; $j < count($results2) ; $j++) { // if course is different, write the name of the course if($results2[$j][2] != $previousCourse) { echo " "; } // if count != de 0 then display toolname et number of visits, else its a course visit if( $results2[$j][1] != 0 ) { echo ""; echo ""; echo ""; echo ""; } $previousCourse = $results2[$j][2]; } echo "
".$results2[$j][2]."
".get_lang(ucfirst($results2[$j][0]))."".$results2[$j][1]." ".get_lang('Visits')."
"; echo "
".get_lang('NoResult')."
"; echo "
+  ".get_lang('Logins')."
-   ".get_lang('ExercicesResults')."   [".get_lang('Close')."]
"; $results = getManyResultsXCol($sql,4); echo ""; echo ""; if (is_array($results)) { for($i = 0; $i < sizeof($results); $i++) { if( $results[$i][1] < ($results[$i][2]/2) ) $scoreColor = "red"; elseif( $results[$i][1] > ($results[$i][2]/100*60) ) $scoreColor = "green"; else $scoreColor = "#FF8C00"; echo ""; echo ""; echo ""; echo ""; echo""; } } else { echo ""; echo ""; echo""; } echo "
".get_lang('ExercicesTitleExerciceColumn')." ".get_lang('Date')." ".get_lang('ExercicesTitleScoreColumn')."
".$results[$i][0]."".$results[$i][3]."".$results[$i][1]." / ".$results[$i][2]."
".get_lang('NoResult')."
"; echo "
+  ".get_lang('ExercicesResults')."
"; } else { echo get_lang('TrackingDisabled'); } Display::display_footer(); ?>