~;
}
sub view_daily {
# -------------------------------------------------------------------
# This is the admin view, it lets people search on keywords
# and purge old listings.
#
my $db_daily = $DB->table('SearchLogDaily');
my $days = $IN->param('days');
if (defined $days and $days =~ /^\d+$/) {
Links::init_date();
my $date = GT::Date::date_get (time - 86400 * $days);
if ($IN->param('daily')) {
$db_daily->delete ( GT::SQL::Condition->new ( 'Last_Hit', '<', $date) );
}
}
my $nh = $IN->param('nh') || 1;
my $mh = $IN->param('mh') || 25;
my $sth = $db_daily->query_sth ($IN);
my $hits = $db_daily->hits;
my $tb = $DB->html($db_daily,$IN)->toolbar ($nh, $mh, $hits, $IN->url);
my $output = qq~
<$FONT>Term |
<$FONT>Count |
<$FONT>Results |
<$FONT>Last Searched |
<$FONT>Hit Date |
~;
while (my $hit = $sth->fetchrow_hashref) {
my $escaped = $IN->escape ($hit->{Term});
$output .= qq!
<$FONT>$hit->{Term} |
<$FONT>$hit->{HitCount} |
<$FONT>$hit->{Results} |
<$FONT>$hit->{Last_Hit} |
<$FONT>$hit->{Hit_Date} |
!;
}
$output .= " | ";
print $IN->header();
print qq~
Links SQL: Keyword Searches.
|