-
Notifications
You must be signed in to change notification settings - Fork 1
/
classic.php
66 lines (54 loc) · 2.64 KB
/
classic.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
<html>
<head>
<script src="//vk.com/js/api/xd_connection.js?2" type="text/javascript"></script>
<style type=”text/css”>
body {
background-color: transparent;
margin: 0; /* Убираем отступы */
padding: 0; /* Убираем поля */
-webkit-user-select: none;
/* user-select -- это нестандартное свойство */
-moz-user-select: none;
/* поэтому нужны префиксы */
-ms-user-select: none;
}
p, div {
font: normal normal normal 8px Comic Sans MS;
color: #000000;
}
a {
font: normal normal normal 18px Comic Sans MS;
color: #5d5d5d;
}
</style>
</head>
<body>
<?php
$link = mysqli_connect("localhost", "db", "password");
if (!$link) {
die('Ошибка подключения (' . mysqli_connect_errno() . ') '
. mysqli_connect_error());
}
mysqli_set_charset($link, "utf8");
mysqli_select_db($link, "db");
$y = 1;
$data = mysqli_query($link, "SELECT * FROM `results` ORDER BY score DESC, time");
echo '<table style = "font: normal normal normal 14px Comic Sans MS; color: #000000;" width="100%" cellspacing="0" cellpadding="0"> <tr> <td valign="top">';
while ($y < 7 and $row = mysqli_fetch_array($data, MYSQLI_ASSOC)){
echo '<img src = ' . $row['photo_url'] . ' height="32" width="32" style="float:left; margin: 0px 6px 0px 0; border: 3px #dec9ad groove">';
echo '<a> <strong>' . $y . '. ' .$row['name'] . '</strong><br /> ' . $row['score'] . ' очк. за ' . $row['time'] . ' секунд </a> <br />';
echo '<br / >';
$y++;
}
echo '</td> <td valign="top"> ';
while ($row = mysqli_fetch_array($data, MYSQLI_ASSOC) and $y < 13){
echo '<img src = ' . $row['photo_url'] . ' height="32" width="32" style="float:left; margin: 0px 6px 0px 0; border: 3px #dec9ad groove">';
echo '<a> <strong>' . $y . '. ' .$row['name'] . '</strong><br /> ' . $row['score'] . ' очк. за ' . $row['time'] . ' секунд </a> <br />';
echo '<br / >';
$y++;
}
echo '</td> </tr> </table> ';
mysqli_close($link);
?>
</body>
</html>