diff options
Diffstat (limited to 'mydl.pl')
-rwxr-xr-x | mydl.pl | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -0,0 +1,33 @@ +#!/usr/bin/perl +use strict; +use CGI qw(:standard); +use CGI::Carp 'fatalsToBrowser'; +use local::nzbget; +use local::db; +use local::user; +my $user = new local::user($ENV{REMOTE_USER}); + + +print header; +print start_html('my downloads'); + +print CGI::start_table(); +my @downloads; +if (param('only_me')) +{ + @downloads = local::db::download->search(owner=>$user->get_id(),{ order_by => 'time DESC'}); +} else { + @downloads = local::db::download->retrieve_all({ order_by => 'time DESC'}); +} +foreach my $dl ( @downloads) +{ + print Tr(td([ + $dl->category->name,a({title=>$dl->description,href=>$dl->category->name.'/'.$dl->download_id},$dl->name),$dl->size.'MB' + + ])); +} +; +print CGI::end_table(); + +print end_html; + |