} if (strlen($_GET['size']) > 0) { $size = get_to_mysql($_GET['size']); } if (strlen($where) > 0) { $query = $query . 'where ' . $where; } if (strlen($_GET['top']) == 0 && strlen($_GET['bottom']) > 0) { $is_prev = 1; $query = $query . ' order by submit_id asc '; } else { $query = $query . ' order by submit_id desc '; } $query = $query . " limit {$size} "; $ret = oj_query($query); set_ojinfo('title', 'ECUST Online Judge - Status list'); include 'include/header.php'; ?> <form action="" method="get"> User ID: <input name="user_id" <?php if (isset($status_user_name)) { echo ' value="' . htmlspecialchars($status_user_name) . '"'; } ?> /> Problem ID: <input name="pro_id" <?php
<?php require_once 'include/function.php'; set_ojinfo('title', 'ECUST Online Judge - Homepage'); include 'include/header.php'; Draw_search_box(); echo 'This is home page and is being redesigned. There will be no more big change before it come out. '; //phpinfo(); ?> <?php include 'include/footer.php'; ?>
<?php //$_GET['submit_id']:提交编号 require_once 'include/function.php'; if (!isset($_GET['submit_id'])) { redirect('status.php'); } $ce_id = get_to_mysql($_GET['submit_id']); $query = "select ce_info from ce_info where submit_id=" . intval($ce_id); $ret = oj_query($query); $row = mysql_fetch_row($ret); if (!isset($row[0]) || strlen($row[0]) == 0) { $row[0] = 'No compile error info. It seems that the code you sent is not friendly.'; } set_ojinfo('title', 'ECUST Online Judge - View compile error info'); include 'include/header.php'; ?> <pre> <?php echo htmlspecialchars($row[0]); ?> </pre> <center><a href='javascript:history.go(-1);'>Go Back</a></center> <?php include 'include/footer.php'; ?>
$ret = oj_query($query); $row = mysql_fetch_row($ret); if (!isset($row[0])) { redirect('error.php?msg=' . urlencode('No such submission')); } if ($row[0] != $_SESSION['user_id'] && !$_SESSION['is_admin']) { redirect('error.php?msg=' . urlencode('This is not your code')); } $query = "select code_content from code_info where submit_id=" . intval($code_id); $ret = oj_query($query); $row = mysql_fetch_row($ret); if (!isset($row[0])) { redirect('error.php?msg=' . urlencode("Can't find the code")); } set_ojinfo('title', 'ECUST Online Judge - View code'); set_ojinfo('highlight'); include 'include/header.php'; ?> <div id="highlight_styleswitcher" class="hl_ss"></div> <div id="highlight_code"> <pre><code> <?php echo htmlspecialchars($row[0]); ?> </code></pre></div> <center><a href='javascript:history.go(-1);'>Go Back</a></center> <?php include 'include/footer.php'; ?>
$hint = $row[6]; $source = htmlspecialchars($row[7]); $time_limit = htmlspecialchars($row[8]); $case_time_limit = htmlspecialchars($row[9]); $mem_limit = htmlspecialchars($row[10]); $accepted = htmlspecialchars($row[11]); $submits = htmlspecialchars($row[12]); $banned = $row[13]; $isspj = $row[14]; if ($banned != 0 && !isset($contest_id)) { if (!$is_admin) { redirect('error.php?msg=' . urlencode('Problem banned')); } } $id = $pro_id; set_ojinfo('title', "ECUST Online Judge - Problem {$id} - {$title}"); include 'include/header.php'; echo '<div class="problem_content">'; echo "<center>"; echo "<p class='subtitle'>{$title}"; if ($is_admin) { echo "<a href='admin_editproblem.php?pro_id={$id}'>[Edit]</a>"; } echo '</p>'; echo "<table>"; echo "<tr><td>Time Limit: {$time_limit}MS </td><td width=10></td><td> Memory Limit: {$mem_limit}K</td></tr>"; if ($case_time_limit != 0 && $case_time_limit < $time_limit) { echo "<tr><td colspan=3>Case Time Limit: {$case_time_limit}MS</td></tr>"; } if ($isspj != 0) { echo '<tr><td colspan=3><font color=red>Special judge</font></td></tr>';
if (empty($row['mail_id'])) { redirect("error.php?msg=" . urlencode("The Mail is not exsisted!")); } $to_user_id = $row['to_user_id']; $from_user_id = $row['from_user_id']; $mail_time = htmlspecialchars($row['mail_time']); $title = htmlspecialchars($row['title']); $content = htmlspecialchars($row['content']); if ($my_user_id != $to_user_id && $my_user_id != $from_user_id) { redirect("error.php?msg=" . urlencode("You cannot read this mail!")); } if ($to_user_id == $my_user_id) { $query = "update mails set readed=1 where mail_id=" . intval($mail_id); oj_query($query); } set_ojinfo('title', 'ECUST Online Judge - Read mail'); include 'include/header.php'; echo "<br><div style='background: #CAF'>"; if ($_GET['sender']) { echo "To: " . htmlspecialchars(user_id_to_name($to_user_id)); } else { echo "From: " . htmlspecialchars($from_user_name = user_id_to_name($from_user_id)); } echo "<br>Title: {$title}<br>"; echo "Time: {$mail_time}<br>"; echo "</div>"; echo "<div style='background: #CCF;padding-bottom: 20px'>"; echo "<hr/><pre class='mail'>{$content}</pre>"; echo "</div>"; echo '<center>'; if (!$_GET['sender']) {
<?php //$_GET['top']:显示大于该值的人 //$_GET['size']:一次显示多少人 require_once 'include/function.php'; set_ojinfo('title', 'ECUST Online Judge - Ranklist'); include 'include/header.php'; Draw_search_box('user'); $rank_top = 0; $rank_size = $ranklist_limit; if (isset($_GET['top'])) { $rank_top = $_GET['top']; } if (isset($_GET['size'])) { $rank_size = $_GET['size']; } $query = "select user_id,name,submits,solved,nick_name from users order by solved desc,submits asc,user_id asc limit {$rank_top},{$rank_size}"; $ret = oj_query($query); ?> <table border=1 class='table_list row_hover'> <tr> <th>Rank</th> <th>Name</th> <th>Nick name</th> <th>Solved</th> <th>Submit</th> </tr> <?php $rank_i = $rank_top; while ($row = mysql_fetch_assoc($ret)) {
if (!isset($_SESSION['user_id'])) { redirect('error.php?msg=' . urlencode('Please login first')); } if (!$_SESSION['is_admin']) { redirect('error.php?msg=' . urlencode('Access denied')); } if (!empty($_GET['pro_id'])) { $pro_id = get_to_mysql($_GET['pro_id']); $query = "select pro_id from problems where pro_id={$pro_id}"; $ret = oj_query($query); $row = mysql_fetch_row($ret); if (!isset($row[0])) { redirect('error.php?msg=' . urlencode('No such problem')); } } set_ojinfo('title', 'ECUST Online Judge - Rejudge'); include 'include/header.php'; if (empty($_GET['pro_id'])) { echo '<center>'; echo '<form action="admin_rejudge.php" method="get">'; echo 'Problem ID:<input name="pro_id"><br>'; echo '<input type="hidden" name="confirm" value="1">'; echo '<input type="submit" value="Rejudge">'; echo '</form>'; echo '</center>'; } else { if (isset($_GET['confirm'])) { echo '<h2>'; echo "Are you sure to rejudge the <a href='problemshow.php?pro_id={$pro_id}'>Problem {$pro_id}</a>?"; echo '</h2><br>'; echo "<center><a href='admin_rejudge.php?pro_id={$pro_id}'>Yes</a></center>";
$addc_desc = get_to_mysql($_POST['description']); $addc_start = get_to_mysql($_POST['start_time']); $addc_end = get_to_mysql($_POST['end_time']); $addc_pwd = get_to_mysql($_POST['att_pwd']); if (empty($addc_pwd)) { $addc_pub = 1; } else { $addc_pub = 0; } $query = 'insert into contest (title,start_time,end_time,description,ispub,att_pwd) values ' . "('{$addc_title}','{$addc_start}','{$addc_end}','{$addc_desc}',{$addc_pub},'{$addc_pwd}') "; $ret = oj_query($query); $ret = oj_query('select last_insert_id()'); $row = mysql_fetch_row($ret); redirect("showcontest.php?contest_id={$row[0]}"); } set_ojinfo('title', 'ECUST Online Judge - Add contest'); include 'include/header.php'; function draw_fillin($left, $input, $name, $prop = '', $right = '') { echo '<tr>'; echo '<td>' . htmlspecialchars($left) . '</td>'; echo "<td><{$input} name='{$name}' {$prop}></{$input}>{$right}</td>"; echo '</tr>'; } ?> <form method=post action="" onsubmit="return check_addc();"> <table align=center> <tr> <td>Contest ID:</td> <td>Auto</td>
$search_field = get_to_mysql($_GET['field']); $search_text = get_to_mysql($_GET['text']); $search_url = 'search.php?text=' . urlencode($search_text) . '&field=' . urlencode($search_field); $search_table = $search_array[$search_field]; if (!isset($search_table)) { $search_table = $search_array['title']; } if ($search_table[1] == 'user_mark') { if (!isset($_SESSION['user_id'])) { redirect('error.php?msg=' . urlencode('Please login first')); } if (!is_numeric($search_text)) { redirect('error.php?msg=' . urlencode('Failed to search')); } } set_ojinfo('title', 'ECUST Online Judge - Search'); include 'include/header.php'; Draw_search_box($search_field, get_to_html($_GET['text'])); echo '<table class="table_list row_hover" border=1>'; if ($search_table[1] == 'users') { $query = 'select user_id,name,emailaddr,submits,solved,nick_name,school,fromaddr ' . "from users where {$search_table[0]} like '%{$search_text}%' " . 'order by solved desc,submits asc '; $ret = oj_query($query); echo '<tr>'; echo '<th>No.</th>'; echo '<th>User ID</th>'; echo '<th>Nick name</th>'; echo '<th>Email</th>'; echo '<th>School</th>'; echo '<th>Come from</th>'; echo '<th>Solved</th>'; echo '<th>Submits</th>';
require_once 'include/function.php'; if (!isset($_SESSION['user_id'])) { redirect("error.php?msg=" . urlencode("Please login first!")); } $from_user_id = $_SESSION['user_id']; if (isset($_GET['name'])) { $to_user_name = $_GET['name']; } else { if (isset($_POST['to'])) { $to_user_name = $_POST['to']; } } if (strlen($to_user_name) > 0) { $to_user_id = name_to_user_id(get_to_mysql($to_user_name)); } set_ojinfo('title', 'ECUST Online Judge - SendMail'); include 'include/header.php'; if (isset($_POST['to'])) { $title = get_to_mysql($_POST['title']); $text = get_to_mysql($_POST['textarea']); $query = "insert into mails (to_user_id,from_user_id,mail_time,title,content,readed,reader_del,writer_del)" . " values({$to_user_id}, {$from_user_id}, now(), '{$title}', '{$text}', 0, 0, 0)"; oj_query($query); echo "<center><h1>Send Mail Successfully!</h1></center>"; } else { ?> <center><h1 style="color:#00f;">Write Mail</h1></center> <form name="form1" method="post" action="mailsend.php" onsubmit="return check_mail()"> <label><strong>To(name):</strong> <input name="to" type="text" id="mail_to" size="25" <?php if (strlen($to_user_name) > 0) { echo 'value="' . get_to_html($to_user_name) . '"';
if (0 != $pro_id) { $query = 'select * from problems where pro_id=' . $pro_id; $ret = oj_query($query); $row = mysql_fetch_assoc($ret); } function draw_fillin($left, $tag_name, $name, $prop = '', $right = '', $value = '') { echo '<tr>'; echo '<td>' . htmlspecialchars($left) . '</td>'; echo "<td><{$tag_name} name='{$name}' id='{$name}' {$prop}>" . htmlspecialchars($value) . "</{$tag_name}>{$right}</td>"; echo '</tr>'; } if (0 == $pro_id) { set_ojinfo('title', 'ECUST Online Judge - Add a Problem'); } else { set_ojinfo('title', 'ECUST Online Judge - Edit Problem ' . $pro_id); } include dirname(__FILE__) . '/../include/header.php'; ?> <form method=post action="admin_editproblem.php?pro_id=<?php echo $pro_id; ?> "> <table align=center> <tr> <td>Problem ID:</td> <td><?php echo $pro_id; ?> </td>
<?php //显示指定帖子 //$_GET['message_id']参数指定显示的帖子 //未完成 require_once 'include/function.php'; if (!isset($_GET['message_id'])) { redirect('bbs.php'); } include 'include/posts.php'; set_ojinfo('title', 'ECUST Online Judge - Detail of message'); include 'include/header.php'; ?> <table class='table_list'> <tr><td> <?php $message_id = intval($_GET['message_id']); $query = 'select discuss_info.*,users.name ' . 'from discuss_info inner join users on discuss_info.user_id=users.user_id ' . "where discuss_info.message_id={$message_id} "; $ret = oj_query($query); $row = mysql_fetch_assoc($ret); echo '<center><h2>' . htmlspecialchars($row['title']) . '</h2></center>'; echo '<p>'; echo "Posted by <a class='user' href='user.php?user_id={$row['user_id']}'>" . htmlspecialchars($row['name']) . '</a>'; echo " at {$row['reply_time']}"; if ($row['pro_id'] != 0) { echo " on <a class='problem' href='problemshow.php?pro_id={$row['pro_id']}'>Problem {$row['pro_id']}</a> "; } echo '<br>'; if ($row['topic_id'] != $row['message_id']) { $query = 'select discuss_info.title,discuss_info.reply_time,discuss_info.user_id,users.name ' . 'from discuss_info inner join users on discuss_info.user_id=users.user_id ' . "where discuss_info.message_id={$row['topic_id']}"; $ret2 = oj_query($query);
<?php require_once 'include/function.php'; set_ojinfo('title', 'ECUST Online Judge - Register'); if (isset($_POST['name'])) { $reg_name = get_to_mysql($_POST['name']); $reg_pwd = get_to_mysql($_POST['pwd']); $reg_email = get_to_mysql($_POST['email']); $reg_nick = get_to_mysql($_POST['nick']); $reg_school = get_to_mysql($_POST['school']); $reg_fromaddr = get_to_mysql($_POST['fromaddr']); if (strlen($reg_pwd) != 32) { redirect('register.php?msg=' . urlencode("Please make sure that you have enabled the Javascript.")); } $query = "select name from users where name='{$reg_name}'"; $ret = oj_query($query); $row = mysql_fetch_row($ret); if (!empty($row[0])) { if (get_magic_quotes_gpc()) { redirect('register.php?msg=' . urlencode("User " . stripslashes($_POST['name']) . " already exsist.")); } else { redirect('register.php?msg=' . urlencode("User " . $_POST['name'] . " already exsist.")); } } $query = "insert into users (name, user_pwd, emailaddr, reg_time, nick_name, school, fromaddr)" . " values ('{$reg_name}', '{$reg_pwd}', '{$reg_email}', now(), '{$reg_nick}', '{$reg_school}', '{$reg_fromaddr}')"; $ret = oj_query($query); include 'include/header.php'; echo "<center><h1>Register success</h1></center>"; } else { include 'include/header.php'; ?>
} } if (!isset($_GET['reverse'])) { $pro_sort_mark[$pro_sort_mark_sel] = '▲'; } else { $pro_sort_mark[$pro_sort_mark_sel] = '▼'; } } $pro_page_top = $pro_sort_pre; if (isset($_GET['order'])) { $pro_page_top = $pro_page_top . '&order=' . $_GET['order']; } if (isset($_GET['reverse'])) { $pro_page_top = $pro_page_top . '&reverse=1'; } set_ojinfo('title', 'ECUST Online Judge - Problem Status'); include 'include/header.php'; ?> <table width=100%> <tr> <td colspan=2><h2> <?php echo "<a href='problemshow.php?{$pro_sort_pre0}'>{$pro_id} - " . htmlspecialchars($row['title']) . '</a>'; ?> </h2></td> </tr> <tr> <td> <table class='table_list' border=1> <tr>
$user_email = htmlspecialchars($row['emailaddr']); $user_submit = htmlspecialchars($row['submits']); $user_solved = htmlspecialchars($row['solved']); $user_login = htmlspecialchars($row['last_login_time']); $user_reg = htmlspecialchars($row['reg_time']); $user_nick = htmlspecialchars($row['nick_name']); $user_school = htmlspecialchars($row['school']); $user_addr = htmlspecialchars($row['fromaddr']); function userinfo_display($left, $right) { echo '<tr>'; echo "<td>{$left}</td>"; echo "<td class='bottomline'>{$right}</td>"; echo '</tr>'; } set_ojinfo('title', "ECUST Online Judge - User {$user_name}"); include 'include/header.php'; ?> <table align=center> <tr> <td colspan=2 style='text-align:center;'><h2> <?php echo '<a href="mailsend.php?name=' . urlencode($row['name']) . '">' . $user_name . '</a>'; ?> </h2></td> </tr> <?php userinfo_display('Nick name:', $user_nick); userinfo_display('Last login time:', $user_login); userinfo_display('Register time:', $user_reg); userinfo_display('Solved:', "<a href='status.php?user_id={$user_id}&result=1'>{$user_solved}</a>");
<?php //$_GET['top']指定contest_id小于该值 //$_GET['show']指定显示哪类比赛,默认all,{'Scheduled'|'Past'|'Current'|'All'} require_once 'include/function.php'; set_ojinfo('title', 'ECUST Online Judge - Contest List'); include 'include/header.php'; ?> <table class="table_list wide_list" border=1> <tr> <th>ID</th> <th width=60%>Title</th> <th>Start time</th> <th>Type</th> <th>State</th> </tr> <?php $query = "select *,start_time>now() as pending,end_time<now() as ended from contest "; $where = ''; if (isset($_GET['top'])) { $clist_top = intval(get_to_mysql($_GET['top'])); $where = "contest_id<{$clist_top} "; } if (isset($_GET['show'])) { $clist_show = $_GET['show']; } if ($clist_show == 'Scheduled') { if (strlen($where) > 0) { $where = $where . 'and '; }
$editc_start = get_to_mysql($_POST['start_time']); $editc_end = get_to_mysql($_POST['end_time']); $editc_pwd = get_to_mysql($_POST['att_pwd']); if (empty($editc_pwd)) { $editc_pub = 1; } else { $editc_pub = 0; } $query = "update contest set title='{$editc_title}',start_time='{$editc_start}',end_time='{$editc_end}'," . "description='{$editc_desc}',ispub={$editc_pub},att_pwd='{$editc_pwd}' " . "where contest_id={$editc_id} "; $ret = oj_query($query); redirect("showcontest.php?contest_id={$editc_id}"); } $query = 'select * from contest where contest_id=' . $editc_id; $ret = oj_query($query); $row = mysql_fetch_assoc($ret); set_ojinfo('title', 'ECUST Online Judge - Edit contest'); include 'include/header.php'; function draw_fillin($left, $input, $name, $prop = '', $right = '', $value = '') { echo '<tr>'; echo '<td>' . htmlspecialchars($left) . '</td>'; echo "<td><{$input} name='{$name}' {$prop}>" . htmlspecialchars($value) . "</{$input}>{$right}</td>"; echo '</tr>'; } ?> <form method=post action="admin_editcontest.php?contest_id=<?php echo $editc_id; ?> " onsubmit="return check_editc();"> <table align=center>
<?php require_once '../include/function.php'; if (!isset($_SESSION['user_id'])) { redirect('error.php?msg=' . urlencode('Please login first')); } if (!permission_admin($_SESSION['user_id'])) { redirect('error.php?msg=' . urlencode('Access denied')); } set_ojinfo('title', 'ECUST Online Judge - Admin'); include '../include/header.php'; ?> Hello? <?php include '../include/footer.php'; ?>
} else { $contest_type = '<font color=blue>Public</font>'; } if ($row['pending'] != 0) { $contest_state = '<font color=green>Pending</font>'; } else { if ($row['ended'] != 0) { $contest_state = '<font color=red>Ended</font>'; } else { $contest_state = '<font color=blue>Running</font>'; } } $is_admin = isset($_SESSION['user_id']) && permission_admin($_SESSION['user_id']); $is_pending = $row['pending']; $is_ended = $row['ended']; set_ojinfo('title', "ECUST Online Judge - Contest - {$contest_title}"); include 'include/header.php'; ?> <table align=center> <tr> <td colspan=2><h2> <?php echo $contest_title; if ($is_admin) { echo "<a class='edit' href='admin_editcontest.php?contest_id={$contest_id}'>[Edit]</a>"; } ?> </h2></td> </tr> <tr> <td colspan=2 class=mid><?php
<?php require_once 'include/function.php'; set_ojinfo('title', 'ECUST Online Judge - Faq'); include 'include/header.php'; ?> <center><h1>Frequently Asked Questions</h1></center><br> Q:How to use 64-bit integer types ?<br> A:For C/C++, use <font color=blue>long long</font> as type name and use <font color=red>"%lld"</font> for scanf/printf.<br> <br> Q: why I get WA doing SPJ problem while I confirm that the code is correct?<br> A: In some cases of the SPJ problems, there will be WA replacing the PE. So be more careful when solving an SPJ problem.<br> <?php include 'include/footer.php'; ?>
<?php //��ʾ�������� //$_GET['top']����ָ��reply_id���ó����ֵ //$_GET['pro_id']ָ������ij��Ŀ������ //��ǰ��ҳ��û�� require_once 'include/function.php'; include 'include/posts.php'; set_ojinfo('title', 'ECUST Online Judge - Messages'); include 'include/header.php'; ?> <table class='table_list'> <tr><td> <ul> <?php $query = 'select discuss_info.*, LENGTH(discuss_info.content) as content_len, users.name ' . 'from discuss_info inner join users on discuss_info.user_id=users.user_id ' . 'where discuss_info.topic_id=discuss_info.message_id '; if (isset($_GET['pro_id'])) { $bbs_pro_id = intval($_GET['pro_id']); $query = $query . "and discuss_info.pro_id={$bbs_pro_id} "; } if (isset($_GET['top'])) { $bbs_top = intval($_GET['top']); $query = $query . "and reply_id<{$bbs_top} "; } $query = $query . 'order by reply_id desc '; $ret = oj_query($query); $bbs_count = 0; $bbs_last_reply = 0; $bbs_first_reply = 0; while ($row = mysql_fetch_assoc($ret)) { echo '<li>';
$old_pwd = get_to_mysql($_POST['pwd']); $new_pwd = get_to_mysql($_POST['newpwd']); $new_email = get_to_mysql($_POST['email']); $new_nick = get_to_mysql($_POST['nick']); $new_school = get_to_mysql($_POST['school']); $new_fromaddr = get_to_mysql($_POST['fromaddr']); if ($old_pwd != $row['user_pwd']) { redirect('modifyuser.php?msg=' . urlencode('Wrong password.')); } $query = "update users set emailaddr='{$new_email}', nick_name='{$new_nick}', school='{$new_school}', fromaddr='{$new_fromaddr}' "; if (strlen($new_pwd) == 32) { $query = $query . ",user_pwd='{$new_pwd}' "; } $query = $query . "where user_id=" . intval($update_id); $ret = oj_query($query); set_ojinfo('title', 'ECUST Online Judge - Update your info'); include 'include/header.php'; echo "<center><h1>Update success</h1></center>"; } else { function draw_fillin($left, $name, $right) { echo '<tr>'; echo '<td>' . htmlspecialchars($left) . '</td>'; echo "<td><input name={$name} value='" . htmlspecialchars($right) . "'/></td>"; echo '</tr>'; } include 'include/header.php'; ?> <form action="modifyuser.php" method="post" onsubmit="return check_update()"> <table align="center">
$rank_size = $_GET['size']; } $receive = true; //read receive mails if (isset($_GET['send'])) { $receive = false; } //send box if ($receive) { $query = "select mail_id,from_user_id,mail_time,title,readed from mails " . "where to_user_id=" . intval($user_id) . " and reader_del=0 order by mail_time desc limit {$rank_top},{$rank_size}"; $ret = oj_query($query); } else { $query = "select mail_id,to_user_id,mail_time,title from mails " . "where from_user_id=" . intval($user_id) . " and writer_del=0 order by mail_time desc limit {$rank_top},{$rank_size}"; $ret = oj_query($query); } set_ojinfo('title', 'ECUST Online Judge - ShowMails'); include 'include/header.php'; ?> <center> <a href="maillist.php" <?php if ($receive) { echo "style='color:red'"; } ?> >Inbox</a>  <a href="maillist.php?send='true'" <?php if (!$receive) { echo "style='color:red'"; } ?>
<?php require_once 'include/function.php'; set_ojinfo('title', 'ECUST Online Judge - Error'); include 'include/header.php'; ?> <center><h1>Error: <?php echo get_to_html($_GET['msg']); ?> </h1> <br/> <a href='javascript:history.go(-1);'>Go Back</a> </center> <?php include 'include/footer.php'; ?>
$contest_stat[$i]['result'][$row[0]] = $row[1]; $contest_stat[$i]['total'] += $row[1]; $contest_stat['total']['result'][$row[0]] += $row[1]; $contest_stat['total']['total'] += $row[1]; } //language $query = 'select language,count(language) from submit_status ' . "where contest_id={$contest_id} and pro_id=" . $pro_id . ' group by language '; $ret = oj_query($query); while ($row = mysql_fetch_row($ret)) { $contest_stat[$i]['lang'][$row[0]] += $row[1]; $contest_stat['total']['lang'][$row[0]] += $row[1]; } } return $contest_stat; } set_ojinfo('title', 'ECUST Online Judge - Contest Statistics'); include 'include/header.php'; ?> <table align=center> <tr> <td><h2> <?php echo "<a href='showcontest.php?contest_id={$contest_id}'>{$contest_title}</a>"; ?> </h2></td> </tr> </table> <table class='table_list wide_list' border=1> <?php $contest_stat = get_contest_statistics();
$query = "update problems set submits=submits+1 where pro_id={$pro_id} "; oj_query($query); $query = "update users set submits=submits+1 where user_id={$user_id} "; oj_query($query); $query = "select result from user_submit where user_id={$user_id} and pro_id={$pro_id}"; $ret = oj_query($query); $row = mysql_fetch_row($ret); if (!isset($row[0])) { $query = "insert into user_submit (user_id,pro_id,result) values ({$user_id},{$pro_id},0)"; oj_query($query); $query = "update problems set submit_users=submit_users+1 where pro_id={$pro_id}"; oj_query($query); } redirect("status.php"); } set_ojinfo('title', 'ECUST Online Judge - Submit code'); include 'include/header.php'; if (isset($_POST['pro_id'])) { $_GET['pro_id'] = $_POST['pro_id']; } ?> <form name="form1" method="post" action="problemsubmit.php"> <label>Problem ID: <input type="text" name="pro_id" value="<?php if (isset($_GET['pro_id'])) { echo htmlspecialchars($_GET['pro_id']); } ?> "> </label>
} if (!empty($old_marked)) { foreach ($old_marked as $key => $val) { $query = "delete from user_mark where user_id=" . intval($user_id) . " and pro_id=" . intval($pro_id) . " and mark_id={$key}"; $ret = oj_query($query); unset($tag_marked[$key]); //echo $query . '<br>'; } } } $query = 'select mark_id,count(user_id) from user_mark ' . "where pro_id=" . intval($pro_id) . " group by mark_id"; $ret = oj_query($query); while ($row = mysql_fetch_row($ret)) { $tag_count[$row[0]] = $row[1]; } set_ojinfo('title', 'ECUST Online Judge - Add tag'); include 'include/header.php'; ?> <form action="" method="post"> <table align=center width=100% > <?php echo "<tr><td colspan='5'><h2><a href='problemshow.php?pro_id={$pro_id}'>Tags of Problem {$pro_id}</a></h2></td></tr>"; $query = 'select * from config_mark'; $ret = oj_query($query); $i = 0; while ($row = mysql_fetch_assoc($ret)) { if ($i == 0) { echo '<tr>'; } $now_mark_id = $row['mark_id'];