$ND::TEMPLATE->param(TITLE => 'Defense Calls');
-die "You don't have access" unless isBC();
+die "You don't have access" unless isDC();
my $call;
if (param('call') =~ /^(\d+)$/){
$query->execute($ND::PLANET);
my @targets;
+my $i = 0;
while (my ($id,$coords,$metal,$crystal,$eonium,$seccents,$dists,$lastcovop,$user,$max) = $query->fetchrow){
push @targets,{Username => $user, Target => $id, Coords => $coords
, Metal => $metal, Crystal => $crystal, Eonium => $eonium, SecCents => $seccents
- , Dists => $dists, MaxResHack => $max, LastCovOp => $lastcovop, List => $list};
+ , Dists => $dists, MaxResHack => $max, LastCovOp => $lastcovop, List => $list, ODD => $i % 2};
+ $i++;
}
$BODY->param(Targets => \@targets);
$query->execute($planet->{id}) or $error .= $DBH->errstr;
my @intellists;
my @intel;
+ my $i = 0;
while (my $intel = $query->fetchrow_hashref){
if ($intel->{ingal}){
$intel->{missionclass} = 'ingal';
}else{
$intel->{missionclass} = $intel->{mission};
}
+ $intel->{ODD} = $i % 2;
push @intel,$intel;
+ $i++;
}
push @intellists,{Message => 'Incoming fleets', Intel => \@intel, Origin => 1};
my $query = $DBH->prepare(intelquery('t.alliance AS talliance,coords(t.x,t.y,t.z) AS target',"o.id = ? $showticks"));
$query->execute($planet->{id}) or $error .= $DBH->errstr;
my @intel;
+ my $i = 0;
while (my $intel = $query->fetchrow_hashref){
if ($intel->{ingal}){
$intel->{missionclass} = 'ingal';
}else{
$intel->{missionclass} = $intel->{mission};
}
+ $intel->{ODD} = $i % 2;
push @intel,$intel;
+ $i++;
}
push @intellists,{Message => 'Outgoing Fleets', Intel => \@intel, Target => 1};
my @intellists;
my @intel;
+ my $i = 0;
while (my $intel = $query->fetchrow_hashref){
if ($intel->{ingal}){
$intel->{missionclass} = 'ingal';
}else{
$intel->{missionclass} = $intel->{mission};
}
+ $intel->{ODD} = $i % 2;
push @intel,$intel;
+ $i++;
}
push @intellists,{Message => q{Intel where alliances doesn't match}, Intel => \@intel, Origin => 1, Target => 1};
$BODY->param(IntelLIsts => \@intellists);
$query->execute;
my @members;
+my $i = 0;
while (my ($username,$defense,$attack,$scan,$humor,$total,$rank) = $query->fetchrow){
push @members,{Username => $username, Defense => $defense, Attack => $attack
- , Scan => $scan, Humor => $humor, Total => $total, Rank => $rank};
+ , Scan => $scan, Humor => $humor, Total => $total, Rank => $rank, ODD => $i % 2};
+ $i++;
}
$BODY->param(Members => \@members);
-<table border="1">
+<table>
<tr>
<th>Coords</th><th>Metal</th><th>Crystal</th><th>Eonium</th><th>% Sec Centres</th><th>Dists</th><th>Max (15 agents)</th><th>Last covop (tick)</th>
</tr>
<TMPL_LOOP Targets>
- <tr align="center">
+ <tr align="center" class="<TMPL_IF ODD>odd<TMPL_ELSE>even</TMPL_IF>">
<td><a href="index.pl?page=check&coords=<TMPL_VAR NAME=Coords>"><TMPL_VAR NAME=Coords></a></td>
<td><TMPL_VAR NAME=Metal></td>
<td><TMPL_VAR NAME=Crystal></td>
<th>Ingal</th><th>Reported by</th>
</tr>
<TMPL_LOOP Intel>
- <tr>
+ <tr class="<TMPL_IF ODD>odd<TMPL_ELSE>even</TMPL_IF>">
<TMPL_IF Origin>
<td><a href="index.pl?page=intel&coords=<TMPL_VAR NAME=Origin>"><TMPL_VAR NAME=Origin></a></td>
<td><TMPL_VAR NAME=OAlliance></td>
-<table border="1">
+<table>
<tr>
<th>User</th>
<th><a href="index.pl?page=points&type=total">Total</a></th>
<th><a href="index.pl?page=points&type=rank">ND Rank</a></th>
</tr>
<TMPL_LOOP Members>
- <tr>
+ <tr class="<TMPL_IF ODD>odd<TMPL_ELSE>even</TMPL_IF>">
<td><TMPL_VAR NAME=Username></td>
<td><TMPL_VAR NAME=Total></td>
<td><TMPL_VAR NAME=Defense></td>
<p><a href="index.pl?page=top100&offset=<TMPL_VAR NAME=PrevOffset>&order=<TMPL_VAR NAME=Order>">Previous 100</a>
<a href="index.pl?page=top100&offset=<TMPL_VAR NAME=NextOffset>&order=<TMPL_VAR NAME=Order>">Next 100</a></p>
-<table border="1">
+<table>
<tr><th>Coords</th><th>Planet</th><th>Race</th>
<th><a href="index.pl?page=top100&offset=<TMPL_VAR NAME=Offset>&order=sizerank">Size (rank)</a></th>
<th><a href="index.pl?page=top100&offset=<TMPL_VAR NAME=Offset>&order=scorerank">Score (rank)</a></th>
</TMPL_IF>
</tr>
<TMPL_LOOP Planets>
- <tr align="center">
+ <tr align="center" class="<TMPL_IF ODD>odd<TMPL_ELSE>even</TMPL_IF>">
<td><a href="index.pl?page=check&coords=<TMPL_VAR NAME=Coords>"><TMPL_VAR NAME=Coords></a></td>
<td><TMPL_VAR NAME=Planet></td>
<td><TMPL_VAR NAME=Race></td>
$extra_columns FROM current_planet_stats ORDER BY $order LIMIT 100 OFFSET ?});
$query->execute($offset);
my @planets;
+my $i = 0;
while (my ($id,$coords,$ruler,$planet,$race,$size,$score,$value,$xp,$sizerank,$scorerank,$valuerank,$xprank
,$planet_status,$hit_us,$alliance,$relationship,$nick) = $query->fetchrow){
my %planet = (Coords => $coords, Planet => "$ruler OF $planet", Race => $race, Size => "$size ($sizerank)"
$planet{Relationship} = $relationship;
$planet{isHC} = 1;
}
+ $planet{ODD} = $i % 2;
push @planets,\%planet;
+ $i++;
}
$BODY->param(Planets => \@planets);