use strict;
use CGI;
+use C4::Auth;
use C4::Context;
use C4::Output;
+use C4::Interface::CGI::Output;
use C4::Search;
use HTML::Template;
$searchstring=~ s/\'/\\\'/g;
my @data=split(' ',$searchstring);
my $count=@data;
- my $query="select bookfundid,bookfundname,bookfundgroup from aqbookfund where bookfundid and (bookfundid like \"$data[0]%\") order by bookfundid";
+ my $query="select bookfundid,bookfundname,bookfundgroup from aqbookfund where (bookfundid like \"$data[0]%\") order by bookfundid";
my $sth=$dbh->prepare($query);
$sth->execute;
my @results;
my $cnt=0;
while (my $data=$sth->fetchrow_hashref){
- push(@results,$data);
- $cnt ++;
+ push(@results,$data);
+ $cnt ++;
}
# $sth->execute;
$sth->finish;
my $op = $input->param('op');
$searchfield=~ s/\,//g;
-my $template = gettemplate("parameters/aqbookfund.tmpl",0);
+my ($template, $borrowernumber, $cookie)
+ = get_template_and_user({template_name => "parameters/aqbookfund.tmpl",
+ query => $input,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => {parameters => 1},
+ debug => 1,
+ });
+
if ($op) {
$template->param(script_name => $script_name,
$op => 1); # we show only the TMPL_VAR names $op
} else {
$toggle="white";
}
- while (@toggle and @bookfundid and @bookfundname and @bookfundgroup) {
+ while (@toggle and @bookfundid and @bookfundname and @bookfundgroup) {
my %row_data;
$row_data{toggle} = shift @toggle;
$row_data{bookfundid} = shift @bookfundid;
$template->param(bookfund => \@loop_data);
} #---- END $OP eq DEFAULT
-
-
-print "Content-Type: text/html\n\n", $template->output;
+output_html_with_http_headers $input, $cookie, $template->output;