summaryrefslogtreecommitdiff
path: root/httemplate/search/elements/match-classnum
blob: ed1efd53c78d013e8fa8df8f2819e1e816ee6d42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
<%args>
$param            # name of the form field containing the classnum
$field => $param  # SQL field that must match that form field
</%args>
<%init>
my @values = grep /^(\d+)$/, $cgi->param( $param );
if (@values) {
  return "COALESCE($field, 0) IN (" . join(',', @values) . ')';
} else {
  return;
}
</%init>