"courseLog.php", "name"=> get_lang('ToolName')); $nameTools = get_lang('TrafficDetails'); $htmlHeadXtra[] = " "; //@todo use Database library $TABLETRACK_ACCESS = $_configuration['statistics_database']."`.`track_e_access"; Display::display_header($nameTools,"Tracking"); include(api_get_path(LIBRARY_PATH)."statsUtils.lib.inc.php"); // the variables for the days and the months // Defining the shorts for the days $DaysShort = array (get_lang("SundayShort"), get_lang("MondayShort"), get_lang("TuesdayShort"), get_lang("WednesdayShort"), get_lang("ThursdayShort"), get_lang("FridayShort"), get_lang("SaturdayShort")); // Defining the days of the week to allow translation of the days $DaysLong = array (get_lang("SundayLong"), get_lang("MondayLong"), get_lang("TuesdayLong"), get_lang("WednesdayLong"), get_lang("ThursdayLong"), get_lang("FridayLong"), get_lang("SaturdayLong")); // Defining the months of the year to allow translation of the months $MonthsLong = array (get_lang("JanuaryLong"), get_lang("FebruaryLong"), get_lang("MarchLong"), get_lang("AprilLong"), get_lang("MayLong"), get_lang("JuneLong"), get_lang("JulyLong"), get_lang("AugustLong"), get_lang("SeptemberLong"), get_lang("OctoberLong"), get_lang("NovemberLong"), get_lang("DecemberLong")); $is_allowedToTrack = $is_courseAdmin; ?>

2149372861 ) $reqdate = time(); //** dislayed period echo ""; //** menu echo " "; //** // display information about this period switch($period) { // all days case "year" : $sql = "SELECT UNIX_TIMESTAMP( `access_date` ) FROM `$TABLETRACK_ACCESS` WHERE YEAR( `access_date` ) = YEAR( FROM_UNIXTIME( '$reqdate' ) ) AND `access_cours_code` = '$_cid' AND `access_tool` IS NULL "; if($displayType == "month") { $sql .= "ORDER BY UNIX_TIMESTAMP( `access_date`)"; $month_array = monthTab($sql); makeHitsTable($month_array,get_lang('PeriodMonth')); } elseif($displayType == "day") { $sql .= "ORDER BY DAYOFYEAR( `access_date`)"; $days_array = daysTab($sql); makeHitsTable($days_array,get_lang('PeriodDay')); } else // by hours by default { $sql .= "ORDER BY HOUR( `access_date`)"; $hours_array = hoursTab($sql); makeHitsTable($hours_array,get_lang('PeriodHour')); } break; // all days case "month" : $sql = "SELECT UNIX_TIMESTAMP( `access_date` ) FROM `$TABLETRACK_ACCESS` WHERE MONTH(`access_date`) = MONTH (FROM_UNIXTIME( '$reqdate' ) ) AND YEAR( `access_date` ) = YEAR( FROM_UNIXTIME( '$reqdate' ) ) AND `access_cours_code` = '$_cid' AND `access_tool` IS NULL "; if($displayType == "day") { $sql .= "ORDER BY DAYOFYEAR( `access_date`)"; $days_array = daysTab($sql); makeHitsTable($days_array,get_lang('PeriodDay')); } else // by hours by default { $sql .= "ORDER BY HOUR( `access_date`)"; $hours_array = hoursTab($sql); makeHitsTable($hours_array,get_lang('PeriodHour')); } break; // all hours case "day" : $sql = "SELECT UNIX_TIMESTAMP( `access_date` ) FROM `$TABLETRACK_ACCESS` WHERE DAYOFMONTH(`access_date`) = DAYOFMONTH(FROM_UNIXTIME( '$reqdate' ) ) AND MONTH(`access_date`) = MONTH (FROM_UNIXTIME( '$reqdate' ) ) AND YEAR( `access_date` ) = YEAR( FROM_UNIXTIME( '$reqdate' ) ) AND `access_cours_code` = '$_cid' AND `access_tool` IS NULL ORDER BY HOUR( `access_date` )"; $hours_array = hoursTab($sql,$reqdate); makeHitsTable($hours_array,get_lang('PeriodHour')); break; } } else // not allowed to track { if(!$_configuration['tracking_enabled']) { echo get_lang('TrackingDisabled'); } else { api_not_allowed(); } } ?>
"; switch($period) { case "year" : echo date(" Y", $reqdate); break; case "month" : echo $MonthsLong[date("n", $reqdate)-1].date(" Y", $reqdate); break; // default == day default : $period = "day"; case "day" : echo $DaysLong[date("w" , $reqdate)].date(" d " , $reqdate).$MonthsLong[date("n", $reqdate)-1].date(" Y" , $reqdate); break; } echo "
"; echo " ".get_lang('PeriodToDisplay')." : [".get_lang('PeriodYear')."] [".get_lang('PeriodMonth')."] [".get_lang('PeriodDay')."]    ||    ".get_lang('DetailView')." : "; switch($period) { case "year" : //-- if period is "year" display can be by month, day or hour echo " [".get_lang('PeriodMonth')."]"; case "month" : //-- if period is "month" display can be by day or hour echo " [".get_lang('PeriodDay')."]"; case "day" : //-- if period is "day" display can only be by hour echo " [".get_lang('PeriodHour')."]"; break; } echo "   ||   "; switch($period) { case "year" : // previous and next date must be evaluated // 30 days should be a good approximation $previousReqDate = mktime(1,1,1,1,1,date("Y",$reqdate)-1); $nextReqDate = mktime(1,1,1,1,1,date("Y",$reqdate)+1); echo " [".get_lang('PreviousYear')."] [".get_lang('NextYear')."] "; break; case "month" : // previous and next date must be evaluated // 30 days should be a good approximation $previousReqDate = mktime(1,1,1,date("m",$reqdate)-1,1,date("Y",$reqdate)); $nextReqDate = mktime(1,1,1,date("m",$reqdate)+1,1,date("Y",$reqdate)); echo " [".get_lang('PreviousMonth')."] [".get_lang('NextMonth')."] "; break; case "day" : // previous and next date must be evaluated $previousReqDate = $reqdate - 86400; $nextReqDate = $reqdate + 86400; echo " [".get_lang('PreviousDay')."] [".get_lang('NextDay')."] "; break; } echo "