DBIx-glueHTML
view release on metacpan or search on metacpan
glueHTML.pm view on Meta::CPAN
157715781579158015811582158315841585158615871588158915901591159215931594159515961597
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.'
);
"<UL>"
;
"<LI><A HREF=\""
.
$self
->_backLink .
"\">Main Menu</A>"
;
"</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
;
glueHTML.pm view on Meta::CPAN
160016011602160316041605160616071608160916101611161216131614161516161617161816191620# 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.'
);
"<UL>"
;
"<LI><A HREF=\""
.
$self
->_backLink .
"\">Main Menu</A>"
;
"</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'
);
$self
->{CGI}->b(
'Press back to cancel. Press Confirm to delete.'
);
$self
->{CGI}->startform;
glueHTML.pm view on Meta::CPAN
164316441645164616471648164916501651165216531654165516561657165816591660166116621663
# 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.'
);
"<UL>"
;
"<LI><A HREF=\""
.
$self
->_repeatLink .
"\">Add Another</A>"
;
"<LI><A HREF=\""
.
$self
->_backLink .
"\">Main Menu</A>"
;
"</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.501 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )