Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function renderBossComposition($current_boss){
- $str = file_get_contents('./content/benchmarks/compositions.json');
- $json_compositions = json_decode($str, true);
- for ($i = 1; $i <= 10; $i++) {
- $p_subtext[$i] = $json_compositions[$current_boss][0][$i]["subtext"];
- $p_profession[$i] = $json_compositions[$current_boss][0][$i]["profession"];
- $p_specialization[$i] = $json_compositions[$current_boss][0][$i]["specialization"];
- $p_build[$i] = $json_compositions[$current_boss][0][$i]["build"];
- $p_subgroup[$i] = $json_compositions[$current_boss][0][$i]["subgroup"];
- }
- echo'
- <div class="card">
- <div class="card-header clr-benchmarks">
- Composition
- </div>
- <div class="card-body text-center">
- ';
- //iterate through all possible subgroups 1-10
- for ($i = 1; $i <= 10; $i++) {
- $subgroupexists=false;
- //iterate through all players 1-10
- for ($j = 1; $j <= 10; $j++) {
- if ($p_subgroup[$j] == $i){
- //check if first time
- if (!$subgroupexists){
- $subgroupexists = true;
- echo '
- <div class="row">
- <div class="col-2">
- Group '.$i.'
- </div>
- ';
- }
- echo '<div class="col-2">';
- if ($p_profession[$j] == "any") { echo '<a name="any">';}
- else{ echo '<a href="/raids/'.$p_profession[$j].'/'.systemStringToURL($p_build[$j]).'/">';}
- echo'
- <img src="/assets/icons/professions/'.$p_specialization[$j].'-dark.png" alt="" class="img-fluid benchmarks-composition-icon">
- </a>
- <span class="benchmarks-composition-title">'.$p_subtext[$j].'</span>
- </div>
- ';
- }
- }
- //close subgroup div
- if ($subgroupexists){
- echo '
- </div>
- <hr>
- ';
- }
- }
- //close group composition divs
- echo '
- </div>
- </div>
- ';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement