コード例 #1
0
function list_import_prepare()
{
    $CI =& get_instance();
    $periods = new Period();
    $periods->truncate();
    echo 'LIST periods table truncated ...' . "\n";
    $courses = new Course();
    $courses->truncate();
    echo 'LIST courses table truncated ...' . "\n";
    $groups = new Group();
    $groups->truncate();
    echo 'LIST groups table truncated ...' . "\n";
    $rooms = new Room();
    $rooms->truncate();
    echo 'LIST rooms table truncated ...' . "\n";
    $participants = new Participant();
    $participants->truncate();
    echo 'LIST participants table truncated ...' . "\n";
    $CI->db->simple_query('TRUNCATE TABLE `course_task_set_type_rel`');
    echo 'LIST course_task_set_type_rel table truncated ...' . "\n";
    $categories = new Category();
    $categories->truncate();
    echo 'LIST categories table truncated ...' . "\n";
    $tasks = new Task();
    $tasks->truncate();
    $CI->lang->delete_overlays('tasks');
    unlink_recursive('private/uploads/task_files/', FALSE);
    unlink_recursive('private/uploads/unit_tests/', FALSE);
    echo 'LIST tasks table truncated ...' . "\n";
    $CI->db->simple_query('TRUNCATE TABLE `task_category_rel`');
    echo 'LIST task_category_rel table truncated ...' . "\n";
    $task_set_types = new Task_set_type();
    $task_set_types->truncate();
    echo 'LIST task_set_types table truncated ...' . "\n";
    $task_sets = new Task_set();
    $task_sets->truncate();
    $CI->lang->delete_overlays('task_sets');
    echo 'LIST task_sets table truncated ...' . "\n";
    $comments = new Comment();
    $comments->truncate();
    echo 'LIST comments table truncated ...' . "\n";
    $solutions = new Solution();
    $solutions->truncate();
    unlink_recursive('private/uploads/solutions/', FALSE);
    echo 'LIST solutions table truncated ...' . "\n";
    $CI->db->simple_query('TRUNCATE TABLE `task_task_set_rel`');
    echo 'LIST task_task_set_rel table truncated ...' . "\n";
}