DBIx-HTMLinterface
view release on metacpan or search on metacpan
HTMLinterface.pm view on Meta::CPAN
my $table = shift;
# Run the SQL
my $sql = $self->_updateSql ($table);
my $cursor = $self->_execSql ($sql);
$cursor->finish;
# Tell the people what we did
$self->_printHeader('Modification Successful', 'Record modified successfully.');
print "<UL>";
print "<LI><A HREF=\"" . $self->_backLink . "\">Main Menu</A>";
print "</UL>";
$self->_printFooter;
# Log it, if logging is enabled
$self->_logEvent("Record modified from $table", $sql);
}
# Internal function to execute a SQL delete
sub _deleteRecord {
my $self = shift;
HTMLinterface.pm view on Meta::CPAN
# Require confirmation of the delete
if ($self->{CGI}->param('confirm')) {
# Run the SQL
my $sql = $self->_deleteSql($table);
my $cursor = $self->_execSql ($sql);
$cursor->finish;
# Tell the people what we did
$self->_printHeader('Deletion Successful', 'Record deleted successfully.');
print "<UL>";
print "<LI><A HREF=\"" . $self->_backLink . "\">Main Menu</A>";
print "</UL>";
$self->_printFooter;
# Log it, if logging is enabled
$self->_logEvent("Record deleted from $table", $sql);
} else {
# Ask them to confirm their action
$self->_printHeader('Confirm Delete', 'Confirm Delete');
print $self->{CGI}->b('Press back to cancel. Press Confirm to delete.');
print $self->{CGI}->startform;
HTMLinterface.pm view on Meta::CPAN
# Run the SQL
my $sql = $self->_insertSql ($table);
my $cursor = $self->_execSql ($sql);
$cursor->finish;
# Tell the people what we did
$self->_printHeader('Addition Successful', 'Record added successfully.');
print "<UL>";
print "<LI><A HREF=\"" . $self->_repeatLink . "\">Add Another</A>";
print "<LI><A HREF=\"" . $self->_backLink . "\">Main Menu</A>";
print "</UL>";
$self->_printFooter;
# Log it, if logging is enabled
$self->_logEvent("Record added to $table", $sql);
}
# _insertSql - internal function to generate insert statements for $table, inserting all values in
# $self->{CGI}->param which match the table column names.
sub _insertSql {
( run in 0.506 second using v1.01-cache-2.11-cpan-49f99fa48dc )