コード例 #1
0
 static function print_activities_stats()
 {
     echo '<h4>' . get_lang('ImportantActivities') . '</h4>';
     // Create a search-box
     $form = new FormValidator('search_simple', 'get', api_get_path(WEB_CODE_PATH) . 'admin/statistics/index.php', '', 'width=200px', false);
     $renderer =& $form->defaultRenderer();
     $renderer->setElementTemplate('<span>{element}</span> ');
     $form->addElement('hidden', 'report', 'activities');
     $form->addElement('hidden', 'activities_direction', 'DESC');
     $form->addElement('hidden', 'activities_column', '4');
     $form->addElement('text', 'keyword', get_lang('keyword'));
     $form->addElement('style_submit_button', 'submit', get_lang('Search'), 'class="search"');
     echo '<div class="actions">';
     $form->display();
     echo '</div>';
     $table = new SortableTable('activities', array('Statistics', 'get_number_of_activities'), array('Statistics', 'get_activities_data'), 5, 50, 'DESC');
     $parameters = array();
     $parameters['report'] = 'activities';
     if (isset($_GET['keyword'])) {
         $parameters['keyword'] = Security::remove_XSS($_GET['keyword']);
     }
     $table->set_additional_parameters($parameters);
     $table->set_header(0, get_lang('EventType'));
     $table->set_header(1, get_lang('DataType'));
     $table->set_header(2, get_lang('Value'));
     $table->set_header(3, get_lang('UserName'));
     $table->set_header(4, get_lang('IPAddress'));
     $table->set_header(5, get_lang('Date'));
     $table->display();
 }
コード例 #2
0
ファイル: courseLog.php プロジェクト: annickvdp/Chamilo1.9.10
            $tab_table_header[] = get_lang('Details');
        } else {
            $table->set_header(13, get_lang('Details'), false);
            $tab_table_header[] = get_lang('Details');
        }
    }
    // display buttons to un hide hidden columns
    echo "<br/><br/><div id='unhideButtons'>";
    for ($i=0; $i < count($tab_table_header); $i++) {
        $index = $i + 1;
        echo "<span title='".get_lang('DisplayColumn')." ".$tab_table_header[$i]."' class='unhide_button hide' onclick='foldup($index)'>".Display :: return_icon('move.png', get_lang('DisplayColumn'), array('align'=>'absmiddle', 'hspace'=>'3px'), 16)." ".$tab_table_header[$i]."</span>";
    }
    echo "</div>";
    // Display the table
    echo "<div id='reporting_table'>";
    $table->display();
    echo "</div>";
} else {
    echo Display::display_warning_message(get_lang('NoUsersInCourse'));
}

// Send the csv file if asked.
if ($export_csv) {
    $csv_headers = array();

    $csv_headers[] = get_lang('OfficialCode', '');
    if ($is_western_name_order) {
        $csv_headers[] = get_lang('FirstName', '');
        $csv_headers[] = get_lang('LastName', '');
    } else {
        $csv_headers[] = get_lang('LastName', '');
コード例 #3
0
 /**
  * This is the main function that displays the list or the table with all
  * the glossary terms
  * @param  string  View ('table' or 'list'). Optional parameter.
  * Defaults to 'table' and prefers glossary_view from the session by default.
  * @return void
  * @author Patrick Cool <*****@*****.**>, Ghent University, Belgium
  * @version januari 2009, dokeos 1.8.6
  */
 public static function display_glossary($view = 'table')
 {
     // This function should always be called with the corresponding
     // parameter for view type. Meanwhile, use this cheap trick.
     $glossaryView = Session::read('glossary_view');
     if (empty($glossaryView)) {
         Session::write('glossary_view', $view);
     }
     // action links
     echo '<div class="actions">';
     if (api_is_allowed_to_edit(null, true)) {
         echo '<a href="index.php?' . api_get_cidreq() . '&action=addglossary&msg=add?' . api_get_cidreq() . '">' . Display::return_icon('new_glossary_term.png', get_lang('TermAddNew'), '', ICON_SIZE_MEDIUM) . '</a>';
     }
     echo '<a href="index.php?' . api_get_cidreq() . '&action=export">' . Display::return_icon('export_csv.png', get_lang('ExportGlossaryAsCSV'), '', ICON_SIZE_MEDIUM) . '</a>';
     if (api_is_allowed_to_edit(null, true)) {
         echo '<a href="index.php?' . api_get_cidreq() . '&action=import">' . Display::return_icon('import_csv.png', get_lang('ImportGlossary'), '', ICON_SIZE_MEDIUM) . '</a>';
     }
     echo '<a href="index.php?' . api_get_cidreq() . '&action=export_to_pdf">' . Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM) . '</a>';
     if (isset($glossaryView) && $glossaryView == 'table' or !isset($glossaryView)) {
         echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=list">' . Display::return_icon('view_detailed.png', get_lang('ListView'), '', ICON_SIZE_MEDIUM) . '</a>';
     } else {
         echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=table">' . Display::return_icon('view_text.png', get_lang('TableView'), '', ICON_SIZE_MEDIUM) . '</a>';
     }
     echo '</div>';
     if (!$glossaryView || $glossaryView == 'table') {
         $table = new SortableTable('glossary', array('GlossaryManager', 'get_number_glossary_terms'), array('GlossaryManager', 'get_glossary_data'), 0);
         //$table->set_header(0, '', false);
         $table->set_header(0, get_lang('TermName'), true);
         $table->set_header(1, get_lang('TermDefinition'), true);
         if (api_is_allowed_to_edit(null, true)) {
             $table->set_header(2, get_lang('Actions'), false, 'width=90px', array('class' => 'td_actions'));
             $table->set_column_filter(2, array('GlossaryManager', 'actions_filter'));
         }
         $table->display();
     }
     if ($glossaryView == 'list') {
         GlossaryManager::display_glossary_list();
     }
 }
コード例 #4
0
ファイル: report.php プロジェクト: annickvdp/Chamilo1.9.10
        if ($start_date != '')
            $sql .= "  access_date >= '$start_date'   ";
        if ($end_date != '') {
            $sql = ($start_date == '') ? $sql : ($sql . " AND ");
            $sql .= "  access_date <= '$end_date'   ";
        }
    }
    $result = Database::query($sql);
    $table_result = new SortableTable();
    $table_result->set_header(0, get_lang('User'), false);
    $table_result->set_header(1, get_lang('Fullname'), false);
    $table_result->set_header(2, get_lang('Date'), false);
    $table_result->set_header(3, get_lang('Course'), false);
    $table_result->set_header(4, get_lang('Tool'), false);
    while ($row = Database::fetch_assoc($result)) {
        $row = array(
                $row['username'],
                $row['fullname'],
                $row['access_date'],
                $row['course'],
                get_lang($tools[$row['tool']]['name'])
            );
        $table_result->addRow($row);
    }
    $table_result->display();
} else {
    show_form();
}

Display::display_footer();
コード例 #5
0
ファイル: survey.lib.php プロジェクト: jloguercio/chamilo-lms
 function display_survey_list_for_coach()
 {
     $parameters = array();
     $parameters['cidReq'] = api_get_course_id();
     if (isset($_GET['do_search'])) {
         $message = get_lang('DisplaySearchResults') . '<br />';
         $message .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '">' . get_lang('DisplayAll') . '</a>';
         Display::display_normal_message($message, false);
     }
     // Create a sortable table with survey-data
     $table = new SortableTable('surveys_coach', 'get_number_of_surveys_for_coach', 'get_survey_data_for_coach', 2);
     $table->set_additional_parameters($parameters);
     $table->set_header(0, '', false);
     $table->set_header(1, get_lang('SurveyName'));
     $table->set_header(2, get_lang('SurveyCode'));
     $table->set_header(3, get_lang('NumberOfQuestions'));
     $table->set_header(4, get_lang('Author'));
     //$table->set_header(5, get_lang('Language'));
     //$table->set_header(6, get_lang('Shared'));
     $table->set_header(5, get_lang('AvailableFrom'));
     $table->set_header(6, get_lang('AvailableUntil'));
     $table->set_header(7, get_lang('Invite'));
     $table->set_header(8, get_lang('Anonymous'));
     $table->set_header(9, get_lang('Modify'), false, 'width="130"');
     $table->set_column_filter(8, 'anonymous_filter');
     $table->set_column_filter(9, 'modify_filter_for_coach');
     $table->display();
 }
コード例 #6
0
 /**
  * This is the main function that displays the list or the table with all
  * the glossary terms
  * @param  string  View ('table' or 'list'). Optional parameter.
  * Defaults to 'table' and prefers glossary_view from the session by default.
  * @return void
  * @author Patrick Cool <*****@*****.**>, Ghent University, Belgium
  * @version januari 2009, dokeos 1.8.6
  */
 public static function display_glossary($view = 'table')
 {
     // This function should always be called with the corresponding
     // parameter for view type. Meanwhile, use this cheap trick.
     $glossaryView = Session::read('glossary_view');
     if (empty($glossaryView)) {
         Session::write('glossary_view', $view);
     }
     // action links
     //echo '<div class="actions">';
     $actionsLeft = '';
     if (api_is_allowed_to_edit(null, true)) {
         $actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=addglossary&msg=add?' . api_get_cidreq() . '">' . Display::return_icon('new_glossary_term.png', get_lang('TermAddNew'), '', ICON_SIZE_MEDIUM) . '</a>';
     }
     $actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=export">' . Display::return_icon('export_csv.png', get_lang('ExportGlossaryAsCSV'), '', ICON_SIZE_MEDIUM) . '</a>';
     if (api_is_allowed_to_edit(null, true)) {
         $actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=import">' . Display::return_icon('import_csv.png', get_lang('ImportGlossary'), '', ICON_SIZE_MEDIUM) . '</a>';
     }
     $actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=export_to_pdf">' . Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM) . '</a>';
     if (isset($_SESSION['glossary_view']) && $_SESSION['glossary_view'] == 'table' or !isset($_SESSION['glossary_view'])) {
         $actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=list">' . Display::return_icon('view_detailed.png', get_lang('ListView'), '', ICON_SIZE_MEDIUM) . '</a>';
     } else {
         $actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=table">' . Display::return_icon('view_text.png', get_lang('TableView'), '', ICON_SIZE_MEDIUM) . '</a>';
     }
     /* BUILD SEARCH FORM */
     $form = new FormValidator('search', 'get', api_get_self() . '?' . api_get_cidreq(), '', array(), FormValidator::LAYOUT_INLINE);
     $form->addText('keyword', '', false, array('class' => 'col-md-2'));
     $form->addElement('hidden', 'cidReq', api_get_course_id());
     $form->addElement('hidden', 'id_session', api_get_session_id());
     $form->addButtonSearch(get_lang('Search'));
     $actionsRight = $form->returnForm();
     $toolbar = Display::toolbarAction('toolbar-document', array(0 => $actionsLeft, 1 => $actionsRight));
     echo $toolbar;
     if ($glossaryView == 'table') {
         $table = new SortableTable('glossary', array('GlossaryManager', 'get_number_glossary_terms'), array('GlossaryManager', 'get_glossary_data'), 0);
         //$table->set_header(0, '', false);
         $table->set_header(0, get_lang('TermName'), true);
         $table->set_header(1, get_lang('TermDefinition'), true);
         if (api_is_allowed_to_edit(null, true)) {
             $table->set_header(2, get_lang('Actions'), false, 'width=90px', array('class' => 'td_actions'));
             $table->set_column_filter(2, array('GlossaryManager', 'actions_filter'));
         }
         $table->display();
     }
     if ($glossaryView == 'list') {
         GlossaryManager::display_glossary_list();
     }
 }
コード例 #7
0
 /**
  * Display a sortable table that contains an overview of all the reporting progress of all sessions and all courses the user is subscribed to
  * @author Guillaume Viguier <*****@*****.**>
  */
 public static function display_tracking_session_overview()
 {
     $t_head = '    <table style="width: 100%;border:0;padding:0;border-collapse:collapse;table-layout: fixed">';
     //$t_head .= '  <caption>'.get_lang('CourseInformation').'</caption>';
     $t_head .= '<tr>';
     $t_head .= '        <th width="155px" style="border-left:0;border-bottom:0"><span>' . get_lang('Course') . '</span></th>';
     $t_head .= '        <th style="padding:0;border-bottom:0"><span>' . cut(get_lang('AvgTimeSpentInTheCourse'), 6, true) . '</span></th>';
     $t_head .= '        <th style="padding:0;border-bottom:0"><span>' . cut(get_lang('AvgStudentsProgress'), 6, true) . '</span></th>';
     $t_head .= '        <th style="padding:0;border-bottom:0"><span>' . cut(get_lang('AvgCourseScore'), 6, true) . '</span></th>';
     //$t_head .= '      <th><div style="width:40px">'.get_lang('AvgExercisesScore').'</div></th>';
     $t_head .= '        <th style="padding:0;border-bottom:0"><span>' . cut(get_lang('TotalNumberOfMessages'), 6, true) . '</span></th>';
     $t_head .= '        <th style="padding:0;border-bottom:0"><span>' . cut(get_lang('TotalNumberOfAssignments'), 6, true) . '</span></th>';
     $t_head .= '        <th width="105px" style="border-bottom:0"><span>' . get_lang('TotalExercisesScoreObtained') . '</span></th>';
     //$t_head .= '      <th><div>'.get_lang('TotalExercisesScorePossible').'</div></th>';
     $t_head .= '        <th style="padding:0;border-bottom:0"><span>' . cut(get_lang('TotalExercisesAnswered'), 6, true) . '</span></th>';
     //$t_head .= '      <th><div>'.get_lang('TotalExercisesScorePercentage').'</div></th>';
     //$t_head .= '      <th><div style="width:60px">'.get_lang('FirstLogin').'</div></th>';
     $t_head .= '        <th style="padding:0;border-bottom:0;border-right:0;"><span>' . get_lang('LatestLogin') . '</span></th>';
     $t_head .= '    </tr></table>';
     $addparams = array('view' => 'admin', 'display' => 'sessionoverview');
     $table = new SortableTable('tracking_session_overview', array('MySpace', 'get_total_number_sessions'), array('MySpace', 'get_session_data_tracking_overview'), 1);
     $table->additional_parameters = $addparams;
     $table->set_header(0, '', false, null, array('style' => 'display: none'));
     $table->set_header(1, get_lang('Session'), true, array('style' => 'font-size:8pt'), array('style' => 'font-size:8pt'));
     $table->set_header(2, $t_head, false, array('style' => 'width:90%;border:0;padding:0;font-size:7.5pt;'), array('style' => 'width:90%;padding:0;font-size:7.5pt;'));
     $table->set_column_filter(2, array('MySpace', 'session_tracking_filter'));
     $table->display();
 }
コード例 #8
0
/**
 * Display a sortable table with all the templates that the platform administrator has defined.
 *
 * @author Patrick Cool <*****@*****.**>, Ghent University, Belgium
 * @version August 2008
 * @since Dokeos 1.8.6
 */
function display_templates()
{
    $table = new SortableTable('templates', 'get_number_of_templates', 'get_template_data', 1);
    $table->set_additional_parameters(array('category' => Security::remove_XSS($_GET['category'])));
    $table->set_header(0, get_lang('Image'), true, array('style' => 'width: 101px;'));
    $table->set_header(1, get_lang('Title'));
    $table->set_header(2, get_lang('Actions'), false, array('style' => 'width:50px;'));
    $table->set_column_filter(2, 'actions_filter');
    $table->set_column_filter(0, 'image_filter');
    $table->display();
}
コード例 #9
0
ファイル: index.php プロジェクト: Eidn/shanghai
/**
 * This is the main function that display the list or the table with all the glossary terms
 *
 * @author Patrick Cool <*****@*****.**>, Ghent University, Belgium
 * @version januari 2009, dokeos 1.8.6
 */
function display_glossary()
{
    // action links
    echo '<div class="actions" style="margin-bottom:10px">';
    if (api_is_allowed_to_edit(null, true)) {
        echo '<a href="index.php?' . api_get_cidreq() . '&action=addglossary&msg=add">' . Display::return_icon('filenew.gif', get_lang('TermAddNew')) . get_lang('TermAddNew') . '</a>';
    }
    if (isset($_SESSION['glossary_view']) && $_SESSION['glossary_view'] == 'table' or !isset($_SESSION['glossary_view'])) {
        echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=list">' . Display::return_icon('view_list.gif', get_lang('ListView')) . get_lang('ListView') . '</a>';
    } else {
        echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=table">' . Display::return_icon('view_table.gif', get_lang('TableView')) . get_lang('TableView') . '</a>';
    }
    echo '</div>';
    if (!$_SESSION['glossary_view'] or $_SESSION['glossary_view'] == 'table') {
        $table = new SortableTable('glossary', 'get_number_glossary_terms', 'get_glossary_data', 0);
        $table->set_header(0, get_lang('DisplayOrder'), true);
        $table->set_header(1, get_lang('TermName'), true);
        $table->set_header(2, get_lang('TermDefinition'), true);
        $table->set_header(3, get_lang('CreationDate'), false);
        $table->set_header(4, get_lang('UpdateDate'), false);
        if (api_is_allowed_to_edit(null, true)) {
            $table->set_header(5, get_lang('Actions'), false);
            $table->set_column_filter(5, 'actions_filter');
        }
        $table->display();
    }
    if ($_SESSION['glossary_view'] == 'list') {
        display_glossary_list();
    }
}
コード例 #10
0
/**
 * Display a sortable table that contains an overview off all the reporting progress of all users and all courses the user is subscribed to
 *
 * @author Patrick Cool <*****@*****.**>, Ghent University, Belgium
 * @version Dokeos 1.8.6
 * @since October 2008
 */
function display_tracking_user_overview()
{
    display_user_overview_export_options();
    $t_head .= '	<table style="width: 100%;border:0;padding:0;border-collapse:collapse;table-layout: fixed">';
    $t_head .= '	<caption>' . get_lang('CourseInformation') . '</caption>';
    $t_head .= '<tr>';
    $t_head .= '		<th width="155px" style="border-left:0;border-bottom:0"><span>' . get_lang('Course') . '</span></th>';
    $t_head .= '		<th style="padding:0;border-bottom:0"><span>' . cut(get_lang('AvgTimeSpentInTheCourse'), 6, true) . '</span></th>';
    $t_head .= '		<th style="padding:0;border-bottom:0"><span>' . cut(get_lang('AvgStudentsProgress'), 6, true) . '</span></th>';
    $t_head .= '		<th style="padding:0;border-bottom:0"><span>' . cut(get_lang('AvgCourseScore'), 6, true) . '</span></th>';
    //$t_head .= '		<th><div style="width:40px">'.get_lang('AvgExercisesScore').'</div></th>';
    $t_head .= '		<th style="padding:0;border-bottom:0"><span>' . cut(get_lang('AvgMessages'), 6, true) . '</span></th>';
    $t_head .= '		<th style="padding:0;border-bottom:0"><span>' . cut(get_lang('AvgAssignments'), 6, true) . '</span></th>';
    $t_head .= '		<th width="105px" style="border-bottom:0"><span>' . get_lang('TotalExercisesScoreObtained') . '</span></th>';
    //$t_head .= '		<th><div>'.get_lang('TotalExercisesScorePossible').'</div></th>';
    $t_head .= '		<th style="padding:0;border-bottom:0"><span>' . cut(get_lang('TotalExercisesAnswered'), 6, true) . '</span></th>';
    //$t_head .= '		<th><div>'.get_lang('TotalExercisesScorePercentage').'</div></th>';
    //$t_head .= '		<th><div style="width:60px">'.get_lang('FirstLogin').'</div></th>';
    $t_head .= '		<th style="padding:0;border-bottom:0;border-right:0;"><span>' . get_lang('LatestLogin') . '</span></th>';
    $t_head .= '	</tr></table>';
    $addparams = array('view' => 'admin', 'display' => 'useroverview');
    $table = new SortableTable('tracking_user_overview', 'get_number_of_users_tracking_overview', 'get_user_data_tracking_overview', 0);
    $table->additional_parameters = $addparams;
    $table->set_header(0, get_lang('OfficialCode'), true, array('style' => 'font-size:8pt'), array('style' => 'font-size:8pt'));
    $table->set_header(1, get_lang('LastName'), true, array('style' => 'font-size:8pt'), array('style' => 'font-size:8pt'));
    $table->set_header(2, get_lang('FirstName'), true, array('style' => 'font-size:8pt'), array('style' => 'font-size:8pt'));
    $table->set_header(3, get_lang('LoginName'), true, array('style' => 'font-size:8pt'), array('style' => 'font-size:8pt'));
    $table->set_header(4, $t_head, false, array('style' => 'width:90%;border:0;padding:0;font-size:7.5pt;'), array('style' => 'width:90%;padding:0;font-size:7.5pt;'));
    $table->set_column_filter(4, 'course_info_tracking_filter');
    $table->display();
}