[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/public/dons/ -> therm.php (source)

   1  <?php
   2  /* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   *
   4   * This program is free software; you can redistribute it and/or modify
   5   * it under the terms of the GNU General Public License as published by
   6   * the Free Software Foundation; either version 2 of the License, or
   7   * (at your option) any later version.
   8   *
   9   * This program is distributed in the hope that it will be useful,
  10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12   * GNU General Public License for more details.
  13   *
  14   * You should have received a copy of the GNU General Public License
  15   * along with this program; if not, write to the Free Software
  16   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17   *
  18   * $Id: therm.php,v 1.9 2005/03/23 23:06:18 eldy Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/public/dons/therm.php,v $
  20   */
  21  
  22  $thermlib = "../../lib/thermometer.php";
  23  
  24  if (file_exists ($thermlib))
  25  {
  26    include($thermlib);
  27  
  28    if (1)
  29      {
  30  
  31  
  32        $dons_file = "/var/run/dolibarr.don.eucd";
  33  
  34        /*
  35         * Read Values
  36         */
  37        
  38        if (file_exists ($dons_file))
  39      {
  40        
  41        $fp = fopen($dons_file, 'r' );
  42        
  43        
  44        if ($fp)
  45          {
  46            $intentValue = fgets( $fp, 10 );
  47            $pendingValue = fgets( $fp, 10 );
  48            $actualValue = fgets( $fp, 10 );
  49            fclose( $fp ); 
  50          }
  51        
  52      }
  53        
  54      }
  55    else
  56      {
  57  
  58  
  59  
  60        /*
  61         * Read Values
  62         */
  63        
  64        $conf = new Conf();
  65      $conf->db->type = $dolibarr_main_db_type;
  66      $conf->db->host = $dolibarr_main_db_host;
  67      $conf->db->name = $dolibarr_main_db_name;
  68      $conf->db->user = $dolibarr_main_db_user;
  69      $conf->db->pass = $dolibarr_main_db_pass;
  70  
  71        $dbt = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name);
  72  
  73        $dontherm = new Don($dbt);
  74        
  75        $actualValue = $dontherm->sum_actual();
  76        $pendingValue = $dontherm->sum_pending();
  77        $intentValue = $dontherm->sum_intent();
  78  
  79        $dbt->close();
  80      }
  81  
  82  
  83    /* 
  84     * Graph thermometer
  85     */
  86    
  87    print moneyMeter($actualValue, $pendingValue, $intentValue);
  88  
  89  
  90  }
  91  ?>


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