14 if (defined $create) {
16 foreach my $k (keys %ARGS) {
17 if ($k =~ m/^t(\d{0,7})$/) {
22 die unless defined $textid;
27 if ($ARGS{'create'}) {
28 my $date = `date --iso-8601=minutes`; chomp $date or die;
29 $tx = { desc => "Message created $date",
30 subject => "Away from my email",
34 my $sth = $dbh->prepare("SELECT * FROM texts WHERE textid=?");
35 $sth->execute($textid);
36 $tx = $sth->fetchrow_hashref();#
39 if (!$tx) { die "no such text $textid"; }
42 <& htmlhead, subpage => "Edit \"$tx->{'desc'}\"" &>
43 <form action="save" method="post">
44 <&| txtable, tx => $tx, inputs => 1 &>
45 <tr><td colspan=2><textarea cols=79 rows=15><%
46 $tx->{'text'} |h %></textarea></td></tr>
48 <input type="hidden" name="textid" value="<% $tx->{'textid'} %>">
49 <input type="submit" name="save" value="Save">
50 <input type="submit" name="cancel" value="Cancel edit">