/[BackupPC]/trunk/lib/BackupPC/SearchLib.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/BackupPC/SearchLib.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 25 by dpavlin, Mon Jul 11 16:48:33 2005 UTC revision 26 by dpavlin, Fri Jul 29 17:30:25 2005 UTC
# Line 4  package BackupPC::SearchLib; Line 4  package BackupPC::SearchLib;
4  use strict;  use strict;
5  use BackupPC::CGI::Lib qw(:all);  use BackupPC::CGI::Lib qw(:all);
6  use BackupPC::Attrib qw(:all);  use BackupPC::Attrib qw(:all);
 use Data::Dumper;  
7  use DBI;  use DBI;
8    
9  sub getUnits() {  sub getUnits() {
# Line 53  sub getWhere($) { Line 52  sub getWhere($) {
52            
53          push( @conditions, ' backups.hostID = ' . $param->{'search_host'} ) if ($param->{'search_host'});          push( @conditions, ' backups.hostID = ' . $param->{'search_host'} ) if ($param->{'search_host'});
54    
55          push (@conditions, " files.name LIKE '".$param->{'search_filename'}."%'") if ($param->{'search_filename'});          push (@conditions, " upper(files.name) LIKE upper('%".$param->{'search_filename'}."%')") if ($param->{'search_filename'});
56    
57          return (          return (
58                  join(" and ", @conditions),                  join(" and ", @conditions),
# Line 279  sub displayGrid($$$$) { Line 278  sub displayGrid($$$$) {
278          $retHTML .= qq{          $retHTML .= qq{
279          <table style="fview" width="100%">          <table style="fview" width="100%">
280                  <tr>                  <tr>
281                  <td class="tableheader">Host</td>                  <td class="tableheader">Share</td>
282                  <td class="tableheader">Name</td>                  <td class="tableheader">Name</td>
283                  <td class="tableheader">Type</td>                  <td class="tableheader">Type</td>
284                  <td class="tableheader">#</td>                  <td class="tableheader">#</td>
# Line 297  sub displayGrid($$$$) { Line 296  sub displayGrid($$$$) {
296                  return $html;                  return $html;
297          }          }
298    
299            sub restore_link($$$$$$) {
300                    my $type = shift;
301                    my $action = 'RestoreFile';
302                    $action = 'browse' if (lc($type) eq 'dir');
303                    return sprintf(qq{<a href="?action=%s&host=%s&num=%d&share=%s&dir=%s">%s</a>}, $action, @_);
304            }
305    
306          foreach $file (@files) {          foreach $file (@files) {
307                  my $typeStr  = BackupPC::Attrib::fileType2Text(undef, $file->{'type'});                  my $typeStr  = BackupPC::Attrib::fileType2Text(undef, $file->{'type'});
308                  $retHTML .= "<tr>";                  $retHTML .= "<tr>";
309    
310                  foreach my $v ((                  foreach my $v ((
311                          $file->{'hname'},                          $file->{'sharename'},
312                          qq{<img src="$Conf{CgiImageDirURL}/icon-$typeStr.gif" align="center">&nbsp;} . hilite_html( $file->{'fpath'}, $hilite ),                          qq{<img src="$Conf{CgiImageDirURL}/icon-$typeStr.gif" align="center">&nbsp;} . hilite_html( $file->{'fpath'}, $hilite ),
313                          $typeStr,                          $typeStr,
314                          $file->{'backupno'},                          restore_link( $typeStr, $file->{'hname'}, $file->{'backupno'}, $file->{'sname'}, $file->{'fpath'}, $file->{'backupno'} ),
315                          $file->{'size'},                          $file->{'size'},
316                          $file->{'date'},                          $file->{'date'},
317                          $file->{'dvd'}                          $file->{'dvd'}

Legend:
Removed from v.25  
changed lines
  Added in v.26

  ViewVC Help
Powered by ViewVC 1.1.26