[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/scripts/ -> count-dons.pl (source)

   1  #!/usr/bin/perl
   2  
   3  # Copyright (C) 2002 Rodolphe Quiedeville
   4  #
   5  # This program is free software; you can redistribute it and/or modify
   6  # it under the terms of the GNU General Public License as published by
   7  # the Free Software Foundation; either version 2 of the License, or
   8  # (at your option) any later version.
   9  #
  10  # This program is distributed in the hope that it will be useful,
  11  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13  # GNU General Public License for more details.
  14  #
  15  # You should have received a copy of the GNU General Public License
  16  # along with this program; if not, write to the Free Software
  17  # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18  
  19  #
  20  # Remember to : export DBI_DSN="dbi:mysql:dbname=dolibarr"
  21  #
  22  use DBI;
  23  
  24  my $dbh = DBI->connect($ARGV[2]) || die $DBI::errstr ;
  25  
  26  my $sql = 'SELECT sum(amount) FROM llx_don';
  27  $sql .= ' WHERE fk_statut in (' .$ARGV[1].') AND fk_don_projet = '.$ARGV[0];
  28  
  29  my $sth = $dbh->prepare("$sql") || die $dbh->errstr ;
  30  $sth->execute;
  31  
  32  while (my @row = $sth->fetchrow_array ) 
  33  {    
  34      print int($row[0]);
  35  }
  36  
  37  
  38  $dbh->disconnect();
  39  


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics