예제 #1
0
<?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&nbsp;name</th>
		<th>Solved</th>
		<th>Submit</th>
	</tr>
<?php 
$rank_i = $rank_top;
while ($row = mysql_fetch_assoc($ret)) {
예제 #2
0
파일: index.php 프로젝트: eaglewei/ecustoj
<?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';
?>

예제 #3
0
파일: search.php 프로젝트: eaglewei/ecustoj
$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>';
    echo '</tr>';
    $i = 1;