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();
21 foreach my $host ( BackupPC::Search::getShares ) {
22 $hosts_html .= "<option value=" . $host->{'id'} . "> " . $host->{'share'} . " </option>\n";
25 sub date_from_to_html {
26 my $name = shift || return;
28 <input type="text" name="${name}_year_from" size="4">
29 <input type="text" name="${name}_month_from" size="2">
30 <input type="text" name="${name}_day_from" size="2">
32 <input type="text" name="${name}_year_to" size="4">
33 <input type="text" name="${name}_month_to" size="2">
34 <input type="text" name="${name}_day_to" size="2">
39 <form name="searchForm" method="GET" action="$MyURL">
42 <input type="text" name="search_filename" size="50">
46 <select name="search_share">$hosts_html</select>
48 <select name="burned">
49 <option value="">all</a>
50 <option value="burned">burned</a>
51 <option value="pending">pending</a>
55 <input type="submit" value="Search">
58 <p style="color:gray;">
60 } . date_from_to_html('search') . qq{
63 } . date_from_to_html('search_backup') . qq{
67 <p style="color: gray;">
68 <input type="checkbox" name="use_hest"> use faster full-text search engine
71 <input type="hidden" value="search" name="action">
72 <input type="hidden" value="results" name="search_results">
76 my $html = eval(q{ ${h1("Search")}});
78 if ( !defined($In{search_results}) ) {
79 $html .= eval(q{ ${h2("Search criteria")}});
83 $html .= eval(q{ ${h2("Search results")}});
85 my $fif = new HTML::FillInForm;
86 $html .= $fif->fill(scalarref => \$form, fdat => \%In);
88 $html .= BackupPC::Search::displayGrid( \%In );
91 Header( eval("qq{$Lang->{Search_archive}}"), "", 1, "", $html );