handle = function() { global $myUser, $contest; mysql_query("delete from contests_registrants where username = '{$myUser['username']}' and contest_id = {$contest['id']}"); updateContestPlayerNum($contest); }; $unregister_form->submit_button_config['class_str'] = 'btn btn-danger btn-xs'; $unregister_form->submit_button_config['text'] = '取消报名'; $unregister_form->succ_href = "/contests"; $unregister_form->runAtServer(); } if ($has_contest_permission) { $pre_rating_form = new UOJForm('pre_rating'); $pre_rating_form->handle = function() { global $contest; foreach (DB::selectAll("select * from contests_registrants where contest_id = {$contest['id']}") as $reg) { $user = queryUser($reg['username']); DB::update("update contests_registrants set user_rating = {$user['rating']} where contest_id = {$contest['id']} and username = '{$user['username']}'"); } }; $pre_rating_form->submit_button_config['align'] = 'right'; $pre_rating_form->submit_button_config['class_str'] = 'btn btn-warning'; $pre_rating_form->submit_button_config['text'] = '重新计算参赛前的 rating'; $pre_rating_form->submit_button_config['smart_confirm'] = ''; $pre_rating_form->runAtServer(); } } ?>

printHTML(); ?>
已报名
当前尚未报名,您可以报名
#'.UOJLocale::get('username').'remote_addrrating'; $ip_owner = array(); foreach (DB::selectAll("select * from contests_registrants where contest_id = {$contest['id']} order by user_rating asc") as $reg) { $user = queryUser($reg['username']); $ip_owner[$user['remote_addr']] = $reg['username']; } } else { $header_row = '#'.UOJLocale::get('username').'rating'; } echoLongTable(array('*'), 'contests_registrants', "contest_id = {$contest['id']}", 'order by user_rating desc', $header_row, function($contest, $num) { global $myUser; global $show_ip, $ip_owner; $user = queryUser($contest['username']); $user_link = getUserLink($contest['username'], $contest['user_rating']); if (!$show_ip) { echo ''; } else { if ($ip_owner[$user['remote_addr']] != $user['username']) { echo ''; } else { echo ''; } } echo ''.$num.''; echo ''.$user_link.''; if ($show_ip) { echo ''.$user['remote_addr'].''; } echo ''.$contest['user_rating'].''; echo ''; }, array('page_len' => 100, 'get_row_index' => '', 'print_after_table' => function() { global $pre_rating_form; if (isset($pre_rating_form)) { $pre_rating_form->printHTML(); } } ) ); ?>