function change_item() { $filter_type = Url::get('filter_type'); if ($filter_type == 1) { $result = Lessons::get_collection_with_join(null); } if ($filter_type == 0) { $result = Classes::get_collection_with_join(null); } $html = ""; if ($result) { foreach ($result as $row) { if ($row['name'] != '' && $row['subject_type'] == 1) { $html .= '<option value="' . $row['id'] . '">' . $row['id'] . '. ' . $row['name'] . '</option>'; } } } echo $html; exit; }
function draw() { global $display; // $this->beginForm(false, 'post', false, Url::build_current(array('cmd' => 'list_log'))); $filter_id = intval(trim(Url::get('filter_id'))); $filter_type = intval(trim(Url::get('filter_type'))); $type_id = intval(trim(Url::get('type_id'))); $cid = intval(trim(Url::get('cid'))); $display->add('cid', $cid); $display->add('type_id', $type_id); $display->add('from_time', Url::get('from_time')); $display->add('to_time', Url::get('to_time')); $cond = array(); if (!empty($filter_id)) { $cond[] = 'a.id LIKE "' . $filter_id . '"'; $display->add('filter_id', $filter_id); } if (!empty($filter_type)) { switch ($filter_type) { case 1: $cond[] = ' type_id = ' . $filter_type; break; case 2: $cond[] = ' type_id = ' . $filter_type; break; case 0: $cond[] = ' type_id = ' . $filter_type; break; default: // $cond[] = ' type_id = 0'; break; } $display->add('filter_type', $filter_type); } else { $cond[] = ' type_id = 0'; $display->add('filter_type', 0); } if (!empty($type_id) && $type_id != 0) { $cond[] = 'object_id = ' . $type_id; if (!empty($cid)) { $cond[] = ' (CONCAT(",", class_id, ",") LIKE "%,' . $cid . ',%") '; } } $from_time = 0; $to_time = 0; if (Url::get('from_time')) { $date_arr = explode('/', Url::get('from_time')); if (isset($date_arr[0]) && isset($date_arr[1]) && isset($date_arr[2])) { $from_time = EClassApi::render_time($date_arr[1] . '/' . $date_arr[0] . '/' . (int) $date_arr[2], 0); } } if (Url::get('to_time')) { $date_arr = explode('/', Url::get('to_time')); if (isset($date_arr[0]) && isset($date_arr[1]) && isset($date_arr[2])) { $to_time = EClassApi::render_time($date_arr[1] . '/' . $date_arr[0] . '/' . (int) $date_arr[2], 1); } } if ($from_time) { $cond[] = ' `time` >= ' . $from_time; } if ($to_time) { $cond[] = ' `time` <= ' . $to_time; } $item_per_page = 50; $cond = EClassApi::analyze_conditions($cond); $list_log = array(); $paging = ''; $total_row = Logs::count_all($cond); if ($total_row) { require_once ROOT_PATH . 'core/ECPagging.php'; $limit = ''; $paging = ECPagging::pagingSE($limit, $total_row, $item_per_page, 10, 'page_no', true); $list_log = Logs::get_collection($limit, $cond, ' ORDER BY id DESC'); } $list_class = Classes::get_collection_with_join(null); $list_lesson = Lessons::get_collection_with_join(null); $list_exam = Exam::get_collection(null); $error_message = $this->getErrorMessage('admin/log/error'); $display->add('error_message', $error_message); $display->add('paging', $paging); $display->add('list_log', $list_log); $display->add('list_class', $list_class); $display->add('list_lesson', $list_lesson); $display->add('list_exam', $list_exam); $display->add('is_admin', User::is_admin()); $display->output('ListLog'); // $this->endForm(); }
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; }