-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated homepage with all gameweek stats.
- Loading branch information
1 parent
8a625ee
commit dd8ee0b
Showing
7 changed files
with
137 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
ini_set('display_errors', 'Off'); | ||
require_once __DIR__ . "/config.php"; | ||
require_once __DIR__ . "/stats.php"; | ||
|
||
if(isset($_REQUEST['id']) && is_numeric($_REQUEST['id'])) { | ||
$gameweekNumber = $_REQUEST['id']; | ||
$topStats = getGameweekStatsForPosition1($conn, $gameweekNumber); | ||
$result = getGameweekStats($conn, $gameweekNumber); | ||
$count = 1; | ||
$html = ''; | ||
foreach ($result as $key => $value) { | ||
if($count == 1 || $count == 5) { | ||
$html .= '<div class="row">'; | ||
} | ||
$label = str_replace('_', ' ', $key); | ||
$label = ucwords($label); | ||
$html .= '<div class="col-md-3"> | ||
<section class="widget widget-simple-sm"> | ||
<div class="widget-simple-sm-statistic"> | ||
<div class="number">' . $value . '</div> | ||
<div class="caption color-blue">' . $label . ' </div> | ||
</div> | ||
</section> | ||
</div>'; | ||
if($count == 4 || $count == 7) { | ||
$html .= '</div>'; | ||
} | ||
$count++; | ||
} | ||
|
||
$table = ''; | ||
$topHtml .= '<div class="row">'; | ||
foreach($topStats as $key => $value) { | ||
$positionName = $value[0]['name']; | ||
$table .= '<div class="col-md-3"> | ||
<section class="card"> | ||
<header class="card-header card-header-lg"> | ||
Top ' . $positionName . 's | ||
</header> | ||
<div class="card-block"> | ||
<table class="table table-hover">'; | ||
foreach($value as $k => $v) { | ||
$table .= "<tr> | ||
<td>" . $v['web_name'] . "</td> | ||
<td>" . $v['total_points'] . "</td> | ||
</tr>"; | ||
} | ||
$table .= "</table></div></section></div>"; | ||
} | ||
$topHtml .= $table . '</div>'; | ||
echo $html . $topHtml; | ||
} else { | ||
echo 0; | ||
} | ||
?> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters