+#classnum
+#false laziness w/cust_pkg.pm::search
+if ( grep { $_ eq 'classnum' } $cgi->param ) {
+
+# my @classnum = ();
+# if ( ref($params->{'classnum'}) ) {
+#
+# if ( ref($params->{'classnum'}) eq 'HASH' ) {
+# @classnum = grep $params->{'classnum'}{$_}, keys %{ $params->{'classnum'} };
+# } elsif ( ref($params->{'classnum'}) eq 'ARRAY' ) {
+# @classnum = @{ $params->{'classnum'} };
+# } else {
+# die 'unhandled classnum ref '. $params->{'classnum'};
+# }
+#
+#
+# } elsif ( $params->{'classnum'} =~ /^(\d*)$/ && $1 ne '0' ) {
+# @classnum = ( $1 );
+# }
+#
+# if ( @classnum ) {
+
+ if ( $cgi->param('classnum') =~ /^(\d*)$/ && $1 ne '0' ) {
+ my @classnum = ( $1 );
+
+ my @c_where = ();
+ my @nums = grep $_, @classnum;
+ push @c_where, 'discount.classnum IN ('. join(',',@nums). ')' if @nums;
+ my $null = scalar( grep { $_ eq '' } @classnum );
+ push @c_where, 'discount.classnum IS NULL' if $null;
+
+ if ( scalar(@c_where) == 1 ) {
+ push @where, @c_where;
+ } elsif ( @c_where ) {
+ push @where, ' ( '. join(' OR ', @c_where). ' ) ';
+ }
+
+ }
+
+}
+