our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
$VERSION = 1.00;
@ISA = qw(Exporter);
- @EXPORT = qw(db_connect db_commit www_begin
+ @EXPORT = qw(db_connect db_commit www_begin hquote
$dbh);
%EXPORT_TAGS = ( );
@EXPORT_OK = qw();
</table><table>
% while (my $row = $usedq->fetchrow_hashref()) {
<tr><td>Use for <% $row->{'emailaddr'} |h %></td>
-<td><input type="checkbox" value="1" name=u_<% hqote($row->{'emailaddr'}) %>
+<td><input type="checkbox" value="1" name=u_<% hquote($row->{'emailaddr'}) %>
% if (!$create && $row->{'textid'} eq $textid) {
checked></td><td>(currently using this message)
% } elsif (defined $row->{'textid'}) {
<hr>
<h2>Outbound messages</h2>
<%perl>
-$sth = $dbh->prepare("SELECT * FROM texts ORDER BY desc");
+$sth = $dbh->prepare("SELECT * FROM texts ORDER BY textid");
$sthi = $dbh->prepare(<<END);
SELECT * FROM addresses
WHERE textid = ?
<%init>
use AwayMsg;
+use Data::Dumper;
db_connect();
www_begin($r,$m);
</%init><%args>
}
if ($textid eq 'new') {
- my $textid = time;
+ $textid = time;
my $ntextq = $dbh->prepare("SELECT textid FROM texts".
" ORDER BY textid DESC LIMIT 1");
$ntextq->execute();
}
}
+print STDERR Dumper([$textid, $desc, $subject, $text]);
+
my $dinsertq = $dbh->prepare("INSERT INTO texts (textid, desc, subject, text)".
" VALUES (?,?,?,?)");
$dinsertq->execute($textid, $desc, $subject, $text);
$tlistq->execute();
while (my $row = $tlistq->fetchrow_hashref()) {
if ($ARGS{"u_".hquote($row->{'emailaddr'})}) {
-fixme
+ $tinsertq->execute($row->{'emailaddr'}, $textid);
}
}