3 #written by chris@katipo.co.nz
5 #script to display and update currency rates
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();
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>
24 <TD bgcolor="99cc33" background="/images/background-mem.gif" colspan=2 ><b>EXCHANGE RATES </b></TD></TR>
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'}>";
34 # print $rates->[$i]->{'currency'};
38 <input type=image name=submit src=/images/save-changes.gif border=0 width=187 height=42>
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);
54 print $input->redirect('/acquisitions/');