use CGI;
use Date::Manip;
use HTML::Template;
-
+use C4::Date;
my %env;
my $input = new CGI;
}
if ($data{'joining'} eq ''){
$data{'joining'}=ParseDate('today');
- $data{'joining'}=&UnixDate($data{'joining'},'%Y-%m-%d');
+ $data{'joining'}=format_date($data{'joining'});
}
if ($data{'expiry'} eq ''){
$data{'expiry'}=ParseDate('in 1 year');
- $data{'expiry'}=&UnixDate($data{'expiry'},'%Y-%m-%d');
+ $data{'expiry'}=format_date($data{'expiry'});
}
my $ethnic=$data{'ethnicity'}." ".$data{'ethnicnotes'};
my $postal=$data{'address'}."<br>".$data{'city'};
push(@inputsloop, \%line);
}
+ #Get the fee
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("SELECT enrolmentfee FROM categories WHERE categorycode = ?");
+ $sth->execute($data{'categorycode'});
+ my ($fee) = $sth->fetchrow;
+ $sth->finish;
+
$template->param(name => $name,
bornum => $data{'borrowernumber'},
cardnum => $data{'cardnumber'},
memcat => $data{'categorycode'},
- area => $data{'area'},
- fee => $data{'fee'},
- joindate => $data{'joining'},
- expdate => $data{'expiry'},
- joinbranch => $data{'joinbranch'},
+ fee => $fee,
+ joindate => format_date($data{'joining'}),
+ expdate => format_date($data{'expiry'}),
+ branchcode => $data{'branchcode'},
ethnic => $ethnic,
- dob => $data{'dateofbirth'},
+ dob => format_date($data{'dateofbirth'}),
sex => $sex,
postal => $postal,
home => $home,
+ zipcode => $data{'zipcode'},
+ homezipcode => $data{'homezipcode'},
phone => $data{'phone'},
phoneday => $data{'phoneday'},
faxnumber => $data{'faxnumber'},
emailaddress => $data{'emailaddress'},
- textmessaging => $data{'textmessaging'},
+ textmessaging => $data{'textmessaging'},
contactname => $data{'contactname'},
altphone => $data{'altphone'},
altrelationship => $data{'altrelationship'},