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