本文整理匯總了PHP中SortableTable::addRow方法的典型用法代碼示例。如果您正苦於以下問題:PHP SortableTable::addRow方法的具體用法?PHP SortableTable::addRow怎麽用?PHP SortableTable::addRow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SortableTable
的用法示例。
在下文中一共展示了SortableTable::addRow方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: SortableTable
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();
示例2: display_tracking_coach_overview
//.........這裏部分代碼省略.........
$table->set_header(5, get_lang('CountCours'), false);
$table->set_header(6, get_lang('NumberOfSessions'), false);
$table->set_header(7, get_lang('Sessions'), false);
if ($is_western_name_order) {
$csv_header[] = array(get_lang('FirstName', ''), get_lang('LastName', ''), get_lang('TimeSpentOnThePlatform', ''), get_lang('LastConnexion', ''), get_lang('NbStudents', ''), get_lang('CountCours', ''), get_lang('NumberOfSessions', ''));
} else {
$csv_header[] = array(get_lang('LastName', ''), get_lang('FirstName', ''), get_lang('TimeSpentOnThePlatform', ''), get_lang('LastConnexion', ''), get_lang('NbStudents', ''), get_lang('CountCours', ''), get_lang('NumberOfSessions', ''));
}
$tbl_track_login = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_sessions = Database::get_main_table(TABLE_MAIN_SESSION);
$sqlCoachs = "SELECT DISTINCT\n scu.user_id as id_coach,\n u.id as user_id,\n lastname,\n firstname,\n MAX(login_date) as login_date\n FROM {$tbl_user} u, {$tbl_session_course_user} scu, {$tbl_track_login}\n WHERE\n scu.user_id = u.id AND scu.status=2 AND login_user_id=u.id\n GROUP BY user_id ";
if (api_is_multiple_url_enabled()) {
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
$access_url_id = api_get_current_access_url_id();
if ($access_url_id != -1) {
$sqlCoachs = "SELECT DISTINCT\n scu.user_id as id_coach,\n u.id as user_id,\n lastname,\n firstname,\n MAX(login_date) as login_date\n FROM {$tbl_user} u,\n {$tbl_session_course_user} scu,\n {$tbl_track_login} ,\n {$tbl_session_rel_access_url} session_rel_url\n WHERE\n scu.user_id = u.id AND\n scu.status = 2 AND\n login_user_id = u.id AND\n access_url_id = {$access_url_id} AND\n session_rel_url.session_id = scu.session_id\n GROUP BY u.id";
}
}
if (!empty($order[$tracking_column])) {
$sqlCoachs .= "ORDER BY " . $order[$tracking_column] . " " . $tracking_direction;
}
$result_coaches = Database::query($sqlCoachs);
$total_no_coaches = Database::num_rows($result_coaches);
$global_coaches = array();
while ($coach = Database::fetch_array($result_coaches)) {
$global_coaches[$coach['user_id']] = $coach;
}
$sql_session_coach = 'SELECT session.id_coach, u.id as user_id, lastname, firstname, MAX(login_date) as login_date
FROM ' . $tbl_user . ' u ,' . $tbl_sessions . ' as session,' . $tbl_track_login . '
WHERE id_coach = u.id AND login_user_id = u.id
GROUP BY u.id
ORDER BY login_date ' . $tracking_direction;
if (api_is_multiple_url_enabled()) {
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
$access_url_id = api_get_current_access_url_id();
if ($access_url_id != -1) {
$sql_session_coach = 'SELECT session.id_coach, u.id as user_id, lastname, firstname, MAX(login_date) as login_date
FROM ' . $tbl_user . ' u ,' . $tbl_sessions . ' as session, ' . $tbl_track_login . ' , ' . $tbl_session_rel_access_url . ' as session_rel_url
WHERE
id_coach = u.id AND
login_user_id = u.id AND
access_url_id = ' . $access_url_id . ' AND
session_rel_url.session_id = session.id
GROUP BY u.id
ORDER BY login_date ' . $tracking_direction;
}
}
$result_sessions_coach = Database::query($sql_session_coach);
$total_no_coaches += Database::num_rows($result_sessions_coach);
while ($coach = Database::fetch_array($result_sessions_coach)) {
$global_coaches[$coach['user_id']] = $coach;
}
$all_datas = array();
foreach ($global_coaches as $id_coach => $coaches) {
$time_on_platform = api_time_to_hms(Tracking::get_time_spent_on_the_platform($coaches['user_id']));
$last_connection = Tracking::get_last_connection_date($coaches['user_id']);
$nb_students = count(Tracking::get_student_followed_by_coach($coaches['user_id']));
$nb_courses = count(Tracking::get_courses_followed_by_coach($coaches['user_id']));
$nb_sessions = count(Tracking::get_sessions_coached_by_user($coaches['user_id']));
$table_row = array();
if ($is_western_name_order) {
$table_row[] = $coaches['firstname'];
$table_row[] = $coaches['lastname'];
} else {
$table_row[] = $coaches['lastname'];
$table_row[] = $coaches['firstname'];
}
$table_row[] = $time_on_platform;
$table_row[] = $last_connection;
$table_row[] = $nb_students;
$table_row[] = $nb_courses;
$table_row[] = $nb_sessions;
$table_row[] = '<a href="session.php?id_coach=' . $coaches['user_id'] . '"><img src="' . api_get_path(WEB_IMG_PATH) . 'icons/22/2rightarrow.png" border="0" /></a>';
$all_datas[] = $table_row;
if ($is_western_name_order) {
$csv_content[] = array(api_html_entity_decode($coaches['firstname'], ENT_QUOTES), api_html_entity_decode($coaches['lastname'], ENT_QUOTES), $time_on_platform, $last_connection, $nb_students, $nb_courses, $nb_sessions);
} else {
$csv_content[] = array(api_html_entity_decode($coaches['lastname'], ENT_QUOTES), api_html_entity_decode($coaches['firstname'], ENT_QUOTES), $time_on_platform, $last_connection, $nb_students, $nb_courses, $nb_sessions);
}
}
if ($tracking_column != 3) {
if ($tracking_direction == 'DESC') {
usort($all_datas, array('MySpace', 'rsort_users'));
} else {
usort($all_datas, array('MySpace', 'sort_users'));
}
}
if ($export_csv && $tracking_column != 3) {
usort($csv_content, 'sort_users');
}
if ($export_csv) {
$csv_content = array_merge($csv_header, $csv_content);
}
foreach ($all_datas as $row) {
$table->addRow($row, 'align="right"');
}
$table->display();
}
示例3: Thematic
$messages_in_course = null;
$assignments_in_course = null;
}
$tematic_advance_progress = 0;
$thematic = new Thematic($course);
$tematic_advance = $thematic->get_total_average_of_thematic_advances($course_code, $id_session);
if (!empty($tematic_advance)) {
$tematic_advance_csv = $tematic_advance_progress . '%';
$tematic_advance_progress = '<a title="' . get_lang('GoToThematicAdvance') . '" href="' . api_get_path(WEB_CODE_PATH) . 'course_progress/index.php?cidReq=' . $course_code . '&id_session=' . $id_session . '">' . $tematic_advance . '%</a>';
} else {
$tematic_advance_progress = '-';
}
$table_row = array();
$table_row[] = $course['title'];
$table_row[] = $nb_students_in_course;
$table_row[] = is_null($avg_time_spent_in_course) ? '-' : $avg_time_spent_in_course;
$table_row[] = $tematic_advance_progress;
$table_row[] = is_null($avg_progress_in_course) ? '-' : $avg_progress_in_course . '%';
$table_row[] = is_null($avg_score_in_course) ? '-' : $avg_score_in_course;
$table_row[] = is_null($messages_in_course) ? '-' : $messages_in_course;
$table_row[] = is_null($assignments_in_course) ? '-' : $assignments_in_course;
$table_row[] = '<a href="../tracking/courseLog.php?cidReq=' . $course_code . '&id_session=' . $id_session . '"><img src="' . api_get_path(WEB_IMG_PATH) . '2rightarrow.gif" border="0" /></a>';
$csv_content[] = array($course['title'], $nb_students_in_course, $avg_time_spent_in_course, $tematic_advance_csv, is_null($avg_progress_in_course) ? null : $avg_progress_in_course . '%', is_null($avg_score_in_course) ? null : $avg_score_in_course, $messages_in_course, $assignments_in_course);
$table->addRow($table_row, 'align="right"');
}
// $csv_content = array_merge($csv_header, $csv_content); // Before this statement you are allowed to sort (in different way) the array $csv_content.
}
//$table -> setColAttributes(0);
//$table -> setColAttributes(7);
$table->display();
Display::display_footer();
示例4: intval
$row[] = '<a href="student.php?id_session=' . $session['id'] . '&id_coach=' . intval($_GET['id_coach']) . '"><img src="' . api_get_path(WEB_IMG_PATH) . '2rightarrow.gif" border="0" /></a>';
} else {
$row[] = '<a href="course.php?id_session=' . $session['id'] . '"><img src="' . api_get_path(WEB_IMG_PATH) . '2rightarrow.gif" border="0" /></a>';
}
$all_data[] = $row;
}
if (!isset($tracking_column)) {
$tracking_column = 0;
}
if ($_GET['tracking_direction'] == 'DESC') {
usort($all_data, 'rsort_sessions');
} else {
usort($all_data, 'sort_sessions');
}
if ($export_csv) {
usort($csv_content, 'sort_sessions');
}
foreach ($all_data as $row) {
$table->addRow($row);
}
//$table -> setColAttributes(2, array('align' => 'center'));
$table->display();
if ($export_csv) {
ob_end_clean();
Export::export_table_csv($csv_content, 'reporting_student_list');
exit;
}
} else {
echo get_lang('NoSession');
}
Display::display_footer();