% if ($message) {
% }
Add a person
Add a course
Not done yet.
%#
%# ========================================================================
%#
<%args>
$action => ''
$name => ''
$phone => ''
%args>
%#
<%init>
my $message = '';
if ($action =~ /person/){
if (not $name or not $phone){
$message = "Oops - please give both a name and phone number.";
}
else {
my $newPerson = Person->create({ name=>$name, phone=>$phone });
if (not $newPerson){
$message = "Oops - an error occured which I was too lazy to document. \n";
}
else {
$message = "OK, '$name' has been added to the database.";
$name = '';
$phone = '';
}
}
}
%init>