Skip to content

Commit 5341a74

Browse files
committed
Store timestamp for the submission in database if no errors
1 parent 27fc24e commit 5341a74

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hpcg/submit_form

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ while(@schema){
6565
}
6666

6767
my $db = DBIx::Simple->connect("dbi:SQLite:dbname=/var/data/$table.db");
68-
my $col_def = join(',', @fields);
68+
my $col_def = join(',', @fields);
6969
$db->{dbh}->do("CREATE TABLE IF NOT EXISTS $table ($col_def)");
7070

7171
my (%data, @errors);
@@ -86,6 +86,9 @@ if(@errors){
8686
exit;
8787
}
8888

89+
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
90+
$data{'list'} = ($year + 1900) . $mon . $mday . 't' . $hour . $min . $sec;
91+
8992
my $result = $db->insert($table, \%data);
9093
if(not defined $result or $result->{lc_columns} != 1){
9194
print $cgi->header();

0 commit comments

Comments
 (0)