chiark / gitweb /
mason diversion etc.
[nj-awaymsg.git] / mason / main
index a9a881719d368e8c7d2b4f0e9546b6fd1719515d..a9bc72e20621da1a183218ecba490259ef544095 100755 (executable)
@@ -40,7 +40,7 @@ $sth->execute();
 <hr>
 <h2>Outbound messages</h2>
 <%perl>
-$sth = $dbh->prepare("SELECT * FROM texts ORDER BY desc");
+$sth = $dbh->prepare("SELECT * FROM texts ORDER BY textid");
 $sthi = $dbh->prepare(<<END);
     SELECT * FROM addresses
      WHERE textid = ?
@@ -54,8 +54,13 @@ $sth->execute();
 
 <&| txtable, tx => $row &>
 %    $sthi->execute($row->{'textid'});
+%    my $anyused = 0;
 %    while (my $rowi= $sthi->fetchrow_hashref()) {
 <tr><td>Used for:</td><td><% $rowi->{'emailaddr'} |h %></td></tr>
+%        $anyused++;
+%    }
+%    if ($anyused) {
+<tr><td colspan=2>Not currently in use</td></tr>
 %    }
 </&>
 <pre>