Skip to content
This repository has been archived by the owner on Aug 30, 2018. It is now read-only.

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Protectator committed May 1, 2014
1 parent 1d71faa commit b9c6ed3
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions pages/player.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,30 +203,25 @@
$wonGames->bindParam(":sId", $summonerId);

// Check if each filter is activated

$filterNames = array(
$filters['fMode'] => ':typeStr',
$filters['fStart'] => ':from',
$filters['fEnd'] => ':to'
);
foreach($filterNames as $fName => $fParam) {
if ($fName) {
$summonerGames->bindParam($fParam, $fName);
$stats->bindParam($fParam, $fName);
$wonGames->bindParam($fParam, $fName);
}
}

// filter games by Champion
if ($filters['fChampion']) {
$summonerGames->bindParam(":championId", intval($filters['fChampion']));
$stats->bindParam(":championId", intval($filters['fChampion']));
$wonGames->bindParam(":championId", intval($filters['fChampion']));
}
// filter games by Mode
if ($filters['fMode']) {
$summonerGames->bindParam(":typeStr", $filters['fMode']);
$stats->bindParam(":typeStr", $filters['fMode']);
$wonGames->bindParam(":typeStr", $filters['fMode']);
}
// filter games by Date
if ($filters['fStart']) {
$summonerGames->bindParam(":from", $filters['fStart']);
$stats->bindParam(":from", $filters['fStart']);
$wonGames->bindParam(":from", $filters['fStart']);
}
if ($filters['fEnd']) {
$summonerGames->bindParam(":to", $filters['fEnd']);
$stats->bindParam(":to", $filters['fEnd']);
$wonGames->bindParam(":to", $filters['fEnd']);
}

$summonerGames->execute(); // Execute the request
$stats->execute(); // Execute the request
Expand Down

0 comments on commit b9c6ed3

Please sign in to comment.