forked from c0deina/csgojackpotV2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
top.php
136 lines (130 loc) · 4.9 KB
/
top.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
@include_once "langdoc.php";
if(!isset($_COOKIE['lang'])) {
setcookie("lang","en",2147485547);
$lang = "en";
} else $lang = $_COOKIE["lang"];
$sitename = "GGSKINS.CF";
$title = "$sitename - TOP10";
@include_once('set.php');
@include_once('steamauth/steamauth.php');
@include_once('steamauth/userInfo.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title><?php echo $title ?></title>
<link rel="stylesheet" href="css/style.css">
<link rel="shortcut icon" href="fav.ico" type="image/x-icon">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="js/noty/packaged/jquery.noty.packaged.min.js"></script>
<script src="js/main.js"></script>
</head>
<body>
<header id="header">
<div style=" width: 1100px; margin: auto;">
<strong class="logo"><a href="/"><?php echo $title ?></a></strong>
<div style="float: right;">
<?php
if(!isset($_SESSION["steamid"])) {
steamlogin();
//echo '<div style="display: inline-block; margin: 35px 90px 0 0; color: #eee; font-size: 12pt;"><a href=en.php><img src=img/en.gif></a><a href=ru.php><img src=img/ru.gif></a></div>';
echo "<a class=\"btns\"></a>";
echo "<a class=\"btn\" href=\"?login\">".$msg[$lang]["login2"]."</a>";
} else {
//echo '<div style="display: inline-block; margin: 35px 90px 0 0; color: #eee; font-size: 12pt;"><a href=en.php><img src=img/en.gif></a><a href=ru.php><img src=img/ru.gif></a> '.$msg[$lang]["loggedin"].' sf</div>';
echo '<div style="display: inline-block; margin: 35px 110px 0 0; color: #eee; font-size: 12pt;">'.$msg[$lang]["loggedin"].' '.$steamprofile['personaname'].' </div><div style="display: inline-block; position: absolute; margin-top: 28px; margin-left: -100px "><img src="'.$steamprofile['avatar'].'"></div>';
echo "<a class=\"btn\" href=\"steamauth/logout.php\">".$msg[$lang]["logout"]."</a>";
mysql_query("UPDATE users SET name='".$steamprofile['personaname']."', avatar='".$steamprofile['avatarfull']."' WHERE steamid='".$_SESSION["steamid"]."'");
}
?>
</div>
</div>
</header>
<div id="wrapper">
<div id="main">
<div class="sidebar">
<nav id="nav">
<h2><?php echo $msg[$lang]["menu"]; ?></h2>
<ul>
<li><a href="/"><?php echo $msg[$lang]["mainpage"]; ?></a></li>
<li><a href="/history"><?php echo $msg[$lang]["history"]; ?></a></li>
<li><a href="/top"><?php echo $msg[$lang]["top"]; ?></a></li>
</ul>
</nav>
<?php
if(isset($_SESSION["steamid"])) {
?>
<nav id="nav">
<h2><?php echo $msg[$lang]["pmenu"]; ?></h2>
<ul>
<li><a href="./settings.php"><?php echo $msg[$lang]["settings"]; ?></a></li>
<li><a href="steamauth/logout.php"><?php echo $msg[$lang]["logout"]; ?></a></li>
</ul>
</nav>
<?php } ?>
<h3>Last winners</h3>
<div class="last-winner">
<?php
$lastgame = fetchinfo("value","info","name","current_game");
$lastwinner = fetchinfo("userid","games","id",$lastgame-1);
$winnercost = fetchinfo("cost","games","id",$lastgame-1);
$winnerpercent = round(fetchinfo("percent","games","id",$lastgame-1),1);
$winneravatar = fetchinfo("avatar","users","steamid",$lastwinner);
$winnername = fetchinfo("name","users","steamid",$lastwinner);
?>
<div class="visual">
<img src="<?php echo $winneravatar ?>" alt="image description" width="109" height="109">
</div>
<h3 style="border-radius: 0px 0px 0px 0px;"><?php echo $winnername ?></h3>
<ul>
<li>
<span class="val"><?php echo $msg[$lang]["win"]; ?>:</span>
<span class="price">$<?php echo round($winnercost,2); ?></span>
</li>
<li>
<span class="val"><?php echo $msg[$lang]["chance"]; ?>:</span>
<span class="price"><?php echo $winnerpercent ?>%</span>
</li>
</ul>
</div>
</div>
<div class="content">
<h2><?php echo $msg[$lang]["top10"]; ?></h2>
<div class="history_game">
<ul>
<?php
$rs = mysql_query("SELECT * FROM `users` ORDER BY `won` DESC LIMIT 10");
$i = 1;
while($row = mysql_fetch_array($rs)) {
echo '<li>
<div class="visual">
<img src="'.$row["avatar"].'" width="105" height="105">
</div>
<div class="list">
<ul>
<li>'.$row["name"].'</li>
<li>
<span>'.$msg[$lang]["winnum"].': </span>
<span class="price">'.$row["games"].'</span>
</li>
<li>
<span>'.$msg[$lang]["winamount"].':</span>
<span class="price">$'.round($row["won"],2).'</span>
</li>
</ul>
</div>
<div class="stuff">
<div class="rate">
<p class="win">'.$i.'</p>
</div>
</div>
</li>';
$i++;
}
?>
</ul>
</div>
</div>
</body>
</html>