forked from AliabbasMerchant/codeTheGame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
104 lines (104 loc) · 3.15 KB
/
index.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
<html>
<head>
<title>
CodeTheGame - CO1531
</title>
<style type="text/css">
p {
font-family: sans-serif;
display:inline-block;
margin: 3px;
margin-bottom: 0px;
position: relative;
left: 50%;
margin-right: -50%;
transform: translate(-50%, 0%);
text-align: center;
font-size: 150%;
}
button {
font-size: 80%;
}
body {
background-color: aliceblue;
}
.header {
font-size: 200%;
color: red;
}
#yellowgreen {
color: yellowgreen
}
#ul {
text-decoration: underline;
}
table {
color: #333; /* Lighten up font color */
font-family: Helvetica, Arial, sans-serif; /* Nicer font */
width: 100%;
font-size: 150%;
border-collapse: collapse;
border-spacing: 0;
border-style: double;
border-width: 2px;
}
td, th {
border: 1px solid #CCC;
height: 40px;
}
th {
background: #F3F3F3;
font-weight: bold;
}
td {
background: #FAFAFA;
text-align: center;
}
#names {
font-style: italic;
font-size: 100%;
}
</style>
</head>
<body>
<div class = "header">
<p>
<span id = "ul">Code The Game</span><br>
<span id = "yellowgreen">CO1531</span>
</p>
</div>
<div>
<p id = "names">
(Swapnil Parekh, Harsh Chedda, Aliabbas Merchant)
</p>
</div>
<br>
<br>
<div>
<p>
<button id = "Dream11" onclick="window.open('dream11.php');">Dream XI</button>
</p>
</div>
<br>
<br>
<table class="myTable">
<tr>
<th> Player Name </th>
<th> Role </th>
<th> Team </th>
<th> Points </th>
</tr>
<?php
$str = file_get_contents('consolidated_data.json');
$json = json_decode($str, true); // decode the JSON into an associative array
foreach ($json as $field => $value) {
$name = $value['name'];
$role = $value['role'];
$team = $value['team'];
$points = $value['points'];
echo "<tr><td><a href='player.php?name=".$name." '> ",$name,"</a></td><td>",$role,"</td><td>",$team,"</td><td>",$points,"</td></tr>" ;
}
?>
</table>
</body>
</html>