Ignore:
Timestamp:
05/10/10 17:33:13 (14 years ago)
Author:
Kris Deugau
Message:

/trunk

Merge basic node-tracking from r393:396 into trunk. See #13.

File:
1 edited

Legend:

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

    r382 r397  
    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.