-
Notifications
You must be signed in to change notification settings - Fork 0
/
prizes.php
36 lines (31 loc) · 1.42 KB
/
prizes.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
<?php include "access_check.php"; ?>
<?php
include "connect.php";
if(isset($_GET['gid'])) { $gid=$_GET['gid']; }
$winner_res=mysqli_query($conn, "SELECT * FROM winners where gid=$gid order by win_type;");
while($win=mysqli_fetch_array($winner_res))
{
$win_type=$win['win_type'];
$points=$win['points'];
$lbl=get_win_label($win_type);
if($win['pid'] != "")
{
echo "<button type='button' class='mb-1 mt-1 mr-1 btn btn-primary' id='$win_type' DISABLED><i class='fas fa-gift'></i> <strike>".$lbl."</strike></button>";
}
else
{
echo "<button type='button' class='mb-1 mt-1 mr-1 btn btn-primary' id='$win_type' onclick=\"claim_prize($tid, '$pid', $gid, '$win_type');\"><i class='fas fa-gift'></i> ".$lbl."</button>";
}
}
function get_win_label($win)
{
if(substr($win, 0, 2) == "J5") { return "JALDI 5";}
else if(substr($win, 0, 2) == "L1") { return "LINE 1";}
else if(substr($win, 0, 2) == "L2") { return "LINE 2";}
else if(substr($win, 0, 2) == "L3") { return "LINE 3";}
else if(substr($win, 0, 2) == "CN") { return "4 CORNERS";}
else if(substr($win, 0, 2) == "C6") { return "6 CORNERS";}
else if(substr($win, 0, 2) == "CS") { return "CENTRE STAR";}
else if(substr($win, 0, 2) == "FH") { return "FULL HOUSIE";}
}
?>