function show_more_history_student() { header('Content-Type: text/html; charset=utf-8'); global $display; $id_view = intval(Url::get('id_view', 0)); $anchor_index = intval(Url::get('anchor_index_h', 0)); if ($id_view) { $history_student = Classes::get_list_teacher_log(' LIMIT ' . $anchor_index * 6 . ', 7', ' WHERE uid = ' . $id_view, 'ORDER BY id DESC'); } else { $history_student = Classes::get_list_teacher_log(' LIMIT ' . $anchor_index * 6 . ', 7', ' WHERE uid = ' . $_SESSION['user_id'], 'ORDER BY id DESC'); } $list_teacher = Teachers::get_collection(null); $list_lesson = Lessons::get_collection_with_join(null); if (count($history_student) == 7) { $is_next_h = 1; array_pop($history_student); } else { $is_next_h = 0; } if (empty($history_student)) { exit; } $display->add('history_student', $history_student); $display->add('list_teacher', $list_teacher); $display->add('list_lesson', $list_lesson); $display->add('anchor_index', $anchor_index); $display->add('is_next_h', $is_next_h); $display->output('Personal/ajax/ShowMoreHistory'); exit; }