Пример #1
0
    }
    $result = $epsclass->db->query("SELECT h.name, m.* FROM " . TBL_K48MARK . " m LEFT JOIN " . TBL_K48HTD . " h ON h.s_id=m.s_id WHERE h.course='" . $epsclass->db->escape($course) . "'") or error('Unable to fetch mark', __FILE__, __LINE__, $epsclass->db->error());
    if (!$epsclass->db->num_rows($result)) {
        alert($eps_lang['Bad_request']);
        return;
    }
    $students = array();
    while ($cur_std = $epsclass->db->fetch_assoc($result)) {
        $tmp = array('id' => $cur_std['id'], 's_id' => $cur_std['s_id'], 'name' => $cur_std['name']);
        foreach ($eps_subjects as $k => $v) {
            $tmp[$k] = $cur_std[$k];
        }
        $students[] = $tmp;
    }
    $epsclass->db->free_result($result);
    $smarty->assign('tpl_jump', gen_course_jump_tpl('index.php?eps=mark&action=postmark', $course));
    $smarty->assign('error_show', !empty($errors) ? gen_alert($errors) : '');
    $smarty->assign('form_tag', auto_gen_form('index.php?eps=mark&action=' . $action . '&list=' . $course, 'mark', true));
    $smarty->assign('subjects', $eps_subjects);
    $smarty->assign('students', $students);
    $smarty->display('module/mark.tpl');
} else {
    $result = $epsclass->db->query("SELECT * FROM " . TBL_K48MARK . " WHERE s_id='" . $epsclass->db->escape($eps_user['s_id']) . "'") or error('Unable to fetch user mark', __FILE__, __LINE__, $epsclass->db->error());
    if ($epsclass->db->num_rows($result) != 1) {
        return;
    }
    $marks = array_slice($epsclass->db->fetch_assoc($result), 2);
    $epsclass->db->free_result($result);
    $mark_sum = $sum = null;
    foreach ($marks as $k => $v) {
        if ($v != null) {
Пример #2
0
            $search = '&search=' . $search;
        } else {
            if ($uid > 0) {
                $where_sql = " WHERE u.id='" . $epsclass->db->escape($uid) . "'";
            }
        }
        $sqls = array("SELECT COUNT(id) FROM " . TBL_USER . " u" . $where_sql, "SELECT g.g_title,h.name,h.course,u.id,u.username,u.email,u.s_id,u.group_id,u.reg_time,u.active FROM " . TBL_USER . " u LEFT JOIN " . TBL_GROUP . " g ON u.group_id=g.g_id LEFT JOIN " . TBL_K48HTD . " h ON u.s_id=h.s_id" . $where_sql . " ORDER BY u.reg_time DESC");
        $page_link = 'index.php?eps=list' . $search;
}
$result = $epsclass->paginate->get_result($sqls, $page_link, $p, $per_page);
$list_shows = array();
if ($epsclass->paginate->num_result()) {
    $empty = false;
    $start = ($p - 1) * $per_page + 1;
    if ($list_type == 2) {
        $smarty->assign('tpl_jump', gen_course_jump_tpl('index.php?eps=list', $list));
    }
    // Show User Detail
    $details = $list_type == 2 ? array('native' => $eps_lang['Native'], 'address' => $eps_lang['Address'], 'phone' => $eps_lang['Phone'], 'yahoo' => $eps_lang['Yahoo']) : array('name' => $eps_lang['Name'], 'course' => $eps_lang['Course'], 's_id' => $eps_lang['StudentID'], 'email' => $eps_lang['Email'], 'active' => $eps_lang['Active']);
    while ($cur_user = $epsclass->db->fetch_assoc($result)) {
        $tmp = array();
        $cur_detail = '';
        if (!$eps_user['is_guest']) {
            $cur_details = array();
            foreach ($details as $key => $value) {
                $cur_details[] = '<li><strong>' . $value . ': </strong>' . $cur_user[$key];
            }
            $cur_detail = '<ul>' . implode('</li>', $cur_details) . '</li></ul>';
        }
        if ($list_type == 2) {
            $tmp[1] = $eps_user['is_guest'] ? html_clean($cur_user['name']) : gen_link('#', html_clean($cur_user['name']), $cur_detail, false, true);