Checked diff in branchtransfers. datesent and datearrived are given datetime, not...
[koha.git] / currency.pl
1 #!/usr/bin/perl
2
3 #written by chris@katipo.co.nz
4 #9/10/2000
5 #script to display and update currency rates
6
7 use CGI;
8 use C4::Acquisitions;
9 use C4::Biblio;
10
11 my $input=new CGI;
12
13 my $type=$input->param('type');
14 #find out what the script is being called for
15 #print $input->header();
16 if ($type ne 'change'){
17   #display, we must fetch the exchange rate data and output it
18   print $input->header();
19   print <<printend
20   <TABLE width="40%" cellspacing=0 cellpadding=5 border=1 >
21   <FORM ACTION="/cgi-bin/koha/currency.pl">
22   <input type=hidden name=type value=change>
23   <TR VALIGN=TOP>
24   <TD  bgcolor="99cc33" background="/images/background-mem.gif" colspan=2 ><b>EXCHANGE RATES </b></TD></TR>
25   <TR VALIGN=TOP>                                                                 
26   <TD>
27 printend
28 ;
29   my ($count,$rates)=getcurrencies();
30   for (my $i=0;$i<$count;$i++){
31     if ($rates->[$i]->{'currency'} ne 'NZD'){
32       print "$rates->[$i]->{'currency'}<INPUT TYPE=\"text\"  SIZE=\"5\"   NAME=\"$rates->[$i]->{'currency'}\" value=$rates->[$i]->{'rate'}>";
33     }
34 #    print $rates->[$i]->{'currency'};
35   }
36   print <<printend
37     <p>                                                                             
38   <input type=image  name=submit src=/images/save-changes.gif border=0 width=187 height=42>
39   
40   </TD></TR>                                                                      
41   </form>                                                                         
42   </table>                                                
43 printend
44 ;
45 } else {
46 #  print $input->Dump;
47   my @params=$input->param;
48   foreach my $param (@params){
49     if ($param ne 'type' && $param !~ /submit/){
50       my $data=$input->param($param);
51       updatecurrencies($param,$data);
52     }
53   }
54   print $input->redirect('/acquisitions/');
55 }