]> ruin.nu Git - ndwebbie.git/commitdiff
minor fixes
authorMichael Andreen <harv@ruin.nu>
Mon, 22 Jan 2007 09:28:22 +0000 (09:28 +0000)
committerMichael Andreen <harv@ruin.nu>
Mon, 22 Jan 2007 09:28:22 +0000 (09:28 +0000)
ND/Web/Pages/Calls.pm
templates/calls.tmpl

index c9a51f7acf00479ac2ac0ba3a876ca56c0186584..73b0916b118515feca901ff848c31fa9b252625f 100644 (file)
@@ -144,13 +144,13 @@ sub render_body {
                my $ships = $DBH->prepare('SELECT ship,amount FROM fleet_ships WHERE fleet = ?');
                $fleets->execute($call->{member},$call->{landing_tick},$call->{landing_tick});
                my @fleets;
-               my $i = 0;
                while (my $fleet = $fleets->fetchrow_hashref){
                        if ($fleet->{back} == $call->{landing_tick}){
                                $fleet->{Fleetcatch} = 1;
                        }
                        $ships->execute($fleet->{id});
                        my @ships;
+                       my $i = 0;
                        while (my $ship = $ships->fetchrow_hashref){
                                $i++;
                                $ship->{ODD} = $i % 2;
@@ -163,15 +163,14 @@ sub render_body {
 
 
                $fleets = $DBH->prepare(q{
-                       SELECT username, id FROM fleets f JOIN users u USING (uid) WHERE target = $1 and landing_tick = $2
-                       AND back = landing_tick + eta - 1
+                       SELECT username, id,back - (landing_tick + eta - 1) AS recalled FROM fleets f JOIN users u USING (uid) WHERE target = $1 and landing_tick = $2
                        });
                $fleets->execute($call->{planet},$call->{landing_tick}) or $ND::ERROR .= p $DBH->errstr;
                my @defenders;
-               $i = 0;
                while (my $fleet = $fleets->fetchrow_hashref){
                        $ships->execute($fleet->{id});
                        my @ships;
+                       my $i = 0;
                        while (my $ship = $ships->fetchrow_hashref){
                                $i++;
                                $ship->{ODD} = $i % 2;
@@ -191,7 +190,7 @@ sub render_body {
                        ORDER BY p.x,p.y,p.z});
                $attackers->execute($call->{id});
                my @attackers;
-               $i = 0;
+               my $i = 0;
                while(my $attacker = $attackers->fetchrow_hashref){
                        $i++;
                        $attacker->{ODD} = $i % 2;
index 32a764bdb8869362356976184175aeba8609d91b..ebedb759df7c5b6ca15112c3c8c1fdb5efe5bc7f 100644 (file)
@@ -29,6 +29,7 @@
        <TMPL_LOOP Defenders>
        <div class="leftinfo">
                <p>Member: <TMPL_VAR NAME=Username></p>
+               <TMPL_IF Recalled><p style="color:red;">RECALLED!</p></TMPL_IF> 
                <table>
                        <tr><th>Ship</th><th>Amount</th></tr>
                        <TMPL_LOOP Ships>