Ejemplo n.º 1
0
        break;
    case 'course_view':
        if ($task) {
            switch ($task) {
                case 'course_view':
                    $file_id = gpc('file_ids', 'GP', 0);
                    $review_status = gpc('review_status', 'GP', 0);
                    $cs_id = gpc('cs_id', 'GP', 0);
                    $course_id = gpc('course_id', 'GP', 0);
                    foreach ($file_id as $k => $v) {
                        $sql = "UPDATE {$tpf}file_cs_relation\n\t\t\t\t\t\t\t\tSET (cs_id, course_id, status)\n\t\t\t\t\t\t\t\tVALUE ({$cs_id}, {$course_id}, {$review_status})\n\t\t\t\t\t\t\t\tWHERE cs_id = {$cs_id} AND course_id={$course_id}";
                        $db->query_unbuffered($sql);
                    }
                    break;
            }
        } else {
            $course_id = gpc('course_id', 'GP', '');
            $chapter_section_array = get_chapter_section_list($course_id);
            require_once template_echo($item, $admin_tpl_dir, '', 1);
        }
        break;
    case 'search':
        $status = (int) gpc('status', 'GP', 0);
        $status = 3;
        $course_array = !empty($status) ? get_course_form_status($status) : array();
        $course_array = $course_array['data'];
        $page_nav = multi($total_num, $perpage, $pg, urr(ADMINCP, "item={$item}&menu=file&action={$action}&view={$view}&uid={$uid}"));
        $dd = date('Y-m-d');
        require_once template_echo($item, $admin_tpl_dir, '', 1);
        break;
}
Ejemplo n.º 2
0
         $course_array = get_course_list('', $perpage);
         $total_num = $course_array['total_num'];
         $course_array = $course_array['data'];
     }
     $nav_path = '<a href="' . urr("mydisk", "item=profile&action=course_manage") . '">课程管理</a>&raquo; ';
     if ($task == 'search') {
         $page_nav = multi($total_num, $perpage, $pg, urr("mydisk", "item={$item}&action={$action}&task={$task}&word=" . rawurlencode($word)));
     } else {
         $page_nav = multi($total_num, $perpage, $pg, urr("mydisk", "item={$item}&action={$action}"));
     }
     require_once template_echo('profile', $user_tpl_dir);
     break;
 case 'chapter_section_manage':
     $course_id = gpc('course_id', 'G', '');
     //该课程数据
     $chapter_section_array = !empty($course_id) ? get_chapter_section_list($course_id) : array();
     //路径条
     $nav_path = '<a href="' . urr("mydisk", "item=profile&action=course_manage") . '">课程管理</a>&raquo; ' . nav_path_course($course_id, $pd_uid, 0, 1);
     require_once template_echo('profile', $user_tpl_dir);
     break;
 case 'course_review':
     $perpage = 20;
     $start_num = ($pg - 1) * $perpage;
     $sql = "SELECT c.*, cg.cate_name FROM {$tpf}course c LEFT JOIN {$tpf}categories cg ON c.cate_id = cg.cate_id WHERE user_id = {$pd_uid} limit {$start_num},{$perpage}";
     $q = $db->query($sql);
     $course_array = array();
     while ($rs = $db->fetch_array($q)) {
         $rs['create_date'] = date('Y-m-d H:i:s', $rs[create_date]);
         $rs['update_date'] = date('Y-m-d H:i:s', $rs[update_date]);
         $rs['status'] = $defineCouser[$rs['status']] ? $defineCouser[$rs['status']] : '未定义状态';
         $rs['a_edit'] = urr("mydisk", "item=course&action=modify_course&course_id={$rs['courseid']}");