version 1.11, 2004/12/22 22:54:59
|
version 1.12, 2004/12/30 16:34:05
|
Line 47 use Apache::Constants qw(:common :http);
|
Line 47 use Apache::Constants qw(:common :http);
|
use Apache::lonnet(); |
use Apache::lonnet(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Time::HiRes; |
use Time::HiRes; |
use Time::Local; |
|
|
|
sub get_data { |
sub get_data { |
my ($r,$prog_state,$navmap,$mode) = @_; |
my ($r,$prog_state,$navmap,$mode) = @_; |
Line 178 sub get_max_time_in_db {
|
Line 177 sub get_max_time_in_db {
|
$timestr = &Apache::lonnet::unescape($line); |
$timestr = &Apache::lonnet::unescape($line); |
} |
} |
close(TIMEDATA); |
close(TIMEDATA); |
my ($year,$month,$day,$hour,$min,$sec) = |
return &Apache::lonmysql::unsqltime($timestr); |
($timestr =~ /^(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)/); |
|
$month -= 1; # Good old timelocal |
|
my $max_time = undef; |
|
if (eval("&timelocal($sec,$min,$hour,$day,$month,$year)")) { |
|
$max_time = &timelocal($sec,$min,$hour,$day,$month,$year); |
|
} |
|
return $max_time; |
|
} |
} |
|
|
sub build_query { |
sub build_query { |
Line 232 sub output_results {
|
Line 224 sub output_results {
|
my ($r,$results_file,$navmap,$mode) = @_; |
my ($r,$results_file,$navmap,$mode) = @_; |
## |
## |
## |
## |
|
if (! -s $results_file) { |
|
# results file is empty, just let them know there is no data |
|
$r->print('<h2>'.&mt('No data was returned for your request').'</h2>'); |
|
return; |
|
} |
if (! open(ACTIVITYDATA,$results_file)) { |
if (! open(ACTIVITYDATA,$results_file)) { |
$r->print('<h2>'.&mt('Unable to read results file.').'</h2>'. |
$r->print('<h2>'.&mt('Unable to read results file.').'</h2>'. |
'<p>'. |
'<p>'. |