32 |
|
|
33 |
sub epoch_to_iso { |
sub epoch_to_iso { |
34 |
my $t = shift || return; |
my $t = shift || return; |
35 |
|
$t += 60 * 60 * +2; # FIXME add TZ |
36 |
my $dt = DateTime->from_epoch( epoch => $t ) || return; |
my $dt = DateTime->from_epoch( epoch => $t ) || return; |
37 |
print STDERR "BUG: $t != " . $dt->epoch . "\n" unless ($t == $dt->epoch); |
print STDERR "BUG: $t != " . $dt->epoch . "\n" unless ($t == $dt->epoch); |
38 |
return $dt->ymd . ' ' . $dt->hms; |
return $dt->ymd . ' ' . $dt->hms; |
72 |
|
|
73 |
push( @conditions, ' files.shareid = ' . $param->{'search_share'} ) if ($param->{'search_share'}); |
push( @conditions, ' files.shareid = ' . $param->{'search_share'} ) if ($param->{'search_share'}); |
74 |
|
|
75 |
push (@conditions, " upper(files.name) LIKE upper('%".$param->{'search_filename'}."%')") if ($param->{'search_filename'}); |
push (@conditions, " upper(files.path) LIKE upper('%".$param->{'search_filename'}."%')") if ($param->{'search_filename'}); |
76 |
|
|
77 |
return ( |
return ( |
78 |
join(" and ", @conditions), |
join(" and ", @conditions), |
95 |
files.backupNum AS backupNum, |
files.backupNum AS backupNum, |
96 |
files.name AS filename, |
files.name AS filename, |
97 |
files.path AS filepath, |
files.path AS filepath, |
|
shares.share||files.fullpath AS networkPath, |
|
98 |
files.date AS date, |
files.date AS date, |
99 |
files.type AS filetype, |
files.type AS filetype, |
100 |
files.size AS size, |
files.size AS size, |
116 |
$sql_where = " WHERE ". $where if ($where); |
$sql_where = " WHERE ". $where if ($where); |
117 |
|
|
118 |
my $sql_order = qq{ |
my $sql_order = qq{ |
119 |
ORDER BY files.id |
ORDER BY files.date |
120 |
LIMIT $on_page |
LIMIT $on_page |
121 |
OFFSET ? |
OFFSET ? |
122 |
}; |
}; |