Issues (24)

views/partials/tree/singleElimination.blade.php (1 issue)

1
<?php
2
use Xoco70\LaravelTournaments\TreeGen\CreateSingleEliminationTree;
3
4
$singleEliminationTree = $championship->fightersGroups->where('round', '>=', $hasPreliminary + 1)->groupBy('round');
5
if (sizeof($singleEliminationTree) > 0) {
6
    $treeGen = new CreateSingleEliminationTree($singleEliminationTree, $championship, $hasPreliminary);
7
    $treeGen->build();
8
    $match = [];
9
//    dd($treeGen->brackets);
0 ignored issues
show
Unused Code Comprehensibility introduced by
63% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
10
}
11
?>
12
@if (sizeof($singleEliminationTree)>0)
13
14
    @if (Request::is('championships/'.$championship->id.'/pdf'))
15
        <h1> {{$championship->buildName()}}</h1>
16
    @endif
17
    <form method="POST" action="{{ route('tree.update', ['championship' => $championship->id])}}"
18
          accept-charset="UTF-8">
19
        {{ csrf_field() }}
20
        <input type="hidden" name="_method" value="PUT">
21
        <input type="hidden" id="activeTreeTab" name="activeTreeTab" value="{{$championship->id}}"/>
22
        {{  $treeGen->printRoundTitles() }}
23
24
        <div id="brackets-wrapper"
25
             style="padding-bottom: {{ ($championship->groupsByRound(1)->count() / 2 * 205) }}px">
26
            <!-- 205 px x 2 groups of 2-->
27
            @foreach ($treeGen->brackets as $roundNumber => $round)
28
                @foreach ($round as $matchNumber => $match)
29
                    @include('laravel-tournaments::partials.tree.brackets.fight')
30
31
                    @if ($roundNumber != $treeGen->noRounds)
32
                        <div class="vertical-connector"
33
                             style="top: {{  $match['vConnectorTop']  }}px; left: {{  $match['vConnectorLeft']  }}px; height: {{  $match['vConnectorHeight']  }}px;"></div>
34
                        <div class="horizontal-connector"
35
                             style="top: {{  $match['hConnectorTop']  }}px; left: {{  $match['hConnectorLeft']  }}px;"></div>
36
                        <div class="horizontal-connector"
37
                             style="top: {{  $match['hConnector2Top']  }}px; left: {{  $match['hConnector2Left']  }}px;"></div>
38
                    @endif
39
                @endforeach
40
            @endforeach
41
        </div>
42
        @endif
43
44
45
        <div class="clearfix"></div>
46
        <div align="right">
47
            <button type="submit" class="btn btn-success" id="update">
48
                Update Tree
49
            </button>
50
        </div>
51
52
53
    </form>