예제 #1
0
$htmlHeadXtra[] = "<style type='text/css'>\n/*<![CDATA[*/\n.secLine {background-color : #E6E6E6;}\n.content {padding-left : 15px;padding-right : 15px; }\n.specialLink{color : #0000FF;}\n/*]]>*/\n</style>\n<style media='print' type='text/css'>\n/*<![CDATA[*/\ntd {border-bottom: thin dashed gray;}\n/*]]>*/\n</style>";
$TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$TABLECOURSE_GROUPSUSER = Database::get_course_table(TABLE_GROUP_USER);
$TABLEUSER = Database::get_main_table(TABLE_MAIN_USER);
$TABLETRACK_ACCESS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS);
Display::display_header($nameTools, "Tracking");
$courseId = api_get_course_int_id();
// the variables for the days and the months
// Defining the shorts for the days
$DaysShort = api_get_week_days_short();
// Defining the days of the week to allow translation of the days
$DaysLong = api_get_week_days_long();
// Defining the months of the year to allow translation of the months
$MonthsLong = api_get_months_long();
// Defining the months of the year to allow translation of the months
$MonthsShort = api_get_months_short();
$is_allowedToTrack = $is_groupTutor;
// allowed to track only user of one group
$is_allowedToTrackEverybodyInCourse = $is_courseAdmin;
// allowed to track all student in course
?>
<h3>
    <?php 
echo $nameTools;
?>
</h3>
<table width="100%" cellpadding="2" cellspacing="3" border="0">
    <?php 
// check if uid is tutor of this group
$courseId = api_get_course_int_id();
if ($is_allowedToTrack || $is_allowedToTrackEverybodyInCourse) {
예제 #2
0
 /**
  * @author Sebastien Piraux <*****@*****.**>
  * @param sql : a sql query (as a string)
  * @return days_array
  * @desc        Return an assoc array.  Keys are the days, values are
  * the number of time this hours was found.
  * key "total" return the sum of all number of time days
  * appear
  */
 public static function daysTab($sql)
 {
     $MonthsShort = api_get_months_short();
     $days_array = array('total' => 0);
     $res = Database::query($sql);
     if ($res !== false) {
         $last_day = -1;
         while ($row = Database::fetch_row($res)) {
             $date_array = getdate($row[0]);
             $display_date = $date_array['mday'] . ' ' . $MonthsShort[$date_array['mon'] - 1] . ' ' . $date_array['year'];
             if ($date_array['mday'] == $last_day) {
                 $days_array[$display_date]++;
             } else {
                 $days_array[$display_date] = 1;
                 $last_day = $display_date;
             }
             $days_array['total']++;
         }
         Database::free_result($res);
     }
     return $days_array;
 }