Diff for /loncom/interface/lonsearchcat.pm between versions 1.60 and 1.61

version 1.60, 2001/03/21 12:19:53 version 1.61, 2001/03/21 12:40:37
Line 524  sub advancedsearch { Line 524  sub advancedsearch {
  $ENV{'form.lastrevisiondateend_day'},   $ENV{'form.lastrevisiondateend_day'},
  $ENV{'form.lastrevisiondateend_year'},   $ENV{'form.lastrevisiondateend_year'},
  );   );
     if ($datequery!~/^Incorrect/) {      if ($datequery=~/^Incorrect/) {
  push @queries,$datequery;  
     }  
     else {  
  &output_date_error($r,$datequery);   &output_date_error($r,$datequery);
    return OK;
       }
       elsif ($datequery) {
    push @queries,$datequery;
     }      }
     if (@queries) {      if (@queries) {
  $query=join(" AND ",@queries);   $query=join(" AND ",@queries);
Line 917  END Line 918  END
 sub build_date_queries {  sub build_date_queries {
     my ($cmonth1,$cday1,$cyear1,$cmonth2,$cday2,$cyear2,      my ($cmonth1,$cday1,$cyear1,$cmonth2,$cday2,$cyear2,
  $lmonth1,$lday1,$lyear1,$lmonth2,$lday2,$lyear2)=@_;   $lmonth1,$lday1,$lyear1,$lmonth2,$lday2,$lyear2)=@_;
       my @queries;
     return "Incorrect for some reason.";      if ($cmonth1 or $cday1 or $cyear1 or $cmonth2 or $cday2 or $cyear2) {
    unless ($cmonth1 and $cday1 and $cyear1 and
    $cmonth2 and $cday2 and $cyear2) {
       return "Incorrect entry for the creation date.  You must specify ".
      "a starting month, day, and year and an ending month, ".
      "day, and year.";
    }
    my $cnumeric1="$cyear1$cmonth1$cday1";
    $cnumeric1+=0;
    my $cnumeric2="$cyear2$cmonth2$cday2";
    $cnumeric2+=0;
    if ($cnumeric1>$cnumeric2) {
       return "Incorrect entry for the creation date.  The starting ".
      "date must occur before the ending date.";
    }
    my $cquery="(creationdate BETWEEN '$cyear1-$cmonth1-$cday1' AND '".
              "$cyear2-$cmonth2-$cday2 23:59:59')";
    push @queries,$cquery;
       }
       if ($lmonth1 or $lday1 or $lyear1 or $lmonth2 or $lday2 or $lyear2) {
    unless ($lmonth1 and $lday1 and $lyear1 and
    $lmonth2 and $lday2 and $lyear2) {
       return "Incorrect entry for the last revision date.  You must ".
      "specify a starting month, day, and year and an ending ".
      "month, day, and year.";
    my $lnumeric1="$lyear1$lmonth1$lday1";
    $lnumeric1+=0;
    my $lnumeric2="$lyear2$lmonth2$lday2";
    $lnumeric2+=0;
    if ($lnumeric1>$lnumeric2) {
       return "Incorrect entry for the last revision date.  The ".
      "starting date must occur before the ending date.";
    }
    my $lquery="(lastrevisiondate BETWEEN '$lyear1-$lmonth1-$lday1' AND '".
              "$lyear2-$lmonth2-$lday2 23:59:59')";
    push @queries,$lquery;
       }
       if (@queries) {
    return join(" AND ",@queries);
       }
       return '';
 }  }
   
 sub output_date_error {  sub output_date_error {

Removed from v.1.60  
changed lines
  Added in v.1.61


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>