This repository has been archived by the owner on May 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
top15-short.php
112 lines (92 loc) · 2.78 KB
/
top15-short.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<meta name="description" content="description"/>
<meta name="keywords" content="keywords"/>
<meta name="author" content="author"/>
<link rel="stylesheet" type="text/css" href="default.css" media="screen"/>
<title>Codechef Ranking System</title>
</head>
<body>
<?php include_once "connect.php"; ?>
<div class="top">
<div class="header">
<div class="left">
Codechef Rankings
</div>
<div class="right">
<?php include "files/top-right.php"; ?>
</div>
</div>
</div>
<div class="container">
<?php include "files/nav.php";?>
<div class="main">
<div class="content">
<h2>Ranking According to Short Contest</h2><br />
<h4><a href="add.php">(To add new student codechef username go to Add menu)</a></h4><br />
<?php
if($value==0)
{
include "files/select-on-page.php";
}
else
{
$sno=1;
$result = mysql_query("SELECT * FROM detail WHERE rank3>0 AND college=".$value." ORDER BY rank3");
echo "<table>
<tr>
<th>Sno.</th>
<th>Username</th>
<th>Name</th>
<th>Country</th>
<th>Global Rank (Short)</th>
<th>Country Rank (Short)</th>
<th>Change Global (Short)</th>
<th></th>
</tr>";
$url='http://www.codechef.com/users/';
while($row = mysql_fetch_array($result))
{
if($sno<=15)
{
echo "<tr>";
$star=0;
if($row['old_rank3']==0)
{
$star=1;
$change=0;
}
else
$change= $row['old_rank3']-$row['rank3'] ;
echo "<td>" . $sno++. "</td>";
echo "<td><a href='".$url . $row['handle'] ."' target=_blank>".$row['handle'] . "</a></td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['country'] . "</td>";
echo "<td>" . $row['rank3'] . "</td>";
echo "<td>" . $row['rank4'] . "</td>";
if($star==1)
echo "<td>" . $change . "</td><td><img src='img/star.png' style='width:20px;height:20px;'/></td>";
else if($change>0)
echo "<td>" . $change . "</td><td><img src='img/up.png' style='width:20px;height:20px;'/></td>";
else
echo "<td>" . $change . "</td><td><img src='img/down.png' style='width:20px;height:20px;' /></td>";
echo "</tr>";
}
}
echo "</table>";
}
?>
</div>
<div class="sidenav">
<?php include "files/sidenav.php";?>
</div>
<div class="clearer"><span></span></div>
</div>
<div class="footer">© 2013 <a href="http://www.shivamkhandelwal.in/" target="_blank">Shivam Khandelwal</a> | Designed and Developed by Shivam Khandelwal
</div>
</div>
</body>
</html>