Diff for /register/prgsrc/register.cgi between versions 1.16 and 1.17

version 1.16, 2003/07/16 02:08:28 version 1.17, 2003/09/04 21:09:47
Line 323  sub ListClubs { Line 323  sub ListClubs {
     my $sth;      my $sth;
     if ($args{'cid'}) {      if ($args{'cid'}) {
         $sth = $args{'dbh'}->prepare("          $sth = $args{'dbh'}->prepare("
 SELECT Child FROM ClubClub WHERE Parent=$args{'cid'}");  SELECT Child, Status FROM ClubClub WHERE Parent=$args{'cid'}");
     } else {      } else {
         $sth = $args{'dbh'}->prepare("          $sth = $args{'dbh'}->prepare("
 SELECT cid FROM ClubRegion WHERE rid=$args{'rid'}");  SELECT cid FROM ClubRegion WHERE rid=$args{'rid'}");
Line 350  END Line 350  END
 END  END
     }      }
     my @clubs=();      my @clubs=();
     while (my ($club)=$sth->fetchrow_array) {      my %stat=();
       while (my ($club,$status)=$sth->fetchrow_array) {
         push @clubs,"cid=$club";          push @clubs,"cid=$club";
           if ($status) {
               $stat{$club}=$status;
           }
     }      }
     my $clause = join(' OR ', @clubs);      my $clause = join(' OR ', @clubs);
     $sth=$args{'dbh'}->prepare("      $sth=$args{'dbh'}->prepare("
 SELECT cid, Name FROM Clubs WHERE $clause ORDER BY Name");  SELECT cid, Name FROM Clubs WHERE $clause ORDER BY Name");
     $sth->execute;      $sth->execute;
     while (my ($cid,$Name)=$sth->fetchrow_array) {      while (my ($cid,$Name)=$sth->fetchrow_array) {
         $result .= li("<a href=\"$self?cid=$cid\">$Name</a>\n");          my $res="<a href=\"$self?cid=$cid\">$Name</a>\n";
           if (exists $stat{$cid}) {
               $res .= " ($stat{$cid})\n";
           }
           $result .= li($res);
     }      }
     $result .= "</ul>\n";      $result .= "</ul>\n";
 }  }
Line 372  sub ListParents { Line 380  sub ListParents {
     my $sth;      my $sth;
   
     $sth = $args{'dbh'}->prepare("      $sth = $args{'dbh'}->prepare("
 SELECT Parent FROM ClubClub WHERE Child=$args{'cid'}");  SELECT Parent, Status FROM ClubClub WHERE Child=$args{'cid'}");
   
     $sth->execute;      $sth->execute;
                   
Line 388  SELECT Parent FROM ClubClub WHERE Child= Line 396  SELECT Parent FROM ClubClub WHERE Child=
 END  END
   
     my @clubs=();      my @clubs=();
     while (my ($club)=$sth->fetchrow_array) {      my %stat=();
       while (my ($club,$status)=$sth->fetchrow_array) {
         push @clubs,"cid=$club";          push @clubs,"cid=$club";
           if ($status) {
               $stat{$club}=$status;
           }
     }      }
     my $clause = join(' OR ', @clubs);      my $clause = join(' OR ', @clubs);
     $sth=$args{'dbh'}->prepare("      $sth=$args{'dbh'}->prepare("
 SELECT cid, Name FROM Clubs WHERE $clause ORDER BY Name");  SELECT cid, Name FROM Clubs WHERE $clause ORDER BY Name");
     $sth->execute;      $sth->execute;
     while (my ($cid,$Name)=$sth->fetchrow_array) {      while (my ($cid,$Name)=$sth->fetchrow_array) {
         $result .= dt("<a href=\"$self?cid=$cid\">$Name</a>\n");          my $res = "<a href=\"$self?cid=$cid\">$Name</a>\n";
           if (exists $stat{$cid}) {
               $res .= " ($stat{$cid})\n";
           }
           $result .= dt($res);
     }      }
     $result .= "</dl></dd></dl>\n";      $result .= "</dl></dd></dl>\n";
 }  }

Removed from v.1.16  
changed lines
  Added in v.1.17


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>