#!/usr/bin/perl use CGI; use POSIX qw(strftime); use Date::Calc qw(Today); use Date::Calc qw(Add_Delta_YM); use Digest::SHA1 qw(sha1_hex); # ----------------------------------------------------------------------------- # Get parameters # ----------------------------------------------------------------------------- my $query = new CGI; my $name = $query->param("name"); my $email = $query->param("email"); my $amount = $query->param("amount"); my $period = substr($amount, 0, 1); my $amount = substr($amount, 1); if ($amount eq "other") { $amount = $query->param($period . "amount_other"); } my $anonymous = $query->param("anonymous"); my $language = $query->param("language"); my $text = $query->param("text"); my $amount100 = $amount * 100; my $date = strftime("%y%j", localtime); my $time = strftime("%s", localtime); my $reference = ""; if ($anonymous) { $reference = "DA$date" . substr($time, -3); # DA = Donation Anonymous } else { $reference = "DL$date" . substr($time, -3); # DL = Donation Listed } if ($period ne "o") { $reference .= ".$period"; } ($year, $mon, $mday) = Today(); my $months = 0; if ($period eq "m") { ($year, $mon, $mday) = Add_Delta_YM($year, $mon, $mday, 0, 1); $months = 1; } if ($period eq "y") { ($year, $mon, $mday) = Add_Delta_YM($year, $mon, $mday, 1, 0); $months = 12; } my $start = sprintf("%04d-%02d-%02d", ($year, $mon, $mday)); my $day = strftime("%d", localtime); my $lang = substr($language, 0, 2); # ----------------------------------------------------------------------------- # Generate form to forward payment request to PayPal or Concardis # ----------------------------------------------------------------------------- print "Content-type: text/html\n\n"; open TEMPLATE, "/home/www/html/global/donate/tmpl-donate.$lang.html"; while (