version 1.59, 2001/03/21 03:40:39
|
version 1.60, 2001/03/21 12:19:53
|
Line 510 sub advancedsearch {
|
Line 510 sub advancedsearch {
|
if ($ENV{'form.copyright'} and $ENV{'form.copyright'} ne 'any') { |
if ($ENV{'form.copyright'} and $ENV{'form.copyright'} ne 'any') { |
push @queries,"(copyright like \"\%$ENV{'form.copyright'}\%\")"; |
push @queries,"(copyright like \"\%$ENV{'form.copyright'}\%\")"; |
} |
} |
|
my $datequery=&build_date_queries( |
|
$ENV{'form.creationdatestart_month'}, |
|
$ENV{'form.creationdatestart_day'}, |
|
$ENV{'form.creationdatestart_year'}, |
|
$ENV{'form.creationdateend_month'}, |
|
$ENV{'form.creationdateend_day'}, |
|
$ENV{'form.creationdateend_year'}, |
|
$ENV{'form.lastrevisiondatestart_month'}, |
|
$ENV{'form.lastrevisiondatestart_day'}, |
|
$ENV{'form.lastrevisiondatestart_year'}, |
|
$ENV{'form.lastrevisiondateend_month'}, |
|
$ENV{'form.lastrevisiondateend_day'}, |
|
$ENV{'form.lastrevisiondateend_year'}, |
|
); |
|
if ($datequery!~/^Incorrect/) { |
|
push @queries,$datequery; |
|
} |
|
else { |
|
&output_date_error($r,$datequery); |
|
} |
if (@queries) { |
if (@queries) { |
$query=join(" AND ",@queries); |
$query=join(" AND ",@queries); |
$query="select * from metadata where $query"; |
$query="select * from metadata where $query"; |
Line 894 END
|
Line 914 END
|
return $result; |
return $result; |
} |
} |
|
|
|
sub build_date_queries { |
|
my ($cmonth1,$cday1,$cyear1,$cmonth2,$cday2,$cyear2, |
|
$lmonth1,$lday1,$lyear1,$lmonth2,$lday2,$lyear2)=@_; |
|
|
|
return "Incorrect for some reason."; |
|
} |
|
|
|
sub output_date_error { |
|
my ($r,$message)=@_; |
|
# make query information persistent to allow for subsequent revision |
|
my $persistent=''; |
|
map { |
|
if (/^form\./ && !/submit/) { |
|
my $name=$_; |
|
my $key=$name; |
|
$name=~s/^form\.//; |
|
$persistent.=<<END; |
|
<INPUT TYPE='hidden' NAME='$name' VALUE='$ENV{$key}'> |
|
END |
|
} |
|
} (keys %ENV); |
|
|
|
$r->print(<<BEGINNING); |
|
<html> |
|
<head> |
|
<title>The LearningOnline Network with CAPA</title> |
|
BEGINNING |
|
$r->print(<<RESULTS); |
|
</head> |
|
<body bgcolor="#ffffff"> |
|
<img align=right src=/adm/lonIcons/lonlogos.gif> |
|
<h1>Search Catalog</h1> |
|
<form method="post" action="/adm/searchcat"> |
|
$persistent |
|
<input type='button' value='Revise search request' |
|
onClick='this.form.submit();'> |
|
$closebutton |
|
<hr> |
|
<h3>Helpful Message</h3> |
|
<p> |
|
$message |
|
</p> |
|
</body> |
|
</html> |
|
RESULTS |
|
} |
|
|
1; |
1; |
__END__ |
__END__ |