-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstat.php
95 lines (94 loc) · 2.88 KB
/
stat.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
<html>
<head>
<title> Статус посылок </title>
<script src="assest/js/jquery-3.2.0.min.js"></script>
<script>
</script>
<meta charset="utf-8">
<link type="text/css" rel="stylesheet" href="assest/css/style.css">
<style>
table{
border-collapse: collapse;
width: 100%;
}
td, th {
padding: 3px;
border: 2px solid black;
}
b.success{
color: green;
text-decoration: underline;
}
b.error{
color: #D00;
}
td.result{
text-align: center;
}
</style>
</head>
<body>
<?php
include('srchead');
?>
<div id="body">
<div id="general_content" style="width: 100%;">
<div id="post">
<h1>Статус посылок</h1>
<table>
<tbody>
<tr style="background: #99D;">
<td class="default" style="text-align: center;">
№
</td>
<td class="default">
IP
</td>
<td class="default">
Задача
</td>
<td class="default" style="text-align: center; width: 110px;">
Уровень задачи
</td>
<td class="default" style="text-align: center;">
Тип задачи
</td>
<td class="default" style="text-align: center;">
Статус
</td>
</tr>
<?php
include("tasks");
include("srcStatPos");
$length = count($stat);
for ($i = $length; $i>max(0, (count($stat) - 40)); $i--) {
if ($stat[$i-1]["ip"] == $ip) { ?>
<tr style="background: #DDF;font-weight: bold;">
<?php } else {
?><tr><?php
}
$resultFile = file_get_contents("user_files/".$i."/result.txt");
?>
<td class="default" style="text-align: center;">
<?php if (($stat[$i-1]["ip"] === $ip)or($type === 1)) {
echo "<a href=\"seecode.php?id=".$i."\" style=\"color: black; text-decoration: none;\">".$i."</a>";
} else {echo $i;}?>
</td>
<td class="default"><?php echo $stat[$i-1]["ip"]; ?></td>
<td class="default"><?php echo("<a href=\"problem.php?number=".$stat[$i-1]["task"]."\">".$stat[$i-1]["task"].". ".$task[$stat[$i-1]["task"] - 1]["title"]."</a>"); ?></td>
<td class="default" style="text-align: center;"><?php echo($task[$stat[$i-1]["task"]]['level']);?>
<td class="default" style="text-align: center;"><?php echo($task[$stat[$i-1]["task"]]["type"]);?>
<td class="result"><?php echo $resultFile; ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
<?php include("srcfooter");
?>
</body>
</html>