removed fieldid in favour of tagid, removed _sergey from table names, added
[koha.git] / renewscript.pl
1 #!/usr/bin/perl
2
3 #written 18/1/2000 by chris@katipo.co.nz
4 #script to renew items from the web
5
6 use CGI;
7 use C4::Circulation::Renewals2;
8 #get input
9 my $input= new CGI;
10 #print $input->header;
11
12 #print $input->dump;
13
14 my @names=$input->param();
15 my $count=@names;
16 my %data;
17
18 for (my $i=0;$i<$count;$i++){
19   if ($names[$i] =~ /renew/){
20     my $temp=$names[$i];
21     $temp=~ s/renew_item_//;
22     $data{$temp}=$input->param($names[$i]);
23   }
24 }
25 my %env;
26 my $bornum=$input->param("bornum");
27 while ( my ($key, $value) = each %data) {
28  #  print "$key = $value\n";
29    if ($value eq 'y'){
30      #means we want to renew this item
31      #check its status
32      my $status=renewstatus(\%env,$bornum,$key);
33 #     print $status;
34      if ($status == 1){
35        renewbook(\%env,$bornum,$key);
36      }
37    }
38 }       
39
40 print $input->redirect("/cgi-bin/koha/moremember.pl?bornum=$bornum");