1 package C4::Maintainance; #asummes C4/Maintainance
3 #package to deal with marking up output
10 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
12 # set the version for version checking
16 @EXPORT = qw(&listsubjects &updatesub &shiftgroup &deletedbib &undeletebib);
17 %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
19 # your exported package globals go here,
20 # as well as any optionally exported functions
22 @EXPORT_OK = qw($Var1 %Hashit);
25 # non-exported package globals go here
26 use vars qw(@more $stuff);
28 # initalize package globals, first exported ones
34 # then the others (which are still accessible as $Some::Module::stuff)
38 # all file-scoped lexicals must be created before
39 # the functions below that use them.
41 # file-private lexicals go here
45 # here's a file-private function as a closure,
46 # callable as &$priv_func; it cannot be prototyped.
51 # make all your functions, whether exported or not;
54 my ($sub,$num,$offset)=@_;
56 my $query="Select * from bibliosubject where subject like '$sub%' group by subject";
58 $query.=" limit $offset,$num";
60 my $sth=$dbh->prepare($query);
65 while (my $data=$sth->fetchrow_hashref){
77 my $query="update bibliosubject set subject='$sub' where subject='$oldsub'";
78 my $sth=$dbh->prepare($query);
87 my $query="update biblioitems set biblionumber=$bib where biblioitemnumber=$bi";
88 my $sth=$dbh->prepare($query);
91 $query="update items set biblionumber=$bib where biblioitemnumber=$bi";
92 $sth=$dbh->prepare($query);
101 my $query="Select * from deletedbiblio where title like '$title%' order by title";
102 my $sth=$dbh->prepare($query);
106 while (my $data=$sth->fetchrow_hashref){
112 return($i,\@results);
118 my $query="select * from deletedbiblio where biblionumber=$bib";
119 my $sth=$dbh->prepare($query);
121 if (my @data=$sth->fetchrow_array){
123 $query="Insert into biblio values (";
124 foreach my $temp (@data){
126 $query=$query."'$temp',";
130 $sth=$dbh->prepare($query);
134 $query="Delete from deletedbiblio where biblionumber=$bib";
135 $sth=$dbh->prepare($query);
142 END { } # module clean-up code here (global destructor)