1 ####################################################################
2 # SearchArchives.pm - module for searching through archived files #
3 # via a sqlite database #
4 ####################################################################
5 package BackupPC::CGI::SearchArchives;
9 use BackupPC::CGI::Lib qw(:all);
13 use vars qw($Cgi %In $MyURL $User %Conf $TopDir $BinDir $bpc);
19 BackupPC::CGI::Lib::NewRequest();
20 my @hosts = BackupPC::Search::getUnits();
22 foreach my $host (@hosts) {
23 $hosts_html .= "<option value=" . $host->{'id'} . "> " . $host->{'share'} . " </option>\n";
26 sub date_from_to_html {
27 my $name = shift || return;
29 <input type="text" name="${name}_year_from" size="4">
30 <input type="text" name="${name}_month_from" size="2">
31 <input type="text" name="${name}_day_from" size="2">
33 <input type="text" name="${name}_year_to" size="4">
34 <input type="text" name="${name}_month_to" size="2">
35 <input type="text" name="${name}_day_to" size="2">
40 <form name="searchForm" method="GET" action="$MyURL">
43 <input type="text" name="search_filename" size="50">
47 <select name="search_share">$hosts_html</select>
49 <select name="burned">
50 <option value="">all</a>
51 <option value="burned">burned</a>
52 <option value="pending">pending</a>
56 <input type="submit" value="Search">
59 <p style="color:gray;">
61 } . date_from_to_html('search') . qq{
64 } . date_from_to_html('search_backup') . qq{
68 <p style="color: gray;">
69 <input type="checkbox" name="use_hest"> use faster full-text search engine
72 <input type="hidden" value="search" name="action">
73 <input type="hidden" value="results" name="search_results">
77 my $html = eval(q{ ${h1("Search")}});
79 if ( !defined($In{search_results}) ) {
80 $html .= eval(q{ ${h2("Search criteria")}});
84 $html .= eval(q{ ${h2("Search results")}});
86 my $fif = new HTML::FillInForm;
87 $html .= $fif->fill(scalarref => \$form, fdat => \%In);
89 $html .= BackupPC::Search::displayGrid( \%In );
92 Header( eval("qq{$Lang->{Search_archive}}"), "", 1, "", $html );