Changeset 12 for trunk/dns.cgi
- Timestamp:
- 09/10/09 17:41:30 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns.cgi
r11 r12 114 114 my ($count) = ($sth->fetchrow_array); 115 115 116 $page->param(ntot => $count); 117 $page->param(nfirst => 1); 118 $page->param(nlast => 10); 119 116 # fill the page-count and first-previous-next-last-all details 117 fill_pgcount($count,"records",domainName($dbh,$webvar{id})); 120 118 fill_fpnla($count); # should put some params on this sub... 121 122 ##fixme123 $page->param(domain => domainName($dbh,$webvar{id}));124 $page->param(id => $webvar{id});125 ##fixme126 119 127 120 $page->param(defrec => $webvar{defrec}); 128 121 if ($webvar{defrec} eq 'y') { 122 ##fixme: hardcoded group 129 123 showdomain('y',1); 130 124 } else { … … 278 272 if ($code eq 'OK') { 279 273 # redirect to dns.cgi?etc&page=reclist 280 print $q->redirect("");274 changepage(page => "reclist", id => $msg); 281 275 $page = HTML::Template->new(filename => "$templatedir/reclist.tmpl"); 282 276 showdomain(0,$msg); … … 454 448 455 449 450 sub fill_pgcount { 451 my $pgcount = shift; 452 my $pgtype = shift; 453 my $parent = shift; 454 455 $page->param(ntot => $pgcount); 456 $page->param(nfirst => (($offset eq 'all' ? 0 : $offset)*$perpage+1)); 457 $page->param(npglast => ($offset eq 'all' ? $pgcount : 458 ( (($offset+1)*$perpage) > $pgcount ? $pgcount : (($offset+1)*$perpage) ) 459 )); 460 $page->param(pgtype => $pgtype); 461 $page->param(parent => $parent); 462 } # end fill_pgcount() 463 464 456 465 sub listdomains { 457 466 my $sth = $dbh->prepare("select count(*) from domains"); … … 459 468 my ($count) = ($sth->fetchrow_array); 460 469 470 # fill page count and first-previous-next-last-all bits 471 ##fixme - hardcoded group bit 472 fill_pgcount($count,"domains","default group"); 461 473 fill_fpnla($count); 462 463 $page->param(ndomains => $count);464 $page->param(nstart => (($offset eq 'all' ? 0 : $offset)*$perpage+1));465 $page->param(npglast => ($offset eq 'all' ? $count :466 ( (($offset+1)*$perpage) > $count ? $count : (($offset+1)*$perpage) )467 ));468 474 469 475 ##fixme - group
Note:
See TracChangeset
for help on using the changeset viewer.