Changeset 91 for branches/stable/cgi-bin/main.cgi
- Timestamp:
- 11/30/04 14:22:50 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/cgi-bin/main.cgi
r89 r91 69 69 # Other global variables 70 70 my @masterblocks; 71 my @citylist; 72 my @poplist; 71 73 my %allocated; # Count for allocated blocks in a master block 72 74 my %free; # Count for free blocks (routed and unrouted) in a master block … … 78 80 # Use the connectDB function, otherwise we end up confusing ourselves 79 81 my $ip_dbh = connectDB; 82 my $sth; 80 83 81 84 # Slurp up the master block list - we need this several places 82 85 # While we're at it, initialize the related hashes. 83 my$sth = $ip_dbh->prepare("select * from masterblocks order by cidr");86 $sth = $ip_dbh->prepare("select * from masterblocks order by cidr"); 84 87 $sth->execute; 85 88 for (my $i=0; my @data = $sth->fetchrow_array(); $i++) { … … 92 95 } 93 96 97 # Initialize the city and poplist arrays 98 $sth = $ip_dbh->prepare("select * from cities order by city"); 99 $sth->execute; 100 my $i = 0; 101 my $j = 0; 102 while (my @data = $sth->fetchrow_array) { 103 $citylist[$i++] = $data[0]; 104 if ($data[1] eq 'y') { 105 $poplist[$j++] = $data[0]; 106 } 107 } 94 108 95 109 … … 779 793 or croak "Could not open assign.html: $!"; 780 794 $html = join('',<HTML>); 795 close HTML; 781 796 my $masterlist = "<select name=allocfrom><option selected>-</option>\n"; 782 797 foreach my $master (@masterblocks) { … … 785 800 $masterlist .= "</select>\n"; 786 801 $html =~ s|\$\$MASTERLIST\$\$|$masterlist|g; 787 close HTML; 788 } 802 my $pops = ''; 803 foreach my $pop (@poplist) { 804 $pops .= "<option>$pop</option>\n"; 805 } 806 $html =~ s|\$\$POPLIST\$\$|$pops|g; 807 } 808 my $cities = ''; 809 foreach my $city (@citylist) { 810 $cities .= "<option>$city</option>\n"; 811 } 812 $html =~ s|\$\$ALLCITIES\$\$|$cities|g; 789 813 790 814 print $html;
Note:
See TracChangeset
for help on using the changeset viewer.