Ignore:
Timestamp:
02/19/10 16:24:54 (15 years ago)
Author:
Kris Deugau
Message:

/branches/stable

Finish basic node tracking - add link in header, extend search tool to

handle the appropriate lookup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/cgi-bin/search.cgi

    r389 r395  
    187187    printError "No matches found.  Try eliminating one of the criteria,".
    188188        " or making one or more criteria more general.";
     189  } else {
     190    # Add the limit/offset clauses
     191    $sql .= " order by cidr";
     192    $sql .= " limit $RESULTS_PER_PAGE offset $offset" if $RESULTS_PER_PAGE != 0;
     193    # And tell the user.
     194    print "<div class=heading>Searching...............</div>\n";
     195    queryResults($sql, $webvar{page}, $count);
     196  }
     197
     198} elsif ($webvar{stype} eq 'n') {
     199  # Node search.
     200
     201  my $sql = "SELECT cidr,custid,type,city,description FROM searchme".
     202        " WHERE cidr IN (SELECT block FROM noderef WHERE node_id=$webvar{node})";
     203
     204  # Find the offset for multipage results
     205  my $offset = ($webvar{page}-1)*$RESULTS_PER_PAGE;
     206
     207  # Find out how many rows the "core" query will return.
     208  my $count = countRows($sql);
     209
     210  if ($count == 0) {
     211    printError "No customers currently listed as connected through this node.";
    189212  } else {
    190213    # Add the limit/offset clauses
Note: See TracChangeset for help on using the changeset viewer.