-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathendContest.php
More file actions
46 lines (33 loc) · 792 Bytes
/
endContest.php
File metadata and controls
46 lines (33 loc) · 792 Bytes
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
<?php
include_once("allFunctions.php");
?>
<?php
include 'header.php';
?>
<!-- Left Content Starts Here -->
<div class="mainbar">
<p class="headings">End Contest</p>
<?php
if(isset($_SESSION['SESS_LOGIN']))
session_start();
echo "Thanks for playing .";
$finalValues = getRates();
$usd = 0.0;
$count = 0;
$asd = getAmount($_SESSION['SESS_LOGIN']);
foreach($_SESSION['currentAmounts'] as $currencyName => $currencyAmount)
{
$usd = $usd + $currencyAmount * 1.0/(floatval($finalValues[$count++]));
}
echo "<br /> Your current amount is $usd";
if($usd> (10*$asd))
$usd=10*$asd;
setAmount($_SESSION['SESS_LOGIN'], $usd);
unset($_SESSION['currentAmounts']);
session_unset();
session_destroy();
?>
</div>
<?php
include 'footer.php'
?>