GreenShirt Display in Ranking
This commit is contained in:
parent
8595808fd2
commit
08ffdf5609
4 changed files with 29 additions and 14 deletions
|
|
@ -279,6 +279,7 @@ class UsersController extends Controller
|
|||
$rankingDisplay[$user_id]["gshirt_score"] = $roundtipps[$key]["gshirt_score"];
|
||||
$rankingDisplay[$user_id]["gshirt_totalscore"] = $roundtipps[$key]["gshirt_totalscore"];
|
||||
$rankingDisplay[$user_id]["gshirt_foulcount"] = $roundtipps[$key]["gshirt_foulcount"];
|
||||
$rankingDisplay[$user_id]["gshirt_leader"] = $roundtipps[$key]["gshirt_leader"];
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -507,6 +507,7 @@ class Tipp extends Model
|
|||
}
|
||||
|
||||
// B) SET GSCORE TOTAL EVERY ROUND ( and take fouls into consideration )
|
||||
$maxScorePerRound=array();
|
||||
foreach($user_ids as $user_id) {
|
||||
$foulCount=0;
|
||||
$totalScore=0;
|
||||
|
|
@ -514,6 +515,8 @@ class Tipp extends Model
|
|||
foreach ($round_ids as $round_id) {
|
||||
$key = $round_id . "_" . $user_id;
|
||||
|
||||
if (!array_key_exists($round_id, $maxScorePerRound)) { $maxScorePerRound[$round_id]=0; }
|
||||
|
||||
$score = $roundtipps[$key]['gshirt_score'];
|
||||
$isFoul = ( $roundtipps[$key]['rankscore'] == 0 && $totalScore > 0 );
|
||||
if ($isFoul) {
|
||||
|
|
@ -522,10 +525,14 @@ class Tipp extends Model
|
|||
if ($foulCount==3) {
|
||||
$foulCount=0;
|
||||
$totalScore=0;
|
||||
$roundtipps[$key]['gshirt_foul_reset']=1;
|
||||
} else {
|
||||
$roundtipps[$key]['gshirt_foul_reset']=0;
|
||||
}
|
||||
}
|
||||
$lastTotalRankScore=
|
||||
$totalScore += $score;
|
||||
if ($totalScore > $maxScorePerRound[$round_id]) { $maxScorePerRound[$round_id]=$totalScore; }
|
||||
$roundtipps[$key]['gshirt_totalscore']=$totalScore;
|
||||
$roundtipps[$key]['gshirt_foulcount']=$foulCount;
|
||||
|
||||
|
|
@ -534,6 +541,19 @@ class Tipp extends Model
|
|||
}
|
||||
}
|
||||
|
||||
// C) Set gscore_leader
|
||||
foreach ($round_ids as $round_id) {
|
||||
foreach($user_ids as $user_id) {
|
||||
$key = $round_id . "_" . $user_id;
|
||||
if ($roundtipps[$key]['gshirt_totalscore'] == $maxScorePerRound[$round_id] && $maxScorePerRound[$round_id]>0 ) {
|
||||
$roundtipps[$key]['gshirt_leader'] =1;
|
||||
} else {
|
||||
$roundtipps[$key]['gshirt_leader'] =0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//dd("User 11 Round 1 gshirt_score =".$roundtipps['1_11']['gshirt_score'].", totalscore=".$roundtipps['1_11']['gshirt_totalscore']);
|
||||
|
||||
|
||||
|
|
|
|||
BIN
pfosten/public/img/green_shirt.png
Normal file
BIN
pfosten/public/img/green_shirt.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
|
|
@ -60,6 +60,12 @@
|
|||
<span style="border-bottom: 1px solid #ccc; padding: 5px 10px;width:50px;">Tagessieg</span>
|
||||
</div>
|
||||
</th>
|
||||
<th style="height:140px;white-space: nowrap;">
|
||||
<div style="transform:translate(10px, 51px) rotate(270deg);width:30px;">
|
||||
<span style="border-bottom: 1px solid #ccc; padding: 5px 10px;width:50px;">Grünes Trikot</span>
|
||||
</div>
|
||||
</th>
|
||||
|
||||
<th style="height:140px;white-space: nowrap;">
|
||||
<div style="transform:translate(10px, 51px) rotate(270deg);width:30px;">
|
||||
<span style="border-bottom: 1px solid #ccc; padding: 5px 10px;width:150px;">Spieler</span>
|
||||
|
|
@ -75,17 +81,6 @@
|
|||
<span style="border-bottom: 1px solid #ccc; padding: 5px 10px;">Punkte Tag</span>
|
||||
</div>
|
||||
</th>
|
||||
<th> </th><!-- Spacer Column -->
|
||||
<th style="height:140px;white-space: nowrap;">
|
||||
<div style="transform:translate(10px, 51px) rotate(270deg);width:30px;">
|
||||
<span style="border-bottom: 1px solid #ccc; padding: 5px 10px;">G-Rang</span>
|
||||
</div>
|
||||
</th>
|
||||
<th style="height:140px;white-space: nowrap;">
|
||||
<div style="transform:translate(10px, 51px) rotate(270deg);width:30px;">
|
||||
<span style="border-bottom: 1px solid #ccc; padding: 5px 10px;">grünes Trikot</span>
|
||||
</div>
|
||||
</th>
|
||||
|
||||
<th> </th><!-- Spacer Column -->
|
||||
<th style="height:140px;white-space: nowrap;">
|
||||
|
|
@ -169,13 +164,12 @@
|
|||
<td class="table-bordered" > <span class="text list-unstyled" href="#" > {{ $entry["rank"] }} </span></td>
|
||||
<!-- <td class="table-bordered" align="center"> $entry["dayScoreWithRankScore"] </td> -->
|
||||
<td class="table-bordered"><div style="margin: 0 auto; width: 32px;"><img src="/img/crown.png" style="{{ ($entry["is_dayscorewinner"] ? 'float:left;width:32px;height:32px' : 'display: none;') }}"></div></td>
|
||||
<!-- <td class="table-bordered" align="center" style=""> <img src="/img/green_shirt.png"/> </td>-->
|
||||
<td class="table-bordered" align="center"> <img src="/img/green_shirt.png" style="{{ ($entry["gshirt_leader"] ? 'width:32px;height:32px' : 'display: none;') }}"/> </td>
|
||||
<td class="table-bordered"> <a class="text list-unstyled {{ $entry['user_id']==Auth::user()->id ? 'blink_text' : '' }}" name="playerid_{{$entry['user_id']}}" href="#" style="vertical-align: middle;">{{ $entry["user_name"] }} </a></td>
|
||||
<td class="table-bordered" align="center"> {{ $entry["totalRankScore"] }} </td>
|
||||
<td class="table-bordered" align="center"> {{ $entry["rankscore"] }} </td>
|
||||
<td class="table-bordered" align="center" style="border: 0px"> </td> <!-- Spacer column -->
|
||||
<td class="table-bordered" align="center" style=""> {{ $entry["grank"] }} </td>
|
||||
<td class="table-bordered" align="center" style="width:75px;"> (+{{ $entry["gshirt_score"]}}) <br/>{{$entry["gshirt_totalscore"]}}<br/> {{$entry["gshirt_foulcount"]." Fouls" }} </td>
|
||||
<td class="table-bordered" align="center" style="border: 0px"> </td> <!-- Spacer column -->
|
||||
<td class="table-bordered" align="center" style="{{$entry["trendCol1"]}}"> {{ str_replace("-1","x",$entry["tipp_score1"]) }} </td>
|
||||
<td class="table-bordered" align="center" style="{{$entry["trendCol1"]}}"> {{ str_replace("-1","x",$entry["tipp_score2"]) }} </td>
|
||||
<td class="table-bordered"><div style="margin: 0 auto; width: 32px;"><img src="/img/joker.png" style="{{ ($entry["joker1"] ? 'float:left;width:32px;height:32px' : 'display: none;') }}"></div></td>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue