-
Notifications
You must be signed in to change notification settings - Fork 1
/
giveaway.php
359 lines (323 loc) · 9.59 KB
/
giveaway.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
<?php
require 'steamauth/steamauth.php';
include_once 'db_connect.php';
?>
<?php
$stat="";
if(isset($_POST['sub'])){
$q="insert into giveaway(giveaway1) values($_SESSION[steamid])";
$res=mysqli_query($db,$q);
$stat="You have successfully entered the giveaway";
}
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/style.css" rel="stylesheet">
<link rel="icon" href="images/favicon.ico">
<link href="css/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="bootstrap/js/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<link href="spop/spop.min.css" rel="stylesheet" type="text/css">
<script src="spop/spop.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/css.php" media="screen">
<title>Home - GIC </title>
<script>
$(document).ready(function() {
var num = 80;
$(window).scroll(function() {
//if you hard code, then use console
//.log to determine when you want the
//nav bar to stick.
console.log($(window).scrollTop())
if ($(window).scrollTop() > num) {
$('#header-inner').addClass('navbar-fixed');
}
if ($(window).scrollTop() < num) {
$('#header-inner').removeClass('navbar-fixed');
}
});
});
</script>
<style>
.giv_img {
height: 150px;
width: 220px;
padding-bottom: 50px;
}
#stat1 {
background-color: beige;
color: dimgray;
text-align: center;
font-size: 200%;
}
a:hover {
text-decoration: none;
}
</style>
</head>
<body>
<header>
<div id="header-inner">
<a href="index.php" id="logo"></a>
<nav>
<a href="#" id="menu-icon"></a>
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="servers.php">Servers</a></li>
<li><a href="download.php">Downloads</a></li>
<li><a href="http://gaminginstitute.in/bans/">Sourcebans</a></li>
<li><a href="about.php">About us</a></li><br>
<div id="login">
<?php
if(!isset($_SESSION['steamid'])) {
loginbutton("rectangle"); //login button
} else {
include ('steamauth/userInfo.php'); //To access the $steamprofile array
//Protected content
?>
<div class="dropdown">
<?php echo "<img src='".$_SESSION['steam_avatar']."'>"; ?>
<div class="dropdown-content">
<a href="profile.php" class="drop">Dashboard</a>
<a href="clans.php" class="drop">Clans</a>
<a href="#" class="drop">
<?php logoutbutton(); } ?>
</a>
</div>
</div>
</div>
</ul>
</nav>
</div>
</header><br>
<div id="stat1">
<?php echo $stat; ?>
</div>
<h2 style="color:#6991AC; margin: 0 auto"><b>Game Giveaway</b></h2>
<center>
<h4>
<ol>
<li><a href="http://steamcommunity.com/groups/gamiin" target="_blank">Click here </a>to invite your friends to GIC group if you have not invited your friends yet. Your entry to giveaway will be cancelled if you will enter without inviting.</li>
<li>All games are indian region locked.</li>
<li>In case if any non-indian player wins any game , he/she will be given one TF2 key in place of that game.</li>
<li>All games will be delivered through steam gifts.</li>
</ol>
</h4>
</center><br><br>
<img src="images/giveaway/terraria.jpg" class="giv_img">
<img src="images/giveaway/priml%20carnage.jpg" class="giv_img">
<img src="images/giveaway/rust.jpg" class="giv_img">
<img src="images/giveaway/kill%20bad%20guy.jpg" class="giv_img">
<img src="images/giveaway/rocket%20league.jpg" class="giv_img">
<img src="images/giveaway/verdun.jpg" class="giv_img">
<img src="images/giveaway/blockstorm.jpg" class="giv_img">
<img src="images/giveaway/castleminer.jpg" class="giv_img">
<img src="images/giveaway/detour.jpg" class="giv_img">
<img src="images/giveaway/guncraft.jpg" class="giv_img">
<img src="images/giveaway/iron%20brigade.jpg" class="giv_img">
<img src="images/giveaway/primal%20fear.jpg" class="giv_img">
<img src="images/giveaway/wanderlust.jpg" class="giv_img">
<img src="images/giveaway/windward.jpg" class="giv_img">
<img src="images/giveaway/worms%20revolution.jpg" class="giv_img">
<img src="images/giveaway/strike%20vector.jpg" class="giv_img">
<img src="images/giveaway/sanctum.jpg" class="giv_img">
<img src="images/giveaway/insurgency.jpg" class="giv_img">
<br><br><br>
<?php
if(!isset($_SESSION['steamid'])) {
echo "<center><h3>Login to Enter</h3>";
loginbutton("rectangle"); //login button
echo "<center>";
} else { ?>
<center>
<form method="post">
<input type="submit" class="btn btn-info" name="sub" value="Enter Giveaway">
</form>
</center>
<br><br>
<?php } ?>
<br><br><br>
<hr style="display: block;
margin-top: 0.5em;
margin-bottom: 0.5em;
margin-left: auto;
margin-right: auto;
border-style: inset;
border-width: 1px;">
<center>
<h3>Entries</h3>
</center>
<br>
<?php
function getdetail($id){
$url="http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key= &steamids=$id";
$get_json=file_get_contents($url);
$decode=json_decode($get_json,true);
if(!empty($decode)){
foreach($decode['response']['players'] as $detail ){
$avatar=$detail['avatarmedium'];
$name=$detail['personaname'];
$profile_url=$detail['profileurl'];
}
}
echo "<img src=$avatar class='img-circle'>";
}
?>
<?php
$qu="select giveaway1 from giveaway";
$r=mysqli_query($db,$qu);
while($row=mysqli_fetch_array($r)){
getdetail($row[0]);
}
?>
<br><br><br><br><br>
<hr style="display: block;
margin-top: 0.5em;
margin-bottom: 0.5em;
margin-left: auto;
margin-right: auto;
border-style: inset;
border-width: 1px;">
<center>
<h3>Winners</h3>
<?php
$input = array("76561198031916532", "76561198140566270", "76561198141296166", "76561198153940908", "76561198163595630","76561198167597272","76561198170021443","76561198175935671","76561198188840902","76561198193029346","76561198198905201","76561198259637419","76561198260420177","76561198280936171","76561198283607211","76561198294860908","76561198319395652","76561198342083431","76561198361392476","NULL");
shuffle($input);
$rand_keys = array_rand($input, 20);
?>
<table class="table" style="margin-left:10%">
<tr>
<td>Game</td>
<td>
Winner
</td>
</tr>
<tr>
<td>Terraria</td>
<td>
<?php echo $input[$rand_keys[0]]; ?>
</td>
</tr>
<tr>
<td>Primal Carnage: Extinction</td>
<td>
<?php echo $input[$rand_keys[1]]; ?>
</td>
</tr>
<tr>
<td>Rust</td>
<td>
<?php echo $input[$rand_keys[2]]; ?>
</td>
</tr>
<tr>
<td>Kill The Bad Guy</td>
<td>
<?php echo $input[$rand_keys[3]]; ?>
</td>
</tr>
<tr>
<td>Kill The Bad Guy</td>
<td>
<?php echo $input[$rand_keys[4]]; ?>
</td>
</tr>
<tr>
<td>Rocket League</td>
<td>
<?php echo $input[$rand_keys[5]]; ?>
</td>
</tr>
<tr>
<td>Verdun</td>
<td>
<?php echo $input[$rand_keys[6]]; ?>
</td>
</tr>
<tr>
<td>Blockstorm</td>
<td>
<?php echo $input[$rand_keys[7]]; ?>
</td>
</tr>
<tr>
<td>CastleMiner Z</td>
<td>
<?php echo $input[$rand_keys[8]]; ?>
</td>
</tr>
<tr>
<td>Detour</td>
<td>
<?php echo $input[$rand_keys[9]]; ?>
</td>
</tr>
<tr>
<td>Guncraft</td>
<td>
<?php echo $input[$rand_keys[10]]; ?>
</td>
</tr>
<tr>
<td>Iron Brigade</td>
<td>
<?php echo $input[$rand_keys[11]]; ?>
</td>
</tr>
<tr>
<td>Blockstorm</td>
<td>
<?php echo $input[$rand_keys[12]]; ?>
</td>
</tr>
<tr>
<td>Primal Fear</td>
<td>
<?php echo $input[$rand_keys[13]]; ?>
</td>
</tr>
<tr>
<td>Wanderlust: Rebirth</td>
<td>
<?php echo $input[$rand_keys[14]]; ?>
</td>
</tr>
<tr>
<td>Windward</td>
<td>
<?php echo $input[$rand_keys[15]]; ?>
</td>
</tr>
<tr>
<td>Worms Revolution</td>
<td>
<?php echo $input[$rand_keys[16]]; ?>
</td>
</tr>
<tr>
<td>Strike Vector</td>
<td>
<?php echo $input[$rand_keys[17]]; ?>
</td>
</tr>
<tr>
<td>Sanctum</td>
<td>
<?php echo $input[$rand_keys[18]]; ?>
</td>
</tr>
<tr>
<td>Insurgency</td>
<td>
<?php echo $input[$rand_keys[19]]; ?>
</td>
</tr>
</table>
</center>
<br>
</body>
</html>