Hallo,
wir nutzen bei uns den Gewinn-MOD und heute ist mir erst aufgefallen, dass die untere Tabelle "Mitspieler" irgendwie nicht passt ..
PHP
- <table width="100%" cellpadding="5" cellspacing="0" border="0" class="news">
- <tr>
- <th>Mitspieler</th>
- </tr>
- </table>
- <table width="100%" cellpadding="0" cellspacing="0" border="0">
- <br />
- <tr>
- <td class="tabHeaderRandl">#</td>
- <td class="tabHeaderMid"> </td>
- <td class="tabHeaderMid">Name</td>
- <?php
- if ($CONFIG['TIPPGRUPPEN'] == 1)
- {
- ?>
- <td class="tabHeaderMid">Tippgruppe</td>
- <?php
- }
- ?>
- <td class="tabHeaderMid">Rang</td>
- <td class="tabHeaderMid">Punkte</td>
- <td class="tabHeaderMid"><center>Gewinn €</center></td>
- </tr>
- <?php
- $sql = "SELECT tb1.*, tb2.pkt
- FROM ". $CONFIG['MYSQL']['PREFIX'] ."users tb1
- LEFT JOIN ". $CONFIG['MYSQL']['PREFIX'] ."rangliste_boni tb2 ON tb2.uid = tb1.id
- WHERE tb1.bezahlt = 1
- ORDER BY tb2.pkt DESC, tb2.rang ASC";
- $sql = mysql_query($sql);
- $index = -1;
- $current_rank = -1;
- $user_per_rank = array();
- while ($row = mysql_fetch_array($sql))
- {
- $rank_temp = (int)getRanglistenplatz("boni", $row['id']);
- if ($current_rank != $rank_temp)
- {
- $index ++;
- $current_rank = $rank_temp;
- }
- if (($index + 1) > count($gewinne))
- {
- break;
- }
- $user_per_rank[$index] ++;
- }
- $betrag_per_rank = array();
- for ($i = 0; $i < count($user_per_rank); $i ++)
- {
- for ($j = 0; $j < $user_per_rank[$i]; $j ++)
- {
- $betrag_per_rank[$i] += $gewinne[$j + $offset];
- }
- $betrag_per_rank[$i] = $betrag_per_rank[$i] / $user_per_rank[$i];
- $offset += $user_per_rank[$i];
- }
- $i = 1;
- $sql = mysql_query("SELECT tb1.*, tb2.pkt
- FROM ". $CONFIG['MYSQL']['PREFIX'] ."users tb1
- LEFT JOIN ". $CONFIG['MYSQL']['PREFIX'] ."rangliste_boni tb2 ON tb2.uid = tb1.id
- WHERE tb1.bezahlt = 1
- ORDER BY tb2.pkt DESC, tb2.rang ASC");
- $current_rank = 0;
- $index_betrag = 0;
- while ($row = mysql_fetch_array($sql))
- {
- $pkt = $row['pkt'];
- $rank = (int)getRanglistenplatz("boni", $row['id']);
- $name = $row['usr'];
- $id = $row['id'];
- $fav = $row['fav'];
- $tgroup = $row['department'];
- if ($reg == "0")
- $reg = "---";
- if ($rank <= 0)
- $rank = "-";
- else
- $rank .= ".";
- if ($pkt == "")
- $pkt = "-";
- $tdstyle = "";
- if ($status == "ONLINE")
- $tdstyle = "background-color:#99ccff; ";
- $ownstyle = "";
- if ($_SESSION['s_id'] == $id)
- $ownstyle = "font-weight:bold;font-size:11px";
- if ($current_rank != $rank)
- {
- $current_rank = $rank;
- $gewinn = str_replace ('.', '.',sprintf("%01.2f", $betrag_per_rank[$index_betrag]));
- $index_betrag ++;
- }
- ?>
- <tr>
- <td class="tabCKRandl" style="<?php echo $tdstyle; ?>text-align:left!important; width:20px;">
- <?php echo str_pad($i, 2, "0", STR_PAD_LEFT); ?>
- </td>
- <td class="tabCKMid" style="<?php echo $tdstyle; ?>text-align:left!important; width:30px;">
- <img style="border:0px; width:28px; height:20px; padding:0px; margin:0px;" src="<?php echo $CONFIG['PATH']."img/flags/". $row['fav'] .".png"; ?>" alt="fav">
- </td>
- <td class="tabCKMid" style="<?php echo $tdstyle; ?>text-align:left!important;">
- <a href="?page=statistik/profil/<?php echo $id; ?>">
- <span style="<?php echo $ownstyle; ?>"><?php echo $name; ?></span>
- <?php if ($CONFIG['USERNAME'] == 0){?>
- <i>(<span style="<?php echo $ownstyle; ?>"><?php echo $row['name']; ?>)</i>
- <?php } else {} ?>
- </a>
- </td>
- <?php
- if ($CONFIG['TIPPGRUPPEN'] == 1)
- {
- ?>
- <td class="tabCKMid" style="<?php echo $tdstyle; ?>text-align:left!important;">
- <span style="<?php echo $ownstyle; ?>"><?php echo $tgroup; ?></span>
- </td>
- <?php
- }
- ?>
- <td class="tabCKMid" style="<?php echo $tdstyle; ?>text-align:center; width:30px;">
- <span style="<?php echo $ownstyle; ?>"><?php echo $rank; ?></span>
- </td>
- <td class="tabCKMid" style="<?php echo $tdstyle; ?>text-align:center; width:50px;">
- <span style="font-weight:bold;font-size:11px"><?php echo $pkt; ?></span>
- </td>
- <td class="tabCKMid" style="<?php echo $tdstyle; ?>text-align:center; width:100px;">
- <span style="font-weight:bold;font-size:11px"><?php echo $gewinn > 0 ? $gewinn : ''; ?></span>
- </td>
- </tr>
- <?php
- $i++;
- }
- ?>
- </table>