[eluser]srpurdy[/eluser]
View File Example
Code:
<?php foreach($show_champ as $mc):?>
<?php endforeach;?>
<?php if(!$show_champ):?>
<p>No data exists for this championship yet!</p>
<?php else:?>
<?php if($mc->team_pts == 'F' AND $mc->teams == 'Y' OR $mc->teams == 'N'):?>
<?php if($mc->multi_class == '1'):?>
<h4><?=$mc->car_name?></h4>
<table id="champlist" class="tablesorter">
<thead>
<tr>
<th>Pos.</th>
<th>Driver</th>
<th>Pts</th>
<?php if($mc->drop_mode == 'ON'):?>
<th>Pts Total</th>
<?php endif;?>
<th>Behind</th>
<th>S</th>
<th>P</th>
<th>W</th>
<th>T5s</th>
<th>Avg S</th>
<th>Avg F</th>
<th>Laps</th>
<th>LL</th>
<th>Pole%</th>
<th>Win%</th>
<th>LL%</th>
<th>Miles</th>
<th>KM</th>
<th>Inc/R</th>
<th>Inc</th>
<th>CPI</th>
</tr>
</thead>
<tbody>
<?php
$count = '1';
?>
<?php foreach($show_champ as $ch):?>
<tr>
<td><?=$count++?></td>
<td><?=$ch->driver_title?></td>
<td><?=/*$dp->points;*/$ch->champ_points?></td>
<?php if($mc->drop_mode == 'ON'):?>
<td><?=$ch->champ_points + $ch->drop_total?><?//=$add;?></td>
<?php endif;?>
<td><?$behind = $ch->champ_points - $pts_total_nmc?><?=$behind?></td>
<td><?=$ch->starts_total?></td>
<td><?=$ch->poles_total?></td>
<td><?=$ch->wins_total?></td>
<td><?=$ch->top5_total?></td>
<td><?=number_format($ch->avg_s_total, 1)?></td>
<td><?=number_format($ch->avg_f_total, 1)?></td>
<td><?=$ch->laps_total?></td>
<td><?=$ch->led_total?></td>
<td><?php if($ch->poles_total == 0):?>0%<?php else:?><?$pole_perc = $ch->poles_total / $ch->starts_total?><?$p_p = $pole_perc * 100; $p_p_result = number_format($p_p, 1);?><?=$p_p_result?>%<?php endif;?></td>
<td><?php if($ch->wins_total == 0):?>0%<?php else:?><?$win_perc = $ch->wins_total / $ch->starts_total?><?$w_p = $win_perc * 100; $w_p_result = number_format($w_p, 1);?><?=$w_p_result?>%<?php endif;?></td>
<td><?php if($ch->led_total == 0):?>0%<?php else:?><?$ll_perc = $ch->led_total / $ch->laps_total?><?$ll_p = $ll_perc * 100; $ll_p_result = number_format($ll_p, 1);?><?=$ll_p_result?>%<?php endif;?></td>
<td><?=$ch->miles_total?></td>
<td><?=$ch->km_total?></td>
<td><?php if($ch->inc_total == 0):?>0.0<?php else:?><?$inc_per_race = $ch->inc_total / $ch->starts_total?><?=number_format($inc_per_race, 1)?><?php endif;?></td>
<td><?=$ch->inc_total?></td>
<td><?$cpi = $ch->turns * $ch->laps_total?><?php if($ch->inc_total == 0):?><?=@number_format($cpi, 1, '.', '')?><?php else:?><?=@number_format($cpi / $ch->inc_total, 1, '.', '')?><?php endif;?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif;?>
So basically a new table, the drop total gets inserted into that table so I can join that with my championship to display the points with the drop races. Maybe this will come in handy for someone for something else.