#!/usr/bin/perl #written by chris@katipo.co.nz #9/10/2000 #script to display and update currency rates use CGI; use C4::Acquisitions; my $input=new CGI; my $type=$input->param('type'); #find out what the script is being called for #print $input->header(); if ($type ne 'change'){ #display, we must fetch the exchange rate data and output it print $input->header(); print <
EXCHANGE RATES printend ; my ($count,$rates)=getcurrencies(); for (my $i=0;$i<$count;$i++){ if ($rates->[$i]->{'currency'} ne 'NZD'){ print "$rates->[$i]->{'currency'}[$i]->{'currency'}\" value=$rates->[$i]->{'rate'}>"; } # print $rates->[$i]->{'currency'}; } print < printend ; } else { # print $input->Dump; my @params=$input->param; foreach my $param (@params){ if ($param ne 'type' && $param !~ /submit/){ my $data=$input->param($param); updatecurrencies($param,$data); } } print $input->redirect('/acquisitions/'); }