Changeset 92 for trunk/cgi-bin/main.cgi
- Timestamp:
- 11/30/04 15:42:30 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/main.cgi
r87 r92 68 68 # Other global variables 69 69 my @masterblocks; 70 my @citylist; 71 my @poplist; 70 72 my %allocated; # Count for allocated blocks in a master block 71 73 my %free; # Count for free blocks (routed and unrouted) in a master block … … 77 79 # Use the connectDB function, otherwise we end up confusing ourselves 78 80 my $ip_dbh = connectDB; 81 my $sth; 79 82 80 83 # Slurp up the master block list - we need this several places 81 84 # While we're at it, initialize the related hashes. 82 my$sth = $ip_dbh->prepare("select * from masterblocks order by cidr");85 $sth = $ip_dbh->prepare("select * from masterblocks order by cidr"); 83 86 $sth->execute; 84 87 for (my $i=0; my @data = $sth->fetchrow_array(); $i++) { … … 91 94 } 92 95 96 # Initialize the city and poplist arrays 97 $sth = $ip_dbh->prepare("select * from cities order by city"); 98 $sth->execute; 99 my $i = 0; 100 my $j = 0; 101 while (my @data = $sth->fetchrow_array) { 102 $citylist[$i++] = $data[0]; 103 if ($data[1] eq 'y') { 104 $poplist[$j++] = $data[0]; 105 } 106 } 93 107 94 108 … … 778 792 or croak "Could not open assign.html: $!"; 779 793 $html = join('',<HTML>); 794 close HTML; 780 795 my $masterlist = "<select name=allocfrom><option selected>-</option>\n"; 781 796 foreach my $master (@masterblocks) { … … 784 799 $masterlist .= "</select>\n"; 785 800 $html =~ s|\$\$MASTERLIST\$\$|$masterlist|g; 786 close HTML; 787 } 801 my $pops = ''; 802 foreach my $pop (@poplist) { 803 $pops .= "<option>$pop</option>\n"; 804 } 805 $html =~ s|\$\$POPLIST\$\$|$pops|g; 806 } 807 my $cities = ''; 808 foreach my $city (@citylist) { 809 $cities .= "<option>$city</option>\n"; 810 } 811 $html =~ s|\$\$ALLCITIES\$\$|$cities|g; 788 812 789 813 print $html; … … 940 964 $html =~ s|\$\$CIRCID\$\$|$webvar{circid}|g; 941 965 $webvar{desc} = desanitize($webvar{desc}); 966 $html =~ s|\$\$DESC\$\$|$webvar{desc}|g; 942 967 $webvar{notes} = desanitize($webvar{notes}); 943 $html =~ s|\$\$DESC\$\$|$webvar{desc}|g;944 968 $html =~ s|\$\$NOTES\$\$|$webvar{notes}|g; 945 969 $html =~ s|\$\$ACTION\$\$|insert|g; … … 1303 1327 1304 1328 $html =~ s/\$\$BLOCK\$\$/$webvar{block}/g; 1329 $webvar{city} = desanitize($webvar{city}); 1305 1330 $html =~ s/\$\$CITY\$\$/$webvar{city}/g; 1306 1331 $html =~ s/\$\$ALLOCTYPE\$\$/$webvar{alloctype}/g; 1307 1332 $html =~ s/\$\$TYPEFULL\$\$/$full_alloc_types{$webvar{alloctype}}/g; 1308 1333 $html =~ s/\$\$CUSTID\$\$/$webvar{custid}/g; 1334 $webvar{circid} = desanitize($webvar{circid}); 1309 1335 $html =~ s/\$\$CIRCID\$\$/$webvar{circid}/g; 1336 $webvar{desc} = desanitize($webvar{desc}); 1310 1337 $html =~ s/\$\$DESC\$\$/$webvar{desc}/g; 1338 $webvar{notes} = desanitize($webvar{notes}); 1311 1339 $html =~ s/\$\$NOTES\$\$/$webvar{notes}/g; 1312 1340
Note:
See TracChangeset
for help on using the changeset viewer.