#!/usr/bin/perl
use CGI;
use strict;
use C4::Acquisitions;
use C4::Output;
my $input = new CGI;
my $keywords = $input->param('keyword');
my $offset = $input->param('offset');
my $num = $input->param('num');
my $total;
my $count;
my @results;
if (! $keywords) {
print $input->redirect('addbooks.pl');
} else {
if (! $offset) { $offset = 0 };
if (! $num) { $num = 10 };
($count, @results) = &websitesearch($keywords);
if ($count < ($offset + $num)) {
$total = $count;
} else {
$total = $offset + $num;
} # else
print $input->header;
print startpage();
print startmenu('acquisitions');
print << "EOF";
Website Search Results
TITLE | AUTHOR | © |
$results[$i]->{'title'} | $results[$i]->{'author'} | $results[$i]->{'copyrightdate'} |
EOF print endmenu(); print endpage(); } # else