5 #written by chris@katipo.co.nz
7 #script to display and update currency rates
10 # Copyright 2000-2002 Katipo Communications
12 # This file is part of Koha.
14 # Koha is free software; you can redistribute it and/or modify it under the
15 # terms of the GNU General Public License as published by the Free Software
16 # Foundation; either version 2 of the License, or (at your option) any later
19 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
20 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
21 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
23 # You should have received a copy of the GNU General Public License along with
24 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
25 # Suite 330, Boston, MA 02111-1307 USA
33 my $type=$input->param('type');
34 #find out what the script is being called for
35 #print $input->header();
36 if ($type ne 'change'){
37 #display, we must fetch the exchange rate data and output it
38 print $input->header();
40 <TABLE width="40%" cellspacing=0 cellpadding=5 border=1 >
41 <FORM ACTION="/cgi-bin/koha/currency.pl">
42 <input type=hidden name=type value=change>
44 <TD bgcolor="99cc33" background="/images/background-mem.gif" colspan=2 ><b>EXCHANGE RATES </b></TD></TR>
49 my ($count,$rates)=getcurrencies();
50 for (my $i=0;$i<$count;$i++){
51 if ($rates->[$i]->{'currency'} ne 'NZD'){
52 print "$rates->[$i]->{'currency'}<INPUT TYPE=\"text\" SIZE=\"5\" NAME=\"$rates->[$i]->{'currency'}\" value=$rates->[$i]->{'rate'}>";
54 # print $rates->[$i]->{'currency'};
58 <input type=image name=submit src=/images/save-changes.gif border=0 width=187 height=42>
67 my @params=$input->param;
68 foreach my $param (@params){
69 if ($param ne 'type' && $param !~ /submit/){
70 my $data=$input->param($param);
71 updatecurrencies($param,$data);
74 print $input->redirect('/acquisitions/');