#!/usr/bin/perl
#script to do some serious catalogue maintainance
#written 22/11/00
# by chris@katipo.co.nz
use strict;
use CGI;
use C4::Output;
use C4::Database;
use C4::Maintainance;
my $input = new CGI;
print $input->header;
my $type=$input->param('type');
print startpage();
print startmenu('catalog');
my $blah;
my $num=0;
my $offset=0;
if ($type eq 'allsub'){
my $sub=$input->param('sub');
my ($count,$results)=listsubjects($sub,$num,$offset);
for (my $i=0;$i<$count;$i++){
my $sub2=$results->[$i]->{'subject'};
$sub2=~ s/ /%20/g;
print "\"$results->[$i]->{'subject'}\"
\n";
}
} elsif ($type eq 'modsub'){
my $sub=$input->param('sub');
print "
This will change the subject headings on all the biblios this subject is applied to" } elsif ($type eq 'upsub'){ my $sub=$input->param('sub'); my $oldsub=$input->param('oldsub'); updatesub($sub,$oldsub); print "Successfully modified $oldsub is now $sub"; print "
Back to catalogue maintenance
";
print "Close this window";
} else {
print "