Changeset 477


Ignore:
Timestamp:
Aug 25, 2010, 4:12:50 PM (11 years ago)
Author:
Kris Deugau
Message:

/branches/htmlform

Convert nodesearch to template. See #3.

Location:
branches/htmlform
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • branches/htmlform/cgi-bin/main.cgi

    r476 r477  
    140140}
    141141elsif ($webvar{action} eq 'nodesearch') {
    142   open HTML, "<../nodesearch.html";
    143   my $html = join('',<HTML>);
    144   close HTML;
    145 
    146142  $sth = $ip_dbh->prepare("SELECT node_id, node_name FROM nodes ORDER BY node_type,node_id");
    147143  $sth->execute() or print "DEBUG: failed retrieval from nodes: ".$sth->errstr,"<br>\n";
    148   my $nodes = '';
     144  my @nodelist;
    149145  while (my ($nid,$nname) = $sth->fetchrow_array()) {
    150     $nodes .= "<option value='$nid'>$nname</option>\n";
    151   }
    152   $html =~ s/\$\$NODELIST\$\$/$nodes/;
    153 
    154   print $html;
     146    my %row = (nodeid => $nid, nodename => $nname);
     147    push @nodelist, \%row;
     148  }
     149  $page->param(nodelist => \@nodelist);
    155150}
    156151
Note: See TracChangeset for help on using the changeset viewer.