}elsif (param('show') eq 'uncovered'){
$where = 'not covered';
}
+ my $pointlimits = $DBH->prepare(q{SELECT value :: int FROM misc WHERE id = ?});
+ my ($minpoints) = $DBH->selectrow_array($pointlimits,undef,'DEFMIN');
+ my ($maxpoints) = $DBH->selectrow_array($pointlimits,undef,'DEFMAX');
+
my $query = $DBH->prepare(qq{
SELECT c.id, coords(p.x,p.y,p.z), u.defense_points, c.landing_tick,
TRIM('/' FROM concat(p2.race||' /')) AS race, TRIM('/' FROM concat(i.amount||' /')) AS amount,
my @calls;
my $i = 0;
while (my $call = $query->fetchrow_hashref){
+ if ($call->{defense_points} < $minpoints){
+ $call->{DefPrio} = 'LowestPrio';
+ }elsif ($call->{defense_points} < $maxpoints){
+ $call->{DefPrio} = 'MediumPrio';
+ }else{
+ $call->{DefPrio} = 'HighestPrio';
+ }
$i++;
$call->{ODD} = $i % 2;
$call->{shiptype} = escapeHTML($call->{shiptype});
<TMPL_LOOP Calls>
<tr align="center" class="<TMPL_IF ODD>odd<TMPL_ELSE>even</TMPL_IF>">
<td><a href="index.pl?page=calls&call=<TMPL_VAR NAME=Id>"><TMPL_VAR NAME=Id></a></td>
- <td><TMPL_VAR NAME=Coords> (<TMPL_VAR NAME=Defense_points>)</td>
+ <td class='<TMPL_VAR NAME=DefPrio>'><TMPL_VAR NAME=Coords> (<TMPL_VAR NAME=Defense_points>)</td>
<td><TMPL_VAR NAME=Landing_tick></td>
<td><TMPL_VAR NAME=Race></td>
<td><TMPL_VAR NAME=Amount></td>