From 5dd5934e8cc695dd7f1f8d80a0670826a702dd8d Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Mon, 19 Sep 2022 16:02:44 +0800 Subject: [PATCH] fix: problem uploader --- web/app/controllers/problem_set.php | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/web/app/controllers/problem_set.php b/web/app/controllers/problem_set.php index 174b3e7..024f5cd 100644 --- a/web/app/controllers/problem_set.php +++ b/web/app/controllers/problem_set.php @@ -14,6 +14,8 @@ if (isSuperUser($myUser) || isProblemManager($myUser) || isProblemUploader($myUser)) { $new_problem_form = new UOJForm('new_problem'); $new_problem_form->handle = function() { + global $myUser; + DB::query("insert into problems (title, uploader, is_hidden, submission_requirement) values ('New Problem', '{$myUser['username']}', 1, '{}')"); $id = DB::insert_id(); DB::query("insert into problems_contents (id, statement, statement_md) values ($id, '', '')"); @@ -113,29 +115,9 @@ EOD; 'url' => "/problems/template" ) ); - - /* - 3, - 'table_classes' => array('table', 'table-bordered', 'table-hover', 'table-striped'), - 'print_after_table' => function() { - global $myUser; - if (isSuperUser($myUser)) { - global $new_problem_form; - $new_problem_form->printHTML(); - } - }, - 'head_pagination' => true - ) - ); -?>*/ $pag_config = array('page_len' => 40); - $pag_config['col_names'] = array('*'); + $pag_config['col_names'] = array('best_ac_submissions.submission_id as submission_id', 'problems.id as id', 'problems.is_hidden as is_hidden', 'problems.title as title', 'problems.submit_num as submit_num', 'problems.ac_num as ac_num', 'problems.zan as zan', 'problems.extra_config as extra_config', 'problems.uploader as uploader'); $pag_config['table_name'] = "problems left join best_ac_submissions on best_ac_submissions.submitter = '{$myUser['username']}' and problems.id = best_ac_submissions.problem_id"; $pag_config['cond'] = $cond; $pag_config['tail'] = "order by id asc";