{$contest['name']} EOD; genMoreContestInfo($contest); if ($contest['cur_progress'] == CONTEST_NOT_STARTED) { $cur_rest_second = $contest['start_time']->getTimestamp() - UOJTime::$time_now->getTimestamp(); if ($cur_rest_second < $rest_second) { $upcoming_contest_name = $contest['name']; $upcoming_contest_href = "/contest/{$contest['id']}"; $rest_second = $cur_rest_second; } if ($myUser != null && hasRegistered($myUser, $contest)) { $contest_name_link .= ''.UOJLocale::get('contests::registered').''; } else { $contest_name_link .= ''.UOJLocale::get('contests::register').''; } } elseif ($contest['cur_progress'] == CONTEST_IN_PROGRESS) { if (hasRegistered($myUser, $contest)) { $contest_name_link .= ''.UOJLocale::get('contests::in progress').''; } else { $contest_name_link .= ''.UOJLocale::get('contests::in progress').''; } } elseif ($contest['cur_progress'] == CONTEST_PENDING_FINAL_TEST) { $contest_name_link .= ''.UOJLocale::get('contests::pending final test').''; } elseif ($contest['cur_progress'] == CONTEST_TESTING) { $contest_name_link .= ''.UOJLocale::get('contests::final testing').''; } elseif ($contest['cur_progress'] == CONTEST_FINISHED) { $contest_name_link .= ''.UOJLocale::get('contests::ended').''; } $last_hour = round($contest['last_min'] / 60, 2); $click_zan_block = getClickZanBlock('C', $contest['id'], $contest['zan']); echo ''; echo '', $contest_name_link, ''; echo '', ''.$contest['start_time_str'].'', ''; echo '', UOJLocale::get('hours', $last_hour), ''; echo '', '', '', ' ×'.$contest['player_num'].'', ''; echo '', '
'.$click_zan_block.'
', ''; echo ''; } ?>

'; $table_header .= ''.UOJLocale::get('contests::contest name').''; $table_header .= ''.UOJLocale::get('contests::start time').''; $table_header .= ''.UOJLocale::get('contests::duration').''; $table_header .= ''.UOJLocale::get('contests::the number of registrants').''; $table_header .= ''.UOJLocale::get('appraisal').''; $table_header .= ''; $table_config = [ 'page_len' => 40, 'div_classes' => ['card', 'mb-3'], 'table_classes' => ['table', 'uoj-table', 'mb-0', 'text-center'], ]; echoLongTable( ['*'], 'contests', "status != 'finished'", 'order by start_time asc, id asc', $table_header, echoContest, $table_config ); if ($rest_second <= 86400) { $notification = json_encode($upcoming_contest_name . " 已经开始了。是否要跳转到比赛页面?"); echo <<
$upcoming_contest_name 倒计时
EOD; } ?>