% if ($message) {
% }
Add a person
Add a course
Not done yet.
%#
%# ========================================================================
%#
<%args>
$action => ''
$name => ''
$phone => ''
%args>
%#
<%init>
#my $registrar = new RegistrarData;
our $registrar;
my $message = '';
if ($action =~ /person/){
if (not $name or not $phone){
$message = "Oops - please give both a name and phone number.";
}
else {
$registrar->addPerson( name => $name, phone => $phone );
if ($registrar->getError){
$message = "Oops - database error: '" . $registrar->error . "'\n";
}
else {
$message = "OK, '$name' has been added to the database.";
$name = '';
$phone = '';
}
}
}
%init>