3 #written by chris@katipo.co.nz
5 #script to display and update currency rates
12 my $type=$input->param('type');
13 #find out what the script is being called for
14 #print $input->header();
15 if ($type ne 'change'){
16 #display, we must fetch the exchange rate data and output it
17 print $input->header();
19 <TABLE width="40%" cellspacing=0 cellpadding=5 border=1 >
20 <FORM ACTION="/cgi-bin/koha/currency.pl">
21 <input type=hidden name=type value=change>
23 <TD bgcolor="99cc33" background="/images/background-mem.gif" colspan=2 ><b>EXCHANGE RATES </b></TD></TR>
28 my ($count,$rates)=getcurrencies();
29 for (my $i=0;$i<$count;$i++){
30 if ($rates->[$i]->{'currency'} ne 'NZD'){
31 print "$rates->[$i]->{'currency'}<INPUT TYPE=\"text\" SIZE=\"5\" NAME=\"$rates->[$i]->{'currency'}\" value=$rates->[$i]->{'rate'}>";
33 # print $rates->[$i]->{'currency'};
37 <input type=image name=submit src=/images/save-changes.gif border=0 width=187 height=42>
46 my @params=$input->param;
47 foreach my $param (@params){
48 if ($param ne 'type' && $param !~ /submit/){
49 my $data=$input->param($param);
50 updatecurrencies($param,$data);
53 print $input->redirect('/acquisitions/');