#!/usr/local/bin/perl -w
#
# This software has been created by Genome Research Limited (GRL). 
# GRL hereby grants permission to use, copy, modify and distribute 
# this software and its documentation for non-commercial purposes 
# without fee at the user's own risk on the basis set out below.
# GRL neither undertakes nor accepts any duty whether contractual or 
# otherwise in connection with the software, its use or the use of 
# any derivative, and makes no representations or warranties, express
# or implied, concerning the software, its suitability, fitness for
# a particular purpose or non-infringement.
# In no event shall the authors of the software or GRL be responsible 
# or liable for any loss or damage whatsoever arising in any way 
# directly or indirectly out of the use of this software or its 
# derivatives, even if advised of the possibility of such damage.
# Our software can be freely distributed under the conditions set out 
# above, and must contain this copyright notice.
#


BEGIN {
    $ENV{'PATH'} = "/usr/sbin/";
    unshift(@INC, "$ENV{'BADGER'}/bin");
    unshift(@INC, "."); 
}

use strict;
use WrapDBI; 
use Autofin_Oracle;
use Autofin_utils;

#use lib "/nfs/WWW/INTWEB_docs/cgi-bin/prodsoft/Autofinishing";
#use Common_stuff;

my $dbh = &OracleConnect("reports");
my ($sql, $ref) = &Get_projects_with_specific_infinishing_status($dbh, 19);

my @projects;
foreach my $line (@{$ref}){
    my ($project) = @{$line}[0];
    push (@projects, $project);
}

my $pc = scalar @projects;
if ($pc >= 10){
    &Mail("AUTOFIN: $pc projects now in the HOLDING AREA...", 
          "Projects need releasing from the holding area...", 
          "bt1");
}
$dbh->disconnect() if ($dbh); 

__END__

# $Id: autoprefin_holding_check.pl,v 1.5 2006/03/22 10:02:45 gjc Exp $
#
# $Log: autoprefin_holding_check.pl,v $
% Revision 1.5  2006/03/22  10:02:45  gjc
% *** empty log message ***
%
% Revision 1.4  2005/03/08  10:53:43  kva
% Altered the lib directory to not be /nfs/intweb etc.. and added the $ENV{PATH} to look at /usr/sbin/.
%
% Revision 1.3  2004/12/15  16:52:30  dn1
% fixed intweb bad path
%
% Revision 1.2  2002/07/12  07:43:15  bt1
% *** empty log message ***
%
% Revision 1.1  2002/03/19  15:33:17  bt1
% Initial revision
%
#
