$members->execute($alliance->{id});
my $i = 0;
while (my $member = $members->fetchrow_hashref){
+ $i++;
$member->{ODD} = $i % 2;
push @members,$member;
- $i++;
}
$BODY->param(Members => \@members);
}else{
$intel->{missionclass} = $intel->{mission};
}
+ $i++;
$intel->{ODD} = $i % 2;
push @intel,$intel;
- $i++;
}
$BODY->param(Intel => \@intel);
}else{
my @alliances;
my $i = 0;
while (my $alliance = $query->fetchrow_hashref){
+ $i++;
next if ($alliance->{score} < 1 && $alliance->{kscore} < 1);
$alliance->{ODD} = $i % 2;
push @alliances, $alliance;
- $i++;
}
$BODY->param(Alliances => \@alliances);
}
my @calls;
my $i = 0;
while (my $call = $query->fetchrow_hashref){
+ $i++;
$call->{ODD} = $i % 2;
$call->{shiptype} = escapeHTML($call->{shiptype});
push @calls, $call;
- $i++;
}
$BODY->param(Calls => \@calls);
}
my @targets;
my $i = 0;
while (my ($id,$coords,$metal,$crystal,$eonium,$seccents,$dists,$lastcovop,$user,$max) = $query->fetchrow){
+ $i++;
push @targets,{Username => $user, Target => $id, Coords => $coords
, Metal => $metal, Crystal => $crystal, Eonium => $eonium, SecCents => $seccents
, Dists => $dists, MaxResHack => $max, LastCovOp => $lastcovop, List => $list, ODD => $i % 2};
- $i++;
}
$BODY->param(Targets => \@targets);
}
sub listTargets {
- my $query = $ND::DBH->prepare(qq{SELECT t.id, r.id AS raid, r.tick+c.wave-1 AS landingtick, released_coords, coords(x,y,z),c.launched,c.wave
+ my $query = $ND::DBH->prepare(qq{SELECT t.id, r.id AS raid, r.tick+c.wave-1 AS landingtick, released_coords, coords(x,y,z),c.launched,c.wave,c.joinable
FROM raid_claims c
JOIN raid_targets t ON c.target = t.id
JOIN raids r ON t.raid = r.id
my $coords = "Target $target->{id}";
$coords = $target->{coords} if $target->{released_coords};
push @targets,{Coords => $coords, Launched => $target->{launched}, Raid => $target->{raid}
- , Target => $target->{id}, Tick => $target->{landingtick}, Wave => $target->{wave}, AJAX => $ND::AJAX};
+ , Target => $target->{id}, Tick => $target->{landingtick}, Wave => $target->{wave}
+ , AJAX => $ND::AJAX, JoinName => $target->{joinable} ? 'N' : 'J'
+ , Joinable => $target->{joinable} ? 'FALSE' : 'TRUE'};
}
my $template = HTML::Template->new(filename => "templates/targetlist.tmpl");
$template->param(Targets => \@targets);
$PLANET = undef;
$TEMPLATE = undef;
$TICK = undef;
-%GROUPS = undef;
+undef %GROUPS;
$ND::BODY = undef;
exit;
}else{
$intel->{missionclass} = $intel->{mission};
}
+ $i++;
$intel->{ODD} = $i % 2;
push @intel,$intel;
- $i++;
}
push @intellists,{Message => 'Incoming fleets', Intel => \@intel, Origin => 1};
}else{
$intel->{missionclass} = $intel->{mission};
}
+ $i++;
$intel->{ODD} = $i % 2;
push @intel,$intel;
- $i++;
}
push @intellists,{Message => 'Outgoing Fleets', Intel => \@intel, Target => 1};
}else{
$intel->{missionclass} = $intel->{mission};
}
+ $i++;
$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);
}else{
$intel->{missionclass} = $intel->{mission};
}
+ $i++;
$intel->{ODD} = $i % 2;
push @intel,$intel;
- $i++;
}
push @intellists,{Message => 'Incoming fleets', Intel => \@intel, Origin => 1};
}else{
$intel->{missionclass} = $intel->{mission};
}
+ $i++;
$intel->{ODD} = $i % 2;
push @intel,$intel;
- $i++;
}
push @intellists,{Message => 'Outgoing Fleets', Intel => \@intel, Target => 1};
body {
- padding-left: 12em;
+ padding-left: 14em;
/*padding-right: 12em;*/
font-family: sans-serif;
color: black;
padding: 0;
margin: 0;
position: absolute;
- width: 10em;
+ width: 14em;
top: 1em;
}
#leftbar{
ul.linkbar {
list-style-type: none;
- width: 10em;
+ width: 13.5em;
padding: 0;
margin: 0;
}
ul.linkbar a {
text-decoration: none;
}
-input.coord {
- width: 3.5em;
+input.coordsinput {
+ width: 4em;
+}
+input.small {
+ width: 1.7em;
}
tr.odd {
background: white;
my @members;
my $i = 0;
while (my ($username,$defense,$attack,$scan,$humor,$total,$rank) = $query->fetchrow){
+ $i++;
push @members,{Username => $username, Defense => $defense, Attack => $attack
, Scan => $scan, Humor => $humor, Total => $total, Rank => $rank, ODD => $i % 2};
- $i++;
}
$BODY->param(Members => \@members);
var obj = document.getElementById("targets");
if (obj){
clearObject(obj);
- var re = new RegExp("targetlist>(.*)</targetlist", "m");
+ var re = new RegExp("targetlist>((.|\\n)*)</targetlist");
if(re.test(http.responseText))
obj.innerHTML = RegExp.$1;
}
my @alliances;
my $i = 0;
while (my $alliance = $query->fetchrow_hashref){
+ $i++;
$alliance->{ODD} = $i % 2;
push @alliances,$alliance;
- $i++
}
$BODY->param(Alliances => \@alliances);
<ul class="linkbar">
<li><form action="index.pl" method="post"><p>
<input type="hidden" name="page" value="check"/>
- <input class="coord" type="text" name="coords" value="<TMPL_VAR NAME=Coords>"/>
- <input class="coord" type="submit" value="Check"/>
+ <input class="coordsinput" type="text" name="coords" value="<TMPL_VAR NAME=Coords>"/>
+ <input class="coordsbutton" type="submit" value="Check"/>
</p></form></li>
<li><a href="index.pl?page=raids">Web raids</a></li>
</ul>
+<p><input type="button" value="Update target list"
+ onclick = "listTargets('index.pl?page=raids&xml=1')"/>
+</p>
<TMPL_IF Targets>
<table>
<tr><th>Target</th><th>Tick</th></tr>
<td><a href="raids.php?raid=<TMPL_VAR NAME=Raid>#target<TMPL_VAR NAME=Target>">
<TMPL_VAR NAME=Tick></a></td>
<td><TMPL_UNLESS AJAX><a href="index.pl?page=raids&raid=<TMPL_VAR NAME=Raid>&cmd=Unclaim&target=<TMPL_VAR NAME=Target>&wave=<TMPL_VAR NAME=Wave>" >U</a>
- <TMPL_ELSE><input type="button" value="U" onclick =
+ <TMPL_ELSE>
+ <input type="button" value="U" class="small" onclick =
"claim('index.pl?page=raids&xml=1&raid=<TMPL_VAR NAME=Raid>',<TMPL_VAR NAME=Target>,<TMPL_VAR NAME=Wave>,'Unclaim')"/>
+ <input type="button" class="small" value="<TMPL_VAR NAME=JoinName>" onclick =
+ "claim('index.pl?page=raids&xml=1&raid=<TMPL_VAR NAME=Raid>',<TMPL_VAR NAME=Target>,<TMPL_VAR NAME=Wave>,'set&joinable=<TMPL_VAR NAME=Joinable>')"/>
</TMPL_UNLESS>
</td>
</tr>
$planet{Relationship} = $relationship;
$planet{isHC} = 1;
}
+ $i++;
$planet{ODD} = $i % 2;
push @planets,\%planet;
- $i++;
}
$BODY->param(Planets => \@planets);
my @users;
my $i = 0;
while (my $user = $query->fetchrow_hashref){
+ $i++;
$user->{ODD} = $i % 2;
push @users, $user;
- $i++;
}
$BODY->param(Users => \@users);
}