Ignore:
Timestamp:
11/02/12 15:54:31 (11 years ago)
Author:
Kris Deugau
Message:

/trunk

Start on SQL in admin.cgi. See #34.

  • Convert Q-n-D allocation list on main page to use existing getTypeList()
  • Convert timestamp-update master block list to use new getMasterList(), with a flag set to return the last-modified time. Also convert main.cgi new assignment page to use this, with the flag set to not return the lastmod.
  • Tweak admin main template to match

While following the code for the master block list, I also removed
several useless globals (@masterblocks, %allocated, %free, and
%routed) since they were only used originally in one place (index
page from main.cgi), obsoleted by changes in r523, and in fact got
overridden locally before that anyway.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/admin.cgi

    r517 r541  
    106106  $sth->execute;
    107107
    108   my @typelist;
    109   my $count = 0;
    110   while (my ($type,$listname) = $sth->fetchrow_array) {
    111     my %row = (
    112         selected => $count++,
    113         type => $type,
    114         dispname => $listname
    115         );
    116     push @typelist, \%row;
    117   }
    118   $page->param(typelist => \@typelist);
    119 
    120   my @masterlist;
    121   $sth = $ip_dbh->prepare("select cidr,mtime from masterblocks order by cidr");
    122   $sth->execute;
    123   while (my ($cidr,$mtime) = $sth->fetchrow_array) {
    124     my %row = (
    125         master => $cidr,
    126         masterdate => $mtime
    127         );
    128     push @masterlist, \%row;
    129   }
    130   $page->param(masterlist => \@masterlist);
     108  my $tlist = getTypeList($ip_dbh, 'a');
     109  $tlist->[0]->{sel} = 1;
     110  $page->param(typelist => $tlist);
     111
     112  my $mlist = getMasterList($ip_dbh, 'm');
     113  $page->param(masterlist => $mlist);
    131114
    132115}
Note: See TracChangeset for help on using the changeset viewer.