[ 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/compta/ventilation/ -> index.php (source)

   1  <?php
   2  /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   * Copyright (C) 2004-2005 Laurent Destailleur  <eldy@users.sourceforge.net>
   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   * $Id: index.php,v 1.8 2005/12/15 10:13:21 rodolphe Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/compta/ventilation/index.php,v $
  21   */
  22  
  23  /**
  24     \file       htdocs/compta/ventilation/index.php
  25     \ingroup    compta
  26     \brief      Page accueil ventilation
  27     \version    $Revision: 1.8 $
  28  */
  29  
  30  require ("./pre.inc.php");
  31  
  32  
  33  llxHeader('','Compta - Ventilation');
  34  
  35  
  36  print_fiche_titre("Ventilation Comptable");
  37  
  38  print '<table border="0" width="100%" class="notopnoleftnoright">';
  39  
  40  print '<tr><td valign="top" width="30%" class="notopnoleft">';
  41  
  42  
  43  $sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."facturedet";
  44  $sql .= " WHERE fk_export_compta = 0";
  45  $result = $db->query($sql);
  46  if ($result)
  47  {
  48    $row = $db->fetch_row($result);
  49    $nbfac = $row[0];
  50  
  51    $db->free($result);
  52  }
  53  
  54  $sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."paiement";
  55  $sql .= " WHERE fk_export_compta = 0";
  56  
  57  $result = $db->query($sql);
  58  if ($result)
  59  {
  60    $row = $db->fetch_row($result);
  61    $nbp = $row[0];
  62  
  63    $db->free($result);
  64  }
  65  
  66  $var=true;
  67  
  68  print '<table class="noborder" width="100%">';
  69  print '<tr class="liste_titre"><td colspan="2">Lignes a ventiler</tr>';
  70  print '<tr class="liste_titre"><td>Type</td><td align="center">Nb</td></tr>';
  71  $var=!$var;
  72  print "<tr $bc[$var]>".'<td>Factures</td><td align="center">'.$nbfac.'</td></tr>';
  73  $var=!$var;
  74  print "<tr $bc[$var]>".'<td>Paiements</td><td align="center">'.$nbp.'</td></tr>';
  75  print "</table>\n";
  76  
  77  print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
  78  
  79  print '<table class="noborder" width="100%">';
  80  print '<tr class="liste_titre"><td>Type</td><td align="center">Nb de lignes</td><td align="center">Numero</td><td align="center">ID</td></tr>';
  81  
  82  $sql = "SELECT count(*), ccg.intitule, ccg.rowid,ccg.numero FROM ".MAIN_DB_PREFIX."facturedet as fd";
  83  $sql.= " ,".MAIN_DB_PREFIX."compta_compte_generaux as ccg";
  84  $sql.= " WHERE fd.fk_code_ventilation = ccg.rowid";
  85  $sql.= " GROUP BY ccg.rowid";
  86  
  87  $resql = $db->query($sql);
  88  if ($resql)
  89  {
  90      $i = 0;
  91      $num = $db->num_rows($resql);
  92      $var=true;
  93      
  94      while ($i < $num)
  95      {
  96  
  97          $row = $db->fetch_row($resql);
  98          $var=!$var;
  99          print '<tr '.$bc[$var].'><td>'.$row[1].'</td><td align="center">'.$row[0].'</td>';
 100          print '<td align="center">'.$row[3].'</td><td align="center">'.$row[2].'</td></tr>';
 101          $i++;
 102      }
 103      $db->free($resql);
 104  }
 105  print "</table>\n";
 106  
 107  print '</td></tr></table>';
 108  
 109  llxFooter('$Date: 2005/12/15 10:13:21 $ - $Revision: 1.8 $');
 110  
 111  ?>


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