show parts archived using view
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 28 Jan 2011 18:55:43 +0000 (19:55 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 28 Jan 2011 18:55:43 +0000 (19:55 +0100)
lib/BackupPC/CGI/BurnMedia.pm

index 1a3a53a..cabd592 100644 (file)
@@ -18,7 +18,7 @@ sub action() {
        my $dbh = DBI->connect($Conf{SearchDSN}, $Conf{SearchUser}, "", { RaiseError => 1, AutoCommit => 0 } );
 
        BackupPC::CGI::Lib::NewRequest();
        my $dbh = DBI->connect($Conf{SearchDSN}, $Conf{SearchUser}, "", { RaiseError => 1, AutoCommit => 0 } );
 
        BackupPC::CGI::Lib::NewRequest();
-       $cont = Dumper(\%In);
+#      $cont = Dumper(\%In);
        if (!defined($In{submitBurner})) {
                $title = eval(q{ ${h1($Lang->{Burn_media})}});
                $cont = Dumper(%In);
        if (!defined($In{submitBurner})) {
                $title = eval(q{ ${h1($Lang->{Burn_media})}});
                $cont = Dumper(%In);
@@ -100,7 +100,26 @@ EOF
 
                        $cont .= q{
                                Archived following backups parts:
 
                        $cont .= q{
                                Archived following backups parts:
-                       } . join(", ", @selected_backup_parts) . q{
+                       } . join(", ", @selected_backup_parts);
+
+                       my $sth = $dbh->prepare(qq{
+                               select
+                                       filename,
+                                       part_nr,
+                                       TIMESTAMP 'epoch' + a.date * INTERVAL '1 second' as date,
+                                       size
+                               from archive_backup_parts a
+                               join archive on archive_id = archive.id
+                               where dvd_nr = ?
+                       });
+                       $sth->execute( $dvd_nr );
+                       $cont .= '<table border=1>';
+                       while( my $row = $sth->fetchrow_arrayref ) {
+                               $cont .= '<tr><td>' . join('</td><td>', @$row) . '</tr><tr>'; 
+                       }
+                       $cont .= '</table>';
+       
+                       $cont .= q{
                                <br/>with total size of
                        <b>} . unit($total_size)
                        . q{</b>
                                <br/>with total size of
                        <b>} . unit($total_size)
                        . q{</b>
@@ -110,6 +129,8 @@ EOF
                        } . $In{'note'} . q{
                                </div>
                        };
                        } . $In{'note'} . q{
                                </div>
                        };
+
+
                }
        }
 
                }
        }