-
Notifications
You must be signed in to change notification settings - Fork 0
/
50rankings.php
203 lines (188 loc) · 9.89 KB
/
50rankings.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
<?php
require "connect.php";
?>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>
50-50 Rankings
</title>
<link type="image/jpg" rel="icon" href="logo.jpg" />
<link rel="stylesheet" href="./css/global.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body></body>
<!-- navigation bar -->
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Pera Cricket</a>
</div>
<div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li>
<a class="btn btn-danger" href="t20rankings">T20</a>
</li>
<li><a href="/"><span class="glyphicon glyphicon-home"></span> Home</a></li>
<li><a href="view"><span class="glyphicon glyphicon-plus"></span> View Match Details</a></li>
<li><a href="player"><span class="glyphicon glyphicon-user"></span> View Player Details</a></li>
<li><a href="rankings"><span class="glyphicon glyphicon-star"></span> View Rankings</a></li>
<li><a href="records"><span class="glyphicon glyphicon-star-empty"></span> View Records</a></li>
</ul>
</div>
</div>
</div>
</nav>
<br /><br /><br />
<div class="container">
<div class="row">
<div class="col-xs-6">
<div class="panel-heading">
<button class="btn btn-primary" style="width:100%" id="bat_btn">Batting</button>
</div>
</div>
<div class="col-xs-6">
<div class="panel-heading">
<button class="btn btn-primary" style="width:100%" id="bowl_btn">Bowling</button>
</div>
</div>
</div>
</div>
<div class='container'>
<div class="panel-body collapse" id="batting">
<?php
$average_query = "SELECT * from batting_statistics ORDER BY Average DESC LIMIT 10";
$is_average_query_run = mysqli_query($connect, $average_query);
$itr = 1;
echo "<br><p align='center'><h4>50-50 Batting Rankings</h4>(According to the Batting Average)</p>";
while ($average_query_execute = mysqli_fetch_assoc($is_average_query_run)) {
$avg_query = "SELECT * FROM player_informations WHERE Reg_no='" . $average_query_execute['Reg_no'] . "'";
$is_avg_query_run = mysqli_query($connect, $avg_query);
$avg_query_execute = mysqli_fetch_assoc($is_avg_query_run);
if ($avg_query_execute["Firstname"] == NULL) {
$avg_query = "SELECT * FROM past_player_informations WHERE Reg_no='" . $average_query_execute['Reg_no'] . "'";
$is_avg_query_run = mysqli_query($connect, $avg_query);
$avg_query_execute = mysqli_fetch_assoc($is_avg_query_run);
}
echo "<div class='row'><div class='col-xs-1'>" . $itr . "</div><div class='col-xs-6'>" . $avg_query_execute['Firstname'] . " " . $avg_query_execute['Lastname'] . "</div>";
echo "<div class='col-xs-3'>" . $average_query_execute['Average'] . "</div></div>";
$itr++;
}
?>
<br><br>
<?php
$runs_query = "SELECT * from batting_statistics ORDER BY Runs DESC LIMIT 10";
$is_runs_query_run = mysqli_query($connect, $runs_query);
$itr = 1;
echo "<br><p align='center'><h4>50-50 Batting Rankings</h4>(According to Runs)</p>";
while ($runs_query_execute = mysqli_fetch_assoc($is_runs_query_run)) {
$rn_query = "SELECT * FROM player_informations WHERE Reg_no='" . $runs_query_execute['Reg_no'] . "'";
$is_rn_query_run = mysqli_query($connect, $rn_query);
$rn_query_execute = mysqli_fetch_assoc($is_rn_query_run);
if ($rn_query_execute["Firstname"] == NULL) {
$rn_query = "SELECT * FROM past_player_informations WHERE Reg_no='" . $runs_query_execute['Reg_no'] . "'";
$is_rn_query_run = mysqli_query($connect, $rn_query);
$rn_query_execute = mysqli_fetch_assoc($is_rn_query_run);
}
echo "<div class='row'><div class='col-xs-1'>" . $itr . "</div><div class='col-xs-6'>" . $rn_query_execute['Firstname'] . " " . $rn_query_execute['Lastname'] . "</div>";
echo "<div class='col-xs-3'>" . $runs_query_execute['Runs'] . "</div></div>";
$itr++;
}
?>
</div>
</div>
<div class='container'>
<div class="panel-body collapse" id="bowling">
<?php
$wickets_query = "SELECT * from bowling_statistics ORDER BY Wickets DESC LIMIT 10";
$is_wickets_query_run = mysqli_query($connect, $wickets_query);
$itr = 1;
echo "<br><p align='center'><h4>50-50 Bowling Rankings</h4>(According to No. of Wickets)</p>";
while ($wickets_query_execute = mysqli_fetch_assoc($is_wickets_query_run)) {
$wk_query = "SELECT * FROM player_informations WHERE Reg_no='" . $wickets_query_execute['Reg_no'] . "'";
$is_wk_query_run = mysqli_query($connect, $wk_query);
$wk_query_execute = mysqli_fetch_assoc($is_wk_query_run);
if ($wk_query_execute["Firstname"] == NULL) {
$wk_query = "SELECT * FROM past_player_informations WHERE Reg_no='" . $wickets_query_execute['Reg_no'] . "'";
$is_wk_query_run = mysqli_query($connect, $wk_query);
$wk_query_execute = mysqli_fetch_assoc($is_wk_query_run);
}
echo "<div class='row'><div class='col-xs-1'>" . $itr . "</div><div class='col-xs-6'>" . $wk_query_execute['Firstname'] . " " . $wk_query_execute['Lastname'] . "</div>";
echo "<div class='col-xs-3'>" . $wickets_query_execute['Wickets'] . "</div></div>";
$itr++;
}
?>
<br><br>
<?php
$econ_query = "SELECT * from bowling_statistics WHERE Overs>1 ORDER BY Econ ASC LIMIT 10";
$is_econ_query_run = mysqli_query($connect, $econ_query);
$itr = 1;
echo "<br><p align='center'><h4>50-50 Bowling Rankings</h4>(According to Economy)</p>";
while ($econ_query_execute = mysqli_fetch_assoc($is_econ_query_run)) {
$ec_query = "SELECT * FROM player_informations WHERE Reg_no='" . $econ_query_execute['Reg_no'] . "'";
$is_ec_query_run = mysqli_query($connect, $ec_query);
$ec_query_execute = mysqli_fetch_assoc($is_ec_query_run);
if ($ec_query_execute["Firstname"] == NULL) {
$ec_query = "SELECT * FROM past_player_informations WHERE Reg_no='" . $econ_query_execute['Reg_no'] . "'";
$is_ec_query_run = mysqli_query($connect, $ec_query);
$ec_query_execute = mysqli_fetch_assoc($is_ec_query_run);
}
echo "<div class='row'><div class='col-xs-1'>" . $itr . "</div><div class='col-xs-6'>" . $ec_query_execute['Firstname'] . " " . $ec_query_execute['Lastname'] . "</div>";
echo "<div class='col-xs-3'>" . $econ_query_execute['Econ'] . "</div></div>";
$itr++;
}
?>
<br><br>
<?php
$econ_query = "SELECT * from bowling_statistics WHERE Wickets>1 ORDER BY Average ASC LIMIT 10";
$is_econ_query_run = mysqli_query($connect, $econ_query);
$itr = 1;
echo "<br><p align='center'><h4>50-50 Bowling Rankings</h4>(According to Average)</p>";
while ($econ_query_execute = mysqli_fetch_assoc($is_econ_query_run)) {
$ec_query = "SELECT * FROM player_informations WHERE Reg_no='" . $econ_query_execute['Reg_no'] . "'";
$is_ec_query_run = mysqli_query($connect, $ec_query);
$ec_query_execute = mysqli_fetch_assoc($is_ec_query_run);
if ($ec_query_execute["Firstname"] == NULL) {
$ec_query = "SELECT * FROM past_player_informations WHERE Reg_no='" . $econ_query_execute['Reg_no'] . "'";
$is_ec_query_run = mysqli_query($connect, $ec_query);
$ec_query_execute = mysqli_fetch_assoc($is_ec_query_run);
}
echo "<div class='row'><div class='col-xs-1'>" . $itr . "</div><div class='col-xs-6'>" . $ec_query_execute['Firstname'] . " " . $ec_query_execute['Lastname'] . "</div>";
echo "<div class='col-xs-3'>" . $econ_query_execute['Average'] . "</div></div>";
$itr++;
}
?>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
$("#bat_btn").click(function () {
$("#bowling").collapse("hide");
$("#batting").collapse("show");
$("#bat_btn").prop("disabled", true);
$("#bowl_btn").prop("disabled", false);
});
$("#bowl_btn").click(function () {
$("#batting").collapse("hide");
$("#bowling").collapse("show");
$("#bowl_btn").prop("disabled", true);
$("#bat_btn").prop("disabled", false);
});
});
function call() {
alert("If you want to see T20 Rankings Click \"T20\" Red Button");
}
//call();
setTimeout(call, 5000);
</script>
</body>
</html>